Command-Line

amixer - 如何更改錄音通道?

  • December 8, 2013

太胖了,我正在設置麥克風設置:

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

但是,經過一些系統。更新,我的預設重新編碼 chanell 更改為'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 手動完成 - 我希望在啟動時將其自動化)。

我在這裡找到了解決方案:

在那裡我發現:

$ 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'

我有一個系統,我有預設主機板音效卡 + 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

所以我想使用作為 USB 麥克風和揚聲器的卡 2

$ 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 或 toggle 然後它就不起作用

我必須使用一種方法,可以將麥克風擷取的所有內容靜音到 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]

引用自:https://unix.stackexchange.com/questions/21697