]> git.alsa-project.org Git - alsa-ucm-conf.git/commitdiff
USB-Audio: ALC4080 - add back SPDIF switch
authorJaroslav Kysela <perex@perex.cz>
Fri, 7 Oct 2022 17:00:44 +0000 (19:00 +0200)
committerJaroslav Kysela <perex@perex.cz>
Fri, 7 Oct 2022 17:01:29 +0000 (19:01 +0200)
It seems that 'IEC958 Playback Switch' is valid for the hardware
with the provided USB mapping in the driver. For others, it appears
that this switch is 'PCM PLayback Switch' with index 2.

BugLink: https://github.com/alsa-project/alsa-ucm-conf/issues/227
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
ucm2/USB-Audio/Realtek/ALC4080-HiFi.conf

index b1e013032a29e29f816ddf1daa593a88eacaab67..519f3b0935410f96f0e1fb7adc7edd8579baee34 100644 (file)
@@ -30,6 +30,8 @@ Define {
 
        SpdifName "S/PDIF Output"
        SpdifPCM "hw:${CardId},3"
+       SpdifMixer "PCM"
+       SpdifMindex "2"
 }
 
 If.speaker_ctl {
@@ -51,6 +53,17 @@ If.front_hp_ctl {
        }
 }
 
+If.spdif_ctl {
+       Condition {
+               Type ControlExists
+               Control "name='IEC958 Playback Switch'"
+       }
+       True.Define {
+               SpdifMixer "IEC958"
+               SpdifMindex "0"
+       }
+}
+
 If.spdif_dev2 {
        Condition {
                Type RegexMatch
@@ -151,9 +164,18 @@ If.spdif {
        False.SectionDevice."SPDIF" {
                Comment "${var:SpdifName}"
 
+               EnableSequence [
+                       cset "name='${var:SpdifMixer} Playback Switch',index=${var:SpdifMindex} on"
+               ]
+
+               DisableSequence [
+                       cset "name='${var:SpdifMixer} Playback Switch',index=${var:SpdifMindex} off"
+               ]
+
                Value {
                        PlaybackPriority 100
                        PlaybackPCM "${var:SpdifPCM}"
+                       PlaybackMixerElem "${var:SpdifMixer},${var:SpdifMindex}"
                }
        }
 }