[PATCH] ucm: Allow empty strings in "${var:...}" substitutions

Jaroslav Kysela perex at perex.cz
Sun Jun 28 17:55:26 CEST 2020


Dne 27. 06. 20 v 20:30 Hans de Goede napsal(a):
> Recent ucm-conf changes introduce checks like this one in various places:
> 
> If.mspk {
>          Condition {
>                  Type String
>                  Empty "${var:MonoSpeaker}"
>          }
>          True ...
>          False ...
> }
> 
> The 'Empty "${var:MonoSpeaker}"' part can only every succeed if we do:
> 
> Define.MonoSpeaker ""
> 
> But so far that would result in an error like this one:
> 
> ALSA lib ucm_subs.c:367:(uc_mgr_get_substituted_value) variable '${var:MonoSpeaker}' is not defined in this context!
> ALSA lib main.c:983:(snd_use_case_mgr_open) error: failed to import cht-bsw-rt5672 use case configuration -22
> alsaucm: error failed to open sound card cht-bsw-rt5672: Invalid argument
> 
> This commit fixes this by allowing empty values for "${var:...}"
> substitutions.
> 
> Signed-off-by: Hans de Goede <hdegoede at redhat.com>

Mea culpa. I had this change in my local tree, but I forgot to push it 
upstream. Anyway, thank you for your work and testing. I accepted your commit 
to retain your credits.

					Jaroslav

-- 
Jaroslav Kysela <perex at perex.cz>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.


More information about the Alsa-devel mailing list