All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 01/13] conf/ucm: bytcr-rt5645: Use the generic bytcr/PlatformEnableSeq.conf
@ 2018-08-08  9:05 Hans de Goede
  2018-08-08  9:05 ` [PATCH v2 02/13] conf/ucm: bytcr-rt5651: Do not use both DAC1 and HPVOL inputs for HP Hans de Goede
                   ` (14 more replies)
  0 siblings, 15 replies; 31+ messages in thread
From: Hans de Goede @ 2018-08-08  9:05 UTC (permalink / raw)
  To: alsa-devel; +Cc: Takashi Iwai, Hans de Goede, Pierre-Louis Bossart

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

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 src/conf/ucm/chtrt5645/HiFi.conf | 116 +------------------------------
 1 file changed, 1 insertion(+), 115 deletions(-)

diff --git a/src/conf/ucm/chtrt5645/HiFi.conf b/src/conf/ucm/chtrt5645/HiFi.conf
index e81866cf..d993f6ae 100644
--- a/src/conf/ucm/chtrt5645/HiFi.conf
+++ b/src/conf/ucm/chtrt5645/HiFi.conf
@@ -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"
-- 
2.18.0

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH v2 02/13] conf/ucm: bytcr-rt5651: Do not use both DAC1 and HPVOL inputs for HP
  2018-08-08  9:05 [PATCH v2 01/13] conf/ucm: bytcr-rt5645: Use the generic bytcr/PlatformEnableSeq.conf Hans de Goede
@ 2018-08-08  9:05 ` Hans de Goede
  2018-08-08  9:05 ` [PATCH v2 03/13] conf/ucm: bytcr-rt5651: Configure all volumes at 0dB Hans de Goede
                   ` (13 subsequent siblings)
  14 siblings, 0 replies; 31+ messages in thread
From: Hans de Goede @ 2018-08-08  9:05 UTC (permalink / raw)
  To: alsa-devel; +Cc: Takashi Iwai, Hans de Goede, Pierre-Louis Bossart

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.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 src/conf/ucm/bytcr-rt5651/HiFi.conf         | 2 --
 src/conf/ucm/bytcr-rt5651/bytcr-rt5651.conf | 4 ++--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/conf/ucm/bytcr-rt5651/HiFi.conf b/src/conf/ucm/bytcr-rt5651/HiFi.conf
index 8ded2d52..bc604276 100644
--- a/src/conf/ucm/bytcr-rt5651/HiFi.conf
+++ b/src/conf/ucm/bytcr-rt5651/HiFi.conf
@@ -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 {
diff --git a/src/conf/ucm/bytcr-rt5651/bytcr-rt5651.conf b/src/conf/ucm/bytcr-rt5651/bytcr-rt5651.conf
index 069427b7..3bf7f69a 100644
--- a/src/conf/ucm/bytcr-rt5651/bytcr-rt5651.conf
+++ b/src/conf/ucm/bytcr-rt5651/bytcr-rt5651.conf
@@ -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"
-- 
2.18.0

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH v2 03/13] conf/ucm: bytcr-rt5651: Configure all volumes at 0dB
  2018-08-08  9:05 [PATCH v2 01/13] conf/ucm: bytcr-rt5645: Use the generic bytcr/PlatformEnableSeq.conf Hans de Goede
  2018-08-08  9:05 ` [PATCH v2 02/13] conf/ucm: bytcr-rt5651: Do not use both DAC1 and HPVOL inputs for HP Hans de Goede
@ 2018-08-08  9:05 ` Hans de Goede
  2018-08-08  9:05 ` [PATCH v2 04/13] conf/ucm: bytcr-rt5651: Start with all outputs and inputs disabled Hans de Goede
                   ` (12 subsequent siblings)
  14 siblings, 0 replies; 31+ messages in thread
From: Hans de Goede @ 2018-08-08  9:05 UTC (permalink / raw)
  To: alsa-devel; +Cc: Takashi Iwai, Hans de Goede, Pierre-Louis Bossart

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.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 src/conf/ucm/bytcr-rt5651/bytcr-rt5651.conf | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/conf/ucm/bytcr-rt5651/bytcr-rt5651.conf b/src/conf/ucm/bytcr-rt5651/bytcr-rt5651.conf
index 3bf7f69a..27a7b5c6 100644
--- a/src/conf/ucm/bytcr-rt5651/bytcr-rt5651.conf
+++ b/src/conf/ucm/bytcr-rt5651/bytcr-rt5651.conf
@@ -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"
-- 
2.18.0

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH v2 04/13] conf/ucm: bytcr-rt5651: Start with all outputs and inputs disabled
  2018-08-08  9:05 [PATCH v2 01/13] conf/ucm: bytcr-rt5645: Use the generic bytcr/PlatformEnableSeq.conf Hans de Goede
  2018-08-08  9:05 ` [PATCH v2 02/13] conf/ucm: bytcr-rt5651: Do not use both DAC1 and HPVOL inputs for HP Hans de Goede
  2018-08-08  9:05 ` [PATCH v2 03/13] conf/ucm: bytcr-rt5651: Configure all volumes at 0dB Hans de Goede
@ 2018-08-08  9:05 ` Hans de Goede
  2018-08-08  9:05 ` [PATCH v2 05/13] conf/ucm: bytcr-rt5651: Change Speaker/Headphone en/disable sequences to fix switching Hans de Goede
                   ` (11 subsequent siblings)
  14 siblings, 0 replies; 31+ messages in thread
From: Hans de Goede @ 2018-08-08  9:05 UTC (permalink / raw)
  To: alsa-devel; +Cc: Takashi Iwai, Hans de Goede, Pierre-Louis Bossart

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.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 src/conf/ucm/bytcr-rt5651/bytcr-rt5651.conf | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/conf/ucm/bytcr-rt5651/bytcr-rt5651.conf b/src/conf/ucm/bytcr-rt5651/bytcr-rt5651.conf
index 27a7b5c6..d3148b3d 100644
--- a/src/conf/ucm/bytcr-rt5651/bytcr-rt5651.conf
+++ b/src/conf/ucm/bytcr-rt5651/bytcr-rt5651.conf
@@ -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"
 ]
-- 
2.18.0

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH v2 05/13] conf/ucm: bytcr-rt5651: Change Speaker/Headphone en/disable sequences to fix switching
  2018-08-08  9:05 [PATCH v2 01/13] conf/ucm: bytcr-rt5645: Use the generic bytcr/PlatformEnableSeq.conf Hans de Goede
                   ` (2 preceding siblings ...)
  2018-08-08  9:05 ` [PATCH v2 04/13] conf/ucm: bytcr-rt5651: Start with all outputs and inputs disabled Hans de Goede
@ 2018-08-08  9:05 ` Hans de Goede
  2018-08-08  9:05 ` [PATCH v2 06/13] conf/ucm: bytcr-rt5651: Use generic SSP enable + disable sequence, support SSP0 Hans de Goede
                   ` (10 subsequent siblings)
  14 siblings, 0 replies; 31+ messages in thread
From: Hans de Goede @ 2018-08-08  9:05 UTC (permalink / raw)
  To: alsa-devel; +Cc: Takashi Iwai, Hans de Goede, Pierre-Louis Bossart

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.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 src/conf/ucm/bytcr-rt5651/HiFi.conf | 22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)

diff --git a/src/conf/ucm/bytcr-rt5651/HiFi.conf b/src/conf/ucm/bytcr-rt5651/HiFi.conf
index bc604276..42fa2c9a 100644
--- a/src/conf/ucm/bytcr-rt5651/HiFi.conf
+++ b/src/conf/ucm/bytcr-rt5651/HiFi.conf
@@ -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 {
-- 
2.18.0

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH v2 06/13] conf/ucm: bytcr-rt5651: Use generic SSP enable + disable sequence, support SSP0
  2018-08-08  9:05 [PATCH v2 01/13] conf/ucm: bytcr-rt5645: Use the generic bytcr/PlatformEnableSeq.conf Hans de Goede
                   ` (3 preceding siblings ...)
  2018-08-08  9:05 ` [PATCH v2 05/13] conf/ucm: bytcr-rt5651: Change Speaker/Headphone en/disable sequences to fix switching Hans de Goede
@ 2018-08-08  9:05 ` Hans de Goede
  2018-08-08  9:05 ` [PATCH v2 07/13] conf/ucm: bytcr-rt5651: Fix ADC and Mic capture volumes Hans de Goede
                   ` (9 subsequent siblings)
  14 siblings, 0 replies; 31+ messages in thread
From: Hans de Goede @ 2018-08-08  9:05 UTC (permalink / raw)
  To: alsa-devel; +Cc: Takashi Iwai, Hans de Goede, Pierre-Louis Bossart

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).

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 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

diff --git a/configure.ac b/configure.ac
index adc654e2..85a6be80 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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 \
diff --git a/src/conf/ucm/Makefile.am b/src/conf/ucm/Makefile.am
index 1e51f73e..669e98d5 100644
--- a/src/conf/ucm/Makefile.am
+++ b/src/conf/ucm/Makefile.am
@@ -29,6 +29,7 @@ PandaBoardES \
 PAZ00 \
 PIPO-W2S-Defaultstring-CherryTrailCR \
 rt5640 \
+rt5651 \
 SDP4430 \
 skylake-rt286 \
 TECLAST-X80Pro-Defaultstring-CherryTrailCR \
diff --git a/src/conf/ucm/bytcr-rt5651/HiFi.conf b/src/conf/ucm/bytcr-rt5651/HiFi.conf
index 42fa2c9a..fd878f4a 100644
--- a/src/conf/ucm/bytcr-rt5651/HiFi.conf
+++ b/src/conf/ucm/bytcr-rt5651/HiFi.conf
@@ -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 {
diff --git a/src/conf/ucm/bytcr-rt5651/bytcr-rt5651.conf b/src/conf/ucm/bytcr-rt5651/bytcr-rt5651.conf
index d3148b3d..45889d82 100644
--- a/src/conf/ucm/bytcr-rt5651/bytcr-rt5651.conf
+++ b/src/conf/ucm/bytcr-rt5651/bytcr-rt5651.conf
@@ -7,140 +7,4 @@ SectionUseCase."HiFi" {
 
 SectionDefaults [
 	cdev "hw:bytcrrt5651"
-
-	# 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
-	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"
-
-	# input settings
-	# pcm1_out settings
-	cset "name='codec_in0 Gain 0 Switch' on"
-	cset "name='codec_in0 Gain 0 Volume' 0"
-	cset "name='pcm1_out mix 0 codec_in0 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"
-
-	# default state
-	cset "name='HPO MIX DAC1 Switch' on"
-	cset "name='HPO MIX HPVOL Switch' off"
-	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='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"
-	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"
-	cset "name='Stereo1 ADC MIXR ADC2 Switch' on"
-	cset "name='Stereo2 ADC MIXL ADC1 Switch' on"
-	cset "name='Stereo2 ADC MIXL ADC2 Switch' on"
-	cset "name='Stereo2 ADC MIXR ADC1 Switch' on"
-	cset "name='Stereo2 ADC MIXR ADC2 Switch' on"
-	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"
-	cset "name='Stereo1 ADC MIXL ADC1 Switch' on"
-	cset "name='Stereo1 ADC MIXR ADC1 Switch' on"
-	cset "name='RECMIXL BST1 Switch' off"
-	cset "name='RECMIXR BST1 Switch' off"
-	cset "name='RECMIXL BST3 Switch' off"
-	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"
 ]
diff --git a/src/conf/ucm/rt5651/EnableSeq.conf b/src/conf/ucm/rt5651/EnableSeq.conf
new file mode 100644
index 00000000..3ef9afc0
--- /dev/null
+++ b/src/conf/ucm/rt5651/EnableSeq.conf
@@ -0,0 +1,46 @@
+# default state
+cset "name='HPO MIX DAC1 Switch' on"
+cset "name='HPO MIX HPVOL Switch' off"
+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='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"
+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"
+cset "name='Stereo1 ADC MIXR ADC2 Switch' on"
+cset "name='Stereo2 ADC MIXL ADC1 Switch' on"
+cset "name='Stereo2 ADC MIXL ADC2 Switch' on"
+cset "name='Stereo2 ADC MIXR ADC1 Switch' on"
+cset "name='Stereo2 ADC MIXR ADC2 Switch' on"
+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"
+cset "name='Stereo1 ADC MIXL ADC1 Switch' on"
+cset "name='Stereo1 ADC MIXR ADC1 Switch' on"
+cset "name='RECMIXL BST1 Switch' off"
+cset "name='RECMIXR BST1 Switch' off"
+cset "name='RECMIXL BST3 Switch' off"
+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"
diff --git a/src/conf/ucm/rt5651/Makefile.am b/src/conf/ucm/rt5651/Makefile.am
new file mode 100644
index 00000000..8a22159c
--- /dev/null
+++ b/src/conf/ucm/rt5651/Makefile.am
@@ -0,0 +1,4 @@
+alsaconfigdir = @ALSA_CONFIG_DIR@
+ucmdir = $(alsaconfigdir)/ucm/rt5651
+ucm_DATA = EnableSeq.conf
+EXTRA_DIST = $(ucm_DATA)
-- 
2.18.0

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH v2 07/13] conf/ucm: bytcr-rt5651: Fix ADC and Mic capture volumes
  2018-08-08  9:05 [PATCH v2 01/13] conf/ucm: bytcr-rt5645: Use the generic bytcr/PlatformEnableSeq.conf Hans de Goede
                   ` (4 preceding siblings ...)
  2018-08-08  9:05 ` [PATCH v2 06/13] conf/ucm: bytcr-rt5651: Use generic SSP enable + disable sequence, support SSP0 Hans de Goede
@ 2018-08-08  9:05 ` Hans de Goede
  2018-08-08  9:05 ` [PATCH v2 08/13] conf/ucm: bytcr-rt5651: Add support for mic input on various pins Hans de Goede
                   ` (8 subsequent siblings)
  14 siblings, 0 replies; 31+ messages in thread
From: Hans de Goede @ 2018-08-08  9:05 UTC (permalink / raw)
  To: alsa-devel; +Cc: Takashi Iwai, Hans de Goede, Pierre-Louis Bossart

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

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 src/conf/ucm/rt5651/EnableSeq.conf | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/src/conf/ucm/rt5651/EnableSeq.conf b/src/conf/ucm/rt5651/EnableSeq.conf
index 3ef9afc0..37bffecb 100644
--- a/src/conf/ucm/rt5651/EnableSeq.conf
+++ b/src/conf/ucm/rt5651/EnableSeq.conf
@@ -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"
-- 
2.18.0

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH v2 08/13] conf/ucm: bytcr-rt5651: Add support for mic input on various pins
  2018-08-08  9:05 [PATCH v2 01/13] conf/ucm: bytcr-rt5645: Use the generic bytcr/PlatformEnableSeq.conf Hans de Goede
                   ` (5 preceding siblings ...)
  2018-08-08  9:05 ` [PATCH v2 07/13] conf/ucm: bytcr-rt5651: Fix ADC and Mic capture volumes Hans de Goede
@ 2018-08-08  9:05 ` Hans de Goede
  2018-08-08  9:05 ` [PATCH v2 09/13] conf/ucm: bytcr-rt5651: Split into 1 .conf file per input / output Hans de Goede
                   ` (7 subsequent siblings)
  14 siblings, 0 replies; 31+ messages in thread
From: Hans de Goede @ 2018-08-08  9:05 UTC (permalink / raw)
  To: alsa-devel; +Cc: Takashi Iwai, Hans de Goede, Pierre-Louis Bossart

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.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 src/conf/ucm/bytcr-rt5651/HiFi.conf | 93 +++++++++++++++++++++++++----
 1 file changed, 82 insertions(+), 11 deletions(-)

diff --git a/src/conf/ucm/bytcr-rt5651/HiFi.conf b/src/conf/ucm/bytcr-rt5651/HiFi.conf
index fd878f4a..54c365d9 100644
--- a/src/conf/ucm/bytcr-rt5651/HiFi.conf
+++ b/src/conf/ucm/bytcr-rt5651/HiFi.conf
@@ -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"
+	}
+}
-- 
2.18.0

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH v2 09/13] conf/ucm: bytcr-rt5651: Split into 1 .conf file per input / output
  2018-08-08  9:05 [PATCH v2 01/13] conf/ucm: bytcr-rt5645: Use the generic bytcr/PlatformEnableSeq.conf Hans de Goede
                   ` (6 preceding siblings ...)
  2018-08-08  9:05 ` [PATCH v2 08/13] conf/ucm: bytcr-rt5651: Add support for mic input on various pins Hans de Goede
@ 2018-08-08  9:05 ` Hans de Goede
  2018-08-08  9:05 ` [PATCH v2 10/13] conf/ucm: bytcr-rt5651: Add mono speaker output profile Hans de Goede
                   ` (6 subsequent siblings)
  14 siblings, 0 replies; 31+ messages in thread
From: Hans de Goede @ 2018-08-08  9:05 UTC (permalink / raw)
  To: alsa-devel; +Cc: Takashi Iwai, Hans de Goede, Pierre-Louis Bossart

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.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 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

diff --git a/src/conf/ucm/bytcr-rt5651/HiFi.conf b/src/conf/ucm/bytcr-rt5651/HiFi.conf
index 54c365d9..961b2604 100644
--- a/src/conf/ucm/bytcr-rt5651/HiFi.conf
+++ b/src/conf/ucm/bytcr-rt5651/HiFi.conf
@@ -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>
diff --git a/src/conf/ucm/rt5651/HeadPhones.conf b/src/conf/ucm/rt5651/HeadPhones.conf
new file mode 100644
index 00000000..b9323a36
--- /dev/null
+++ b/src/conf/ucm/rt5651/HeadPhones.conf
@@ -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"
+	}
+}
diff --git a/src/conf/ucm/rt5651/IN1-InternalMic.conf b/src/conf/ucm/rt5651/IN1-InternalMic.conf
new file mode 100644
index 00000000..85e25a5c
--- /dev/null
+++ b/src/conf/ucm/rt5651/IN1-InternalMic.conf
@@ -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"
+	}
+}
diff --git a/src/conf/ucm/rt5651/IN12-InternalMic.conf b/src/conf/ucm/rt5651/IN12-InternalMic.conf
new file mode 100644
index 00000000..f1cc17fe
--- /dev/null
+++ b/src/conf/ucm/rt5651/IN12-InternalMic.conf
@@ -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"
+	}
+}
diff --git a/src/conf/ucm/rt5651/IN2-InternalMic.conf b/src/conf/ucm/rt5651/IN2-InternalMic.conf
new file mode 100644
index 00000000..18f74e1a
--- /dev/null
+++ b/src/conf/ucm/rt5651/IN2-InternalMic.conf
@@ -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"
+	}
+}
diff --git a/src/conf/ucm/rt5651/IN3-HeadsetMic.conf b/src/conf/ucm/rt5651/IN3-HeadsetMic.conf
new file mode 100644
index 00000000..bfd0b009
--- /dev/null
+++ b/src/conf/ucm/rt5651/IN3-HeadsetMic.conf
@@ -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"
+	}
+}
diff --git a/src/conf/ucm/rt5651/Makefile.am b/src/conf/ucm/rt5651/Makefile.am
index 8a22159c..abd45ad7 100644
--- a/src/conf/ucm/rt5651/Makefile.am
+++ b/src/conf/ucm/rt5651/Makefile.am
@@ -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)
diff --git a/src/conf/ucm/rt5651/Speaker.conf b/src/conf/ucm/rt5651/Speaker.conf
new file mode 100644
index 00000000..44168cc5
--- /dev/null
+++ b/src/conf/ucm/rt5651/Speaker.conf
@@ -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"
+	}
+}
-- 
2.18.0

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH v2 10/13] conf/ucm: bytcr-rt5651: Add mono speaker output profile
  2018-08-08  9:05 [PATCH v2 01/13] conf/ucm: bytcr-rt5645: Use the generic bytcr/PlatformEnableSeq.conf Hans de Goede
                   ` (7 preceding siblings ...)
  2018-08-08  9:05 ` [PATCH v2 09/13] conf/ucm: bytcr-rt5651: Split into 1 .conf file per input / output Hans de Goede
@ 2018-08-08  9:05 ` Hans de Goede
  2018-08-08  9:05 ` [PATCH v2 11/13] conf/ucm: bytcr-rt5651: Add long-name UCM profiles Hans de Goede
                   ` (5 subsequent siblings)
  14 siblings, 0 replies; 31+ messages in thread
From: Hans de Goede @ 2018-08-08  9:05 UTC (permalink / raw)
  To: alsa-devel; +Cc: Takashi Iwai, Hans de Goede, Pierre-Louis Bossart

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.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 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%)

diff --git a/src/conf/ucm/bytcr-rt5651/HiFi.conf b/src/conf/ucm/bytcr-rt5651/HiFi.conf
index 961b2604..8733403c 100644
--- a/src/conf/ucm/bytcr-rt5651/HiFi.conf
+++ b/src/conf/ucm/bytcr-rt5651/HiFi.conf
@@ -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>
diff --git a/src/conf/ucm/rt5651/EnableSeq.conf b/src/conf/ucm/rt5651/EnableSeq.conf
index 37bffecb..6fb3c1f2 100644
--- a/src/conf/ucm/rt5651/EnableSeq.conf
+++ b/src/conf/ucm/rt5651/EnableSeq.conf
@@ -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"
diff --git a/src/conf/ucm/rt5651/HeadPhones.conf b/src/conf/ucm/rt5651/HeadPhones.conf
index b9323a36..eaf5fdfc 100644
--- a/src/conf/ucm/rt5651/HeadPhones.conf
+++ b/src/conf/ucm/rt5651/HeadPhones.conf
@@ -3,6 +3,7 @@ SectionDevice."Headphones" {
 
 	ConflictingDevice [
 		"Speaker"
+		"MonoSpeaker"
 	]
 
 	EnableSequence [
diff --git a/src/conf/ucm/rt5651/Makefile.am b/src/conf/ucm/rt5651/Makefile.am
index abd45ad7..a9600ed6 100644
--- a/src/conf/ucm/rt5651/Makefile.am
+++ b/src/conf/ucm/rt5651/Makefile.am
@@ -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)
diff --git a/src/conf/ucm/rt5651/Speaker.conf b/src/conf/ucm/rt5651/MonoSpeaker.conf
similarity index 52%
copy from src/conf/ucm/rt5651/Speaker.conf
copy to src/conf/ucm/rt5651/MonoSpeaker.conf
index 44168cc5..0c3492fb 100644
--- a/src/conf/ucm/rt5651/Speaker.conf
+++ b/src/conf/ucm/rt5651/MonoSpeaker.conf
@@ -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 {
diff --git a/src/conf/ucm/rt5651/Speaker.conf b/src/conf/ucm/rt5651/Speaker.conf
index 44168cc5..c1091523 100644
--- a/src/conf/ucm/rt5651/Speaker.conf
+++ b/src/conf/ucm/rt5651/Speaker.conf
@@ -2,6 +2,7 @@ SectionDevice."Speaker" {
 	Comment "Speakers"
 
 	ConflictingDevice [
+		"MonoSpeaker"
 		"Headphones"
 	]
 
-- 
2.18.0

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH v2 11/13] conf/ucm: bytcr-rt5651: Add long-name UCM profiles
  2018-08-08  9:05 [PATCH v2 01/13] conf/ucm: bytcr-rt5645: Use the generic bytcr/PlatformEnableSeq.conf Hans de Goede
                   ` (8 preceding siblings ...)
  2018-08-08  9:05 ` [PATCH v2 10/13] conf/ucm: bytcr-rt5651: Add mono speaker output profile Hans de Goede
@ 2018-08-08  9:05 ` Hans de Goede
  2018-08-08  9:05 ` [PATCH v2 12/13] conf/ucm: bytcr-rt5651: Add bytcr-rt5651-mono-spk-in2-mic-hp-swapped config Hans de Goede
                   ` (4 subsequent siblings)
  14 siblings, 0 replies; 31+ messages in thread
From: Hans de Goede @ 2018-08-08  9:05 UTC (permalink / raw)
  To: alsa-devel; +Cc: Takashi Iwai, Hans de Goede, Pierre-Louis Bossart

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.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 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

diff --git a/configure.ac b/configure.ac
index 85a6be80..9fb7218c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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 \
diff --git a/src/conf/ucm/Makefile.am b/src/conf/ucm/Makefile.am
index 669e98d5..1246e7ae 100644
--- a/src/conf/ucm/Makefile.am
+++ b/src/conf/ucm/Makefile.am
@@ -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 \
diff --git a/src/conf/ucm/bytcr-rt5651-mono-spk-in1-mic/HiFi.conf b/src/conf/ucm/bytcr-rt5651-mono-spk-in1-mic/HiFi.conf
new file mode 100644
index 00000000..dd5b35fc
--- /dev/null
+++ b/src/conf/ucm/bytcr-rt5651-mono-spk-in1-mic/HiFi.conf
@@ -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>
diff --git a/src/conf/ucm/bytcr-rt5651-mono-spk-in1-mic/Makefile.am b/src/conf/ucm/bytcr-rt5651-mono-spk-in1-mic/Makefile.am
new file mode 100644
index 00000000..3c5ad289
--- /dev/null
+++ b/src/conf/ucm/bytcr-rt5651-mono-spk-in1-mic/Makefile.am
@@ -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)
diff --git a/src/conf/ucm/bytcr-rt5651-mono-spk-in1-mic/bytcr-rt5651-mono-spk-in1-mic.conf b/src/conf/ucm/bytcr-rt5651-mono-spk-in1-mic/bytcr-rt5651-mono-spk-in1-mic.conf
new file mode 100644
index 00000000..a2f584e8
--- /dev/null
+++ b/src/conf/ucm/bytcr-rt5651-mono-spk-in1-mic/bytcr-rt5651-mono-spk-in1-mic.conf
@@ -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"
+]
diff --git a/src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic/HiFi.conf b/src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic/HiFi.conf
new file mode 100644
index 00000000..9f56c077
--- /dev/null
+++ b/src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic/HiFi.conf
@@ -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>
diff --git a/src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic/Makefile.am b/src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic/Makefile.am
new file mode 100644
index 00000000..38ee13b9
--- /dev/null
+++ b/src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic/Makefile.am
@@ -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)
diff --git a/src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic/bytcr-rt5651-mono-spk-in2-mic.conf b/src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic/bytcr-rt5651-mono-spk-in2-mic.conf
new file mode 100644
index 00000000..4ad36ec3
--- /dev/null
+++ b/src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic/bytcr-rt5651-mono-spk-in2-mic.conf
@@ -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"
+]
diff --git a/src/conf/ucm/bytcr-rt5651-stereo-spk-in1-mic/HiFi.conf b/src/conf/ucm/bytcr-rt5651-stereo-spk-in1-mic/HiFi.conf
new file mode 100644
index 00000000..e2a579ab
--- /dev/null
+++ b/src/conf/ucm/bytcr-rt5651-stereo-spk-in1-mic/HiFi.conf
@@ -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>
diff --git a/src/conf/ucm/bytcr-rt5651-stereo-spk-in1-mic/Makefile.am b/src/conf/ucm/bytcr-rt5651-stereo-spk-in1-mic/Makefile.am
new file mode 100644
index 00000000..40691994
--- /dev/null
+++ b/src/conf/ucm/bytcr-rt5651-stereo-spk-in1-mic/Makefile.am
@@ -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)
diff --git a/src/conf/ucm/bytcr-rt5651-stereo-spk-in1-mic/bytcr-rt5651-stereo-spk-in1-mic.conf b/src/conf/ucm/bytcr-rt5651-stereo-spk-in1-mic/bytcr-rt5651-stereo-spk-in1-mic.conf
new file mode 100644
index 00000000..40d871be
--- /dev/null
+++ b/src/conf/ucm/bytcr-rt5651-stereo-spk-in1-mic/bytcr-rt5651-stereo-spk-in1-mic.conf
@@ -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"
+]
diff --git a/src/conf/ucm/bytcr-rt5651-stereo-spk-in12-mic/HiFi.conf b/src/conf/ucm/bytcr-rt5651-stereo-spk-in12-mic/HiFi.conf
new file mode 100644
index 00000000..ae52e719
--- /dev/null
+++ b/src/conf/ucm/bytcr-rt5651-stereo-spk-in12-mic/HiFi.conf
@@ -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>
diff --git a/src/conf/ucm/bytcr-rt5651-stereo-spk-in12-mic/Makefile.am b/src/conf/ucm/bytcr-rt5651-stereo-spk-in12-mic/Makefile.am
new file mode 100644
index 00000000..12514945
--- /dev/null
+++ b/src/conf/ucm/bytcr-rt5651-stereo-spk-in12-mic/Makefile.am
@@ -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)
diff --git a/src/conf/ucm/bytcr-rt5651-stereo-spk-in12-mic/bytcr-rt5651-stereo-spk-in12-mic.conf b/src/conf/ucm/bytcr-rt5651-stereo-spk-in12-mic/bytcr-rt5651-stereo-spk-in12-mic.conf
new file mode 100644
index 00000000..56bf3f07
--- /dev/null
+++ b/src/conf/ucm/bytcr-rt5651-stereo-spk-in12-mic/bytcr-rt5651-stereo-spk-in12-mic.conf
@@ -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"
+]
diff --git a/src/conf/ucm/bytcr-rt5651-stereo-spk-in2-mic/HiFi.conf b/src/conf/ucm/bytcr-rt5651-stereo-spk-in2-mic/HiFi.conf
new file mode 100644
index 00000000..a73ff5f8
--- /dev/null
+++ b/src/conf/ucm/bytcr-rt5651-stereo-spk-in2-mic/HiFi.conf
@@ -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>
diff --git a/src/conf/ucm/bytcr-rt5651-stereo-spk-in2-mic/Makefile.am b/src/conf/ucm/bytcr-rt5651-stereo-spk-in2-mic/Makefile.am
new file mode 100644
index 00000000..9b06afd1
--- /dev/null
+++ b/src/conf/ucm/bytcr-rt5651-stereo-spk-in2-mic/Makefile.am
@@ -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)
diff --git a/src/conf/ucm/bytcr-rt5651-stereo-spk-in2-mic/bytcr-rt5651-stereo-spk-in2-mic.conf b/src/conf/ucm/bytcr-rt5651-stereo-spk-in2-mic/bytcr-rt5651-stereo-spk-in2-mic.conf
new file mode 100644
index 00000000..84e86e42
--- /dev/null
+++ b/src/conf/ucm/bytcr-rt5651-stereo-spk-in2-mic/bytcr-rt5651-stereo-spk-in2-mic.conf
@@ -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"
+]
-- 
2.18.0

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH v2 12/13] conf/ucm: bytcr-rt5651: Add bytcr-rt5651-mono-spk-in2-mic-hp-swapped config
  2018-08-08  9:05 [PATCH v2 01/13] conf/ucm: bytcr-rt5645: Use the generic bytcr/PlatformEnableSeq.conf Hans de Goede
                   ` (9 preceding siblings ...)
  2018-08-08  9:05 ` [PATCH v2 11/13] conf/ucm: bytcr-rt5651: Add long-name UCM profiles Hans de Goede
@ 2018-08-08  9:05 ` Hans de Goede
  2018-08-08  9:05 ` [PATCH v2 13/13] conf/ucm: bytcr-rt5640: Improve human readable input/output names Hans de Goede
                   ` (3 subsequent siblings)
  14 siblings, 0 replies; 31+ messages in thread
From: Hans de Goede @ 2018-08-08  9:05 UTC (permalink / raw)
  To: alsa-devel; +Cc: Takashi Iwai, Hans de Goede, Pierre-Louis Bossart

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.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 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

diff --git a/configure.ac b/configure.ac
index 9fb7218c..97d61abd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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 \
diff --git a/src/conf/ucm/Makefile.am b/src/conf/ucm/Makefile.am
index 1246e7ae..7cdc6176 100644
--- a/src/conf/ucm/Makefile.am
+++ b/src/conf/ucm/Makefile.am
@@ -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 \
diff --git a/src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic-hp-swapped/HiFi.conf b/src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic-hp-swapped/HiFi.conf
new file mode 100644
index 00000000..777ed783
--- /dev/null
+++ b/src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic-hp-swapped/HiFi.conf
@@ -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>
diff --git a/src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic-hp-swapped/Makefile.am b/src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic-hp-swapped/Makefile.am
new file mode 100644
index 00000000..862d38b9
--- /dev/null
+++ b/src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic-hp-swapped/Makefile.am
@@ -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)
diff --git a/src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic-hp-swapped/bytcr-rt5651-mono-spk-in2-mic-hp-swapped.conf b/src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic-hp-swapped/bytcr-rt5651-mono-spk-in2-mic-hp-swapped.conf
new file mode 100644
index 00000000..916fbc19
--- /dev/null
+++ b/src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic-hp-swapped/bytcr-rt5651-mono-spk-in2-mic-hp-swapped.conf
@@ -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"
+]
diff --git a/src/conf/ucm/rt5651/HeadPhones-swapped.conf b/src/conf/ucm/rt5651/HeadPhones-swapped.conf
new file mode 100644
index 00000000..e79b40a7
--- /dev/null
+++ b/src/conf/ucm/rt5651/HeadPhones-swapped.conf
@@ -0,0 +1,42 @@
+SectionDevice."Headphones" {
+	Comment "Headphones"
+
+	ConflictingDevice [
+		"Speaker"
+		"MonoSpeaker"
+	]
+
+	EnableSequence [
+		cdev "hw:bytcrrt5651"
+
+		# Swap left and right
+		cset "name='Stereo DAC MIXL DAC R1 Switch' on"
+		cset "name='Stereo DAC MIXL DAC L1 Switch' off"
+		cset "name='Stereo DAC MIXR DAC L1 Switch' on"
+		cset "name='Stereo DAC MIXR DAC R1 Switch' off"
+
+		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"
+		# Disabling the HP switches is done by the Speaker EnableSeq
+
+		# Unswap left and right
+		cset "name='Stereo DAC MIXL DAC L1 Switch' on"
+		cset "name='Stereo DAC MIXL DAC R1 Switch' off"
+		cset "name='Stereo DAC MIXR DAC R1 Switch' on"
+		cset "name='Stereo DAC MIXR DAC L1 Switch' off"
+	]
+
+	Value {
+		PlaybackChannels "2"
+		JackControl "Headphone Jack"
+	}
+}
diff --git a/src/conf/ucm/rt5651/Makefile.am b/src/conf/ucm/rt5651/Makefile.am
index a9600ed6..acc8ea49 100644
--- a/src/conf/ucm/rt5651/Makefile.am
+++ b/src/conf/ucm/rt5651/Makefile.am
@@ -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)
-- 
2.18.0

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH v2 13/13] conf/ucm: bytcr-rt5640: Improve human readable input/output names
  2018-08-08  9:05 [PATCH v2 01/13] conf/ucm: bytcr-rt5645: Use the generic bytcr/PlatformEnableSeq.conf Hans de Goede
                   ` (10 preceding siblings ...)
  2018-08-08  9:05 ` [PATCH v2 12/13] conf/ucm: bytcr-rt5651: Add bytcr-rt5651-mono-spk-in2-mic-hp-swapped config Hans de Goede
@ 2018-08-08  9:05 ` Hans de Goede
  2018-08-08  9:46 ` [PATCH v2 01/13] conf/ucm: bytcr-rt5645: Use the generic bytcr/PlatformEnableSeq.conf Jaroslav Kysela
                   ` (2 subsequent siblings)
  14 siblings, 0 replies; 31+ messages in thread
From: Hans de Goede @ 2018-08-08  9:05 UTC (permalink / raw)
  To: alsa-devel; +Cc: Takashi Iwai, Hans de Goede, Pierre-Louis Bossart

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.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 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(-)

diff --git a/src/conf/ucm/rt5640/DigitalMics.conf b/src/conf/ucm/rt5640/DigitalMics.conf
index c7d54099..06b42f16 100644
--- a/src/conf/ucm/rt5640/DigitalMics.conf
+++ b/src/conf/ucm/rt5640/DigitalMics.conf
@@ -1,5 +1,5 @@
 SectionDevice."DigitalMics" {
-	Comment "DigitalMics capture"
+	Comment "Internal Digital Microphones"
 
 	ConflictingDevice [
 		"IN1-InternalMics"
diff --git a/src/conf/ucm/rt5640/HeadPhones.conf b/src/conf/ucm/rt5640/HeadPhones.conf
index 0e7149e5..38f37a6f 100644
--- a/src/conf/ucm/rt5640/HeadPhones.conf
+++ b/src/conf/ucm/rt5640/HeadPhones.conf
@@ -1,5 +1,5 @@
 SectionDevice."Headphones" {
-	Comment "Headphones playback"
+	Comment "Headphones"
 
 	ConflictingDevice [
 		"Speaker"
diff --git a/src/conf/ucm/rt5640/HeadsetMic.conf b/src/conf/ucm/rt5640/HeadsetMic.conf
index 4d54eed0..567d4122 100644
--- a/src/conf/ucm/rt5640/HeadsetMic.conf
+++ b/src/conf/ucm/rt5640/HeadsetMic.conf
@@ -1,5 +1,5 @@
 SectionDevice."HeadsetMic" {
-	Comment "Headset Mic capture"
+	Comment "Headset Microphone"
 
 	ConflictingDevice [
 		"IN1-InternalMics"
diff --git a/src/conf/ucm/rt5640/IN1-InternalMic.conf b/src/conf/ucm/rt5640/IN1-InternalMic.conf
index d18c21db..3bf31e64 100644
--- a/src/conf/ucm/rt5640/IN1-InternalMic.conf
+++ b/src/conf/ucm/rt5640/IN1-InternalMic.conf
@@ -1,5 +1,5 @@
 SectionDevice."IN1-InternalMics" {
-	Comment "Internal IN1 analog Mic capture"
+	Comment "Internal Microphone on IN1"
 
 	ConflictingDevice [
 		"DigitalMics"
diff --git a/src/conf/ucm/rt5640/IN3-InternalMic.conf b/src/conf/ucm/rt5640/IN3-InternalMic.conf
index 17d85229..e1a6c49b 100644
--- a/src/conf/ucm/rt5640/IN3-InternalMic.conf
+++ b/src/conf/ucm/rt5640/IN3-InternalMic.conf
@@ -1,5 +1,5 @@
 SectionDevice."IN3-InternalMics" {
-	Comment "Internal IN3 analog Mic capture"
+	Comment "Internal Microphone on IN3"
 
 	ConflictingDevice [
 		"DigitalMics"
diff --git a/src/conf/ucm/rt5640/MonoSpeaker.conf b/src/conf/ucm/rt5640/MonoSpeaker.conf
index 0fb54030..58ab7807 100644
--- a/src/conf/ucm/rt5640/MonoSpeaker.conf
+++ b/src/conf/ucm/rt5640/MonoSpeaker.conf
@@ -1,5 +1,5 @@
 SectionDevice."MonoSpeaker" {
-	Comment "MonoSpeaker playback"
+	Comment "Mono Speaker"
 
 	ConflictingDevice [
 		"Headphones"
diff --git a/src/conf/ucm/rt5640/Speaker.conf b/src/conf/ucm/rt5640/Speaker.conf
index b745ed06..a7df9fbf 100644
--- a/src/conf/ucm/rt5640/Speaker.conf
+++ b/src/conf/ucm/rt5640/Speaker.conf
@@ -1,5 +1,5 @@
 SectionDevice."Speaker" {
-	Comment "Speaker playback"
+	Comment "Speakers"
 
 	ConflictingDevice [
 		"Headphones"
-- 
2.18.0

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* Re: [PATCH v2 01/13] conf/ucm: bytcr-rt5645: Use the generic bytcr/PlatformEnableSeq.conf
  2018-08-08  9:05 [PATCH v2 01/13] conf/ucm: bytcr-rt5645: Use the generic bytcr/PlatformEnableSeq.conf Hans de Goede
                   ` (11 preceding siblings ...)
  2018-08-08  9:05 ` [PATCH v2 13/13] conf/ucm: bytcr-rt5640: Improve human readable input/output names Hans de Goede
@ 2018-08-08  9:46 ` Jaroslav Kysela
  2018-11-25 11:11 ` youling257
  2018-11-26  9:49 ` youling257
  14 siblings, 0 replies; 31+ messages in thread
From: Jaroslav Kysela @ 2018-08-08  9:46 UTC (permalink / raw)
  To: Hans de Goede, alsa-devel; +Cc: Takashi Iwai, Pierre-Louis Bossart

Dne 8.8.2018 v 11:05 Hans de Goede napsal(a):
> Use the generic Intel SSP bytcr/PlatformEnableSeq.conf file, it is
> identical to all the cset statements this commit removes.
> 
> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
>  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

-- 
Jaroslav Kysela <perex@perex.cz>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH v2 01/13] conf/ucm: bytcr-rt5645: Use the generic bytcr/PlatformEnableSeq.conf
  2018-08-08  9:05 [PATCH v2 01/13] conf/ucm: bytcr-rt5645: Use the generic bytcr/PlatformEnableSeq.conf Hans de Goede
                   ` (12 preceding siblings ...)
  2018-08-08  9:46 ` [PATCH v2 01/13] conf/ucm: bytcr-rt5645: Use the generic bytcr/PlatformEnableSeq.conf Jaroslav Kysela
@ 2018-11-25 11:11 ` youling257
  2018-11-26  8:25   ` Takashi Iwai
  2018-11-26  9:49 ` youling257
  14 siblings, 1 reply; 31+ messages in thread
From: youling257 @ 2018-11-25 11:11 UTC (permalink / raw)
  To: alsa-devel; +Cc: tiwai, hdegoede, pierre-louis.bossart

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

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH v2 01/13] conf/ucm: bytcr-rt5645: Use the generic bytcr/PlatformEnableSeq.conf
  2018-11-25 11:11 ` youling257
@ 2018-11-26  8:25   ` Takashi Iwai
  2018-11-26  9:37     ` youling 257
  0 siblings, 1 reply; 31+ messages in thread
From: Takashi Iwai @ 2018-11-26  8:25 UTC (permalink / raw)
  To: youling257; +Cc: hdegoede, alsa-devel, pierre-louis.bossart

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

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH v2 01/13] conf/ucm: bytcr-rt5645: Use the generic bytcr/PlatformEnableSeq.conf
  2018-11-26  8:25   ` Takashi Iwai
@ 2018-11-26  9:37     ` youling 257
  0 siblings, 0 replies; 31+ messages in thread
From: youling 257 @ 2018-11-26  9:37 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: hdegoede, alsa-devel, pierre-louis.bossart

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.

Takashi Iwai <tiwai@suse.de> 于 2018年11月26日周一 下午4:25写道:

> 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
>
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH v2 01/13] conf/ucm: bytcr-rt5645: Use the generic bytcr/PlatformEnableSeq.conf
  2018-08-08  9:05 [PATCH v2 01/13] conf/ucm: bytcr-rt5645: Use the generic bytcr/PlatformEnableSeq.conf Hans de Goede
                   ` (13 preceding siblings ...)
  2018-11-25 11:11 ` youling257
@ 2018-11-26  9:49 ` youling257
  2018-11-26 10:07   ` Takashi Iwai
  14 siblings, 1 reply; 31+ messages in thread
From: youling257 @ 2018-11-26  9:49 UTC (permalink / raw)
  To: alsa-devel; +Cc: tiwai, hdegoede, pierre-louis.bossart

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.

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH v2 01/13] conf/ucm: bytcr-rt5645: Use the generic bytcr/PlatformEnableSeq.conf
  2018-11-26  9:49 ` youling257
@ 2018-11-26 10:07   ` Takashi Iwai
  2018-11-26 13:40     ` Hans de Goede
  0 siblings, 1 reply; 31+ messages in thread
From: Takashi Iwai @ 2018-11-26 10:07 UTC (permalink / raw)
  To: youling257; +Cc: hdegoede, alsa-devel, pierre-louis.bossart

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.

> 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

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH v2 01/13] conf/ucm: bytcr-rt5645: Use the generic bytcr/PlatformEnableSeq.conf
  2018-11-26 10:07   ` Takashi Iwai
@ 2018-11-26 13:40     ` Hans de Goede
  2018-11-26 14:18       ` Takashi Iwai
                         ` (3 more replies)
  0 siblings, 4 replies; 31+ messages in thread
From: Hans de Goede @ 2018-11-26 13:40 UTC (permalink / raw)
  To: Takashi Iwai, youling257; +Cc: alsa-devel, pierre-louis.bossart

Hi,

On 26-11-18 11:07, Takashi Iwai wrote:
> 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:

 > 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.
 >
 > 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

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH v2 01/13] conf/ucm: bytcr-rt5645: Use the generic bytcr/PlatformEnableSeq.conf
  2018-11-26 13:40     ` Hans de Goede
@ 2018-11-26 14:18       ` Takashi Iwai
  2018-11-26 15:28         ` Jaroslav Kysela
  2018-11-28  2:53       ` youling 257
                         ` (2 subsequent siblings)
  3 siblings, 1 reply; 31+ messages in thread
From: Takashi Iwai @ 2018-11-26 14:18 UTC (permalink / raw)
  To: Hans de Goede; +Cc: youling257, alsa-devel, pierre-louis.bossart

On Mon, 26 Nov 2018 14:40:48 +0100,
Hans de Goede wrote:
> 
> > 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.
> >
> > 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>

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


Thanks!

Takashi

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH v2 01/13] conf/ucm: bytcr-rt5645: Use the generic bytcr/PlatformEnableSeq.conf
  2018-11-26 14:18       ` Takashi Iwai
@ 2018-11-26 15:28         ` Jaroslav Kysela
  2018-11-26 17:20           ` Pierre-Louis Bossart
  0 siblings, 1 reply; 31+ messages in thread
From: Jaroslav Kysela @ 2018-11-26 15:28 UTC (permalink / raw)
  To: Takashi Iwai, Hans de Goede; +Cc: youling257, alsa-devel, pierre-louis.bossart

Dne 26.11.2018 v 15:18 Takashi Iwai napsal(a):
> On Mon, 26 Nov 2018 14:40:48 +0100,
> Hans de Goede wrote:
>>
>>> 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.
>>>
>>> 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>
> 
> 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

-- 
Jaroslav Kysela <perex@perex.cz>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH v2 01/13] conf/ucm: bytcr-rt5645: Use the generic bytcr/PlatformEnableSeq.conf
  2018-11-26 15:28         ` Jaroslav Kysela
@ 2018-11-26 17:20           ` Pierre-Louis Bossart
  2018-11-27 13:08             ` Takashi Iwai
  0 siblings, 1 reply; 31+ messages in thread
From: Pierre-Louis Bossart @ 2018-11-26 17:20 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai, Hans de Goede; +Cc: youling257, alsa-devel


On 11/26/18 9:28 AM, Jaroslav Kysela wrote:
> Dne 26.11.2018 v 15:18 Takashi Iwai napsal(a):
>> On Mon, 26 Nov 2018 14:40:48 +0100,
>> Hans de Goede wrote:
>>>> 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.
>>>>
>>>> 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>
>> 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

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH v2 01/13] conf/ucm: bytcr-rt5645: Use the generic bytcr/PlatformEnableSeq.conf
  2018-11-26 17:20           ` Pierre-Louis Bossart
@ 2018-11-27 13:08             ` Takashi Iwai
  2018-11-27 17:08               ` Pierre-Louis Bossart
  0 siblings, 1 reply; 31+ messages in thread
From: Takashi Iwai @ 2018-11-27 13:08 UTC (permalink / raw)
  To: Pierre-Louis Bossart; +Cc: Hans de Goede, youling257, alsa-devel

On Mon, 26 Nov 2018 18:20:41 +0100,
Pierre-Louis Bossart wrote:
> 
> 
> On 11/26/18 9:28 AM, Jaroslav Kysela wrote:
> > Dne 26.11.2018 v 15:18 Takashi Iwai napsal(a):
> >> On Mon, 26 Nov 2018 14:40:48 +0100,
> >> Hans de Goede wrote:
> >>>> 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.
> >>>>
> >>>> 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>
> >> 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.


> 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.

A good point, it should be suppressed.

> 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.

> - 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

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH v2 01/13] conf/ucm: bytcr-rt5645: Use the generic bytcr/PlatformEnableSeq.conf
  2018-11-27 13:08             ` Takashi Iwai
@ 2018-11-27 17:08               ` Pierre-Louis Bossart
  2018-11-27 17:12                 ` Takashi Iwai
  0 siblings, 1 reply; 31+ messages in thread
From: Pierre-Louis Bossart @ 2018-11-27 17:08 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: Hans de Goede, youling257, alsa-devel


>> - 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.

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.

>
>> - 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.

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH v2 01/13] conf/ucm: bytcr-rt5645: Use the generic bytcr/PlatformEnableSeq.conf
  2018-11-27 17:08               ` Pierre-Louis Bossart
@ 2018-11-27 17:12                 ` Takashi Iwai
  2018-11-28  4:35                   ` youling 257
  0 siblings, 1 reply; 31+ messages in thread
From: Takashi Iwai @ 2018-11-27 17:12 UTC (permalink / raw)
  To: Pierre-Louis Bossart; +Cc: Hans de Goede, youling257, alsa-devel

On Tue, 27 Nov 2018 18:08:30 +0100,
Pierre-Louis Bossart wrote:
> 
> 
> >> - 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.
> 
> I think we should have UCM and topology files in the same repo since
> they are related (control names, etc).

OK, makes sense.

> 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.

> >
> >> - 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.

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

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH v2 01/13] conf/ucm: bytcr-rt5645: Use the generic bytcr/PlatformEnableSeq.conf
  2018-11-26 13:40     ` Hans de Goede
  2018-11-26 14:18       ` Takashi Iwai
@ 2018-11-28  2:53       ` youling 257
  2018-11-28  3:04       ` youling 257
  2018-11-28  3:27       ` youling 257
  3 siblings, 0 replies; 31+ messages in thread
From: youling 257 @ 2018-11-28  2:53 UTC (permalink / raw)
  To: Hans de Goede; +Cc: Takashi Iwai, alsa-devel, Pierre-Louis Bossart

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 ?
Hans de Goede <hdegoede@redhat.com> 于2018年11月26日周一 下午9:40写道:
>
> Hi,
>
> On 26-11-18 11:07, Takashi Iwai wrote:
> > 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:
>
>  > 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.
>  >
>  > 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
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH v2 01/13] conf/ucm: bytcr-rt5645: Use the generic bytcr/PlatformEnableSeq.conf
  2018-11-26 13:40     ` Hans de Goede
  2018-11-26 14:18       ` Takashi Iwai
  2018-11-28  2:53       ` youling 257
@ 2018-11-28  3:04       ` youling 257
  2018-11-28  3:27       ` youling 257
  3 siblings, 0 replies; 31+ messages in thread
From: youling 257 @ 2018-11-28  3:04 UTC (permalink / raw)
  To: Hans de Goede; +Cc: Takashi Iwai, alsa-devel, Pierre-Louis Bossart

why not i use this command, speaker also work on x205ta.
alsaucm -c chtrt5645-mono-speaker-analog-mic set _verb HiFi set _enadev Speaker
Hans de Goede <hdegoede@redhat.com> 于2018年11月26日周一 下午9:40写道:
>
> Hi,
>
> On 26-11-18 11:07, Takashi Iwai wrote:
> > 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:
>
>  > 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.
>  >
>  > 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
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH v2 01/13] conf/ucm: bytcr-rt5645: Use the generic bytcr/PlatformEnableSeq.conf
  2018-11-26 13:40     ` Hans de Goede
                         ` (2 preceding siblings ...)
  2018-11-28  3:04       ` youling 257
@ 2018-11-28  3:27       ` youling 257
  3 siblings, 0 replies; 31+ messages in thread
From: youling 257 @ 2018-11-28  3:27 UTC (permalink / raw)
  To: Hans de Goede; +Cc: Takashi Iwai, alsa-devel, Pierre-Louis Bossart

/src/conf/ucm/chtrt5645/HiFi.conf missed <searchdir:ucm>, now, should
add <searchdir:ucm-includes>.
Hans de Goede <hdegoede@redhat.com> 于2018年11月26日周一 下午9:40写道:
>
> Hi,
>
> On 26-11-18 11:07, Takashi Iwai wrote:
> > 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:
>
>  > 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.
>  >
>  > 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
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH v2 01/13] conf/ucm: bytcr-rt5645: Use the generic bytcr/PlatformEnableSeq.conf
  2018-11-27 17:12                 ` Takashi Iwai
@ 2018-11-28  4:35                   ` youling 257
  2018-11-28  9:51                     ` Takashi Iwai
  0 siblings, 1 reply; 31+ messages in thread
From: youling 257 @ 2018-11-28  4:35 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: Hans de Goede, alsa-devel, Pierre-Louis Bossart

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

Takashi Iwai <tiwai@suse.de> 于2018年11月28日周三 上午1:12写道:
>
> On Tue, 27 Nov 2018 18:08:30 +0100,
> Pierre-Louis Bossart wrote:
> >
> >
> > >> - 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.
> >
> > I think we should have UCM and topology files in the same repo since
> > they are related (control names, etc).
>
> OK, makes sense.
>
> > 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.
>
> > >
> > >> - 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.
>
> 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
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH v2 01/13] conf/ucm: bytcr-rt5645: Use the generic bytcr/PlatformEnableSeq.conf
  2018-11-28  4:35                   ` youling 257
@ 2018-11-28  9:51                     ` Takashi Iwai
  0 siblings, 0 replies; 31+ messages in thread
From: Takashi Iwai @ 2018-11-28  9:51 UTC (permalink / raw)
  To: youling 257; +Cc: Hans de Goede, alsa-devel, Pierre-Louis Bossart

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

> 
> Takashi Iwai <tiwai@suse.de> 于2018年11月28日周三 上午1:12写道:
> >
> > On Tue, 27 Nov 2018 18:08:30 +0100,
> > Pierre-Louis Bossart wrote:
> > >
> > >
> > > >> - 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.
> > >
> > > I think we should have UCM and topology files in the same repo since
> > > they are related (control names, etc).
> >
> > OK, makes sense.
> >
> > > 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.
> >
> > > >
> > > >> - 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.
> >
> > 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
> 
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2018-11-28  9:51 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-08  9:05 [PATCH v2 01/13] conf/ucm: bytcr-rt5645: Use the generic bytcr/PlatformEnableSeq.conf Hans de Goede
2018-08-08  9:05 ` [PATCH v2 02/13] conf/ucm: bytcr-rt5651: Do not use both DAC1 and HPVOL inputs for HP Hans de Goede
2018-08-08  9:05 ` [PATCH v2 03/13] conf/ucm: bytcr-rt5651: Configure all volumes at 0dB Hans de Goede
2018-08-08  9:05 ` [PATCH v2 04/13] conf/ucm: bytcr-rt5651: Start with all outputs and inputs disabled Hans de Goede
2018-08-08  9:05 ` [PATCH v2 05/13] conf/ucm: bytcr-rt5651: Change Speaker/Headphone en/disable sequences to fix switching Hans de Goede
2018-08-08  9:05 ` [PATCH v2 06/13] conf/ucm: bytcr-rt5651: Use generic SSP enable + disable sequence, support SSP0 Hans de Goede
2018-08-08  9:05 ` [PATCH v2 07/13] conf/ucm: bytcr-rt5651: Fix ADC and Mic capture volumes Hans de Goede
2018-08-08  9:05 ` [PATCH v2 08/13] conf/ucm: bytcr-rt5651: Add support for mic input on various pins Hans de Goede
2018-08-08  9:05 ` [PATCH v2 09/13] conf/ucm: bytcr-rt5651: Split into 1 .conf file per input / output Hans de Goede
2018-08-08  9:05 ` [PATCH v2 10/13] conf/ucm: bytcr-rt5651: Add mono speaker output profile Hans de Goede
2018-08-08  9:05 ` [PATCH v2 11/13] conf/ucm: bytcr-rt5651: Add long-name UCM profiles Hans de Goede
2018-08-08  9:05 ` [PATCH v2 12/13] conf/ucm: bytcr-rt5651: Add bytcr-rt5651-mono-spk-in2-mic-hp-swapped config Hans de Goede
2018-08-08  9:05 ` [PATCH v2 13/13] conf/ucm: bytcr-rt5640: Improve human readable input/output names Hans de Goede
2018-08-08  9:46 ` [PATCH v2 01/13] conf/ucm: bytcr-rt5645: Use the generic bytcr/PlatformEnableSeq.conf Jaroslav Kysela
2018-11-25 11:11 ` youling257
2018-11-26  8:25   ` Takashi Iwai
2018-11-26  9:37     ` youling 257
2018-11-26  9:49 ` youling257
2018-11-26 10:07   ` Takashi Iwai
2018-11-26 13:40     ` Hans de Goede
2018-11-26 14:18       ` Takashi Iwai
2018-11-26 15:28         ` Jaroslav Kysela
2018-11-26 17:20           ` Pierre-Louis Bossart
2018-11-27 13:08             ` Takashi Iwai
2018-11-27 17:08               ` Pierre-Louis Bossart
2018-11-27 17:12                 ` Takashi Iwai
2018-11-28  4:35                   ` youling 257
2018-11-28  9:51                     ` Takashi Iwai
2018-11-28  2:53       ` youling 257
2018-11-28  3:04       ` youling 257
2018-11-28  3:27       ` youling 257

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.