
Thank you Jaroslav! This is exactly what I was after.
On Tue, Mar 18, 2025 at 4:14 PM Jaroslav Kysela perex@perex.cz wrote:
On 18. 03. 25 14:57, Giedrius Trainavičius wrote:
Hello,
I'm writing a UCM2 .conf file, depending on Device Tree options, some kcontrols may or may not exist - how do I handle this in the
BootSequence,
so alsactl does not error out if some controls don't exist?
I know there's a possible If condition to check if a control exists, but how do I use that to conditionally append to the BootSequence?
Example (from ucm2/Intel/sof-hda-dsp/sof-hda-dsp.conf):
If.amute { Condition { Type ControlExists Control "name='Auto-Mute Mode'" } True.BootSequence [ cset "name='Auto-Mute Mode' off" ] }
The arrays are merged, thus any additional 'BootSequence []' will be handed as extension.
Jaroslav
-- Jaroslav Kysela perex@perex.cz Linux Sound Maintainer; ALSA Project; Red Hat, Inc.