首页 > 解决方案 > ALSA - 在命令行中为行设置输入音量 - 输入无法识别但可用于程序

问题描述

我在 USB 板上看不到 alsamixer 中的输入设备,但它在我做 arecord -L 时被列出(为什么它默认列出第二个声卡?)

arecord -l
**** List of CAPTURE Hardware Devices ****
card 1: CODEC [USB Audio CODEC], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

我可以看到很多信息,但我无法从人那里了解如何在命令行或 gui 中更改行输入的级别

 amixer info 
Card default 'CODEC'/'Burr-Brown from TI USB Audio CODEC at usb-3f980000.usb-1.3, full speed'
  Mixer name    : 'USB Mixer'
  Components    : 'USB08bb:2902'
  Controls      : 4
  Simple ctrls  : 1

amixer contents
numid=3,iface=MIXER,name='PCM Playback Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=on
numid=4,iface=MIXER,name='PCM Playback Volume'
  ; type=INTEGER,access=rw---R--,values=2,min=0,max=128,step=0
  : values=128,128
  | dBminmax-min=-128.00dB,max=0.00dB
numid=2,iface=PCM,name='Capture Channel Map'
  ; type=INTEGER,access=r----R--,values=2,min=0,max=36,step=0
  : values=0,0
  | container
    | chmap-fixed=FL,FR
    | chmap-fixed=MONO

numid=1,iface=PCM,name='Playback Channel Map'
  ; type=INTEGER,access=r----R--,values=2,min=0,max=36,step=0
  : values=0,0
  | container
    | chmap-fixed=FL,FR
    | chmap-fixed=MONO

我实际上不确定如何实现这一目标,因为很多人说了成千上万种不同的事情

在这里,我尝试以笨拙的方式设置音量,但它不起作用:

amixer  -c 1 sset numid=2 0
amixer: Unable to find simple control 'numid=2',0

amixer  -c 1 cset numid=2 0
amixer: Control hw:1 element write error: Operation not permitted

sudo amixer  -c 1 cset numid=2 0
amixer: Control hw:1 element write error: Operation not permitted

amixer 没有列出任何录音设备,尽管我可以用 audacity 或 puredata 清楚地录制音频

amixer -c 1
Simple mixer control 'PCM',0
  Capabilities: pvolume pswitch pswitch-joined
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 128
  Mono:
  Front Left: Playback 128 [100%] [0.00dB] [on]
  Front Right: Playback 128 [100%] [0.00dB] [on]

amixer -c 0
Simple mixer control 'PCM',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback -10239 - 400
  Mono: Playback 0 [96%] [0.00dB] [on]

请帮帮我,这对我来说毫无意义

多谢你们

标签: inputvolumealsa

解决方案


amixer and alsamixer shows those mixer controls that the hardware actually has.

As figure 31 in the PCM2902 datasheet shows, this device indeed has no mechanism to change the capture volume:

PCM2902 USB Audio Function Topology

It might be possible to add a softvol plugin, but it would be easier to just use PulseAudio.


推荐阅读