연결하기 위해 Raspberry Pi에 글을 쓰고 있습니다.ICUSBAUDIO7D 캡처에 사용되는 장치입니다. 지금까지 "default"를 경로로 전달하면 성공적으로 대화할 수 있었습니다.
r = snd_pcm_open(&_pcm, "default",
SND_PCM_STREAM_CAPTURE, SND_PCM_NONBLOCK);
오디오를 캡쳐할 수 있는데,
/usr/share/alsa/alsa.conf에 정의했습니다.
defaults.ctl.card 1
defaults.pcm.card 1
하지만 제가 하고 싶은 것은 라인이나 마이크에 대한 입력을 선택할 수 있는 것입니다.
믹서기를 보니
Simple mixer control 'Speaker',0
Capabilities: pvolume pswitch pswitch-joined
Playback channels: Front Left - Front Right - Rear Left - Rear Right - Front Center - Woofer - Side Left - Side Right
Limits: Playback 0 - 197
Mono:
Front Left: Playback 0 [0%] [-36.93dB] [on]
Front Right: Playback 0 [0%] [-36.93dB] [on]
Rear Left: Playback 90 [46%] [-20.06dB] [on]
Rear Right: Playback 90 [46%] [-20.06dB] [on]
Front Center: Playback 90 [46%] [-20.06dB] [on]
Woofer: Playback 90 [46%] [-20.06dB] [on]
Side Left: Playback 0 [0%] [-36.93dB] [on]
Side Right: Playback 0 [0%] [-36.93dB] [on]
Simple mixer control 'PCM',0
Capabilities: cvolume cswitch cswitch-joined
Capture channels: Front Left - Front Right
Limits: Capture 0 - 6928
Front Left: Capture 4096 [59%] [-0.01dB] [on]
Front Right: Capture 4096 [59%] [-0.01dB] [on]
Simple mixer control 'PCM Capture Source',0
Capabilities: enum
Items: 'Mic' 'Line' 'IEC958 In' 'Mixer'
Item0: 'Line'
Simple mixer control 'Line',0
Capabilities: pvolume cvolume pswitch pswitch-joined cswitch cswitch-joined
Playback channels: Front Left - Front Right
Capture channels: Front Left - Front Right
Limits: Playback 0 - 8065 Capture 0 - 6928
Front Left: Playback 8065 [100%] [7.50dB] [off] Capture 4096 [59%] [-0.01dB] [on]
Front Right: Playback 8065 [100%] [7.50dB] [off] Capture 4096 [59%] [-0.01dB] [on]
Simple mixer control 'Mic',0
Capabilities: pvolume cvolume pswitch pswitch-joined cswitch cswitch-joined
Playback channels: Front Left - Front Right
Capture channels: Front Left - Front Right
Limits: Playback 0 - 8065 Capture 0 - 6928
Front Left: Playback 6144 [76%] [-0.01dB] [off] Capture 4096 [59%] [-0.01dB] [on]
Front Right: Playback 6144 [76%] [-0.01dB] [off] Capture 4096 [59%] [-0.01dB] [on]
Simple mixer control 'IEC958 In',0
Capabilities: cswitch cswitch-joined
Capture channels: Mono
Mono: Capture [on]
하지만 내가 할 때
arecord -L
null
Discard all samples (playback) or generate zero samples (capture)
default
Default Audio Device
sysdefault
Default Audio Device
duplicate
hw:CARD=ICUSBAUDIO7D,DEV=0
ICUSBAUDIO7D, USB Audio
Direct hardware device without any conversions
plughw:CARD=ICUSBAUDIO7D,DEV=0
ICUSBAUDIO7D, USB Audio
Hardware device with all software conversions
default:CARD=ICUSBAUDIO7D
ICUSBAUDIO7D, USB Audio
Default Audio Device
sysdefault:CARD=ICUSBAUDIO7D
ICUSBAUDIO7D, USB Audio
Default Audio Device
front:CARD=ICUSBAUDIO7D,DEV=0
ICUSBAUDIO7D, USB Audio
Front output / input
dsnoop:CARD=ICUSBAUDIO7D,DEV=0
ICUSBAUDIO7D, USB Audio
Direct sample snooping device
amixer -c 1 scontrols
Simple mixer control 'Speaker',0
Simple mixer control 'PCM',0
Simple mixer control 'PCM Capture Source',0
Simple mixer control 'Line',0
Simple mixer control 'Mic',0
Simple mixer control 'IEC958 In',0
저는 마이크나 라인을 장치로 생각하지 않습니다. 프로그래밍 방식으로 둘 중 하나를 선택하는 방법이 혼란스럽습니다.
누구든지 나에게 단서를 줄 수 있습니까? 매우 감사합니다.