私は接続するために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
私はマイクやラインをデバイスとして考えていません。プログラムでどちらかを選択する方法は混乱しています。
誰でも私に手がかりを与えることができますか?とても感謝しています。