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>
SpdifName "S/PDIF Output"
SpdifPCM "hw:${CardId},3"
+ SpdifMixer "PCM"
+ SpdifMindex "2"
}
If.speaker_ctl {
}
}
+If.spdif_ctl {
+ Condition {
+ Type ControlExists
+ Control "name='IEC958 Playback Switch'"
+ }
+ True.Define {
+ SpdifMixer "IEC958"
+ SpdifMindex "0"
+ }
+}
+
If.spdif_dev2 {
Condition {
Type RegexMatch
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}"
}
}
}