alsa-lib-1.2.15: no sound
After upgrading alsa-lib to 1.2.15 I get
grozin@localhost /home/Music $ qmmp
and no sound. Similarly,
grozin@localhost /home/Music $ mpv
Could not open/initialize audio device -> no sound.
Audio: no audio
Exiting... (Errors when loading file)
After downgrading alsa-lib to 1.2.14 everything works fine again. This is on Gentoo Linux, see the Gentoo bug https://bugs.gentoo.org/967264
It should be fixed with a6238053c4fa518b214f99d91a01b96c5ef6e3ca . It would be nice, if you can confirm this.
Testing current master (commit 2f59398c83b8065fb9ff58939df3a9187746068e) on a RPi5 (which uses the vc4-hdmi card conf) running LibreELEC works fine as long as no additional sound cards are installed.
But as soon as I connect a USB audio device things go south, the default and vc4-hdmi devices vanish from aplay -L and only the PCMs of the USB card are shown.
aplay -L output without the USB card:
rpi5:~ # aplay -L
null
Discard all samples (playback) or generate zero samples (capture)
default
Default Audio Device
sysdefault
Default Audio Device
default:CARD=vc4hdmi0
vc4-hdmi-0, MAI PCM i2s-hifi-0
Default Audio Device
sysdefault:CARD=vc4hdmi0
vc4-hdmi-0, MAI PCM i2s-hifi-0
Default Audio Device
hdmi:CARD=vc4hdmi0,DEV=0
vc4-hdmi-0, MAI PCM i2s-hifi-0
HDMI Audio Output
default:CARD=vc4hdmi1
vc4-hdmi-1, MAI PCM i2s-hifi-0
Default Audio Device
sysdefault:CARD=vc4hdmi1
vc4-hdmi-1, MAI PCM i2s-hifi-0
Default Audio Device
hdmi:CARD=vc4hdmi1,DEV=0
vc4-hdmi-1, MAI PCM i2s-hifi-0
HDMI Audio Output
aplay -L output with USB audio device attached:
rpi5:~ # aplay -L
null
Discard all samples (playback) or generate zero samples (capture)
front:CARD=DAC,DEV=0
USB Audio DAC, USB Audio
Front output / input
surround21:CARD=DAC,DEV=0
USB Audio DAC, USB Audio
2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=DAC,DEV=0
USB Audio DAC, USB Audio
4.0 Surround output to Front and Rear speakers
surround41:CARD=DAC,DEV=0
USB Audio DAC, USB Audio
4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=DAC,DEV=0
USB Audio DAC, USB Audio
5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=DAC,DEV=0
USB Audio DAC, USB Audio
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=DAC,DEV=0
USB Audio DAC, USB Audio
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=DAC,DEV=0
USB Audio DAC, USB Audio
IEC958 (S/PDIF) Digital Audio Output
aplay -l output with USB audio device attached:
rpi5:~ # aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: vc4hdmi0 [vc4-hdmi-0], device 0: MAI PCM i2s-hifi-0 [MAI PCM i2s-hifi-0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: vc4hdmi1 [vc4-hdmi-1], device 0: MAI PCM i2s-hifi-0 [MAI PCM i2s-hifi-0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 2: DAC [USB Audio DAC], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
strace shows the card conf files are being opened, but device merging doesn't seem to work:
rpi5:~ # strace aplay -L 2>&1 | grep alsa/cards
newfstatat(AT_FDCWD, "/usr/share/alsa/cards/aliases.conf", {st_mode=S_IFREG|0644, st_size=1536, ...}, 0) = 0
openat(AT_FDCWD, "/usr/share/alsa/cards/aliases.conf", O_RDONLY) = 3
faccessat(AT_FDCWD, "/usr/share/alsa/cards/vc4-hdmi.conf", R_OK) = 0
newfstatat(AT_FDCWD, "/usr/share/alsa/cards/vc4-hdmi.conf", {st_mode=S_IFREG|0644, st_size=1403, ...}, 0) = 0
openat(AT_FDCWD, "/usr/share/alsa/cards/vc4-hdmi.conf", O_RDONLY) = 3
faccessat(AT_FDCWD, "/usr/share/alsa/cards/vc4-hdmi.conf", R_OK) = 0
newfstatat(AT_FDCWD, "/usr/share/alsa/cards/vc4-hdmi.conf", {st_mode=S_IFREG|0644, st_size=1403, ...}, 0) = 0
openat(AT_FDCWD, "/usr/share/alsa/cards/vc4-hdmi.conf", O_RDONLY) = 3
faccessat(AT_FDCWD, "/usr/share/alsa/cards/USB-Audio.conf", R_OK) = 0
newfstatat(AT_FDCWD, "/usr/share/alsa/cards/USB-Audio.conf", {st_mode=S_IFREG|0644, st_size=9892, ...}, 0) = 0
openat(AT_FDCWD, "/usr/share/alsa/cards/USB-Audio.conf", O_RDONLY) = 3
I'm also seeing no default sound device on 1.2.15, testing git HEAD, bisect points to this commit as the change:
commit e5cb0b3346914e1326d84fe042f795e29826c2ba Author: Jaroslav Kysela [email protected] Date: Thu Sep 18 11:03:02 2025 +0200
conf: Revert "conf: fix load_for_all_cards()"
This reverts commit ddfc32abf5697de1618b9e7ffdf57a0f97013090.
It was not a correct fix. The private values may differ (multiple
instances for e.g. USB sound cards). This fix prevents to load
private configurations for other instances.
Signed-off-by: Jaroslav Kysela <[email protected]>
The fixes are in 2ef8952b46a46b97a6df2f29bcd182f895ebf9e4, 16ab43db6ed6f71424d5ad78e62f85baaeae5051, 010b699c92a9a6ffdca1874cd2e3c6c054d212e0 right now. The last commit is the recommended tree to work with right now.
I'm going to release 1.2.15.1 when the fix is confirmed.
Running commit 010b699c92a9a6ffdca1874cd2e3c6c054d212e0 made it worse, both the default and hdmi PCMs are now broken om my RPi5:
rpi5:~ # speaker-test -c 2 -t sine
speaker-test 1.2.15
Playback device is default
Stream parameters are 48000Hz, S16_LE, 2 channels
Sine wave rate is 440.0000Hz
ALSA lib /home/hias/libreelec/libreelec-master/build.LibreELEC-RPi5.aarch64-13.0-devel/build/alsa-lib-010b699c92a9a6ffdca1874cd2e3c6c054d212e0/src/conf.c:5572:(parse_args) [error.core] Parameter AES3 must be an integer
ALSA lib /home/hias/libreelec/libreelec-master/build.LibreELEC-RPi5.aarch64-13.0-devel/build/alsa-lib-010b699c92a9a6ffdca1874cd2e3c6c054d212e0/src/conf.c:5714:(snd_config_expand) [error.core] Parse arguments error: Invalid argument
ALSA lib /home/hias/libreelec/libreelec-master/build.LibreELEC-RPi5.aarch64-13.0-devel/build/alsa-lib-010b699c92a9a6ffdca1874cd2e3c6c054d212e0/src/pcm/pcm.c:2722:(snd_pcm_open_noupdate) [error.pcm] Unknown PCM cards.vc4-hdmi.pcm.hdmi.0:CARD=0,AES0=0x04,AES1=0x82,AES2=0x00,AES3=0x01cards.vc4-hdmi.pcm.hdmi.0:CARD=0,AES0=0x04,AES1=0x82,AES2=0x00,AES3=0x01
Playback open error: -22,Invalid argument
rpi5:~ # speaker-test -c 2 -t sine -D hdmi:CARD=vc4hdmi0,DEV=0
speaker-test 1.2.15
Playback device is hdmi:CARD=vc4hdmi0,DEV=0
Stream parameters are 48000Hz, S16_LE, 2 channels
Sine wave rate is 440.0000Hz
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 4 to 163840
Period size range from 2 to 81920
Periods = 4
ALSA lib /home/hias/libreelec/libreelec-master/build.LibreELEC-RPi5.aarch64-13.0-devel/build/alsa-lib-010b699c92a9a6ffdca1874cd2e3c6c054d212e0/src/control/setup.c:96:(snd_sctl_install) [error.control] Cannot lock ctl elem
Unable to set hw params for playback: Device or resource busy
Setting of hwparams failed: Device or resource busy
@HiassofT : Could you attach output from alsactl dump-cfg ? Also, what cards are in your system (aplay -l or cat /proc/asound/cards) ?
EDIT: Try these two small changes:
diff --git a/src/conf/cards/vc4-hdmi.conf b/src/conf/cards/vc4-hdmi.conf
index 0f313d82..7041d185 100644
--- a/src/conf/cards/vc4-hdmi.conf
+++ b/src/conf/cards/vc4-hdmi.conf
@@ -3,7 +3,7 @@
# subframe conversion
#
-vc4-hdmi.pcm.hdmi.0 {
+vc4-hdmi.pcm.hdmi.!0 {
@args [ CARD AES0 AES1 AES2 AES3 ]
@args.CARD {
type string
@@ -50,7 +50,7 @@ vc4-hdmi.pcm.hdmi.0 {
}
# default with plug and softvol
-vc4-hdmi.pcm.default {
+vc4-hdmi.pcm.!default {
@args [ CARD ]
@args.CARD {
type string
In this test I didn't have any additional audio devices attached, so just had the audio devices from the two on-board HDMI ports:
rpi5:~ # aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: vc4hdmi0 [vc4-hdmi-0], device 0: MAI PCM i2s-hifi-0 [MAI PCM i2s-hifi-0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: vc4hdmi1 [vc4-hdmi-1], device 0: MAI PCM i2s-hifi-0 [MAI PCM i2s-hifi-0]
Subdevices: 1/1
Subdevice #0: subdevice #0
With the above patch, adding the !, audio is working fine again (haven't tested with additional audio devices yet though)
dump-cfg of commit 010b699c92a9a6ffdca1874cd2e3c6c054d212e0: dump-cfg-master.txt dump-cfg with above patch: dump-cfg-patch.txt
@perexg https://github.com/alsa-project/alsa-lib/commit/010b699c92a9a6ffdca1874cd2e3c6c054d212e0 seems to have fixed the bug on my system. I'm on an HDA-Intel - HD-Audio Generic analog. Thanks!
Thank you all for the tests!
Okay, I will do the '!' changes for all configs in the conf/cards directory and I'll release 1.2.15.1 with those changes.
changes for all configs in the conf/cards directory
You really go to need to change all configs on earth?
The problem is visible only when there are two ALSA cards in the system using one driver. So yes, for safety, it's better to update all config files.
I did test with CoreELEC and all sound devices are listed again with current HEAD f30c355278cf9c86420b49ab9efc7eee890b658c.
I had an issue with 1.2.15 on my Asus TUF Gaming X670E Plus where it would only offer me Stereo Sound instead of 5.1. That is also fixed with the current master.