diff mbox series

[alsa-lib,1/3] chtnau8824: Fix mono speaker config not working

Message ID 20201206124718.14060-1-hdegoede@redhat.com (mailing list archive)
State New, archived
Headers show
Series [alsa-lib,1/3] chtnau8824: Fix mono speaker config not working | expand

Commit Message

Hans de Goede Dec. 6, 2020, 12:47 p.m. UTC
Fix the Speaker define / var being changed from "Speaker" to "MonoSpeaker"
not having any effect because the variable gets expanded before the if
making the change is interpreted.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 ucm2/chtnau8824/HiFi.conf | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

Comments

Hans de Goede Dec. 6, 2020, 12:50 p.m. UTC | #1
Hi,

Patch prefix should have been "PATCH alsa-ucm-conf", I have fixed this in
my git config now, sorry about that.

Regards,

Hans

On 12/6/20 1:47 PM, Hans de Goede wrote:
> Fix the Speaker define / var being changed from "Speaker" to "MonoSpeaker"
> not having any effect because the variable gets expanded before the if
> making the change is interpreted.
> 
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
>  ucm2/chtnau8824/HiFi.conf | 15 +++++++++++----
>  1 file changed, 11 insertions(+), 4 deletions(-)
> 
> diff --git a/ucm2/chtnau8824/HiFi.conf b/ucm2/chtnau8824/HiFi.conf
> index 3ccd6b1..d7a5f63 100644
> --- a/ucm2/chtnau8824/HiFi.conf
> +++ b/ucm2/chtnau8824/HiFi.conf
> @@ -34,8 +34,15 @@ SectionVerb {
>  	}
>  }
>  
> -Include.spk.File "/codecs/nau8824/${var:Speaker}.conf"
> -Include.hp.File "/codecs/nau8824/HeadPhones.conf"
> +# The includes using $vars in there path must be conditional otherwise the
> +# $var gets expanded before the other If-s above can change the vars.
> +If.cfg-includes {
> +	Condition { Type String Empty "" }
> +	True {
> +		Include.spk.File "/codecs/nau8824/${var:Speaker}.conf"
> +		Include.hp.File "/codecs/nau8824/HeadPhones.conf"
>  
> -Include.mic.File "/codecs/nau8824/InternalMic.conf"
> -Include.hsmic.File "/codecs/nau8824/HeadsetMic.conf"
> +		Include.mic.File "/codecs/nau8824/InternalMic.conf"
> +		Include.hsmic.File "/codecs/nau8824/HeadsetMic.conf"
> +	}
> +}
>
Jaroslav Kysela Dec. 14, 2020, 8:23 a.m. UTC | #2
Dne 06. 12. 20 v 13:50 Hans de Goede napsal(a):
> Hi,
> 
> Patch prefix should have been "PATCH alsa-ucm-conf", I have fixed this in
> my git config now, sorry about that.

Thanks for your patches. I applied them all to the alsa-ucm-conf repo.

				Jaroslav
diff mbox series

Patch

diff --git a/ucm2/chtnau8824/HiFi.conf b/ucm2/chtnau8824/HiFi.conf
index 3ccd6b1..d7a5f63 100644
--- a/ucm2/chtnau8824/HiFi.conf
+++ b/ucm2/chtnau8824/HiFi.conf
@@ -34,8 +34,15 @@  SectionVerb {
 	}
 }
 
-Include.spk.File "/codecs/nau8824/${var:Speaker}.conf"
-Include.hp.File "/codecs/nau8824/HeadPhones.conf"
+# The includes using $vars in there path must be conditional otherwise the
+# $var gets expanded before the other If-s above can change the vars.
+If.cfg-includes {
+	Condition { Type String Empty "" }
+	True {
+		Include.spk.File "/codecs/nau8824/${var:Speaker}.conf"
+		Include.hp.File "/codecs/nau8824/HeadPhones.conf"
 
-Include.mic.File "/codecs/nau8824/InternalMic.conf"
-Include.hsmic.File "/codecs/nau8824/HeadsetMic.conf"
+		Include.mic.File "/codecs/nau8824/InternalMic.conf"
+		Include.hsmic.File "/codecs/nau8824/HeadsetMic.conf"
+	}
+}