amixer - How to change recording channel?

28,065

Solution 1

I found solution here:

there I've found :

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

slightly modified according to my sound-card and setup (default sound-card, different items ordering) :

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

Solution 2

I have a System, where i have default mother-board sound card + WebCAM sound card + external USB sound card = Total 3 sound card.

Now i want to mute/unmute specific sound card out of 3, in that case i can do it using following method:

show me all the card in the system

$ 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

so i want to use the card 2 which is a USB mic and speaker

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

Now, in this sound card i have 4 bars

1) Speaker 2) Mic 3) Mic (Capture) 4) Auto gain

My problem is if i simply do amixer sset Capture cap or toggle then it does not work

I have to use a way which can mute everything for microphone capture to 0% and when requires put it back to 70%, without this i did not had any choice left. Its ALSA fault, they should added something like 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]
Share:
28,065

Related videos on Youtube

Grzegorz Wierzowiecki
Author by

Grzegorz Wierzowiecki

Updated on September 18, 2022

Comments

  • Grzegorz Wierzowiecki
    Grzegorz Wierzowiecki over 1 year

    So fat, I am setting up microphone settings :

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

    But, after some sys. update, my default recoding chanell changed to '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'
    

    How to change 'Input Source' to 'Read Mic' with amixer ? (Currently I do it manually with alsamixer or kmix - I would love to automatize it on startup).

  • Grzegorz Wierzowiecki
    Grzegorz Wierzowiecki over 12 years
    It does not work $ amixer sset 'Input Source',0,'Rear Mic' returns : Specify what you want to set....
  • Jack Kelly
    Jack Kelly about 11 years
    A slight modification of Mr Shunz's proposed syntax works for me: $ amixer sset 'Input Source' 'Rear Mic' works for me.