硬件配置:Raspberry Pi3 + 罗技C310摄像头
使用摄像头作为图像/音频输入,3.5mm耳机插口提供音频输出
RPi将音频与视频传至Windows
如果使用3.5mm音频插口,先将音频输出从默认的HDMI配置为audio jack
输出测试用:
$speaker-test -t sine -f 440 -c 2 -s 1
apt安装alsa相关包(略)
列出相关设备:
$arecord -l
**** List of CAPTURE Hardware Devices ****
card 1: U0x46d0x81b [USB Device 0x46d:0x81b], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
录音进行测试:
$arecord -D plughw:1,0 test.wav -v -d 10
列出音频设备
$aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7
card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]
Subdevices: 1/1
Subdevice #0: subdevice #0
传一个音频文件到RPi上测试输出:
$aplay test.wav
如果没有声音的话检查
1. 是不是连接了HDMI,修改强制声音从audio jack输出
2. alsamixer设置增益
$cat /proc/asound/cards
0 [ALSA ]: bcm2835 - bcm2835 ALSA
bcm2835 ALSA
1 [U0x46d0x81b ]: USB-Audio - USB Device 0x46d:0x81b
USB Device 0x46d:0x81b at usb-3