From 0780d6e9c27eae687e3c1fa2b544173efd7b6d65 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Mon, 21 Mar 2022 15:24:51 +0100 Subject: [PATCH] ucm2: HDA - make Speaker device optional BugLink: https://github.com/alsa-project/alsa-ucm-conf/issues/141 Signed-off-by: Jaroslav Kysela --- ucm2/HDA/HiFi-analog.conf | 70 +++++++++++++++++++++------------------ 1 file changed, 38 insertions(+), 32 deletions(-) diff --git a/ucm2/HDA/HiFi-analog.conf b/ucm2/HDA/HiFi-analog.conf index f1e8fa4..2434c6d 100644 --- a/ucm2/HDA/HiFi-analog.conf +++ b/ucm2/HDA/HiFi-analog.conf @@ -95,43 +95,49 @@ SectionDevice."Headphones" { } } -SectionDevice."Speaker" { - Comment "Speaker" +If.spk { + Condition { + Type ControlExists + Control "name='Speaker Playback Switch'" + } + True.SectionDevice."Speaker" { + Comment "Speaker" - If.seq { - Condition { - Type ControlExists - Control "name='Bass Speaker Playback Switch'" - } - True { - EnableSequence [ - cset "name='Speaker Playback Switch' on" - cset "name='Bass Speaker Playback Switch' on" - ] + If.seq { + Condition { + Type ControlExists + Control "name='Bass Speaker Playback Switch'" + } + True { + EnableSequence [ + cset "name='Speaker Playback Switch' on" + cset "name='Bass Speaker Playback Switch' on" + ] - DisableSequence [ - cset "name='Speaker Playback Switch' off" - cset "name='Bass Speaker Playback Switch' off" - ] - } - False { - EnableSequence [ - cset "name='Speaker Playback Switch' on" - ] + DisableSequence [ + cset "name='Speaker Playback Switch' off" + cset "name='Bass Speaker Playback Switch' off" + ] + } + False { + EnableSequence [ + cset "name='Speaker Playback Switch' on" + ] - DisableSequence [ - cset "name='Speaker Playback Switch' off" - ] + DisableSequence [ + cset "name='Speaker Playback Switch' off" + ] + } } - } - Value { - PlaybackPriority 100 - PlaybackPCM "hw:${CardId}" - PlaybackMixerElem "Speaker" - PlaybackMasterElem "Master" - PlaybackVolume "Speaker Playback Volume" - PlaybackSwitch "Speaker Playback Switch" + Value { + PlaybackPriority 100 + PlaybackPCM "hw:${CardId}" + PlaybackMixerElem "Speaker" + PlaybackMasterElem "Master" + PlaybackVolume "Speaker Playback Volume" + PlaybackSwitch "Speaker Playback Switch" + } } } -- 2.47.1