alsa-project / alsa-lib

The Advanced Linux Sound Architecture (ALSA) - library
GNU Lesser General Public License v2.1
366 stars 177 forks source link

UCM SectionModifier doesn't like 'Comment' #167

Closed plbossart closed 2 years ago

plbossart commented 3 years ago

Adding the following patch generates a crash with alsaucm

alsaucm -c sof-soundwire set _verb HiFi set _enadev Headphones
alsaucm: conf.c:4355: snd_config_iterator_first: Assertion `config->type == SND_CONFIG_TYPE_COMPOUND' failed.
Aborted (core dumped)
diff --git a/ucm2/sof-soundwire/HiFi.conf b/ucm2/sof-soundwire/HiFi.conf
index e780ea4..fbadb65 100644
--- a/ucm2/sof-soundwire/HiFi.conf
+++ b/ucm2/sof-soundwire/HiFi.conf
@@ -29,3 +29,12 @@ If.hsdev {
 }

 <sof-soundwire/Hdmi.conf>
+
+SectionModifier."PlayMusic" {
+       # this works fine
+}
+
+SectionModifier."PlayRadio" {
+       # this doesn't
+       Comment "Play Radio"
+}

I am not sure if anyone ever used the SectionModifier, if it's a bug in alsa-lib or alsaucm.

SectionModifiers are part of the current proposal in PipeWire according to the documentation for "stream endpoints". https://docs.pipewire.org/page_objects_design.html

"The available UCM modifiers for each UCM device will be added as streams, plus one "default" stream for accessing the device with no modifiers."

perexg commented 2 years ago

Thanks. It was a bug. Fixed in ea5481296f281625ef6517208ebf6e41b5fd838c .