From: Jaroslav Kysela Date: Fri, 7 Oct 2022 17:00:44 +0000 (+0200) Subject: USB-Audio: ALC4080 - add back SPDIF switch X-Git-Tag: v1.2.8~6 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=0c8c5d81775c249e4b7a29679ca1dc0b8b213a88;p=alsa-ucm-conf.git USB-Audio: ALC4080 - add back SPDIF switch 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 --- diff --git a/ucm2/USB-Audio/Realtek/ALC4080-HiFi.conf b/ucm2/USB-Audio/Realtek/ALC4080-HiFi.conf index b1e0130..519f3b0 100644 --- a/ucm2/USB-Audio/Realtek/ALC4080-HiFi.conf +++ b/ucm2/USB-Audio/Realtek/ALC4080-HiFi.conf @@ -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}" } } }