Skip to contentSkip to conversation

conf/ucm: bytcr-rt5645: Use the generic bytcr/PlatformEnableSeq.conf

PATCH Applied Hans de Goede 5 participants 31 messages Aug 8, 2018 – Nov 28, 2018

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/13 conf/ucm: bytcr-rt5645: Use the generic bytcr/PlatformEnableSeq.conf

Use the generic Intel SSP bytcr/PlatformEnableSeq.conf file, it is identical to all the cset statements this commit removes.

---
 src/conf/ucm/chtrt5645/HiFi.conf | 116 +------------------------------
 1 file changed, 1 insertion(+), 115 deletions(-)
src/conf/ucm/chtrt5645/HiFi.conf +1 -115
index e81866cf..d993f6ae 100644
@@ -11,121 +11,7 @@ SectionVerb {
 	EnableSequence [
 		cdev "hw:chtrt5645"
 
-		# media mixer settings
-		#   compress
-		cset "name='media0_in Gain 0 Switch' on"
-		cset "name='media0_in Gain 0 Volume' 0"
-
-		#   normal
-		cset "name='media1_in Gain 0 Switch' on"
-		cset "name='media1_in Gain 0 Volume' 0"
-		#   swm loopback
-		cset "name='media2_in Gain 0 Switch' off"
-		cset "name='media2_in Gain 0 Volume' 0%"
-		#   deep buffer
-		cset "name='media3_in Gain 0 Switch' on"
-		cset "name='media3_in Gain 0 Volume' 0"
-
-		cset "name='media0_out mix 0 media0_in Switch' on"
-		cset "name='media0_out mix 0 media1_in Switch' on"
-		cset "name='media0_out mix 0 media2_in Switch' off"
-		cset "name='media0_out mix 0 media3_in Switch' on"
-
-		cset "name='media1_out mix 0 media0_in Switch' off"
-		cset "name='media1_out mix 0 media1_in Switch' off"
-		cset "name='media1_out mix 0 media2_in Switch' off"
-		cset "name='media1_out mix 0 media3_in Switch' off"
-
-		cset "name='pcm0_in Gain 0 Switch' on"
-		cset "name='pcm0_in Gain 0 Volume' 0"
-
-		cset "name='pcm1_in Gain 0 Switch' off"
-		cset "name='pcm1_in Gain 0 Volume' 0%"
-
-		# codec0_out settings (used if ssp2 is connected to aif1)
-		cset "name='codec_out0 mix 0 codec_in0 Switch' off"
-		cset "name='codec_out0 mix 0 codec_in1 Switch' off"
-		cset "name='codec_out0 mix 0 media_loop1_in Switch' off"
-		cset "name='codec_out0 mix 0 media_loop2_in Switch' off"
-		cset "name='codec_out0 mix 0 pcm0_in Switch' on"
-		cset "name='codec_out0 mix 0 pcm1_in Switch' off"
-		cset "name='codec_out0 mix 0 sprot_loop_in Switch' off"
-		cset "name='codec_out0 Gain 0 Switch' on"
-		cset "name='codec_out0 Gain 0 Volume' 0"
-
-		# modem_out settings (used if ssp0 is connected to aif2)
-		cset "name='modem_out mix 0 codec_in0 Switch' off"
-		cset "name='modem_out mix 0 codec_in1 Switch' off"
-		cset "name='modem_out mix 0 media_loop1_in Switch' off"
-		cset "name='modem_out mix 0 media_loop2_in Switch' off"
-		cset "name='modem_out mix 0 pcm0_in Switch' on"
-		cset "name='modem_out mix 0 pcm1_in Switch' off"
-		cset "name='modem_out mix 0 sprot_loop_in Switch' off"
-		cset "name='modem_out Gain 0 Switch' on"
-		cset "name='modem_out Gain 0 Volume' 0"
-
-		# input settings
-		# pcm1_out settings
-
-		# input used when SSP2 is connected
-		cset "name='codec_in0 Gain 0 Switch' on"
-		cset "name='codec_in0 Gain 0 Volume' 0"
-
-		# input used when SSP0 is connected
-		cset "name='modem_in Gain 0 Switch' on"
-		cset "name='modem_in Gain 0 Volume' 0"
-
-		cset "name='pcm1_out mix 0 codec_in0 Switch' on"
-		cset "name='pcm1_out mix 0 modem_in Switch' on"
-		cset "name='pcm1_out mix 0 codec_in1 Switch' off"
-		cset "name='pcm1_out mix 0 media_loop1_in Switch' off"
-		cset "name='pcm1_out mix 0 media_loop2_in Switch' off"
-		cset "name='pcm1_out mix 0 pcm0_in Switch' off"
-		cset "name='pcm1_out mix 0 pcm1_in Switch' off"
-		cset "name='pcm1_out mix 0 sprot_loop_in Switch' off"
-
-		cset "name='pcm1_out Gain 0 Switch' on"
-		cset "name='pcm1_out Gain 0 Volume' 0"
-
-		# disable codec_out1
-		cset "name='codec_out1 mix 0 codec_in0 Switch' off"
-		cset "name='codec_out1 mix 0 codec_in1 Switch' off"
-		cset "name='codec_out1 mix 0 media_loop1_in Switch' off"
-		cset "name='codec_out1 mix 0 media_loop2_in Switch' off"
-		cset "name='codec_out1 mix 0 pcm0_in Switch' off"
-		cset "name='codec_out1 mix 0 pcm1_in Switch' off"
-		cset "name='codec_out1 mix 0 sprot_loop_in Switch' off"
-		cset "name='codec_out1 Gain 0 Switch' off"
-		cset "name='codec_out1 Gain 0 Volume' 0%"
-
-		# disable codec_in1
-		cset "name='codec_in1 Gain 0 Switch' off"
-		cset "name='codec_in1 Gain 0 Volume' 0%"
-
-		# disable all loops
-		cset "name='media_loop1_out mix 0 codec_in0 Switch' off"
-		cset "name='media_loop1_out mix 0 codec_in1 Switch' off"
-		cset "name='media_loop1_out mix 0 media_loop1_in Switch' off"
-		cset "name='media_loop1_out mix 0 media_loop2_in Switch' off"
-		cset "name='media_loop1_out mix 0 pcm0_in Switch' off"
-		cset "name='media_loop1_out mix 0 pcm1_in Switch' off"
-		cset "name='media_loop1_out mix 0 sprot_loop_in Switch' off"
-
-		cset "name='media_loop2_out mix 0 codec_in0 Switch' off"
-		cset "name='media_loop2_out mix 0 codec_in1 Switch' off"
-		cset "name='media_loop2_out mix 0 media_loop1_in Switch' off"
-		cset "name='media_loop2_out mix 0 media_loop2_in Switch' off"
-		cset "name='media_loop2_out mix 0 pcm0_in Switch' off"
-		cset "name='media_loop2_out mix 0 pcm1_in Switch' off"
-		cset "name='media_loop2_out mix 0 sprot_loop_in Switch' off"
-
-		cset "name='sprot_loop_out mix 0 codec_in0 Switch' off"
-		cset "name='sprot_loop_out mix 0 codec_in1 Switch' off"
-		cset "name='sprot_loop_out mix 0 media_loop1_in Switch' off"
-		cset "name='sprot_loop_out mix 0 media_loop2_in Switch' off"
-		cset "name='sprot_loop_out mix 0 pcm0_in Switch' off"
-		cset "name='sprot_loop_out mix 0 pcm1_in Switch' off"
-		cset "name='sprot_loop_out mix 0 sprot_loop_in Switch' off"
+		<bytcr/PlatformEnableSeq.conf>
 
 		# Output Configuration
 		cset "name='DAC1 L Mux' IF1 DAC"
Signature · 1 line
2.18.0
#1 lore raw

PATCH v2 2/13 conf/ucm: bytcr-rt5651: Do not use both DAC1 and HPVOL inputs for HP

The headphones can either be driven directly from DAC1, or through the HP volume mixer chain to allow volume control, both can be enabled at the same time, but this should not be done.

Mix only DAC1 to the headphones and not the HP volume path, there are 2 reasons to choice the DAC1 path;
1) It is the power-on-reset default
2) We don't expose the volume control to e.g. pulseaudio anyways so it is not useful

While at it also move the "HPO MIX DAC1" and "HPO MIX HPVOL" entries up a bit so that they are no longer inbetween the "HPO L Playback Switch" and "HPO R Playback Switch" entries.

---
 src/conf/ucm/bytcr-rt5651/HiFi.conf         | 2 --
 src/conf/ucm/bytcr-rt5651/bytcr-rt5651.conf | 4 ++--
 2 files changed, 2 insertions(+), 4 deletions(-)
src/conf/ucm/bytcr-rt5651/HiFi.conf +0 -2
index 8ded2d52..bc604276 100644
@@ -30,7 +30,6 @@ SectionDevice."Headphones" {
 		cset "name='Headphone Switch' on"
 		cset "name='HPO L Playback Switch' on"
 		cset "name='HPO R Playback Switch' on"
-		cset "name='HP Playback Volume' 100"
 	]
 
 	DisableSequence [
@@ -39,7 +38,6 @@ SectionDevice."Headphones" {
 		cset "name='Headphone Switch' off"
 		cset "name='HPO L Playback Switch' off"
 		cset "name='HPO R Playback Switch' off"
-		cset "name='HP Playback Volume' 0"
 	]
 
 	Value {
src/conf/ucm/bytcr-rt5651/bytcr-rt5651.conf +2 -2
index 069427b7..3bf7f69a 100644
@@ -99,10 +99,10 @@ SectionDefaults [
 
 	# default state
 	cset "name='ADC Capture Volume' 126"
+	cset "name='HPO MIX DAC1 Switch' on"
+	cset "name='HPO MIX HPVOL Switch' off"
 	cset "name='HP Playback Volume' 0"
 	cset "name='HPO L Playback Switch' off"
-	cset "name='HPO MIX DAC1 Switch' on"
-	cset "name='HPO MIX HPVOL Switch' on"
 	cset "name='HPO R Playback Switch' off"
 	cset "name='HPOVOL L Switch' on"
 	cset "name='HPOVOL R Switch' on"
Signature · 1 line
2.18.0
#2 lore raw

PATCH v2 3/13 conf/ucm: bytcr-rt5651: Configure all volumes at 0dB

In reply to Hans de Goede

The volumes are taken from this commit:
https://github.com/plbossart/UCM/commit/753e2430cd0e6cafbf10c6b29b689dbd32ac5250

That commit also adds line-in support, so it has not been taken in its entirety.

---
 src/conf/ucm/bytcr-rt5651/bytcr-rt5651.conf | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
src/conf/ucm/bytcr-rt5651/bytcr-rt5651.conf +7 -3
index 3bf7f69a..27a7b5c6 100644
@@ -98,16 +98,13 @@ SectionDefaults [
 	cset "name='sprot_loop_out mix 0 sprot_loop_in Switch' off"
 
 	# default state
-	cset "name='ADC Capture Volume' 126"
 	cset "name='HPO MIX DAC1 Switch' on"
 	cset "name='HPO MIX HPVOL Switch' off"
-	cset "name='HP Playback Volume' 0"
 	cset "name='HPO L Playback Switch' off"
 	cset "name='HPO R Playback Switch' off"
 	cset "name='HPOVOL L Switch' on"
 	cset "name='HPOVOL R Switch' on"
 	cset "name='IF1 ASRC Switch' on"
-	cset "name='IN Capture Volume' 27"
 	cset "name='IN2 Boost' 1"
 	cset "name='IN1 Boost' 1"
 	cset "name='LOUT L Playback Switch' on"
@@ -126,6 +123,13 @@ SectionDefaults [
 	cset "name='Headphone Switch' off"
 	cset "name='Speaker Switch' off"
 
+	# volumes for 0dB
+	cset "name='OUT Playback Volume' 31"
+	cset "name='HP Playback Volume' 31"
+	cset "name='IN Capture Volume' 23"
+	cset "name='ADC Capture Volume' 47"
+	cset "name='DAC1 Playback Volume' 175"
+
 	# input
 	cset "name='Stereo1 ADC L1 Mux' ADC"
 	cset "name='Stereo1 ADC R1 Mux' ADC"
Signature · 1 line
2.18.0
#3 lore raw

PATCH v2 4/13 conf/ucm: bytcr-rt5651: Start with all outputs and inputs disabled

In reply to Hans de Goede

Start with all switches disabled, so that e.g. the
LOUT L/R Playback Switches are not left enabled when starting with headphones plugged in.

This fixes the platform clock being kept on by these in some cases.

While at also move the IN? Boost and IF1 ASRC Switch lines around a bit to match the order from https://github.com/plbossart/UCM so the profiles can be more easily compared.

---
 src/conf/ucm/bytcr-rt5651/bytcr-rt5651.conf | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
src/conf/ucm/bytcr-rt5651/bytcr-rt5651.conf +8 -6
index 27a7b5c6..d3148b3d 100644
@@ -104,14 +104,13 @@ SectionDefaults [
 	cset "name='HPO R Playback Switch' off"
 	cset "name='HPOVOL L Switch' on"
 	cset "name='HPOVOL R Switch' on"
-	cset "name='IF1 ASRC Switch' on"
-	cset "name='IN2 Boost' 1"
-	cset "name='IN1 Boost' 1"
-	cset "name='LOUT L Playback Switch' on"
 	cset "name='LOUT MIX DAC L1 Switch' on"
 	cset "name='LOUT MIX DAC R1 Switch' on"
-	cset "name='LOUT R Playback Switch' on"
-	cset "name='OUT Playback Volume' 33"
+	cset "name='IN1 Boost' 1"
+	cset "name='IN2 Boost' 1"
+	cset "name='IF1 ASRC Switch' on"
+	cset "name='LOUT L Playback Switch' off"
+	cset "name='LOUT R Playback Switch' off"
 	cset "name='Stereo DAC MIXL DAC L1 Switch' on"
 	cset "name='Stereo DAC MIXR DAC R1 Switch' on"
 	cset "name='Stereo1 ADC MIXR ADC1 Switch' on"
@@ -141,4 +140,7 @@ SectionDefaults [
 	cset "name='RECMIXR BST3 Switch' off"
 	cset "name='RECMIXL BST2 Switch' off"
 	cset "name='RECMIXR BST2 Switch' off"
+	cset "name='Headset Mic Switch' off"
+	cset "name='Internal Mic Switch' off"
+	cset "name='Line In Switch' off"
 ]
Signature · 1 line
2.18.0
#4 lore raw

PATCH v2 5/13 conf/ucm: bytcr-rt5651: Change Speaker/Headphone en/disable sequences to fix switching

In reply to Hans de Goede

pulseaudio will run the DisableSequence of the current playback device before running the EnableSequence of the new playback device.

This causes the Platform Clock and BIAS to temporarily get turned off which on the rt5651 breaks audio-streams which are playing when switching.

This commit moves the disabling to the EnableSequence of the other device fixing this.

---
 src/conf/ucm/bytcr-rt5651/HiFi.conf | 22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)
src/conf/ucm/bytcr-rt5651/HiFi.conf +18 -4
index bc604276..42fa2c9a 100644
@@ -30,14 +30,19 @@ SectionDevice."Headphones" {
 		cset "name='Headphone Switch' on"
 		cset "name='HPO L Playback Switch' on"
 		cset "name='HPO R Playback Switch' on"
+		# Done after turning the HP on to keep the bias and clk on
+		cset "name='Speaker Switch' off"
+		cset "name='LOUT L Playback Switch' off"
+		cset "name='LOUT R Playback Switch' off"
 	]
 
 	DisableSequence [
 		cdev "hw:bytcrrt5651"
 		exec "echo Headphones playback disable sequence"
-		cset "name='Headphone Switch' off"
-		cset "name='HPO L Playback Switch' off"
-		cset "name='HPO R Playback Switch' off"
+		# This is done by the Speaker EnableSequence, so that the
+		# Platform Clock and BIAS do not temporarily get turned off
+		# as that breaks audio-streams which are playing when
+		# switching between Speaker/Headphone
 	]
 
 	Value {
@@ -57,12 +62,21 @@ SectionDevice."Speaker" {
 		cdev "hw:bytcrrt5651"
 		exec "echo Speaker enable sequence"
 		cset "name='Speaker Switch' on"
+		cset "name='LOUT L Playback Switch' on"
+		cset "name='LOUT R Playback Switch' on"
+		# Done after turning the speaker on to keep the bias and clk on
+		cset "name='Headphone Switch' off"
+		cset "name='HPO L Playback Switch' off"
+		cset "name='HPO R Playback Switch' off"
 	]
 
 	DisableSequence [
 		cdev "hw:bytcrrt5651"
 		exec "echo Speaker disable sequence"
-		cset "name='Speaker Switch' off"
+		# This is done by the Headphones EnableSequence, so that the
+		# Platform Clock and BIAS do not temporarily get turned off
+		# as that breaks audio-streams which are playing when
+		# switching between Speaker/Headphone
 	]
 
 	Value {
Signature · 1 line
2.18.0
#5 lore raw

PATCH v2 6/13 conf/ucm: bytcr-rt5651: Use generic SSP enable + disable sequence, support SSP0

In reply to Hans de Goede

Use the generic SSP enable sequence from bytcr/PlatformEnableSeq.conf, for boards using SSP2 this is identical the code it replaces and this adds support for boards using SSP0.

This fixes sound not working on Bay Trail CR tablets with a rt5651 codec.

This commit also calls the generic disable sequence on shutdown (this is new).

---
 configure.ac                                |   1 +
 src/conf/ucm/Makefile.am                    |   1 +
 src/conf/ucm/bytcr-rt5651/HiFi.conf         |   5 +-
 src/conf/ucm/bytcr-rt5651/bytcr-rt5651.conf | 136 --------------------
 src/conf/ucm/rt5651/EnableSeq.conf          |  46 +++++++
 src/conf/ucm/rt5651/Makefile.am             |   4 +
 6 files changed, 55 insertions(+), 138 deletions(-)
 create mode 100644 src/conf/ucm/rt5651/EnableSeq.conf
 create mode 100644 src/conf/ucm/rt5651/Makefile.am
configure.ac +1 -0
index adc654e2..85a6be80 100644
@@ -747,6 +747,7 @@ AC_OUTPUT(Makefile doc/Makefile doc/pictures/Makefile doc/doxygen.cfg \
 	  src/conf/ucm/PAZ00/Makefile \
 	  src/conf/ucm/PIPO-W2S-Defaultstring-CherryTrailCR/Makefile \
 	  src/conf/ucm/rt5640/Makefile \
+	  src/conf/ucm/rt5651/Makefile \
 	  src/conf/ucm/SDP4430/Makefile \
 	  src/conf/ucm/skylake-rt286/Makefile \
 	  src/conf/ucm/TECLAST-X80Pro-Defaultstring-CherryTrailCR/Makefile \
src/conf/ucm/Makefile.am +1 -0
index 1e51f73e..669e98d5 100644
@@ -29,6 +29,7 @@ PandaBoardES \
 PAZ00 \
 PIPO-W2S-Defaultstring-CherryTrailCR \
 rt5640 \
+rt5651 \
 SDP4430 \
 skylake-rt286 \
 TECLAST-X80Pro-Defaultstring-CherryTrailCR \
src/conf/ucm/bytcr-rt5651/HiFi.conf +3 -2
index 42fa2c9a..fd878f4a 100644
@@ -3,12 +3,13 @@
 SectionVerb {
 	EnableSequence [
 		cdev "hw:bytcrrt5651"
-		exec "echo HiFi enable sequence"
+		<bytcr/PlatformEnableSeq.conf>
+		<rt5651/EnableSeq.conf>
 	]
 
 	DisableSequence [
 		cdev "hw:bytcrrt5651"
-		exec "echo HiFi disable sequence"
+		<bytcr/PlatformDisableSeq.conf>
 	]
 
 	Value {
src/conf/ucm/bytcr-rt5651/bytcr-rt5651.conf +0 -136

140 lines not on this page · raw message

src/conf/ucm/rt5651/EnableSeq.conf new file +46 -0

46 lines not on this page · raw message

src/conf/ucm/rt5651/Makefile.am new file +4 -0
new file mode 100644
index 00000000..8a22159c
@@ -0,0 +1,4 @@
+alsaconfigdir = @ALSA_CONFIG_DIR@
+ucmdir = $(alsaconfigdir)/ucm/rt5651
+ucm_DATA = EnableSeq.conf
+EXTRA_DIST = $(ucm_DATA)
Signature · 1 line
2.18.0
#6 lore raw

PATCH v2 7/13 conf/ucm: bytcr-rt5651: Fix ADC and Mic capture volumes

In reply to Hans de Goede

Fix ADC and Mic capture volumes, so that the microphone inputs actually work.

---
 src/conf/ucm/rt5651/EnableSeq.conf | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)
src/conf/ucm/rt5651/EnableSeq.conf +11 -5
index 3ef9afc0..37bffecb 100644
@@ -7,8 +7,6 @@ cset "name='HPOVOL L Switch' on"
 cset "name='HPOVOL R Switch' on"
 cset "name='LOUT MIX DAC L1 Switch' on"
 cset "name='LOUT MIX DAC R1 Switch' on"
-cset "name='IN1 Boost' 1"
-cset "name='IN2 Boost' 1"
 cset "name='IF1 ASRC Switch' on"
 cset "name='LOUT L Playback Switch' off"
 cset "name='LOUT R Playback Switch' off"
@@ -23,12 +21,20 @@ cset "name='Stereo2 ADC MIXR ADC2 Switch' on"
 cset "name='Headphone Switch' off"
 cset "name='Speaker Switch' off"
 
-# volumes for 0dB
+# volumes
 cset "name='OUT Playback Volume' 31"
 cset "name='HP Playback Volume' 31"
-cset "name='IN Capture Volume' 23"
-cset "name='ADC Capture Volume' 47"
 cset "name='DAC1 Playback Volume' 175"
+cset "name='IN Capture Volume' 23"
+# 47=0dB, 0.375 dB/step, set it to 6 dB to help with soft mics
+cset "name='ADC Capture Volume' 63"
+cset "name='ADC Capture Switch' on"
+# Set ADC Boost Gain to 3dB higher vals result in too much noise
+cset "name='ADC Boost Gain' 1"
+# Set IN1, IN2 and IN3 internal mic boost to 1
+cset "name='IN1 Boost' 1"
+cset "name='IN2 Boost' 1"
+cset "name='IN3 Boost' 1"
 
 # input
 cset "name='Stereo1 ADC L1 Mux' ADC"
Signature · 1 line
2.18.0
#7 lore raw

PATCH v2 8/13 conf/ucm: bytcr-rt5651: Add support for mic input on various pins

In reply to Hans de Goede

Note this commit replaces the pre-existing "Handset Microphone" and "Main Microphone" options, these come from the first commit of the bytcr-rt5651 UCM profile and were based on wrong assumptions about the input mappings. None of the existing devices has the Hand/Headset mic on IN1 as these options assumed.

The rt5651 is used in various configurations with the Internal Mic(s) hooked up to IN1, IN2, or to IN1 and IN2 and the Headset Mic hooked up to IN3.

Add support for all these to the generic bytcr-rt5651 profile and name them accotding to their input + functions.

A follow up commit will add specialized longname configs which will only expose the inputs actually used on the board with that longname.

---
 src/conf/ucm/bytcr-rt5651/HiFi.conf | 93 +++++++++++++++++++++++++----
 1 file changed, 82 insertions(+), 11 deletions(-)
src/conf/ucm/bytcr-rt5651/HiFi.conf +82 -11
index fd878f4a..54c365d9 100644
@@ -85,51 +85,91 @@ SectionDevice."Speaker" {
 	}
 }
 
-SectionDevice."Handset" {
-	Comment "Handset Microphone"
+SectionDevice."InternalMic-IN1" {
+	Comment "Internal Microphone on IN1"
 
 	ConflictingDevice [
-		"Mainmic"
+		"InternalMic-IN2"
+		"InternalMic-IN12"
+		"HeadsetMic-IN3"
 	]
 
 	EnableSequence [
 		cdev "hw:bytcrrt5651"
-		exec "echo Handset Microphone enable sequence"
+		exec "echo Internal Mic IN1 Microphone enable sequence"
+		cset "name='Internal Mic Switch' on"
 		cset "name='RECMIXL BST1 Switch' on"
 		cset "name='RECMIXR BST1 Switch' on"
 	]
 
 	DisableSequence [
 		cdev "hw:bytcrrt5651"
-		exec "echo Handset Microphone disable sequence"
+		exec "echo Internal Mic IN1 Microphone disable sequence"
+		cset "name='Internal Mic Switch' off"
 		cset "name='RECMIXL BST1 Switch' off"
 		cset "name='RECMIXR BST1 Switch' off"
 	]
 
 	Value {
 		CaptureChannels "2"
-		JackControl "Headset Mic Jack"
 	}
 }
 
+SectionDevice."InternalMic-IN2" {
+	Comment "Internal Microphone on IN2"
+
+	ConflictingDevice [
+		"InternalMic-IN1"
+		"InternalMic-IN12"
+		"HeadsetMic-IN3"
+	]
+
+	EnableSequence [
+		cdev "hw:bytcrrt5651"
+		exec "echo Internal Mic IN2 Microphone enable sequence"
+		cset "name='Internal Mic Switch' on"
+		cset "name='RECMIXL BST2 Switch' on"
+		cset "name='RECMIXR BST2 Switch' on"
+	]
+
+	DisableSequence [
+		cdev "hw:bytcrrt5651"
+		exec "echo Internal Mic IN2 Microphone disable sequence"
+		cset "name='Internal Mic Switch' off"
+		cset "name='RECMIXL BST2 Switch' off"
+		cset "name='RECMIXR BST2 Switch' off"
+	]
 
-SectionDevice."Mainmic" {
-	Comment "Main Microphone"
+	Value {
+		CaptureChannels "2"
+	}
+}
+
+SectionDevice."InternalMic-IN12" {
+	Comment "Internal Microphones on IN1 and IN2"
 
 	ConflictingDevice [
-		"Handset"
+		"InternalMic-IN1"
+		"InternalMic-IN2"
+		"HeadsetMic-IN3"
 	]
 
 	EnableSequence [
 		cdev "hw:bytcrrt5651"
-		exec "echo Main Microphone enable sequence"
+		exec "echo Internal Mic IN12 Microphone enable sequence"
+		cset "name='Internal Mic Switch' on"
+		cset "name='RECMIXL BST1 Switch' on"
+		cset "name='RECMIXR BST1 Switch' on"
 		cset "name='RECMIXL BST2 Switch' on"
 		cset "name='RECMIXR BST2 Switch' on"
 	]
 
 	DisableSequence [
 		cdev "hw:bytcrrt5651"
-		exec "echo Main Microphone disable sequence"
+		exec "echo Internal Mic IN12 Microphone disable sequence"
+		cset "name='Internal Mic Switch' off"
+		cset "name='RECMIXL BST1 Switch' off"
+		cset "name='RECMIXR BST1 Switch' off"
 		cset "name='RECMIXL BST2 Switch' off"
 		cset "name='RECMIXR BST2 Switch' off"
 	]
@@ -138,3 +178,34 @@ SectionDevice."Mainmic" {
 		CaptureChannels "2"
 	}
 }
+
+SectionDevice."HeadsetMic-IN3" {
+	Comment "Headset Microphone"
+
+	ConflictingDevice [
+		"InternalMic-IN1"
+		"InternalMic-IN2"
+		"InternalMic-IN12"
+	]
+
+	EnableSequence [
+		cdev "hw:bytcrrt5651"
+		exec "echo HeadsetMic-IN3 Microphone enable sequence"
+		cset "name='Headset Mic Switch' on"
+		cset "name='RECMIXL BST3 Switch' on"
+		cset "name='RECMIXR BST3 Switch' on"
+	]
+
+	DisableSequence [
+		cdev "hw:bytcrrt5651"
+		exec "echo HeadsetMic-IN3 Microphone disable sequence"
+		cset "name='Headset Mic Switch' off"
+		cset "name='RECMIXL BST3 Switch' off"
+		cset "name='RECMIXR BST3 Switch' off"
+	]
+
+	Value {
+		CaptureChannels "2"
+		JackControl "Headset Mic Jack"
+	}
+}
Signature · 1 line
2.18.0
#8 lore raw

PATCH v2 9/13 conf/ucm: bytcr-rt5651: Split into 1 .conf file per input / output

In reply to Hans de Goede

Split the bytcr-rt5651 config into 1 .conf file per input / output as has already been done for the bytcr-rt5640 and the chtnau8824 profiles.

This allows easy creation of long-name profiles with the specific input / output combinations found on a board without needing to copy and paste things.

---
 src/conf/ucm/bytcr-rt5651/HiFi.conf       | 197 +---------------------
 src/conf/ucm/rt5651/HeadPhones.conf       |  31 ++++
 src/conf/ucm/rt5651/IN1-InternalMic.conf  |  27 +++
 src/conf/ucm/rt5651/IN12-InternalMic.conf |  31 ++++
 src/conf/ucm/rt5651/IN2-InternalMic.conf  |  27 +++
 src/conf/ucm/rt5651/IN3-HeadsetMic.conf   |  28 +++
 src/conf/ucm/rt5651/Makefile.am           |   4 +-
 src/conf/ucm/rt5651/Speaker.conf          |  30 ++++
 8 files changed, 185 insertions(+), 190 deletions(-)
 create mode 100644 src/conf/ucm/rt5651/HeadPhones.conf
 create mode 100644 src/conf/ucm/rt5651/IN1-InternalMic.conf
 create mode 100644 src/conf/ucm/rt5651/IN12-InternalMic.conf
 create mode 100644 src/conf/ucm/rt5651/IN2-InternalMic.conf
 create mode 100644 src/conf/ucm/rt5651/IN3-HeadsetMic.conf
 create mode 100644 src/conf/ucm/rt5651/Speaker.conf
src/conf/ucm/bytcr-rt5651/HiFi.conf +8 -189
index 54c365d9..961b2604 100644
@@ -1,5 +1,7 @@
 # Adapted from https://github.com/plbossart/UCM/tree/master/bytcr-rt5651
 
+<searchdir:ucm>
+
 SectionVerb {
 	EnableSequence [
 		cdev "hw:bytcrrt5651"
@@ -18,194 +20,11 @@ SectionVerb {
 	}
 }
 
-SectionDevice."Headphones" {
-	Comment "Headphones playback"
-
-	ConflictingDevice [
-		"Speaker"
-	]
-
-	EnableSequence [
-		cdev "hw:bytcrrt5651"
-		exec "echo Headphones playback enable sequence"
-		cset "name='Headphone Switch' on"
-		cset "name='HPO L Playback Switch' on"
-		cset "name='HPO R Playback Switch' on"
-		# Done after turning the HP on to keep the bias and clk on
-		cset "name='Speaker Switch' off"
-		cset "name='LOUT L Playback Switch' off"
-		cset "name='LOUT R Playback Switch' off"
-	]
-
-	DisableSequence [
-		cdev "hw:bytcrrt5651"
-		exec "echo Headphones playback disable sequence"
-		# This is done by the Speaker EnableSequence, so that the
-		# Platform Clock and BIAS do not temporarily get turned off
-		# as that breaks audio-streams which are playing when
-		# switching between Speaker/Headphone
-	]
-
-	Value {
-		PlaybackChannels "2"
-		JackControl "Headphone Jack"
-	}
-}
-
-SectionDevice."Speaker" {
-	Comment "Speaker playback"
-
-	ConflictingDevice [
-		"Headphones"
-	]
-
-	EnableSequence [
-		cdev "hw:bytcrrt5651"
-		exec "echo Speaker enable sequence"
-		cset "name='Speaker Switch' on"
-		cset "name='LOUT L Playback Switch' on"
-		cset "name='LOUT R Playback Switch' on"
-		# Done after turning the speaker on to keep the bias and clk on
-		cset "name='Headphone Switch' off"
-		cset "name='HPO L Playback Switch' off"
-		cset "name='HPO R Playback Switch' off"
-	]
-
-	DisableSequence [
-		cdev "hw:bytcrrt5651"
-		exec "echo Speaker disable sequence"
-		# This is done by the Headphones EnableSequence, so that the
-		# Platform Clock and BIAS do not temporarily get turned off
-		# as that breaks audio-streams which are playing when
-		# switching between Speaker/Headphone
-	]
-
-	Value {
-		PlaybackChannels "2"
-	}
-}
-
-SectionDevice."InternalMic-IN1" {
-	Comment "Internal Microphone on IN1"
-
-	ConflictingDevice [
-		"InternalMic-IN2"
-		"InternalMic-IN12"
-		"HeadsetMic-IN3"
-	]
-
-	EnableSequence [
-		cdev "hw:bytcrrt5651"
-		exec "echo Internal Mic IN1 Microphone enable sequence"
-		cset "name='Internal Mic Switch' on"
-		cset "name='RECMIXL BST1 Switch' on"
-		cset "name='RECMIXR BST1 Switch' on"
-	]
-
-	DisableSequence [
-		cdev "hw:bytcrrt5651"
-		exec "echo Internal Mic IN1 Microphone disable sequence"
-		cset "name='Internal Mic Switch' off"
-		cset "name='RECMIXL BST1 Switch' off"
-		cset "name='RECMIXR BST1 Switch' off"
-	]
-
-	Value {
-		CaptureChannels "2"
-	}
-}
-
-SectionDevice."InternalMic-IN2" {
-	Comment "Internal Microphone on IN2"
-
-	ConflictingDevice [
-		"InternalMic-IN1"
-		"InternalMic-IN12"
-		"HeadsetMic-IN3"
-	]
-
-	EnableSequence [
-		cdev "hw:bytcrrt5651"
-		exec "echo Internal Mic IN2 Microphone enable sequence"
-		cset "name='Internal Mic Switch' on"
-		cset "name='RECMIXL BST2 Switch' on"
-		cset "name='RECMIXR BST2 Switch' on"
-	]
-
-	DisableSequence [
-		cdev "hw:bytcrrt5651"
-		exec "echo Internal Mic IN2 Microphone disable sequence"
-		cset "name='Internal Mic Switch' off"
-		cset "name='RECMIXL BST2 Switch' off"
-		cset "name='RECMIXR BST2 Switch' off"
-	]
-
-	Value {
-		CaptureChannels "2"
-	}
-}
-
-SectionDevice."InternalMic-IN12" {
-	Comment "Internal Microphones on IN1 and IN2"
-
-	ConflictingDevice [
-		"InternalMic-IN1"
-		"InternalMic-IN2"
-		"HeadsetMic-IN3"
-	]
-
-	EnableSequence [
-		cdev "hw:bytcrrt5651"
-		exec "echo Internal Mic IN12 Microphone enable sequence"
-		cset "name='Internal Mic Switch' on"
-		cset "name='RECMIXL BST1 Switch' on"
-		cset "name='RECMIXR BST1 Switch' on"
-		cset "name='RECMIXL BST2 Switch' on"
-		cset "name='RECMIXR BST2 Switch' on"
-	]
-
-	DisableSequence [
-		cdev "hw:bytcrrt5651"
-		exec "echo Internal Mic IN12 Microphone disable sequence"
-		cset "name='Internal Mic Switch' off"
-		cset "name='RECMIXL BST1 Switch' off"
-		cset "name='RECMIXR BST1 Switch' off"
-		cset "name='RECMIXL BST2 Switch' off"
-		cset "name='RECMIXR BST2 Switch' off"
-	]
-
-	Value {
-		CaptureChannels "2"
-	}
-}
-
-SectionDevice."HeadsetMic-IN3" {
-	Comment "Headset Microphone"
-
-	ConflictingDevice [
-		"InternalMic-IN1"
-		"InternalMic-IN2"
-		"InternalMic-IN12"
-	]
+<rt5651/Speaker.conf>
+<rt5651/HeadPhones.conf>
 
-	EnableSequence [
-		cdev "hw:bytcrrt5651"
-		exec "echo HeadsetMic-IN3 Microphone enable sequence"
-		cset "name='Headset Mic Switch' on"
-		cset "name='RECMIXL BST3 Switch' on"
-		cset "name='RECMIXR BST3 Switch' on"
-	]
 
-	DisableSequence [
-		cdev "hw:bytcrrt5651"
-		exec "echo HeadsetMic-IN3 Microphone disable sequence"
-		cset "name='Headset Mic Switch' off"
-		cset "name='RECMIXL BST3 Switch' off"
-		cset "name='RECMIXR BST3 Switch' off"
-	]
-
-	Value {
-		CaptureChannels "2"
-		JackControl "Headset Mic Jack"
-	}
-}
+<rt5651/IN1-InternalMic.conf>
+<rt5651/IN2-InternalMic.conf>
+<rt5651/IN12-InternalMic.conf>
+<rt5651/IN3-HeadsetMic.conf>
src/conf/ucm/rt5651/HeadPhones.conf new file +31 -0
new file mode 100644
index 00000000..b9323a36
@@ -0,0 +1,31 @@
+SectionDevice."Headphones" {
+	Comment "Headphones"
+
+	ConflictingDevice [
+		"Speaker"
+	]
+
+	EnableSequence [
+		cdev "hw:bytcrrt5651"
+		cset "name='Headphone Switch' on"
+		cset "name='HPO L Playback Switch' on"
+		cset "name='HPO R Playback Switch' on"
+		# Done after turning the HP on to keep the bias and clk on
+		cset "name='Speaker Switch' off"
+		cset "name='LOUT L Playback Switch' off"
+		cset "name='LOUT R Playback Switch' off"
+	]
+
+	DisableSequence [
+		cdev "hw:bytcrrt5651"
+		# This is done by the Speaker EnableSequence, so that the
+		# Platform Clock and BIAS do not temporarily get turned off
+		# as that breaks audio-streams which are playing when
+		# switching between Speaker/Headphone
+	]
+
+	Value {
+		PlaybackChannels "2"
+		JackControl "Headphone Jack"
+	}
+}
src/conf/ucm/rt5651/IN1-InternalMic.conf new file +27 -0
new file mode 100644
index 00000000..85e25a5c
@@ -0,0 +1,27 @@
+SectionDevice."InternalMic-IN1" {
+	Comment "Internal Microphone on IN1"
+
+	ConflictingDevice [
+		"InternalMic-IN2"
+		"InternalMic-IN12"
+		"HeadsetMic-IN3"
+	]
+
+	EnableSequence [
+		cdev "hw:bytcrrt5651"
+		cset "name='Internal Mic Switch' on"
+		cset "name='RECMIXL BST1 Switch' on"
+		cset "name='RECMIXR BST1 Switch' on"
+	]
+
+	DisableSequence [
+		cdev "hw:bytcrrt5651"
+		cset "name='Internal Mic Switch' off"
+		cset "name='RECMIXL BST1 Switch' off"
+		cset "name='RECMIXR BST1 Switch' off"
+	]
+
+	Value {
+		CaptureChannels "2"
+	}
+}
src/conf/ucm/rt5651/IN12-InternalMic.conf new file +31 -0
new file mode 100644
index 00000000..f1cc17fe
@@ -0,0 +1,31 @@
+SectionDevice."InternalMic-IN12" {
+	Comment "Internal Microphones on IN1 and IN2"
+
+	ConflictingDevice [
+		"InternalMic-IN1"
+		"InternalMic-IN2"
+		"HeadsetMic-IN3"
+	]
+
+	EnableSequence [
+		cdev "hw:bytcrrt5651"
+		cset "name='Internal Mic Switch' on"
+		cset "name='RECMIXL BST1 Switch' on"
+		cset "name='RECMIXR BST1 Switch' on"
+		cset "name='RECMIXL BST2 Switch' on"
+		cset "name='RECMIXR BST2 Switch' on"
+	]
+
+	DisableSequence [
+		cdev "hw:bytcrrt5651"
+		cset "name='Internal Mic Switch' off"
+		cset "name='RECMIXL BST1 Switch' off"
+		cset "name='RECMIXR BST1 Switch' off"
+		cset "name='RECMIXL BST2 Switch' off"
+		cset "name='RECMIXR BST2 Switch' off"
+	]
+
+	Value {
+		CaptureChannels "2"
+	}
+}
src/conf/ucm/rt5651/IN2-InternalMic.conf new file +27 -0
new file mode 100644
index 00000000..18f74e1a
@@ -0,0 +1,27 @@
+SectionDevice."InternalMic-IN2" {
+	Comment "Internal Microphone on IN2"
+
+	ConflictingDevice [
+		"InternalMic-IN1"
+		"InternalMic-IN12"
+		"HeadsetMic-IN3"
+	]
+
+	EnableSequence [
+		cdev "hw:bytcrrt5651"
+		cset "name='Internal Mic Switch' on"
+		cset "name='RECMIXL BST2 Switch' on"
+		cset "name='RECMIXR BST2 Switch' on"
+	]
+
+	DisableSequence [
+		cdev "hw:bytcrrt5651"
+		cset "name='Internal Mic Switch' off"
+		cset "name='RECMIXL BST2 Switch' off"
+		cset "name='RECMIXR BST2 Switch' off"
+	]
+
+	Value {
+		CaptureChannels "2"
+	}
+}
src/conf/ucm/rt5651/IN3-HeadsetMic.conf new file +28 -0
new file mode 100644
index 00000000..bfd0b009
@@ -0,0 +1,28 @@
+SectionDevice."HeadsetMic-IN3" {
+	Comment "Headset Microphone"
+
+	ConflictingDevice [
+		"InternalMic-IN1"
+		"InternalMic-IN2"
+		"InternalMic-IN12"
+	]
+
+	EnableSequence [
+		cdev "hw:bytcrrt5651"
+		cset "name='Headset Mic Switch' on"
+		cset "name='RECMIXL BST3 Switch' on"
+		cset "name='RECMIXR BST3 Switch' on"
+	]
+
+	DisableSequence [
+		cdev "hw:bytcrrt5651"
+		cset "name='Headset Mic Switch' off"
+		cset "name='RECMIXL BST3 Switch' off"
+		cset "name='RECMIXR BST3 Switch' off"
+	]
+
+	Value {
+		CaptureChannels "2"
+		JackControl "Headset Mic Jack"
+	}
+}
src/conf/ucm/rt5651/Makefile.am +3 -1
index 8a22159c..abd45ad7 100644
@@ -1,4 +1,6 @@
 alsaconfigdir = @ALSA_CONFIG_DIR@
 ucmdir = $(alsaconfigdir)/ucm/rt5651
-ucm_DATA = EnableSeq.conf
+ucm_DATA = EnableSeq.conf HeadPhones.conf IN1-InternalMic.conf \
+	   IN2-InternalMic.conf IN12-InternalMic.conf IN3-HeadsetMic.conf \
+	   Speaker.conf
 EXTRA_DIST = $(ucm_DATA)
src/conf/ucm/rt5651/Speaker.conf new file +30 -0
new file mode 100644
index 00000000..44168cc5
@@ -0,0 +1,30 @@
+SectionDevice."Speaker" {
+	Comment "Speakers"
+
+	ConflictingDevice [
+		"Headphones"
+	]
+
+	EnableSequence [
+		cdev "hw:bytcrrt5651"
+		cset "name='Speaker Switch' on"
+		cset "name='LOUT L Playback Switch' on"
+		cset "name='LOUT R Playback Switch' on"
+		# Done after turning the speaker on to keep the bias and clk on
+		cset "name='Headphone Switch' off"
+		cset "name='HPO L Playback Switch' off"
+		cset "name='HPO R Playback Switch' off"
+	]
+
+	DisableSequence [
+		cdev "hw:bytcrrt5651"
+		# This is done by the Headphones EnableSequence, so that the
+		# Platform Clock and BIAS do not temporarily get turned off
+		# as that breaks audio-streams which are playing when
+		# switching between Speaker/Headphone
+	]
+
+	Value {
+		PlaybackChannels "2"
+	}
+}
Signature · 1 line
2.18.0
#9 lore raw

PATCH v2 10/13 conf/ucm: bytcr-rt5651: Add mono speaker output profile

In reply to Hans de Goede

Many rt5651 devices only have a single speaker and even though there is some external mixing done on the PCB, the quality of that mixing is quite poor and various sounds come out garbled when relying on the on PCB mixing.

Using the codecs builtin mixer to mix left + right to the left output works much better. This commits adds a new MonoSpeaker.conf output profile which allows this.

---
 src/conf/ucm/bytcr-rt5651/HiFi.conf           |  2 +-
 src/conf/ucm/rt5651/EnableSeq.conf            |  2 ++
 src/conf/ucm/rt5651/HeadPhones.conf           |  1 +
 src/conf/ucm/rt5651/Makefile.am               |  2 +-
 .../rt5651/{Speaker.conf => MonoSpeaker.conf} | 20 ++++++++++++-------
 src/conf/ucm/rt5651/Speaker.conf              |  1 +
 6 files changed, 19 insertions(+), 9 deletions(-)
 copy src/conf/ucm/rt5651/{Speaker.conf => MonoSpeaker.conf} (52%)
src/conf/ucm/bytcr-rt5651/HiFi.conf +1 -1
index 961b2604..8733403c 100644
@@ -21,9 +21,9 @@ SectionVerb {
 }
 
 <rt5651/Speaker.conf>
+<rt5651/MonoSpeaker.conf>
 <rt5651/HeadPhones.conf>
 
-
 <rt5651/IN1-InternalMic.conf>
 <rt5651/IN2-InternalMic.conf>
 <rt5651/IN12-InternalMic.conf>
src/conf/ucm/rt5651/EnableSeq.conf +2 -0
index 37bffecb..6fb3c1f2 100644
@@ -11,6 +11,8 @@ cset "name='IF1 ASRC Switch' on"
 cset "name='LOUT L Playback Switch' off"
 cset "name='LOUT R Playback Switch' off"
 cset "name='Stereo DAC MIXL DAC L1 Switch' on"
+cset "name='Stereo DAC MIXL DAC R1 Switch' off"
+cset "name='Stereo DAC MIXR DAC L1 Switch' off"
 cset "name='Stereo DAC MIXR DAC R1 Switch' on"
 cset "name='Stereo1 ADC MIXR ADC1 Switch' on"
 cset "name='Stereo1 ADC MIXR ADC2 Switch' on"
src/conf/ucm/rt5651/HeadPhones.conf +1 -0
index b9323a36..eaf5fdfc 100644
@@ -3,6 +3,7 @@ SectionDevice."Headphones" {
 
 	ConflictingDevice [
 		"Speaker"
+		"MonoSpeaker"
 	]
 
 	EnableSequence [
src/conf/ucm/rt5651/Makefile.am +1 -1
index abd45ad7..a9600ed6 100644
@@ -2,5 +2,5 @@ alsaconfigdir = @ALSA_CONFIG_DIR@
 ucmdir = $(alsaconfigdir)/ucm/rt5651
 ucm_DATA = EnableSeq.conf HeadPhones.conf IN1-InternalMic.conf \
 	   IN2-InternalMic.conf IN12-InternalMic.conf IN3-HeadsetMic.conf \
-	   Speaker.conf
+	   Speaker.conf MonoSpeaker.conf
 EXTRA_DIST = $(ucm_DATA)
src/conf/ucm/rt5651/MonoSpeaker.conf renamed from src/conf/ucm/rt5651/Speaker.conf +13 -7
similarity index 52%
copy from src/conf/ucm/rt5651/Speaker.conf
copy to src/conf/ucm/rt5651/MonoSpeaker.conf
index 44168cc5..0c3492fb 100644
@@ -1,15 +1,20 @@
-SectionDevice."Speaker" {
-	Comment "Speakers"
+SectionDevice."MonoSpeaker" {
+	Comment "Mono Speaker"
 
 	ConflictingDevice [
+		"Speaker"
 		"Headphones"
 	]
 
 	EnableSequence [
 		cdev "hw:bytcrrt5651"
+
+		# Map left and right input on left
+		cset "name='Stereo DAC MIXR DAC R1 Switch' off"
+		cset "name='Stereo DAC MIXL DAC R1 Switch' on"
+
 		cset "name='Speaker Switch' on"
 		cset "name='LOUT L Playback Switch' on"
-		cset "name='LOUT R Playback Switch' on"
 		# Done after turning the speaker on to keep the bias and clk on
 		cset "name='Headphone Switch' off"
 		cset "name='HPO L Playback Switch' off"
@@ -18,10 +23,11 @@ SectionDevice."Speaker" {
 
 	DisableSequence [
 		cdev "hw:bytcrrt5651"
-		# This is done by the Headphones EnableSequence, so that the
-		# Platform Clock and BIAS do not temporarily get turned off
-		# as that breaks audio-streams which are playing when
-		# switching between Speaker/Headphone
+		# Disabling the  switches is done by the Speaker EnableSeq
+
+		# Undo mono mapping
+		cset "name='Stereo DAC MIXL DAC R1 Switch' off"
+		cset "name='Stereo DAC MIXR DAC R1 Switch' on"
 	]
 
 	Value {
src/conf/ucm/rt5651/Speaker.conf +1 -0
index 44168cc5..c1091523 100644
@@ -2,6 +2,7 @@ SectionDevice."Speaker" {
 	Comment "Speakers"
 
 	ConflictingDevice [
+		"MonoSpeaker"
 		"Headphones"
 	]
 
Signature · 1 line
2.18.0
#10 lore raw

PATCH v2 11/13 conf/ucm: bytcr-rt5651: Add long-name UCM profiles

In reply to Hans de Goede

After recent kernel work, the kernel now sets a long-name for bytcr-rt5651 boards which indicates if a single (mono) speaker or stereo speakers are used and if in1, in2, or in1 and 2 are used for the internal mic(s) (the headset mic sofar is always on in3).

This commit adds UCM profiles for bytcr-rt5651 boards using these new long-names, based on the generic bytcr-rt5651 profile.

---
 configure.ac                                  |  5 ++++
 src/conf/ucm/Makefile.am                      |  5 ++++
 .../bytcr-rt5651-mono-spk-in1-mic/HiFi.conf   | 27 +++++++++++++++++++
 .../bytcr-rt5651-mono-spk-in1-mic/Makefile.am |  4 +++
 .../bytcr-rt5651-mono-spk-in1-mic.conf        | 10 +++++++
 .../bytcr-rt5651-mono-spk-in2-mic/HiFi.conf   | 27 +++++++++++++++++++
 .../bytcr-rt5651-mono-spk-in2-mic/Makefile.am |  4 +++
 .../bytcr-rt5651-mono-spk-in2-mic.conf        | 10 +++++++
 .../bytcr-rt5651-stereo-spk-in1-mic/HiFi.conf | 27 +++++++++++++++++++
 .../Makefile.am                               |  4 +++
 .../bytcr-rt5651-stereo-spk-in1-mic.conf      | 10 +++++++
 .../HiFi.conf                                 | 27 +++++++++++++++++++
 .../Makefile.am                               |  4 +++
 .../bytcr-rt5651-stereo-spk-in12-mic.conf     | 10 +++++++
 .../bytcr-rt5651-stereo-spk-in2-mic/HiFi.conf | 27 +++++++++++++++++++
 .../Makefile.am                               |  4 +++
 .../bytcr-rt5651-stereo-spk-in2-mic.conf      | 10 +++++++
 17 files changed, 215 insertions(+)
 create mode 100644 src/conf/ucm/bytcr-rt5651-mono-spk-in1-mic/HiFi.conf
 create mode 100644 src/conf/ucm/bytcr-rt5651-mono-spk-in1-mic/Makefile.am
 create mode 100644 src/conf/ucm/bytcr-rt5651-mono-spk-in1-mic/bytcr-rt5651-mono-spk-in1-mic.conf
 create mode 100644 src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic/HiFi.conf
 create mode 100644 src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic/Makefile.am
 create mode 100644 src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic/bytcr-rt5651-mono-spk-in2-mic.conf
 create mode 100644 src/conf/ucm/bytcr-rt5651-stereo-spk-in1-mic/HiFi.conf
 create mode 100644 src/conf/ucm/bytcr-rt5651-stereo-spk-in1-mic/Makefile.am
 create mode 100644 src/conf/ucm/bytcr-rt5651-stereo-spk-in1-mic/bytcr-rt5651-stereo-spk-in1-mic.conf
 create mode 100644 src/conf/ucm/bytcr-rt5651-stereo-spk-in12-mic/HiFi.conf
 create mode 100644 src/conf/ucm/bytcr-rt5651-stereo-spk-in12-mic/Makefile.am
 create mode 100644 src/conf/ucm/bytcr-rt5651-stereo-spk-in12-mic/bytcr-rt5651-stereo-spk-in12-mic.conf
 create mode 100644 src/conf/ucm/bytcr-rt5651-stereo-spk-in2-mic/HiFi.conf
 create mode 100644 src/conf/ucm/bytcr-rt5651-stereo-spk-in2-mic/Makefile.am
 create mode 100644 src/conf/ucm/bytcr-rt5651-stereo-spk-in2-mic/bytcr-rt5651-stereo-spk-in2-mic.conf
configure.ac +5 -0
index 85a6be80..9fb7218c 100644
@@ -729,6 +729,11 @@ AC_OUTPUT(Makefile doc/Makefile doc/pictures/Makefile doc/doxygen.cfg \
 	  src/conf/ucm/bytcr-rt5640-stereo-spk-in1-mic/Makefile \
 	  src/conf/ucm/bytcr-rt5640-stereo-spk-in3-mic/Makefile \
 	  src/conf/ucm/bytcr-rt5651/Makefile \
+	  src/conf/ucm/bytcr-rt5651-mono-spk-in1-mic/Makefile \
+	  src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic/Makefile \
+	  src/conf/ucm/bytcr-rt5651-stereo-spk-in1-mic/Makefile \
+	  src/conf/ucm/bytcr-rt5651-stereo-spk-in2-mic/Makefile \
+	  src/conf/ucm/bytcr-rt5651-stereo-spk-in12-mic/Makefile \
 	  src/conf/ucm/chtnau8824/Makefile \
 	  src/conf/ucm/chtrt5645/Makefile \
 	  src/conf/ucm/chtrt5645-mono-speaker-analog-mic/Makefile \
src/conf/ucm/Makefile.am +5 -0
index 669e98d5..1246e7ae 100644
@@ -11,6 +11,11 @@ bytcr-rt5640-stereo-spk-dmic1-mic \
 bytcr-rt5640-stereo-spk-in1-mic \
 bytcr-rt5640-stereo-spk-in3-mic \
 bytcr-rt5651 \
+bytcr-rt5651-mono-spk-in1-mic \
+bytcr-rt5651-mono-spk-in2-mic \
+bytcr-rt5651-stereo-spk-in1-mic \
+bytcr-rt5651-stereo-spk-in2-mic \
+bytcr-rt5651-stereo-spk-in12-mic \
 chtnau8824 \
 chtrt5645 \
 chtrt5645-mono-speaker-analog-mic \
src/conf/ucm/bytcr-rt5651-mono-spk-in1-mic/HiFi.conf new file +27 -0
new file mode 100644
index 00000000..dd5b35fc
@@ -0,0 +1,27 @@
+# Adapted from https://github.com/plbossart/UCM/tree/master/bytcr-rt5651
+
+<searchdir:ucm>
+
+SectionVerb {
+	EnableSequence [
+		cdev "hw:bytcrrt5651"
+		<bytcr/PlatformEnableSeq.conf>
+		<rt5651/EnableSeq.conf>
+	]
+
+	DisableSequence [
+		cdev "hw:bytcrrt5651"
+		<bytcr/PlatformDisableSeq.conf>
+	]
+
+	Value {
+		PlaybackPCM "hw:bytcrrt5651"
+		CapturePCM "hw:bytcrrt5651"
+	}
+}
+
+<rt5651/MonoSpeaker.conf>
+<rt5651/HeadPhones.conf>
+
+<rt5651/IN1-InternalMic.conf>
+<rt5651/IN3-HeadsetMic.conf>
src/conf/ucm/bytcr-rt5651-mono-spk-in1-mic/Makefile.am new file +4 -0
new file mode 100644
index 00000000..3c5ad289
@@ -0,0 +1,4 @@
+alsaconfigdir = @ALSA_CONFIG_DIR@
+ucmdir = $(alsaconfigdir)/ucm/bytcr-rt5651-mono-spk-in1-mic
+ucm_DATA = bytcr-rt5651-mono-spk-in1-mic.conf HiFi.conf
+EXTRA_DIST = $(ucm_DATA)
src/conf/ucm/bytcr-rt5651-mono-spk-in1-mic/bytcr-rt5651-mono-spk-in1-mic.conf new file +10 -0
new file mode 100644
index 00000000..a2f584e8
@@ -0,0 +1,10 @@
+# Adapted from https://github.com/plbossart/UCM/tree/master/bytcr-rt5651
+
+SectionUseCase."HiFi" {
+	File "../bytcr-rt5651-mono-spk-in1-mic/HiFi.conf"
+	Comment "Play HiFi quality Music"
+}
+
+SectionDefaults [
+	cdev "hw:bytcrrt5651"
+]
src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic/HiFi.conf new file +27 -0
new file mode 100644
index 00000000..9f56c077
@@ -0,0 +1,27 @@
+# Adapted from https://github.com/plbossart/UCM/tree/master/bytcr-rt5651
+
+<searchdir:ucm>
+
+SectionVerb {
+	EnableSequence [
+		cdev "hw:bytcrrt5651"
+		<bytcr/PlatformEnableSeq.conf>
+		<rt5651/EnableSeq.conf>
+	]
+
+	DisableSequence [
+		cdev "hw:bytcrrt5651"
+		<bytcr/PlatformDisableSeq.conf>
+	]
+
+	Value {
+		PlaybackPCM "hw:bytcrrt5651"
+		CapturePCM "hw:bytcrrt5651"
+	}
+}
+
+<rt5651/MonoSpeaker.conf>
+<rt5651/HeadPhones.conf>
+
+<rt5651/IN2-InternalMic.conf>
+<rt5651/IN3-HeadsetMic.conf>
src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic/Makefile.am new file +4 -0
new file mode 100644
index 00000000..38ee13b9
@@ -0,0 +1,4 @@
+alsaconfigdir = @ALSA_CONFIG_DIR@
+ucmdir = $(alsaconfigdir)/ucm/bytcr-rt5651-mono-spk-in2-mic
+ucm_DATA = bytcr-rt5651-mono-spk-in2-mic.conf HiFi.conf
+EXTRA_DIST = $(ucm_DATA)
src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic/bytcr-rt5651-mono-spk-in2-mic.conf new file +10 -0
new file mode 100644
index 00000000..4ad36ec3
@@ -0,0 +1,10 @@
+# Adapted from https://github.com/plbossart/UCM/tree/master/bytcr-rt5651
+
+SectionUseCase."HiFi" {
+	File "../bytcr-rt5651-mono-spk-in2-mic/HiFi.conf"
+	Comment "Play HiFi quality Music"
+}
+
+SectionDefaults [
+	cdev "hw:bytcrrt5651"
+]
src/conf/ucm/bytcr-rt5651-stereo-spk-in1-mic/HiFi.conf new file +27 -0
new file mode 100644
index 00000000..e2a579ab
@@ -0,0 +1,27 @@
+# Adapted from https://github.com/plbossart/UCM/tree/master/bytcr-rt5651
+
+<searchdir:ucm>
+
+SectionVerb {
+	EnableSequence [
+		cdev "hw:bytcrrt5651"
+		<bytcr/PlatformEnableSeq.conf>
+		<rt5651/EnableSeq.conf>
+	]
+
+	DisableSequence [
+		cdev "hw:bytcrrt5651"
+		<bytcr/PlatformDisableSeq.conf>
+	]
+
+	Value {
+		PlaybackPCM "hw:bytcrrt5651"
+		CapturePCM "hw:bytcrrt5651"
+	}
+}
+
+<rt5651/Speaker.conf>
+<rt5651/HeadPhones.conf>
+
+<rt5651/IN1-InternalMic.conf>
+<rt5651/IN3-HeadsetMic.conf>
src/conf/ucm/bytcr-rt5651-stereo-spk-in1-mic/Makefile.am new file +4 -0
new file mode 100644
index 00000000..40691994
@@ -0,0 +1,4 @@
+alsaconfigdir = @ALSA_CONFIG_DIR@
+ucmdir = $(alsaconfigdir)/ucm/bytcr-rt5651-stereo-spk-in1-mic
+ucm_DATA = bytcr-rt5651-stereo-spk-in1-mic.conf HiFi.conf
+EXTRA_DIST = $(ucm_DATA)
src/conf/ucm/bytcr-rt5651-stereo-spk-in1-mic/bytcr-rt5651-stereo-spk-in1-mic.conf new file +10 -0
new file mode 100644
index 00000000..40d871be
@@ -0,0 +1,10 @@
+# Adapted from https://github.com/plbossart/UCM/tree/master/bytcr-rt5651
+
+SectionUseCase."HiFi" {
+	File "../bytcr-rt5651-stereo-spk-in1-mic/HiFi.conf"
+	Comment "Play HiFi quality Music"
+}
+
+SectionDefaults [
+	cdev "hw:bytcrrt5651"
+]
src/conf/ucm/bytcr-rt5651-stereo-spk-in12-mic/HiFi.conf new file +27 -0
new file mode 100644
index 00000000..ae52e719
@@ -0,0 +1,27 @@
+# Adapted from https://github.com/plbossart/UCM/tree/master/bytcr-rt5651
+
+<searchdir:ucm>
+
+SectionVerb {
+	EnableSequence [
+		cdev "hw:bytcrrt5651"
+		<bytcr/PlatformEnableSeq.conf>
+		<rt5651/EnableSeq.conf>
+	]
+
+	DisableSequence [
+		cdev "hw:bytcrrt5651"
+		<bytcr/PlatformDisableSeq.conf>
+	]
+
+	Value {
+		PlaybackPCM "hw:bytcrrt5651"
+		CapturePCM "hw:bytcrrt5651"
+	}
+}
+
+<rt5651/Speaker.conf>
+<rt5651/HeadPhones.conf>
+
+<rt5651/IN12-InternalMic.conf>
+<rt5651/IN3-HeadsetMic.conf>
src/conf/ucm/bytcr-rt5651-stereo-spk-in12-mic/Makefile.am new file +4 -0
new file mode 100644
index 00000000..12514945
@@ -0,0 +1,4 @@
+alsaconfigdir = @ALSA_CONFIG_DIR@
+ucmdir = $(alsaconfigdir)/ucm/bytcr-rt5651-stereo-spk-in12-mic
+ucm_DATA = bytcr-rt5651-stereo-spk-in12-mic.conf HiFi.conf
+EXTRA_DIST = $(ucm_DATA)
src/conf/ucm/bytcr-rt5651-stereo-spk-in12-mic/bytcr-rt5651-stereo-spk-in12-mic.conf new file +10 -0
new file mode 100644
index 00000000..56bf3f07
@@ -0,0 +1,10 @@
+# Adapted from https://github.com/plbossart/UCM/tree/master/bytcr-rt5651
+
+SectionUseCase."HiFi" {
+	File "../bytcr-rt5651-stereo-spk-in12-mic/HiFi.conf"
+	Comment "Play HiFi quality Music"
+}
+
+SectionDefaults [
+	cdev "hw:bytcrrt5651"
+]
src/conf/ucm/bytcr-rt5651-stereo-spk-in2-mic/HiFi.conf new file +27 -0
new file mode 100644
index 00000000..a73ff5f8
@@ -0,0 +1,27 @@
+# Adapted from https://github.com/plbossart/UCM/tree/master/bytcr-rt5651
+
+<searchdir:ucm>
+
+SectionVerb {
+	EnableSequence [
+		cdev "hw:bytcrrt5651"
+		<bytcr/PlatformEnableSeq.conf>
+		<rt5651/EnableSeq.conf>
+	]
+
+	DisableSequence [
+		cdev "hw:bytcrrt5651"
+		<bytcr/PlatformDisableSeq.conf>
+	]
+
+	Value {
+		PlaybackPCM "hw:bytcrrt5651"
+		CapturePCM "hw:bytcrrt5651"
+	}
+}
+
+<rt5651/Speaker.conf>
+<rt5651/HeadPhones.conf>
+
+<rt5651/IN2-InternalMic.conf>
+<rt5651/IN3-HeadsetMic.conf>
src/conf/ucm/bytcr-rt5651-stereo-spk-in2-mic/Makefile.am new file +4 -0
new file mode 100644
index 00000000..9b06afd1
@@ -0,0 +1,4 @@
+alsaconfigdir = @ALSA_CONFIG_DIR@
+ucmdir = $(alsaconfigdir)/ucm/bytcr-rt5651-stereo-spk-in2-mic
+ucm_DATA = bytcr-rt5651-stereo-spk-in2-mic.conf HiFi.conf
+EXTRA_DIST = $(ucm_DATA)
src/conf/ucm/bytcr-rt5651-stereo-spk-in2-mic/bytcr-rt5651-stereo-spk-in2-mic.conf new file +10 -0
new file mode 100644
index 00000000..84e86e42
@@ -0,0 +1,10 @@
+# Adapted from https://github.com/plbossart/UCM/tree/master/bytcr-rt5651
+
+SectionUseCase."HiFi" {
+	File "../bytcr-rt5651-stereo-spk-in2-mic/HiFi.conf"
+	Comment "Play HiFi quality Music"
+}
+
+SectionDefaults [
+	cdev "hw:bytcrrt5651"
+]
Signature · 1 line
2.18.0
#11 lore raw

PATCH v2 12/13 conf/ucm: bytcr-rt5651: Add bytcr-rt5651-mono-spk-in2-mic-hp-swapped config

In reply to Hans de Goede

Add a longname profile for devices with a mono speaker, the Internal Mic hooked up to IN2 and the left and right channels of their headphones output swapped.

---
 configure.ac                                  |  1 +
 src/conf/ucm/Makefile.am                      |  1 +
 .../HiFi.conf                                 | 27 ++++++++++++
 .../Makefile.am                               |  4 ++
 ...cr-rt5651-mono-spk-in2-mic-hp-swapped.conf | 10 +++++
 src/conf/ucm/rt5651/HeadPhones-swapped.conf   | 42 +++++++++++++++++++
 src/conf/ucm/rt5651/Makefile.am               |  6 +--
 7 files changed, 88 insertions(+), 3 deletions(-)
 create mode 100644 src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic-hp-swapped/HiFi.conf
 create mode 100644 src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic-hp-swapped/Makefile.am
 create mode 100644 src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic-hp-swapped/bytcr-rt5651-mono-spk-in2-mic-hp-swapped.conf
 create mode 100644 src/conf/ucm/rt5651/HeadPhones-swapped.conf
configure.ac +1 -0
index 9fb7218c..97d61abd 100644
@@ -731,6 +731,7 @@ AC_OUTPUT(Makefile doc/Makefile doc/pictures/Makefile doc/doxygen.cfg \
 	  src/conf/ucm/bytcr-rt5651/Makefile \
 	  src/conf/ucm/bytcr-rt5651-mono-spk-in1-mic/Makefile \
 	  src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic/Makefile \
+	  src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic-hp-swapped/Makefile \
 	  src/conf/ucm/bytcr-rt5651-stereo-spk-in1-mic/Makefile \
 	  src/conf/ucm/bytcr-rt5651-stereo-spk-in2-mic/Makefile \
 	  src/conf/ucm/bytcr-rt5651-stereo-spk-in12-mic/Makefile \
src/conf/ucm/Makefile.am +1 -0
index 1246e7ae..7cdc6176 100644
@@ -13,6 +13,7 @@ bytcr-rt5640-stereo-spk-in3-mic \
 bytcr-rt5651 \
 bytcr-rt5651-mono-spk-in1-mic \
 bytcr-rt5651-mono-spk-in2-mic \
+bytcr-rt5651-mono-spk-in2-mic-hp-swapped \
 bytcr-rt5651-stereo-spk-in1-mic \
 bytcr-rt5651-stereo-spk-in2-mic \
 bytcr-rt5651-stereo-spk-in12-mic \
src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic-hp-swapped/HiFi.conf new file +27 -0
new file mode 100644
index 00000000..777ed783
@@ -0,0 +1,27 @@
+# Adapted from https://github.com/plbossart/UCM/tree/master/bytcr-rt5651
+
+<searchdir:ucm>
+
+SectionVerb {
+	EnableSequence [
+		cdev "hw:bytcrrt5651"
+		<bytcr/PlatformEnableSeq.conf>
+		<rt5651/EnableSeq.conf>
+	]
+
+	DisableSequence [
+		cdev "hw:bytcrrt5651"
+		<bytcr/PlatformDisableSeq.conf>
+	]
+
+	Value {
+		PlaybackPCM "hw:bytcrrt5651"
+		CapturePCM "hw:bytcrrt5651"
+	}
+}
+
+<rt5651/MonoSpeaker.conf>
+<rt5651/HeadPhones-swapped.conf>
+
+<rt5651/IN2-InternalMic.conf>
+<rt5651/IN3-HeadsetMic.conf>
src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic-hp-swapped/Makefile.am new file +4 -0
new file mode 100644
index 00000000..862d38b9
@@ -0,0 +1,4 @@
+alsaconfigdir = @ALSA_CONFIG_DIR@
+ucmdir = $(alsaconfigdir)/ucm/bytcr-rt5651-mono-spk-in2-mic-hp-swapped
+ucm_DATA = bytcr-rt5651-mono-spk-in2-mic-hp-swapped.conf HiFi.conf
+EXTRA_DIST = $(ucm_DATA)
src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic-hp-swapped/bytcr-rt5651-mono-spk-in2-mic-hp-swapped.conf new file +10 -0
new file mode 100644
index 00000000..916fbc19
@@ -0,0 +1,10 @@
+# Adapted from https://github.com/plbossart/UCM/tree/master/bytcr-rt5651
+
+SectionUseCase."HiFi" {
+	File "../bytcr-rt5651-mono-spk-in2-mic-hp-swapped/HiFi.conf"
+	Comment "Play HiFi quality Music"
+}
+
+SectionDefaults [
+	cdev "hw:bytcrrt5651"
+]
src/conf/ucm/rt5651/HeadPhones-swapped.conf new file +42 -0

42 lines not on this page · raw message

src/conf/ucm/rt5651/Makefile.am +3 -3
index a9600ed6..acc8ea49 100644
@@ -1,6 +1,6 @@
 alsaconfigdir = @ALSA_CONFIG_DIR@
 ucmdir = $(alsaconfigdir)/ucm/rt5651
-ucm_DATA = EnableSeq.conf HeadPhones.conf IN1-InternalMic.conf \
-	   IN2-InternalMic.conf IN12-InternalMic.conf IN3-HeadsetMic.conf \
-	   Speaker.conf MonoSpeaker.conf
+ucm_DATA = EnableSeq.conf HeadPhones.conf HeadPhones-swapped.conf \
+	   IN1-InternalMic.conf IN2-InternalMic.conf IN12-InternalMic.conf \
+	   IN3-HeadsetMic.conf Speaker.conf MonoSpeaker.conf
 EXTRA_DIST = $(ucm_DATA)
Signature · 1 line
2.18.0
#12 lore raw

PATCH v2 13/13 conf/ucm: bytcr-rt5640: Improve human readable input/output names

In reply to Hans de Goede

The Comment field is displayed tot the end user in various UIs as such names like MonoSpeaker and DigitalMics without any spaces are no good.

Also the names themselves as well as how they get displayed in the typical UI (in separate input / output tabs) makes the adding of playback and capture to the comment superfluous and this looks weird in the UI, so drop it.

---
 src/conf/ucm/rt5640/DigitalMics.conf     | 2 +-
 src/conf/ucm/rt5640/HeadPhones.conf      | 2 +-
 src/conf/ucm/rt5640/HeadsetMic.conf      | 2 +-
 src/conf/ucm/rt5640/IN1-InternalMic.conf | 2 +-
 src/conf/ucm/rt5640/IN3-InternalMic.conf | 2 +-
 src/conf/ucm/rt5640/MonoSpeaker.conf     | 2 +-
 src/conf/ucm/rt5640/Speaker.conf         | 2 +-
 7 files changed, 7 insertions(+), 7 deletions(-)
src/conf/ucm/rt5640/DigitalMics.conf +1 -1
index c7d54099..06b42f16 100644
@@ -1,5 +1,5 @@
 SectionDevice."DigitalMics" {
-	Comment "DigitalMics capture"
+	Comment "Internal Digital Microphones"
 
 	ConflictingDevice [
 		"IN1-InternalMics"
src/conf/ucm/rt5640/HeadPhones.conf +1 -1
index 0e7149e5..38f37a6f 100644
@@ -1,5 +1,5 @@
 SectionDevice."Headphones" {
-	Comment "Headphones playback"
+	Comment "Headphones"
 
 	ConflictingDevice [
 		"Speaker"
src/conf/ucm/rt5640/HeadsetMic.conf +1 -1
index 4d54eed0..567d4122 100644
@@ -1,5 +1,5 @@
 SectionDevice."HeadsetMic" {
-	Comment "Headset Mic capture"
+	Comment "Headset Microphone"
 
 	ConflictingDevice [
 		"IN1-InternalMics"
src/conf/ucm/rt5640/IN1-InternalMic.conf +1 -1
index d18c21db..3bf31e64 100644
@@ -1,5 +1,5 @@
 SectionDevice."IN1-InternalMics" {
-	Comment "Internal IN1 analog Mic capture"
+	Comment "Internal Microphone on IN1"
 
 	ConflictingDevice [
 		"DigitalMics"
src/conf/ucm/rt5640/IN3-InternalMic.conf +1 -1
index 17d85229..e1a6c49b 100644
@@ -1,5 +1,5 @@
 SectionDevice."IN3-InternalMics" {
-	Comment "Internal IN3 analog Mic capture"
+	Comment "Internal Microphone on IN3"
 
 	ConflictingDevice [
 		"DigitalMics"
src/conf/ucm/rt5640/MonoSpeaker.conf +1 -1
index 0fb54030..58ab7807 100644
@@ -1,5 +1,5 @@
 SectionDevice."MonoSpeaker" {
-	Comment "MonoSpeaker playback"
+	Comment "Mono Speaker"
 
 	ConflictingDevice [
 		"Headphones"
src/conf/ucm/rt5640/Speaker.conf +1 -1
index b745ed06..a7df9fbf 100644
@@ -1,5 +1,5 @@
 SectionDevice."Speaker" {
-	Comment "Speaker playback"
+	Comment "Speakers"
 
 	ConflictingDevice [
 		"Headphones"
Signature · 1 line
2.18.0
#13 lore raw
In reply to Hans de Goede

Dne 8.8.2018 v 11:05 Hans de Goede napsal(a):

Quoted 8 lines

Use the generic Intel SSP bytcr/PlatformEnableSeq.conf file, it is identical to all the cset statements this commit removes.

---
 src/conf/ucm/chtrt5645/HiFi.conf | 116 +------------------------------
 1 file changed, 1 insertion(+), 115 deletions(-)

I applied all 13 patches to the alsa-lib git tree. Thanks.

Jaroslav

Signature · 2 lines
Jaroslav Kysela <[email protected]>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.
#14 lore raw
In reply to Hans de Goede

alsaucm -c chtrt5645 set _verb HiFi set _enadev Speaker

ALSA lib conf.c:823:(get_char_skip_comments) Cannot access file bytcr/PlatformEnableSeq.conf
ALSA lib conf.c:1877:(snd_config_load1) _toplevel_:17:18:Unexpected char

ALSA lib utils.c:67:(uc_mgr_config_load) could not open configuration file /usr/share/alsa/ucm/ASUSTeKCOMPUTERINC.-X205TA-1.0-X205TA/ASUSTeKCOMPUTERINC.-X205TA-1.0-X205TA.conf ALSA lib parser.c:1427:(load_master_config) error: could not parse
configuration for card ASUSTeKCOMPUTERINC.-X205TA-1.0-X205TA
ALSA lib conf.c:823:(get_char_skip_comments) Cannot access file bytcr/PlatformEnableSeq.conf
ALSA lib conf.c:1877:(snd_config_load1) _toplevel_:17:18:Unexpected char
ALSA lib utils.c:75:(uc_mgr_config_load) could not load configuration file /usr/share/alsa/ucm/chtrt5645/HiFi.conf
ALSA lib parser.c:1101:(parse_verb_file) error: failed to open verb file /usr/share/alsa/ucm/chtrt5645/HiFi.conf : -2
ALSA lib main.c:946:(snd_use_case_mgr_open) error: failed to import
chtrt5645 use case configuration -22
alsaucm: error failed to open sound card chtrt5645: Invalid argument

#15 lore raw
Quoted 2 lines · On Sun, 25 Nov 2018 12:11:29 +0100, youling257 wrote:

alsaucm -c chtrt5645 set _verb HiFi set _enadev Speaker

....

Could you explain what you want?

thanks,

Takashi

#16 lore raw

what you want me explain anyting ?
alsaucm -c xxxx set _verb HiFi set _enadev Speaker
https://www.systutorials.com/docs/linux/man/1-alsaucm/

I used alsa-utils 1.17 and alsa-lib 1.17.

Quoted 4 lines · Takashi Iwai <[email protected]> 于 2018年11月26日周一 下午4:25写道:
Quoted 2 lines · On Sun, 25 Nov 2018 12:11:29 +0100, youling257 wrote:

alsaucm -c chtrt5645 set _verb HiFi set _enadev Speaker

Quoted 9 lines

....

Could you explain what you want?

thanks,

Takashi

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#18 lore raw
Quoted 2 lines · On Mon, 26 Nov 2018 10:49:11 +0100, youling257 wrote:

what you want me explain anyting ?

Anything more useful to understand the situation *and* your demand.

The error messages (at least some of them) are known issues and I already posted the problem on alsa-devel ML. The fix should be easy but I'd like to get consensus beforehand.

Other than that, I'm really not sure what you want in the previous posts; it were merely a dump from some command invocation, and that's all what you wrote.

If you want us to fix something, *please* write / report more explicitly. Only pasting an error message isn't better than some bot.

Quoted 4 lines

alsaucm -c xxxx set _verb HiFi set _enadev Speaker
https://www.systutorials.com/docs/linux/man/1-alsaucm/

I used alsa-utils 1.17 and alsa-lib 1.17.

Thanks, that's at least some more background for better understanding.

Currently alsaucm is so-to-say broken. Just avoid using it until it gets fixed. PA shouldn't hit the problem, it seems almost only alsaucm.

thanks,

Takashi

#19 lore raw

Hi,

Quoted 3 lines · Takashi Iwai

The error messages (at least some of them) are known issues and I already posted the problem on alsa-devel ML. The fix should be easy but I'd like to get consensus beforehand.

Ah I missed that mail as I'm not subscribed to alsa-devel. Since my changes are the cause of this alsaucm command problem, let me reply here:

Quoted 16 lines

some of the recently added UCM profiles are the files to be included by others, and they are not card targets. Unfortunately alsaucm doesn't know about it, and it aborts with error, e.g.

====
% alsaucm
ALSA lib utils.c:67:(uc_mgr_config_load) could not open configuration file /usr/share/alsa/ucm/bytcr/bytcr.conf ALSA lib parser.c:1427:(load_master_config) error: could not parse configuration for card bytcr
alsaucm: unable to obtain card list: No such file or directory
====

The similar error is found in nau8824, rt5640 and rt5651. After putting a placeholder card config file (e.g. bytcr.conf), the error is gone. But certainly we don't want to allow user to choose this as the proper card.

Quoted 6 lines

So, I guess we need to put some flag to each such directory indicating that it's no card config. For example, putting /usr/share/alsa/ucm/bytcr/.nocard file or such...

Not sure whether it's wise to have a file starting with dot, though. Maybe clearer to be "nocard" or any other visible one?

All the HiFi.conf files using the "include" snippets I added to avoid copy and pasting a lot, already need to have this at the top for this to work:

<searchdir:ucm>

So it might be best to move all the dirs holding include files rather then proper card configs from /usr/share/alsa/ucm to /usr/share/alsa/ucm-includes and then change the searchdir part of the configs using these to:

<searchdir:ucm-includes>

Regards,

Hans

#20 lore raw
Quoted 28 lines · Hans de Goede
Quoted 17 lines

some of the recently added UCM profiles are the files to be included by others, and they are not card targets. Unfortunately alsaucm doesn't know about it, and it aborts with error, e.g.

====
% alsaucm
ALSA lib utils.c:67:(uc_mgr_config_load) could not open configuration file /usr/share/alsa/ucm/bytcr/bytcr.conf ALSA lib parser.c:1427:(load_master_config) error: could not parse configuration for card bytcr
alsaucm: unable to obtain card list: No such file or directory
====

The similar error is found in nau8824, rt5640 and rt5651. After putting a placeholder card config file (e.g. bytcr.conf), the error is gone. But certainly we don't want to allow user to choose this as the proper card.

Quoted 6 lines

So, I guess we need to put some flag to each such directory indicating that it's no card config. For example, putting /usr/share/alsa/ucm/bytcr/.nocard file or such...

Not sure whether it's wise to have a file starting with dot, though. Maybe clearer to be "nocard" or any other visible one?

All the HiFi.conf files using the "include" snippets I added to avoid copy and pasting a lot, already need to have this at the top for this to work:

Quoted 8 lines

<searchdir:ucm>

So it might be best to move all the dirs holding include files rather then proper card configs from /usr/share/alsa/ucm to /usr/share/alsa/ucm-includes and then change the searchdir part of the configs using these to:

<searchdir:ucm-includes>

This sounds like a good solution, indeed.
Care to submit a fix patch? I'll apply it unless anyone objects.

Thanks!

Takashi

#21 lore raw

Dne 26.11.2018 v 15:18 Takashi Iwai napsal(a):

Quoted 37 lines
Quoted 35 lines · Hans de Goede
Quoted 17 lines

some of the recently added UCM profiles are the files to be included by others, and they are not card targets. Unfortunately alsaucm doesn't know about it, and it aborts with error, e.g.

====
% alsaucm
ALSA lib utils.c:67:(uc_mgr_config_load) could not open configuration file /usr/share/alsa/ucm/bytcr/bytcr.conf ALSA lib parser.c:1427:(load_master_config) error: could not parse configuration for card bytcr
alsaucm: unable to obtain card list: No such file or directory
====

The similar error is found in nau8824, rt5640 and rt5651. After putting a placeholder card config file (e.g. bytcr.conf), the error is gone. But certainly we don't want to allow user to choose this as the proper card.

Quoted 6 lines

So, I guess we need to put some flag to each such directory indicating that it's no card config. For example, putting /usr/share/alsa/ucm/bytcr/.nocard file or such...

Not sure whether it's wise to have a file starting with dot, though. Maybe clearer to be "nocard" or any other visible one?

All the HiFi.conf files using the "include" snippets I added to avoid copy and pasting a lot, already need to have this at the top for this to work:

<searchdir:ucm>

So it might be best to move all the dirs holding include files rather then proper card configs from /usr/share/alsa/ucm to /usr/share/alsa/ucm-includes and then change the searchdir part of the configs using these to:

Quoted 4 lines
Quoted 1 line

<searchdir:ucm-includes>

This sounds like a good solution, indeed.
Care to submit a fix patch? I'll apply it unless anyone objects.

Yep, it looks like a good idea.

Jaroslav

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

Dne 26.11.2018 v 15:18 Takashi Iwai napsal(a):

Quoted 35 lines
Quoted 33 lines · Hans de Goede
Quoted 16 lines

some of the recently added UCM profiles are the files to be included by others, and they are not card targets. Unfortunately alsaucm doesn't know about it, and it aborts with error, e.g.

====
% alsaucm
ALSA lib utils.c:67:(uc_mgr_config_load) could not open configuration file /usr/share/alsa/ucm/bytcr/bytcr.conf ALSA lib parser.c:1427:(load_master_config) error: could not parse configuration for card bytcr
alsaucm: unable to obtain card list: No such file or directory
====

The similar error is found in nau8824, rt5640 and rt5651. After putting a placeholder card config file (e.g. bytcr.conf), the error is gone. But certainly we don't want to allow user to choose this as the proper card.

Quoted 6 lines

So, I guess we need to put some flag to each such directory indicating that it's no card config. For example, putting /usr/share/alsa/ucm/bytcr/.nocard file or such...

Not sure whether it's wise to have a file starting with dot, though. Maybe clearer to be "nocard" or any other visible one?

All the HiFi.conf files using the "include" snippets I added to avoid copy and pasting a lot, already need to have this at the top for this to work:

<searchdir:ucm>

So it might be best to move all the dirs holding include files rather then proper card configs from /usr/share/alsa/ucm to /usr/share/alsa/ucm-includes and then change the searchdir part of the configs using these to:

Quoted 4 lines
Quoted 3 lines
Quoted 1 line

<searchdir:ucm-includes>

This sounds like a good solution, indeed.
Care to submit a fix patch? I'll apply it unless anyone objects.

Yep, it looks like a good idea.

Makes sense.

We may also want to change the error message when the DMI-based configuration is not found, e.g.

ALSA lib utils.c:67:(uc_mgr_config_load) could not open configuration file /usr/share/alsa/ucm/ASUSTeKCOMPUTERINC.-X205TA-1.0-X205TA/ASUSTeKCOMPUTERINC.-X205TA-1.0-X205TA.conf

ALSA lib parser.c:1427:(load_master_config) error: could not parse configuration for card ASUSTeKCOMPUTERINC.-X205TA-1.0-X205TA

This is reported as an error even if there is a fallback. I remember losing a couple of hours trying to figure out what was happening when in reality there was no issue.

I have two other points I need to sort out

- what is the license for those UCM files? I keep getting questions and I don't have the answer. It'd be odd to have then inherit the LGPL license from alsa-lib, it's expected that people will have to do minor modifications left and right and handle a number of derivatives, e.g. because the perceived volume is too low due to some mechanics/acoustics issue and requiring them to share is a bit cumbersome.

- how are we going to handle the changes for SOF, we added an "sof-" prefix to make it explicit that the platform/DSP driver side is different, but having a different board name will interfere with search and includes.

Thanks

-Pierre

#23 lore raw
Quoted 39 lines · Pierre-Louis Bossart
Quoted 36 lines · Jaroslav Kysela

Dne 26.11.2018 v 15:18 Takashi Iwai napsal(a):

Quoted 35 lines
Quoted 33 lines · Hans de Goede
Quoted 16 lines

some of the recently added UCM profiles are the files to be included by others, and they are not card targets. Unfortunately alsaucm doesn't know about it, and it aborts with error, e.g.

====
% alsaucm
ALSA lib utils.c:67:(uc_mgr_config_load) could not open configuration file /usr/share/alsa/ucm/bytcr/bytcr.conf ALSA lib parser.c:1427:(load_master_config) error: could not parse configuration for card bytcr
alsaucm: unable to obtain card list: No such file or directory
====

The similar error is found in nau8824, rt5640 and rt5651. After putting a placeholder card config file (e.g. bytcr.conf), the error is gone. But certainly we don't want to allow user to choose this as the proper card.

Quoted 6 lines

So, I guess we need to put some flag to each such directory indicating that it's no card config. For example, putting /usr/share/alsa/ucm/bytcr/.nocard file or such...

Not sure whether it's wise to have a file starting with dot, though. Maybe clearer to be "nocard" or any other visible one?

All the HiFi.conf files using the "include" snippets I added to avoid copy and pasting a lot, already need to have this at the top for this to work:

<searchdir:ucm>

So it might be best to move all the dirs holding include files rather then proper card configs from /usr/share/alsa/ucm to /usr/share/alsa/ucm-includes and then change the searchdir part of the configs using these to:

Quoted 6 lines
Quoted 4 lines
Quoted 3 lines
Quoted 1 line

<searchdir:ucm-includes>

This sounds like a good solution, indeed.
Care to submit a fix patch? I'll apply it unless anyone objects.

Yep, it looks like a good idea.

Makes sense.

OK, I cooked up the patch now. Will submit soon later.

Quoted 8 lines

We may also want to change the error message when the DMI-based configuration is not found, e.g.

ALSA lib utils.c:67:(uc_mgr_config_load) could not open configuration
file /usr/share/alsa/ucm/ASUSTeKCOMPUTERINC.-X205TA-1.0-X205TA/ASUSTeKCOMPUTERINC.-X205TA-1.0-X205TA.conf

Quoted 6 lines

ALSA lib parser.c:1427:(load_master_config) error: could not parse configuration for card ASUSTeKCOMPUTERINC.-X205TA-1.0-X205TA

This is reported as an error even if there is a fallback. I remember losing a couple of hours trying to figure out what was happening when in reality there was no issue.

A good point, it should be suppressed.

Quoted 9 lines

I have two other points I need to sort out

- what is the license for those UCM files? I keep getting questions and I don't have the answer. It'd be odd to have then inherit the LGPL license from alsa-lib, it's expected that people will have to do minor modifications left and right and handle a number of derivatives, e.g. because the perceived volume is too low due to some mechanics/acoustics issue and requiring them to share is a bit cumbersome.

Unless explicitly specified, it should inherit from the whole alsa-lib license, i.e. LGPL. But I guess we have no problem for re-licensing (or dual-license) with a more relaxed one for UCM profiles, once when they are split to an individual repo.

Since the whole projects were moved to github, we can do it easily, I suppose.

Quoted 4 lines

- how are we going to handle the changes for SOF, we added an "sof-" prefix to make it explicit that the platform/DSP driver side is different, but having a different board name will interfere with search and includes.

Sorry, it's not clear about the question. You need to use a different UCM profile when the device is bound with SOF, right?

thanks,

Takashi

#24 lore raw
Quoted 8 lines
Quoted 8 lines

- what is the license for those UCM files? I keep getting questions and I don't have the answer. It'd be odd to have then inherit the LGPL license from alsa-lib, it's expected that people will have to do minor modifications left and right and handle a number of derivatives, e.g. because the perceived volume is too low due to some mechanics/acoustics issue and requiring them to share is a bit cumbersome.

Quoted 7 lines

Unless explicitly specified, it should inherit from the whole alsa-lib license, i.e. LGPL. But I guess we have no problem for re-licensing (or dual-license) with a more relaxed one for UCM profiles, once when they are split to an individual repo.

Since the whole projects were moved to github, we can do it easily, I suppose.

I think we should have UCM and topology files in the same repo since they are related (control names, etc).

BTW that's also one improvement that I forgot about. alsa-lib currently bails when it cannot find a control in an UCM file, and that's painful when control names change over time. I have e.g. older UCM profiles for Chromebooks that aren't compatible any longer with the upstream kernel for HDMI paths, but work fine with analog paths. It'd be really nice to downgrade the error to a warning.

Quoted 7 lines
Quoted 5 lines

- how are we going to handle the changes for SOF, we added an "sof-" prefix to make it explicit that the platform/DSP driver side is different, but having a different board name will interfere with search and includes.

Sorry, it's not clear about the question. You need to use a different UCM profile when the device is bound with SOF, right?

It's only different for the DSP parts, the codec settings are completely identical so I was hoping to avoid duplication of all the profiles and use some sort of run-time rule to only include the changed DSP settings. I don't have a turn-key solution to suggest, just a desire to avoid more maintenance work just because of a prefix added.

#25 lore raw
Quoted 14 lines · Pierre-Louis Bossart
Quoted 14 lines
Quoted 9 lines

- what is the license for those UCM files? I keep getting questions and I don't have the answer. It'd be odd to have then inherit the LGPL license from alsa-lib, it's expected that people will have to do minor modifications left and right and handle a number of derivatives, e.g. because the perceived volume is too low due to some mechanics/acoustics issue and requiring them to share is a bit cumbersome.

Unless explicitly specified, it should inherit from the whole alsa-lib license, i.e. LGPL. But I guess we have no problem for re-licensing (or dual-license) with a more relaxed one for UCM profiles, once when they are split to an individual repo.

Quoted 5 lines
Quoted 2 lines

Since the whole projects were moved to github, we can do it easily, I suppose.

I think we should have UCM and topology files in the same repo since they are related (control names, etc).

OK, makes sense.

Quoted 6 lines

BTW that's also one improvement that I forgot about. alsa-lib currently bails when it cannot find a control in an UCM file, and that's painful when control names change over time. I have e.g. older UCM profiles for Chromebooks that aren't compatible any longer with the upstream kernel for HDMI paths, but work fine with analog paths. It'd be really nice to downgrade the error to a warning.

Yeah, I've hit this a few times as well :) It'd be helpful to fallback or allow optional controls.

Quoted 8 lines
Quoted 7 lines
Quoted 5 lines

- how are we going to handle the changes for SOF, we added an "sof-" prefix to make it explicit that the platform/DSP driver side is different, but having a different board name will interfere with search and includes.

Sorry, it's not clear about the question. You need to use a different UCM profile when the device is bound with SOF, right?

Quoted 6 lines

It's only different for the DSP parts, the codec settings are completely identical so I was hoping to avoid duplication of all the profiles and use some sort of run-time rule to only include the changed DSP settings. I don't have a turn-key solution to suggest, just a desire to avoid more maintenance work just because of a prefix added.

Some string manipulations should be available in the alsa-lib config syntax, so a thing like a control name might be set dynamically (hopefully).

But my coverage and memory in that area are a bit vague, so let me see again once when more concrete pictures show up.

thanks,

Takashi

#26 lore raw

revert "conf/ucm: bytcr-rt5645: Use the generic bytcr/PlatformEnableSeq.conf", or add missed <searchdir:ucm-includes> for chtrt5645, what do you want?

Quoted 54 lines · Takashi Iwai <[email protected]> 于2018年11月28日周三 上午1:12写道:
Quoted 14 lines · Pierre-Louis Bossart
Quoted 14 lines
Quoted 9 lines

- what is the license for those UCM files? I keep getting questions and I don't have the answer. It'd be odd to have then inherit the LGPL license from alsa-lib, it's expected that people will have to do minor modifications left and right and handle a number of derivatives, e.g. because the perceived volume is too low due to some mechanics/acoustics issue and requiring them to share is a bit cumbersome.

Unless explicitly specified, it should inherit from the whole alsa-lib license, i.e. LGPL. But I guess we have no problem for re-licensing (or dual-license) with a more relaxed one for UCM profiles, once when they are split to an individual repo.

Quoted 5 lines
Quoted 2 lines

Since the whole projects were moved to github, we can do it easily, I suppose.

I think we should have UCM and topology files in the same repo since they are related (control names, etc).

OK, makes sense.

Quoted 6 lines

BTW that's also one improvement that I forgot about. alsa-lib currently bails when it cannot find a control in an UCM file, and that's painful when control names change over time. I have e.g. older UCM profiles for Chromebooks that aren't compatible any longer with the upstream kernel for HDMI paths, but work fine with analog paths. It'd be really nice to downgrade the error to a warning.

Yeah, I've hit this a few times as well :) It'd be helpful to fallback or allow optional controls.

Quoted 8 lines
Quoted 7 lines
Quoted 5 lines

- how are we going to handle the changes for SOF, we added an "sof-" prefix to make it explicit that the platform/DSP driver side is different, but having a different board name will interfere with search and includes.

Sorry, it's not clear about the question. You need to use a different UCM profile when the device is bound with SOF, right?

Quoted 6 lines

It's only different for the DSP parts, the codec settings are completely identical so I was hoping to avoid duplication of all the profiles and use some sort of run-time rule to only include the changed DSP settings. I don't have a turn-key solution to suggest, just a desire to avoid more maintenance work just because of a prefix added.

Some string manipulations should be available in the alsa-lib config syntax, so a thing like a control name might be set dynamically (hopefully).

Quoted 7 lines

But my coverage and memory in that area are a bit vague, so let me see again once when more concrete pictures show up.

thanks,

Takashi

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#27 lore raw
Quoted 4 lines · On Wed, 28 Nov 2018 05:35:50 +0100, youling 257 wrote:

revert "conf/ucm: bytcr-rt5645: Use the generic bytcr/PlatformEnableSeq.conf", or add missed <searchdir:ucm-includes> for chtrt5645, what do you want?

Avoid top-posting and a bit more context for understanding by human beings, please :)

In anyway, I see the point, my previous patch was far imperfect. The second patch will be submitted soon.

thanks,

Takashi

Quoted 56 lines
Quoted 54 lines · Takashi Iwai <[email protected]> 于2018年11月28日周三 上午1:12写道:
Quoted 14 lines · Pierre-Louis Bossart
Quoted 14 lines
Quoted 9 lines

- what is the license for those UCM files? I keep getting questions and I don't have the answer. It'd be odd to have then inherit the LGPL license from alsa-lib, it's expected that people will have to do minor modifications left and right and handle a number of derivatives, e.g. because the perceived volume is too low due to some mechanics/acoustics issue and requiring them to share is a bit cumbersome.

Unless explicitly specified, it should inherit from the whole alsa-lib license, i.e. LGPL. But I guess we have no problem for re-licensing (or dual-license) with a more relaxed one for UCM profiles, once when they are split to an individual repo.

Quoted 5 lines
Quoted 2 lines

Since the whole projects were moved to github, we can do it easily, I suppose.

I think we should have UCM and topology files in the same repo since they are related (control names, etc).

OK, makes sense.

Quoted 6 lines

BTW that's also one improvement that I forgot about. alsa-lib currently bails when it cannot find a control in an UCM file, and that's painful when control names change over time. I have e.g. older UCM profiles for Chromebooks that aren't compatible any longer with the upstream kernel for HDMI paths, but work fine with analog paths. It'd be really nice to downgrade the error to a warning.

Yeah, I've hit this a few times as well :) It'd be helpful to fallback or allow optional controls.

Quoted 8 lines
Quoted 7 lines
Quoted 5 lines

- how are we going to handle the changes for SOF, we added an "sof-" prefix to make it explicit that the platform/DSP driver side is different, but having a different board name will interfere with search and includes.

Sorry, it's not clear about the question. You need to use a different UCM profile when the device is bound with SOF, right?

Quoted 6 lines

It's only different for the DSP parts, the codec settings are completely identical so I was hoping to avoid duplication of all the profiles and use some sort of run-time rule to only include the changed DSP settings. I don't have a turn-key solution to suggest, just a desire to avoid more maintenance work just because of a prefix added.

Some string manipulations should be available in the alsa-lib config syntax, so a thing like a control name might be set dynamically (hopefully).

Quoted 8 lines
Quoted 7 lines

But my coverage and memory in that area are a bit vague, so let me see again once when more concrete pictures show up.

thanks,

Takashi

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#28 lore raw
In reply to Hans de Goede

alsaucm -c chtrt5645 set _verb HiFi set _enadev Speaker
ALSA lib conf.c:823:(get_char_skip_comments) Cannot access file bytcr/PlatformEnableSeq.conf
ALSA lib conf.c:1877:(snd_config_load1) _toplevel_:17:18:Unexpected char speaker never work on asus x205ta.

used https://github.com/plbossart/UCM/blob/master/chtrt5645/HiFi.conf file, alsaucm -c chtrt5645 set _verb HiFi set _enadev Speaker, speaker work on x205ta.

what are you talk about 5651/5640/nau8824 ? help me x205ta ?

Quoted 46 lines · Hans de Goede <[email protected]> 于2018年11月26日周一 下午9:40写道:

Hi,

Quoted 3 lines · Takashi Iwai

The error messages (at least some of them) are known issues and I already posted the problem on alsa-devel ML. The fix should be easy but I'd like to get consensus beforehand.

Ah I missed that mail as I'm not subscribed to alsa-devel. Since my changes are the cause of this alsaucm command problem, let me reply here:

Quoted 16 lines

some of the recently added UCM profiles are the files to be included by others, and they are not card targets. Unfortunately alsaucm doesn't know about it, and it aborts with error, e.g.

====
% alsaucm
ALSA lib utils.c:67:(uc_mgr_config_load) could not open configuration file /usr/share/alsa/ucm/bytcr/bytcr.conf ALSA lib parser.c:1427:(load_master_config) error: could not parse configuration for card bytcr
alsaucm: unable to obtain card list: No such file or directory
====

The similar error is found in nau8824, rt5640 and rt5651. After putting a placeholder card config file (e.g. bytcr.conf), the error is gone. But certainly we don't want to allow user to choose this as the proper card.

Quoted 6 lines

So, I guess we need to put some flag to each such directory indicating that it's no card config. For example, putting /usr/share/alsa/ucm/bytcr/.nocard file or such...

Not sure whether it's wise to have a file starting with dot, though. Maybe clearer to be "nocard" or any other visible one?

All the HiFi.conf files using the "include" snippets I added to avoid copy and pasting a lot, already need to have this at the top for this to work:

<searchdir:ucm>

So it might be best to move all the dirs holding include files rather then proper card configs from /usr/share/alsa/ucm to /usr/share/alsa/ucm-includes and then change the searchdir part of the configs using these to:

Quoted 5 lines

<searchdir:ucm-includes>

Regards,

Hans

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#29 lore raw
In reply to Hans de Goede

why not i use this command, speaker also work on x205ta.
alsaucm -c chtrt5645-mono-speaker-analog-mic set _verb HiFi set _enadev Speaker

Quoted 46 lines · Hans de Goede <[email protected]> 于2018年11月26日周一 下午9:40写道:

Hi,

Quoted 3 lines · Takashi Iwai

The error messages (at least some of them) are known issues and I already posted the problem on alsa-devel ML. The fix should be easy but I'd like to get consensus beforehand.

Ah I missed that mail as I'm not subscribed to alsa-devel. Since my changes are the cause of this alsaucm command problem, let me reply here:

Quoted 16 lines

some of the recently added UCM profiles are the files to be included by others, and they are not card targets. Unfortunately alsaucm doesn't know about it, and it aborts with error, e.g.

====
% alsaucm
ALSA lib utils.c:67:(uc_mgr_config_load) could not open configuration file /usr/share/alsa/ucm/bytcr/bytcr.conf ALSA lib parser.c:1427:(load_master_config) error: could not parse configuration for card bytcr
alsaucm: unable to obtain card list: No such file or directory
====

The similar error is found in nau8824, rt5640 and rt5651. After putting a placeholder card config file (e.g. bytcr.conf), the error is gone. But certainly we don't want to allow user to choose this as the proper card.

Quoted 6 lines

So, I guess we need to put some flag to each such directory indicating that it's no card config. For example, putting /usr/share/alsa/ucm/bytcr/.nocard file or such...

Not sure whether it's wise to have a file starting with dot, though. Maybe clearer to be "nocard" or any other visible one?

All the HiFi.conf files using the "include" snippets I added to avoid copy and pasting a lot, already need to have this at the top for this to work:

<searchdir:ucm>

So it might be best to move all the dirs holding include files rather then proper card configs from /usr/share/alsa/ucm to /usr/share/alsa/ucm-includes and then change the searchdir part of the configs using these to:

Quoted 5 lines

<searchdir:ucm-includes>

Regards,

Hans

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#30 lore raw
In reply to Hans de Goede

/src/conf/ucm/chtrt5645/HiFi.conf missed <searchdir:ucm>, now, should add <searchdir:ucm-includes>.

Quoted 46 lines · Hans de Goede <[email protected]> 于2018年11月26日周一 下午9:40写道:

Hi,

Quoted 3 lines · Takashi Iwai

The error messages (at least some of them) are known issues and I already posted the problem on alsa-devel ML. The fix should be easy but I'd like to get consensus beforehand.

Ah I missed that mail as I'm not subscribed to alsa-devel. Since my changes are the cause of this alsaucm command problem, let me reply here:

Quoted 16 lines

some of the recently added UCM profiles are the files to be included by others, and they are not card targets. Unfortunately alsaucm doesn't know about it, and it aborts with error, e.g.

====
% alsaucm
ALSA lib utils.c:67:(uc_mgr_config_load) could not open configuration file /usr/share/alsa/ucm/bytcr/bytcr.conf ALSA lib parser.c:1427:(load_master_config) error: could not parse configuration for card bytcr
alsaucm: unable to obtain card list: No such file or directory
====

The similar error is found in nau8824, rt5640 and rt5651. After putting a placeholder card config file (e.g. bytcr.conf), the error is gone. But certainly we don't want to allow user to choose this as the proper card.

Quoted 6 lines

So, I guess we need to put some flag to each such directory indicating that it's no card config. For example, putting /usr/share/alsa/ucm/bytcr/.nocard file or such...

Not sure whether it's wise to have a file starting with dot, though. Maybe clearer to be "nocard" or any other visible one?

All the HiFi.conf files using the "include" snippets I added to avoid copy and pasting a lot, already need to have this at the top for this to work:

<searchdir:ucm>

So it might be best to move all the dirs holding include files rather then proper card configs from /usr/share/alsa/ucm to /usr/share/alsa/ucm-includes and then change the searchdir part of the configs using these to:

Quoted 5 lines

<searchdir:ucm-includes>

Regards,

Hans

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel