OSDN Git Service

sof-hda-dsp: remove standalone Bass Speaker, fix mixer values
authorJaroslav Kysela <perex@perex.cz>
Thu, 28 Nov 2019 16:01:50 +0000 (17:01 +0100)
committerJaroslav Kysela <perex@perex.cz>
Thu, 28 Nov 2019 16:45:03 +0000 (17:45 +0100)
Use the mixer values MixerElem and MasterElem by the latest use-case.h.
Merge the Bass Speaker to Speaker. The standalone Speaker is unusable
on Lenovo Carbon X1 7th gen.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
ucm2/sof-hda-dsp/HiFi.conf

index 372fd02..f1cfa0b 100644 (file)
@@ -2,7 +2,6 @@
 
 SectionVerb {
        EnableSequence [
-               cset "name='Master Playback Switch' on"
                cset "name='Capture Switch' on"
        ]
 }
@@ -20,23 +19,13 @@ SectionDevice."Headphone" {
 
        Value {
                PlaybackPCM "hw:${CardId},0"
-               PlaybackMixerID "Headphone"
+               PlaybackMixerElem "Headphone"
+               PlaybackMixerMaster "Master"
                PlaybackVolume "Headphone Playback Volume"
                PlaybackSwitch "Headphone Playback Switch"
                PlaybackChannels "2"
-               If.1 {
-                       Condition {
-                               Type ControlExists
-                               Control "name='Bass Speaker Playback Switch'"
-                       }
-                       True {
-                               JackHWMute "Speaker BassSpeaker"
-                       }
-                       False {
-                               JackHWMute "Speaker"
-                       }
-               }
-               If.2 {
+               JackHWMute "Speaker"
+               If.jack {
                        Condition {
                                Type ControlExists
                                Control "iface=CARD,name='Headphone Mic Jack'"
@@ -54,56 +43,41 @@ SectionDevice."Headphone" {
 SectionDevice."Speaker" {
        Comment "Speaker"
 
-       EnableSequence [
-               cset "name='Speaker Playback Switch' on"
-       ]
-
-       DisableSequence [
-               cset "name='Speaker Playback Switch' off"
-       ]
-
-       Value {
-               PlaybackPCM "hw:${CardId},0"
-               PlaybackMixerID "Speaker"
-               PlaybackVolume "Speaker Playback Volume"
-               PlaybackSwitch "Speaker Playback Switch"
-               PlaybackChannels "2"
-       }
-}
-
-If.1 {
-       After.SectionDevice "Speaker"
-       Condition {
-               Type ControlExists
-               Control "name='Bass Speaker Playback Switch'"
-       }
-       True {
-               SectionDevice."BassSpeaker" {
-                       Comment "Bass Speaker"
-
-                       ConflictingDevice [
-                               "Speaker"
-                       ]
-
+       If.seq {
+               Condition {
+                       Type ControlExists
+                       Control "name='Bass Speaker Playback Switch'"
+               }
+               True {
                        EnableSequence [
-                               cset "name='Bass Speaker Playback Switch' on"
                                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"
+                       ]
 
-                       Value {
-                               PlaybackPCM "hw:${CardId},0"
-                               PlaybackMixerID "Speaker"
-                               PlaybackVolume "Speaker Playback Volume"
-                               PlaybackSwitch "Speaker Playback Switch"
-                               PlaybackChannels "2"
-                       }
+                       DisableSequence [
+                               cset "name='Speaker Playback Switch' off"
+                       ]
                }
        }
+
+       Value {
+               PlaybackPCM "hw:${CardId},0"
+               PlaybackMixerElem "Speaker"
+               PlaybackMasterElem "Master"
+               PlaybackVolume "Speaker Playback Volume"
+               PlaybackSwitch "Speaker Playback Switch"
+               PlaybackChannels "2"
+       }
 }
 
 SectionDevice."HeadsetMic" {
@@ -111,7 +85,7 @@ SectionDevice."HeadsetMic" {
 
        Value {
                CapturePCM "hw:${CardId},0"
-               CaptureMixerID "Capture"
+               CaptureMixerElem "Capture"
                CaptureVolume "Capture Volume"
                CaptureSwitch "Capture Switch"
                CaptureChannels "2"
@@ -128,9 +102,22 @@ SectionDevice."DigitalMic" {
 
        Value {
                CapturePCM "hw:${CardId},6"
-               CaptureMixerID "Dmic0 Capture"
-               CaptureVolume "Dmic0 Capture Volume"
-               CaptureSwitch "Dmic0 Capture Switch"
                CaptureChannels "2"
+               If.vol {
+                       Condition {
+                               Type ControlExists
+                               Control "name='Dmic0 Capture Switch'"
+                       }
+                       True {
+                               CaptureMixerElem "Dmic0 Capture"
+                               CaptureVolume "Dmic0 Capture Volume"
+                               CaptureSwitch "Dmic0 Capture Switch"
+                       }
+                       False {
+                               # v1.3 SOF firmware
+                               CaptureMixerElem "PGA10.0 10 Master"
+                               CaptureVolume "PGA10.0 10 Master Capture Volume"
+                       }
+               }
        }
 }