树莓派多声卡,尝试配置声卡0为默认输出设备,声卡1为默认输入设备。
List all play/record device
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| pi@raspberrypi:~ $ aplay -l **** List of PLAYBACK Hardware Devices **** card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA] Subdevices: 7/7 Subdevice Subdevice Subdevice Subdevice Subdevice Subdevice Subdevice card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI] Subdevices: 1/1 Subdevice
|
1 2 3 4 5
| pi@raspberrypi:~ $ arecord -l **** List of CAPTURE Hardware Devices **** card 1: Device [USB PnP Sound Device], device 0: USB Audio [USB Audio] Subdevices: 1/1 Subdevice
|
Set card 0 as playback, card 1 as capture
Open .asoundrc file under $HOME
Modify .asoundrc:
1 2 3 4 5 6 7 8 9
| pcm.!default { type asym playback.pcm "plughw:0,0" capture.pcm "plughw:1,0" } ctl.!default { type hw card 0 }
|
“plughw:1,0” means card 1, device 0
Then save file and reboot