Skip to contentSkip to conversation

sof-soundwire: cs42l43: Drop headset mic from mic mute LED

PATCH Superseded Maciej Strozek 2 participants 7 messages Mar 28, 2025 – Apr 1, 2025

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 sof-soundwire: cs42l43: Drop headset mic from mic mute LED

As per conversation in [1], let headsets be dropped from LED bindings. Also remove turning off the mics on device disable since they are now not needed.

[1]: https://github.com/alsa-project/alsa-ucm-conf/pull/512

---
 ucm2/codecs/cs42l43/init.conf        | 6 ------
 ucm2/sof-soundwire/cs42l43-dmic.conf | 2 --
 ucm2/sof-soundwire/cs42l43.conf      | 1 -
 3 files changed, 9 deletions(-)
ucm2/codecs/cs42l43/init.conf +0 -6
index 0e987c21..c0fa863c 100644
@@ -10,9 +10,3 @@ LibraryConfig.remap.Config {
 		}
 	}
 }
-
-BootSequence [
-	cset "name='cs42l43 Decimator 1 Switch' 0"
-]
-
-Macro [{ SetLED { LED="mic" Action="attach" CtlId="cs42l43 Decimator 1 Switch" } }]
ucm2/sof-soundwire/cs42l43-dmic.conf +0 -2
index 70ce40ff..b68a70d1 100644
@@ -13,8 +13,6 @@ SectionDevice."Mic" {
 	]
 
 	DisableSequence [
-		cset "name='cs42l43 Decimator 3 Switch' 0"
-		cset "name='cs42l43 Decimator 4 Switch' 0"
 		cset "name='cs42l43 DP1TX1 Input' 'None'"
 		cset "name='cs42l43 DP1TX2 Input' 'None'"
 	]
ucm2/sof-soundwire/cs42l43.conf +0 -1
index 4b4e1187..51832126 100644
@@ -33,7 +33,6 @@ SectionDevice."Headset" {
 	]
 
 	DisableSequence [
-		cset "name='cs42l43 Decimator 1 Switch' 0"
 		cset "name='cs42l43 DP2TX1 Input' 'None'"
 		cset "name='cs42l43 DP2TX2 Input' 'None'"
 	]

--
2.39.5

#1 lore raw

PATCH 2/2 sof-soundwire: cs42l43: Control hardware volume to avoid clipping

Hardware volume control in cs42l43 can go up to +31.5dB which can cause audio degradation. For best results, keep the hardware volume set to 0dB and let software volume control the output.

---
 ucm2/sof-soundwire/cs42l43-spk.conf | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
ucm2/sof-soundwire/cs42l43-spk.conf +12 -1
index 693c450b..b2b32e57 100644
@@ -1,5 +1,14 @@
 # Use case Configuration for sof-soundwire card
 
+LibraryConfig.remap.Config {
+	ctl.default.map {
+		"name='cs42l43 Speaker Playback Switch'" {
+			"name='cs42l43 Speaker Digital Switch'".vindex.0 0
+			"name='cs42l43 Speaker Digital Switch'".vindex.1 1
+		}
+	}
+}
+
 SectionDevice."Speaker" {
 	Comment "Speaker"
 
@@ -8,6 +17,7 @@ SectionDevice."Speaker" {
 	]
 
 	EnableSequence [
+		cset "name='cs42l43 Speaker Digital Volume' 128"
 		cset "name='cs42l43 Speaker L Input 1' 'DP6RX1'"
 		cset "name='cs42l43 Speaker R Input 1' 'DP6RX2'"
 	]
@@ -20,6 +30,7 @@ SectionDevice."Speaker" {
 	Value {
 		PlaybackPriority 100
 		PlaybackPCM "hw:${CardId},2"
-		PlaybackMixerElem "cs42l43 Speaker Digital"
+		PlaybackMixer "default:${CardId}"
+		PlaybackMixerElem "cs42l43 Speaker"
 	}
 }

--
2.39.5

#2 lore raw

Re: [PATCH alsa-ucm-conf 2/2] sof-soundwire: cs42l43: Control hardware volume to avoid clipping

Quoted 3 lines · Maciej Strozek

Hardware volume control in cs42l43 can go up to +31.5dB which can cause audio degradation. For best results, keep the hardware volume set to 0dB and let software volume control the output.

It's something which I dislike (software volume control). If there's a hardware limit, it should be added to the driver. Eventually, alsa-lib plugins may be extended to do this cropping using a configuration. Also, it may be a bug in pulseaudio/pipewire. The +0dB volumes should be handed with a care.

Jaroslav

Signature · 2 lines
Jaroslav Kysela <[email protected]>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.
#3 lore raw

Re: [PATCH alsa-ucm-conf 2/2] sof-soundwire: cs42l43: Control hardware volume to avoid clipping

W dniu pią, 28.03.2025 o godzinie 11∶41 +0100, użytkownik Jaroslav

Quoted 7 lines · Kysela
Quoted 5 lines · Maciej Strozek

Hardware volume control in cs42l43 can go up to +31.5dB which can cause audio
degradation. For best results, keep the hardware volume set to 0dB and let
software volume control the output.

Quoted 8 lines

It's something which I dislike (software volume control). If there's a
hardware limit, it should be added to the driver. Eventually, alsa- lib plugins
may be extended to do this cropping using a configuration. Also, it may be a
bug in pulseaudio/pipewire. The +0dB volumes should be handed with a care.

I agree this is not very elegant to leave it to soft volume, but until things are resolved elsewhere this is the best way to get best audio for most users?

Quoted 3 lines

                                Jaroslav

Signature · 2 lines
Regards,
Maciej
#4 lore raw

Re: [PATCH alsa-ucm-conf 2/2] sof-soundwire: cs42l43: Control hardware volume to avoid clipping

Quoted 18 lines · Maciej Strozek

W dniu pią, 28.03.2025 o godzinie 11∶41 +0100, użytkownik Jaroslav

Quoted 7 lines · Kysela
Quoted 5 lines · Maciej Strozek

Hardware volume control in cs42l43 can go up to +31.5dB which can cause audio
degradation. For best results, keep the hardware volume set to 0dB and let
software volume control the output.

Quoted 8 lines

It's something which I dislike (software volume control). If there's a
hardware limit, it should be added to the driver. Eventually, alsa- lib plugins
may be extended to do this cropping using a configuration. Also, it may be a
bug in pulseaudio/pipewire. The +0dB volumes should be handed with a care.

Quoted 3 lines

I agree this is not very elegant to leave it to soft volume, but until things are resolved elsewhere this is the best way to get best audio for most users?

I don't see the pipewire upstream report. Please, make an report against pipewire to move discussion there and add the Link: tag to the comment.

If you like to disable something just because the UCM application does not support a feature or misbehaves right now, use a new application variable like @SplitPCM - see [1]. A nice name may be '@OutMix>0dB' or so.

Jaroslav

[1] https://github.com/alsa-project/alsa-ucm-conf/blob/master/ucm2/common/pcm/split.conf

Signature · 2 lines
Jaroslav Kysela <[email protected]>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.
#5 lore raw

Re: [PATCH alsa-ucm-conf 2/2] sof-soundwire: cs42l43: Control hardware volume to avoid clipping

W dniu pon, 31.03.2025 o godzinie 15∶43 +0200, użytkownik Jaroslav

Quoted 6 lines · Kysela

I don't see the pipewire upstream report. Please, make an report against
pipewire to move discussion there and add the Link: tag to the comment.

Quoted 8 lines

If you like to disable something just because the UCM application does not
support a feature or misbehaves right now, use a new application variable like
@SplitPCM - see [1]. A nice name may be '@OutMix>0dB' or so.

                                        Jaroslav

Thanks! Will have a look at those variables and submit something to github soon. Also will include the pipewire issue link which is [1] for reference.

[1] https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/4622

Signature · 2 lines
Regards,
Maciej
#6 lore raw
In reply to Maciej Strozek
Quoted 3 lines · Maciej Strozek

As per conversation in [1], let headsets be dropped from LED bindings. Also remove turning off the mics on device disable since they are now not needed.

Actually, it's preferred to turn off the unused paths. I would keep the sequences.

Jaroslav

Signature · 2 lines
Jaroslav Kysela <[email protected]>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.