aplay doesn't play audio sometimes "unable to open slave"
alsa-project/alsa-lib issue #426 was opened from haoyi-codes:
I have initially thought it was a bug that was related to chromium as stated in #425. However, now I realize it has to be something else that is wrong.
`aplay -D default /dev/zero`
``` ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.2.13/work/alsa-lib-1.2.13/src/pcm/pcm_dmix.c:1000:(snd_pcm_dmix_open) unable to open slave aplay: main:850: audio open error: No such file or directory ```
`aplay -D plughw:0 /dev/zero`
``` aplay: main:850: audio open error: No such file or directory ```
`aplay -l`
``` **** List of PLAYBACK Hardware Devices **** card 0: NVidia [HDA NVidia], device 3: Generic Digital [Generic Digital] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: HDMI [HDA ATI HDMI], device 3: Generic Digital [Generic Digital] Subdevices: 1/1 Subdevice #0: subdevice #0 card 2: Audio [SA9123 USB Audio], device 0: USB Audio [USB Audio] Subdevices: 1/1 Subdevice #0: subdevice #0 ```
`cat /proc/asound/cards`
``` 0 [NVidia ]: HDA-Intel - HDA NVidia HDA NVidia at 0x81080000 irq 17 1 [HDMI ]: HDA-Intel - HDA ATI HDMI HDA ATI HDMI at 0x81220000 irq 165 2 [Audio ]: USB-Audio - SA9123 USB Audio SYC SA9123 USB Audio at usb-0000:00:14.0-3.2, full speed 3 [Edition ]: USB-Audio - Logi 4K Stream Edition Logi 4K Stream Edition at usb-0000:00:14.0-3.3, super speed ```
`ls -la /dev/snd/*`
``` crw-rw----+ 1 root audio 116, 0 Dec 4 23:18 /dev/snd/controlC0 crw-rw----+ 1 root audio 116, 32 Dec 4 23:18 /dev/snd/controlC1 crw-rw----+ 1 root audio 116, 64 Dec 4 23:18 /dev/snd/controlC2 crw-rw----+ 1 root audio 116, 96 Dec 4 23:18 /dev/snd/controlC3 crw-rw----+ 1 root audio 116, 19 Dec 4 23:18 /dev/snd/pcmC0D3p crw-rw----+ 1 root audio 116, 51 Dec 4 23:18 /dev/snd/pcmC1D3p crw-rw----+ 1 root audio 116, 80 Dec 4 23:18 /dev/snd/pcmC2D0p crw-rw----+ 1 root audio 116, 120 Dec 4 23:18 /dev/snd/pcmC3D0c crw-rw----+ 1 root audio 116, 1 Dec 4 23:18 /dev/snd/seq crw-rw----+ 1 root audio 116, 33 Dec 4 23:18 /dev/snd/timer
/dev/snd/by-id: total 0 drwxr-xr-x 2 root root 80 Dec 4 23:18 . drwxr-xr-x 4 root root 280 Dec 4 23:17 .. lrwxrwxrwx 1 root root 12 Dec 4 23:18 usb-046d_Logi_4K_Stream_Edition_51C07EAF-03 -> ../controlC3 lrwxrwxrwx 1 root root 12 Dec 4 23:18 usb-SYC_SA9123_USB_Audio-01 -> ../controlC2
/dev/snd/by-path: total 0 drwxr-xr-x 2 root root 160 Dec 4 23:18 . drwxr-xr-x 4 root root 280 Dec 4 23:17 .. lrwxrwxrwx 1 root root 12 Dec 4 23:18 pci-0000:00:14.0-usb-0:3.2:1.1 -> ../controlC2 lrwxrwxrwx 1 root root 12 Dec 4 23:18 pci-0000:00:14.0-usb-0:3.3:1.3 -> ../controlC3 lrwxrwxrwx 1 root root 12 Dec 4 23:18 pci-0000:00:14.0-usbv2-0:3.2:1.1 -> ../controlC2 lrwxrwxrwx 1 root root 12 Dec 4 23:18 pci-0000:00:14.0-usbv3-0:3.3:1.3 -> ../controlC3 lrwxrwxrwx 1 root root 12 Dec 4 23:18 pci-0000:01:00.1 -> ../controlC0 lrwxrwxrwx 1 root root 12 Dec 4 23:18 pci-0000:05:00.1 -> ../controlC1 ```
For reference I am still able to play audio on my system as pulseaudio is running but for applications that use alsa directly it does not work.
``` Server String: /run/user/1011/pulse/native Library Protocol Version: 35 Server Protocol Version: 35 Is Local: yes Client Index: 59 Tile Size: 65472 User Name: user Host Name: system Server Name: PulseAudio (on PipeWire 1.2.7) Server Version: 15.0.0 Default Sample Specification: float32le 2ch 48000Hz Default Channel Map: front-left,front-right Default Sink: alsa_output.usb-SYC_SA9123_USB_Audio-01.iec958-stereo Default Source: alsa_output.usb-SYC_SA9123_USB_Audio-01.iec958-stereo.monitor Cookie: XXXX:XXXX ```
Issue URL : https://github.com/alsa-project/alsa-lib/issues/426 Repository URL: https://github.com/alsa-project/alsa-lib
participants (1)
-
GitHub issues - opened