显示系统中所有卡

显示系统中所有卡

太胖了,我正在设置麦克风设置:

$ amixer set 'Rear Mic' 90% mute cap
$ amixer set 'Rear Mic Boost' 80%

但是,经过一些系统。更新,我的默认重新编码通道更改为'Front Mic'

$ amixer sget 'Input Source'
Simple mixer control 'Input Source',0
  Capabilities: cenum
  Items: 'Front Mic' 'Rear Mic' 'Line' 'CD' 'Mix'
  Item0: 'Front Mic'

如何更改'Input Source''Read Mic'amixer ? (目前我使用 alsamixer 或 kmix 手动执行此操作 - 我希望在启动时将其自动化)。

答案1

我在这里找到了解决方案:

在那里我发现:

$ amixer -c0 cset iface=MIXER,name='Input Source',index=1 'Front Mic' # (Record from Front Mic)

根据我的声卡和设置稍作修改(默认声卡,不同的项目排序):

$ amixer cset name='Input Source',index=0 'Rear Mic'

答案2

我有一个系统,其中有默认主板声卡 + WebCAM 声卡 + 外部 USB 声卡 = 总共 3 个声卡。

现在我想将 3 个声卡静音/取消静音,在这种情况下,我可以使用以下方法来实现:

显示系统中所有卡

$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: CA0132 Analog [CA0132 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: U0x11110x2222 [USB Device 0x1111:0x2222], device 0: USB Audio [USB Audio]
  Subdevices: 0/1
  Subdevice #0: subdevice #0

所以我想使用卡 2,它是 USB 麦克风和扬声器

$ amixer -c2
Simple mixer control 'Speaker',0
  Capabilities: pvolume pswitch pswitch-joined penum
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 151
  Mono:
  Front Left: Playback 44 [29%] [-20.13dB] [on]
  Front Right: Playback 44 [29%] [-20.13dB] [on]
Simple mixer control 'Mic',0
  Capabilities: pvolume pvolume-joined cvolume cvolume-joined pswitch pswitch-joined cswitch cswitch-joined penum
  Playback channels: Mono
  Capture channels: Mono
  Limits: Playback 0 - 32 Capture 0 - 16
  Mono: Playback 32 [100%] [47.81dB] [on] Capture 16 [100%] [23.81dB] [on]
Simple mixer control 'Auto Gain Control',0
  Capabilities: pswitch pswitch-joined penum
  Playback channels: Mono
  Mono: Playback [on]

现在,在这个声卡中我有 4 个小节

1) 扬声器 2) 麦克风 3) 麦克风(捕捉) 4) 自动增益

我的问题是,如果我只是做 amixer sset Capture cap 或切换,那么它不起作用

我必须使用一种方法,可以将麦克风捕获的所有内容静音到 0%,并在需要时将其恢复到 70%,如果没有这个,我就没有任何选择了。这是 ALSA 的错,他们应该添加诸如pulseaudio pactl之类的东西

# Now this does MUTE for device 2
$ amixer -c2 sset Mic 0dB
Simple mixer control 'Mic',0
  Capabilities: pvolume pvolume-joined cvolume cvolume-joined pswitch pswitch-joined cswitch cswitch-joined penum
  Playback channels: Mono
  Capture channels: Mono
  Limits: Playback 0 - 32 Capture 0 - 16
  Mono: Playback 0 [0%] [0.00dB] [on] Capture 0 [0%] [0.00dB] [on]

# Unmute for device 2
$ amixer -c2 sset Mic 70dB
Simple mixer control 'Mic',0
  Capabilities: pvolume pvolume-joined cvolume cvolume-joined pswitch pswitch-joined cswitch cswitch-joined penum
  Playback channels: Mono
  Capture channels: Mono
  Limits: Playback 0 - 32 Capture 0 - 16
  Mono: Playback 32 [100%] [47.81dB] [on] Capture 16 [100%] [23.81dB] [on]

答案3

您可以使用sset参数。从man amixer

   set or sset <SCONTROL> <PARAMETER> ...
          Sets the simple mixer control contents. The parameter can be the volume either as a percentage  from  0%  to  100%
          with  % suffix, a dB gain with dB suffix (like -12.5dB), or an exact hardware value.  The dB gain can be used only
          for the mixer elements with available dB information.  When plus(+) or minus(-) letter is  appended  after  volume
          value, the volume is incremented or decremented from the current value, respectively.

          The  parameters  cap,  nocap, mute, unmute, toggle are used to change capture (recording) and muting for the group
          specified.

          The optional modifiers can be put as extra parameters to specify the stream direction or channels to  apply.   The
          modifiers playback and capture specify the stream, and the modifiers front, rear, center, woofer are used to spec‐
          ify channels to be changed.

          A simple mixer control must be specified. Only one device can be controlled at a time.

在你的情况下应该像(未测试

$ amixer sset 'Input Source',0,'Rear Mic'

相关内容