Skip to contentSkip to conversation

sof-soundwire: Change mapped control names to make them unique

PATCH Superseded Maciej Strozek 3 participants 6 messages Sep 30, 2024 – Oct 1, 2024

v1 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 sof-soundwire: Change mapped control names to make them unique

Both 'Speaker Digital' and 'cs42l43 PDM2' names were found as substrings in other alsa controls, confusing the MixerElems paths. Make them unique to avoid errors for hardware mutes. Also add 'Capture' string into microphone controls to make them work properly.

Fixes e87dde51d689 ("sof-soundwire: Add basic support for cs42l43")
Fixes e4277a204cd6 ("sof-soundwire: Add support for cs42l43/cs35l56 bridge configuration")
---
 ucm2/codecs/cs42l43/init.conf          | 4 ++--
 ucm2/sof-soundwire/cs35l56-bridge.conf | 6 +++---
 ucm2/sof-soundwire/cs42l43-dmic.conf   | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)
ucm2/codecs/cs42l43/init.conf +2 -2
index 10a6e1f..cf61833 100644
@@ -2,11 +2,11 @@
 
 LibraryConfig.remap.Config {
 	ctl.default.map {
-		"name='cs42l43 PDM2 Switch'" {
+		"name='cs42l43 Microphone Capture Switch'" {
 			"name='cs42l43 Decimator 3 Switch'".vindex.0 0
 			"name='cs42l43 Decimator 4 Switch'".vindex.1 0
 		}
-		"name='cs42l43 PDM2 Volume'" {
+		"name='cs42l43 Microphone Capture Volume'" {
 			"name='cs42l43 Decimator 3 Volume'".vindex.0 0
 			"name='cs42l43 Decimator 4 Volume'".vindex.1 0
 		}
ucm2/sof-soundwire/cs35l56-bridge.conf +3 -3
index 5435b11..7c36655 100644
@@ -2,11 +2,11 @@
 
 LibraryConfig.remap.Config {
 	ctl.default.map {
-		"name='Speaker Digital Switch'" {
+		"name='Speaker Combined Switch'" {
 			"name='AMPL Speaker Switch'".vindex.0 0
 			"name='AMPR Speaker Switch'".vindex.1 0
 		}
-		"name='Speaker Digital Volume'" {
+		"name='Speaker Combined Volume'" {
 			"name='AMPL Speaker Volume'".vindex.0 0
 			"name='AMPR Speaker Volume'".vindex.1 0
 		}
@@ -56,6 +56,6 @@ SectionDevice."Speaker" {
 		PlaybackPriority 100
 		PlaybackPCM "hw:${CardId},0"
 		PlaybackMixer "default:${CardId}"
-		PlaybackMixerElem "Speaker Digital"
+		PlaybackMixerElem "Speaker Combined"
 	}
 }
ucm2/sof-soundwire/cs42l43-dmic.conf +1 -1
index d5f895d..b68a70d 100644
@@ -21,6 +21,6 @@ SectionDevice."Mic" {
 		CapturePriority 100
 		CapturePCM "hw:${CardId},4"
 		CaptureMixer "default:${CardId}"
-		CaptureMixerElem "cs42l43 PDM2"
+		CaptureMixerElem "cs42l43 Microphone"
 	}
 }

--
2.39.5

#1 lore raw

PATCH 2/2 sof-soundwire: Add sequence for controlling Mic Mute LED

---
 ucm2/codecs/cs42l43/init.conf | 6 ++++++
 1 file changed, 6 insertions(+)
ucm2/codecs/cs42l43/init.conf +6 -0
index cf61833..fad41dd 100644
@@ -12,3 +12,9 @@ LibraryConfig.remap.Config {
 		}
 	}
 }
+
+FixedBootSequence [
+        exec "-/sbin/modprobe snd_ctl_led"
+        sysw "-/class/sound/ctl-led/mic/card${CardNumber}/attach:cs42l43 Decimator 3 Switch"
+        sysw "-/class/sound/ctl-led/mic/card${CardNumber}/attach:cs42l43 Decimator 4 Switch"
+]
Signature · 1 line
2.39.5
Reviewed-by on v1 1/2
#3 lore raw
In reply to Maciej Strozek
Quoted 9 lines · Maciej Strozek

Both 'Speaker Digital' and 'cs42l43 PDM2' names were found as substrings in other alsa controls, confusing the MixerElems paths. Make them unique to avoid errors for hardware mutes. Also add 'Capture' string into microphone controls to make them work properly.

Fixes e87dde51d689 ("sof-soundwire: Add basic support for cs42l43")
Fixes e4277a204cd6 ("sof-soundwire: Add support for cs42l43/cs35l56 bridge configuration")

---

Thanks,
Charles

#4 lore raw
In reply to Maciej Strozek
Quoted 19 lines · Maciej Strozek

Both 'Speaker Digital' and 'cs42l43 PDM2' names were found as substrings in other alsa controls, confusing the MixerElems paths. Make them unique to avoid errors for hardware mutes. Also add 'Capture' string into microphone controls to make them work properly.

Fixes e87dde51d689 ("sof-soundwire: Add basic support for cs42l43")
Fixes e4277a204cd6 ("sof-soundwire: Add support for cs42l43/cs35l56 bridge configuration")
---
  ucm2/codecs/cs42l43/init.conf          | 4 ++--
  ucm2/sof-soundwire/cs35l56-bridge.conf | 6 +++---
  ucm2/sof-soundwire/cs42l43-dmic.conf   | 2 +-
  3 files changed, 6 insertions(+), 6 deletions(-)
ucm2/codecs/cs42l43/init.conf +0 -0
index 10a6e1f..cf61833 100644

ucm2/codecs/cs42l43/init.conf line 5

Quoted 5 lines
ucm2/codecs/cs42l43/init.conf +1 -1
@@ -2,11 +2,11 @@
 
  LibraryConfig.remap.Config {
  	ctl.default.map {
-		"name='cs42l43 PDM2 Switch'" {
+		"name='cs42l43 Microphone Capture Switch'" {

This looks like a good cleanup.

ucm2/codecs/cs42l43/init.conf line 8

Quoted 4 lines
ucm2/codecs/cs42l43/init.conf +1 -1
  LibraryConfig.remap.Config {
  	ctl.default.map {
-		"name='Speaker Digital Switch'" {
+		"name='Speaker Combined Switch'" {

Combined? This string is for users not for developers. Please, find a better name describing the purpose of the control from the the user view. The old name is fine IMHO.

Jaroslav

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

W dniu wto, 01.10.2024 o godzinie 12∶38 +0200, użytkownik Jaroslav

Quoted 6 lines · Kysela
Quoted 5 lines

  LibraryConfig.remap.Config { ctl.default.map {
-               "name='Speaker Digital Switch'" { +               "name='Speaker Combined Switch'" {

Quoted 6 lines

Combined? This string is for users not for developers. Please, find a better
name describing the purpose of the control from the the user view. The old
name is fine IMHO.

Unfortunately it can't be "Speaker Digital", what do you think of "Speaker Stereo", or maybe "Speaker Control"? "Speaker Master"?

Signature · 2 lines
Regards,
Maciej