시스템의 모든 카드 표시

시스템의 모든 카드 표시

너무 뚱뚱해서 마이크 설정을 하고 있어요:

$ 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'? (현재는 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

그래서 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 또는 스위치를 수행하면 작동하지 않는다는 것입니다.

마이크에 의해 캡처된 모든 것을 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'

관련 정보