![ALSA 无法正确检测所有 USB 卡](https://linux22.com/image/1481936/ALSA%20%E6%97%A0%E6%B3%95%E6%AD%A3%E7%A1%AE%E6%A3%80%E6%B5%8B%E6%89%80%E6%9C%89%20USB%20%E5%8D%A1.png)
我想运行四个相同的 USB 音频设备,但 ALSA 在一台机器上只显示其中两个(单独插入时所有四个都可以正常运行)。
看起来它们被正确检测(并初始化):
cat /proc/asound/modules
0 snd_usb_audio
1 snd_usb_audio
2 snd_usb_audio
3 snd_usb_audio
cat /proc/asound/cards
0 [Device ]: USB-Audio - USB PnP Sound Device
C-Media Electronics Inc. USB PnP Sound Device at usb-0000:00:12.2-3.1, full spe
1 [Device_1 ]: USB-Audio - USB PnP Sound Device
C-Media Electronics Inc. USB PnP Sound Device at usb-0000:00:12.2-3.2, full spe
2 [Device_2 ]: USB-Audio - USB PnP Sound Device
C-Media Electronics Inc. USB PnP Sound Device at usb-0000:00:12.2-3.3, full spe
3 [Device_3 ]: USB-Audio - USB PnP Sound Device
C-Media Electronics Inc. USB PnP Sound Device at usb-0000:00:12.2-3.4, full spe
cat /proc/asound/devices
0: [ 0] : control
16: [ 0- 0]: digital audio playback
24: [ 0- 0]: digital audio capture
32: [ 1] : control
33: : timer
48: [ 1- 0]: digital audio playback
56: [ 1- 0]: digital audio capture
64: [ 2] : control
80: [ 2- 0]: digital audio playback
88: [ 2- 0]: digital audio capture
96: [ 3] : control
112: [ 3- 0]: digital audio playback
120: [ 3- 0]: digital audio capture
然而 aplay 只显示其中两个。
./aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Device [USB PnP Sound Device], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: Device_1 [USB PnP Sound Device], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
这里的限制因素是什么?
答案1
@CL 的评论解决了这个问题。由于此设置在没有运行 udev 的 Synology 上运行,因此只有两个字符设备。
ls -lA
crw-r--r-- 1 root root 116, 0 Nov 11 2009 controlC0
crw-r--r-- 1 root root 116, 32 Nov 11 2009 controlC1
crw-r--r-- 1 root root 116, 4 Nov 11 2009 hwC0D0
crw-r--r-- 1 root root 116, 36 Nov 11 2009 hwC1D0
crw-r--r-- 1 root root 116, 16 Jan 26 20:51 pcmC0D0p
crw-r--r-- 1 root root 116, 48 Jan 26 16:27 pcmC1D0p
crw-r--r-- 1 root root 116, 1 Nov 11 2009 seq
crw-r--r-- 1 root root 116, 33 Nov 11 2009 timer
按照 /proc/asound/devices 的输出创建它们可以解决这个问题。
mknod controlC2 c 116 64
mknod controlC3 c 116 96
mknod pcmC2D0p c 116 80
mknod pcmC3D0p c 116 112