From d1c372f5eea5b92a1eadba52a878c79b1a4bde87 Mon Sep 17 00:00:00 2001 From: qaqland Date: Sat, 7 Mar 2026 13:25:28 +0800 Subject: [PATCH] alsa-udev: support alsa.ignore-dB Some sound cards are only adapted for Android/macOS and other systems, without considering Linux. The hardware-reported dB volume is incorrect (while the percentage volume is normal). Add support for the ignore-dB option to simplify compatibility. For example, the 3206:0798 HP SIMGOT GEW1 Sound Card reports: numid=4,iface=MIXER,name='PCM Playback Volume' ; type=INTEGER,access=rw---R--,values=2,min=0,max=100,step=0 : values=100,100 | dBminmax-min=0.00dB,max=0.39dB This dB value does not match actual audio perception, and the vendor attributed this issue to non-target system compatibility. --- spa/plugins/alsa/alsa-udev.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spa/plugins/alsa/alsa-udev.c b/spa/plugins/alsa/alsa-udev.c index 8537c9760..fdc255864 100644 --- a/spa/plugins/alsa/alsa-udev.c +++ b/spa/plugins/alsa/alsa-udev.c @@ -538,6 +538,9 @@ static int emit_added_object_info(struct impl *this, struct card *card) if ((str = udev_device_get_property_value(udev_device, "ACP_PROFILE_SET")) && *str) items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_DEVICE_PROFILE_SET, str); + if ((str = udev_device_get_property_value(udev_device, "ACP_IGNORE_DB")) && *str) + items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_API_ALSA_IGNORE_DB, str); + if ((str = udev_device_get_property_value(udev_device, "SOUND_CLASS")) && *str) items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_DEVICE_CLASS, str);