OSDN Git Service

codecs/rt5640: Fix restoring of playback volumes
authorDmitry Osipenko <digetx@gmail.com>
Thu, 20 May 2021 14:14:57 +0000 (17:14 +0300)
committerJaroslav Kysela <perex@perex.cz>
Thu, 27 May 2021 07:08:38 +0000 (09:08 +0200)
The playback volumes shall be initialized only during of the first
enable sequence, not during the initialization of speaker/headphones
devices. This fixes sound level restoring by pulseaudio when headphones
are inserted/ejected. Previously sound level was always reset to the
default level on insert/ejection, which is the incorrect behaviour.
The correct behaviour is to restore volume the previous level, i.e.
if sound level was 3% before headphones were ejected, then level should
be restored to 3% when headphones are inserted back.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
ucm2/codecs/rt5640/EnableSeq.conf
ucm2/codecs/rt5640/HeadPhones.conf
ucm2/codecs/rt5640/MonoSpeaker.conf
ucm2/codecs/rt5640/Speaker.conf

index 8928855..4e9a6c0 100644 (file)
@@ -79,4 +79,7 @@ EnableSequence [
        cset "name='HP R Playback Switch' off"
        cset "name='Speaker L Playback Switch' off"
        cset "name='Speaker R Playback Switch' off"
+
+       cset "name='HP Playback Volume' 29"
+       cset "name='Speaker Playback Volume' 35"
 ]
index 3921e8d..d3be2a9 100644 (file)
@@ -18,7 +18,6 @@ SectionDevice."Headphones" {
                cset "name='HP Channel Switch' on"
                cset "name='HP L Playback Switch' on"
                cset "name='HP R Playback Switch' on"
-               cset "name='HP Playback Volume' 29"
 
        ]
 
@@ -26,7 +25,6 @@ SectionDevice."Headphones" {
                cset "name='HP Channel Switch' off"
                cset "name='HP L Playback Switch' off"
                cset "name='HP R Playback Switch' off"
-               cset "name='HP Playback Volume' 0"
        ]
 
        Value {
index a5cf839..3a87d01 100644 (file)
@@ -13,7 +13,6 @@ SectionDevice."Speaker" {
                cset "name='Speaker Channel Switch' on"
                cset "name='Speaker L Playback Switch' on"
                cset "name='Speaker R Playback Switch' on"
-               cset "name='Speaker Playback Volume' 35"
 
        ]
 
@@ -21,7 +20,6 @@ SectionDevice."Speaker" {
                cset "name='Speaker Channel Switch' off"
                cset "name='Speaker L Playback Switch' off"
                cset "name='Speaker R Playback Switch' off"
-               cset "name='Speaker Playback Volume' 0"
        ]
 
        Value {
index 692a549..31bb6f7 100644 (file)
@@ -13,7 +13,6 @@ SectionDevice."Speaker" {
                cset "name='Speaker Channel Switch' on"
                cset "name='Speaker L Playback Switch' on"
                cset "name='Speaker R Playback Switch' on"
-               cset "name='Speaker Playback Volume' 35"
 
        ]
 
@@ -21,7 +20,6 @@ SectionDevice."Speaker" {
                cset "name='Speaker Channel Switch' off"
                cset "name='Speaker L Playback Switch' off"
                cset "name='Speaker R Playback Switch' off"
-               cset "name='Speaker Playback Volume' 0"
        ]
 
        Value {