diff mbox series

[alsa-ucm-conf] codecs/es8316: Fix mono speaker settings from previous boot getting applied

Message ID 20231029145007.24106-1-hdegoede@redhat.com (mailing list archive)
State New, archived
Headers show
Series [alsa-ucm-conf] codecs/es8316: Fix mono speaker settings from previous boot getting applied | expand

Commit Message

Hans de Goede Oct. 29, 2023, 2:50 p.m. UTC
When codecs/es8316/MonoSpeaker.conf's EnableSeq was run last before
shutdown the 'Playback Polarity' and 'DAC Mono Mix Switch' controls for
Mono Speaker output get saved and restored on the next boot.

These settings are undone by the MonoSpeaker DisableSeq, but that never
runs when an updated kernel switches from the default "cfg-spk:1" in
components to "cfg-spk:2" for devices which do actually have 2 speakers,
which causes the ucm profile to use codecs/es8316/Speaker.conf instead.

Set the 'Playback Polarity' and 'DAC Mono Mix Switch' controls to their
defaults in codecs/es8316/EnableSeq.conf to avoid them getting stuck
in Mono mix mode in this scenario.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 ucm2/codecs/es8316/EnableSeq.conf | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Jaroslav Kysela Oct. 31, 2023, 2:12 p.m. UTC | #1
On 29. 10. 23 15:50, Hans de Goede wrote:
> When codecs/es8316/MonoSpeaker.conf's EnableSeq was run last before
> shutdown the 'Playback Polarity' and 'DAC Mono Mix Switch' controls for
> Mono Speaker output get saved and restored on the next boot.
> 
> These settings are undone by the MonoSpeaker DisableSeq, but that never
> runs when an updated kernel switches from the default "cfg-spk:1" in
> components to "cfg-spk:2" for devices which do actually have 2 speakers,
> which causes the ucm profile to use codecs/es8316/Speaker.conf instead.
> 
> Set the 'Playback Polarity' and 'DAC Mono Mix Switch' controls to their
> defaults in codecs/es8316/EnableSeq.conf to avoid them getting stuck
> in Mono mix mode in this scenario.
> 
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
>   ucm2/codecs/es8316/EnableSeq.conf | 4 ++++
>   1 file changed, 4 insertions(+)

Thanks. Applied.

				Jaroslav
Hans de Goede Oct. 31, 2023, 2:38 p.m. UTC | #2
Hi Jaroslav,

On 10/31/23 15:12, Jaroslav Kysela wrote:
> On 29. 10. 23 15:50, Hans de Goede wrote:
>> When codecs/es8316/MonoSpeaker.conf's EnableSeq was run last before
>> shutdown the 'Playback Polarity' and 'DAC Mono Mix Switch' controls for
>> Mono Speaker output get saved and restored on the next boot.
>>
>> These settings are undone by the MonoSpeaker DisableSeq, but that never
>> runs when an updated kernel switches from the default "cfg-spk:1" in
>> components to "cfg-spk:2" for devices which do actually have 2 speakers,
>> which causes the ucm profile to use codecs/es8316/Speaker.conf instead.
>>
>> Set the 'Playback Polarity' and 'DAC Mono Mix Switch' controls to their
>> defaults in codecs/es8316/EnableSeq.conf to avoid them getting stuck
>> in Mono mix mode in this scenario.
>>
>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
>> ---
>>   ucm2/codecs/es8316/EnableSeq.conf | 4 ++++
>>   1 file changed, 4 insertions(+)
> 
> Thanks. Applied.

Thank you.

Did you see my other 3 ucm-conf patches? :

https://lore.kernel.org/alsa-devel/20231021143109.52210-1-hdegoede@redhat.com/
https://lore.kernel.org/alsa-devel/20231021211614.115152-1-hdegoede@redhat.com/
https://lore.kernel.org/alsa-devel/20231021211614.115152-2-hdegoede@redhat.com/

Regards,

Hans
diff mbox series

Patch

diff --git a/ucm2/codecs/es8316/EnableSeq.conf b/ucm2/codecs/es8316/EnableSeq.conf
index b6c81d8..b75c4a7 100644
--- a/ucm2/codecs/es8316/EnableSeq.conf
+++ b/ucm2/codecs/es8316/EnableSeq.conf
@@ -22,4 +22,8 @@  EnableSequence [
 	# Setup muxes / switches
 	cset "name='Left Headphone Mixer Left DAC Switch' on"
 	cset "name='Right Headphone Mixer Right DAC Switch' on"
+
+	# Undo MonoSpeaker settings which may have been saved on shutdown
+	cset "name='Playback Polarity' 0"
+	cset "name='DAC Mono Mix Switch' off"
 ]