All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/14] conf/ucm: bytcr-rt5651: Various improvements + long-name profiles addition
@ 2018-07-20  7:27 Hans de Goede
  2018-07-20  7:27 ` [PATCH 01/14] conf/ucm: bytcr-rt5645: Use the generic bytcr/PlatformEnableSeq.conf Hans de Goede
                   ` (14 more replies)
  0 siblings, 15 replies; 23+ messages in thread
From: Hans de Goede @ 2018-07-20  7:27 UTC (permalink / raw)
  To: alsa-devel; +Cc: Takashi Iwai, Hans de Goede, Pierre-Louis Bossart

Hi All,

Here is a set of patches to the bytcr-rt5651 UCM profiles. This series
also adds a bunch of long-name profiles so that users automatically
only see the inputs / outputs which their device actually has.

The long-names are based on the long-names set by the kernel after
the rt5651 patch series which is currently queued in -next:
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git/log/?h=for-next

With these UCM profile patches and the kernel changes in place all
inputs and outputs as well as jack-detect will work 100% OOTB on
supported bytcr-rt5651 devices, without the user needing to do any
manual config or mixer settings.

Regards,

Hans

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

* [PATCH 01/14] conf/ucm: bytcr-rt5645: Use the generic bytcr/PlatformEnableSeq.conf
  2018-07-20  7:27 [PATCH 00/14] conf/ucm: bytcr-rt5651: Various improvements + long-name profiles addition Hans de Goede
@ 2018-07-20  7:27 ` Hans de Goede
  2018-07-20  7:27 ` [PATCH 02/14] conf/ucm: bytcr-rt5651: Add support for boards using SSP0 Hans de Goede
                   ` (13 subsequent siblings)
  14 siblings, 0 replies; 23+ messages in thread
From: Hans de Goede @ 2018-07-20  7:27 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.

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

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

* [PATCH 02/14] conf/ucm: bytcr-rt5651: Add support for boards using SSP0
  2018-07-20  7:27 [PATCH 00/14] conf/ucm: bytcr-rt5651: Various improvements + long-name profiles addition Hans de Goede
  2018-07-20  7:27 ` [PATCH 01/14] conf/ucm: bytcr-rt5645: Use the generic bytcr/PlatformEnableSeq.conf Hans de Goede
@ 2018-07-20  7:27 ` Hans de Goede
  2018-07-20  7:27 ` [PATCH 03/14] conf/ucm: bytcr-rt5651: Do not use both DAC1 and HPVOL inputs for HP Hans de Goede
                   ` (12 subsequent siblings)
  14 siblings, 0 replies; 23+ messages in thread
From: Hans de Goede @ 2018-07-20  7:27 UTC (permalink / raw)
  To: alsa-devel; +Cc: Takashi Iwai, Hans de Goede, Pierre-Louis Bossart

Add support for bytcr-rt5651 boards using SSP0.

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

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 src/conf/ucm/bytcr-rt5651/bytcr-rt5651.conf | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/src/conf/ucm/bytcr-rt5651/bytcr-rt5651.conf b/src/conf/ucm/bytcr-rt5651/bytcr-rt5651.conf
index 069427b7..9efcafc0 100644
--- a/src/conf/ucm/bytcr-rt5651/bytcr-rt5651.conf
+++ b/src/conf/ucm/bytcr-rt5651/bytcr-rt5651.conf
@@ -34,7 +34,7 @@ SectionDefaults [
 	cset "name='pcm1_in Gain 0 Switch' off"
 	cset "name='pcm1_in Gain 0 Volume' 0%"
 
-	# codec0_out settings
+	# codec0_out settings used when SSP2 is connected
 	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"
@@ -45,11 +45,30 @@ SectionDefaults [
 	cset "name='codec_out0 Gain 0 Switch' on"
 	cset "name='codec_out0 Gain 0 Volume' 0"
 
+	# modem_out settings used when SSP0 is connected
+	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"
-- 
2.17.1

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

* [PATCH 03/14] conf/ucm: bytcr-rt5651: Do not use both DAC1 and HPVOL inputs for HP
  2018-07-20  7:27 [PATCH 00/14] conf/ucm: bytcr-rt5651: Various improvements + long-name profiles addition Hans de Goede
  2018-07-20  7:27 ` [PATCH 01/14] conf/ucm: bytcr-rt5645: Use the generic bytcr/PlatformEnableSeq.conf Hans de Goede
  2018-07-20  7:27 ` [PATCH 02/14] conf/ucm: bytcr-rt5651: Add support for boards using SSP0 Hans de Goede
@ 2018-07-20  7:27 ` Hans de Goede
  2018-07-20  7:27 ` [PATCH 04/14] conf/ucm: bytcr-rt5651: Configure all volumes at 0dB Hans de Goede
                   ` (11 subsequent siblings)
  14 siblings, 0 replies; 23+ messages in thread
From: Hans de Goede @ 2018-07-20  7:27 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.

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 9efcafc0..5dcb11e6 100644
--- a/src/conf/ucm/bytcr-rt5651/bytcr-rt5651.conf
+++ b/src/conf/ucm/bytcr-rt5651/bytcr-rt5651.conf
@@ -118,10 +118,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.17.1

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

* [PATCH 04/14] conf/ucm: bytcr-rt5651: Configure all volumes at 0dB
  2018-07-20  7:27 [PATCH 00/14] conf/ucm: bytcr-rt5651: Various improvements + long-name profiles addition Hans de Goede
                   ` (2 preceding siblings ...)
  2018-07-20  7:27 ` [PATCH 03/14] conf/ucm: bytcr-rt5651: Do not use both DAC1 and HPVOL inputs for HP Hans de Goede
@ 2018-07-20  7:27 ` Hans de Goede
  2018-07-20 13:48   ` Pierre-Louis Bossart
  2018-07-20  7:27 ` [PATCH 05/14] conf/ucm: bytcr-rt5651: Start with all outputs and inputs disabled Hans de Goede
                   ` (10 subsequent siblings)
  14 siblings, 1 reply; 23+ messages in thread
From: Hans de Goede @ 2018-07-20  7:27 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.

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 5dcb11e6..d6e8e48d 100644
--- a/src/conf/ucm/bytcr-rt5651/bytcr-rt5651.conf
+++ b/src/conf/ucm/bytcr-rt5651/bytcr-rt5651.conf
@@ -117,16 +117,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"
@@ -145,6 +142,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.17.1

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

* [PATCH 05/14] conf/ucm: bytcr-rt5651: Start with all outputs and inputs disabled
  2018-07-20  7:27 [PATCH 00/14] conf/ucm: bytcr-rt5651: Various improvements + long-name profiles addition Hans de Goede
                   ` (3 preceding siblings ...)
  2018-07-20  7:27 ` [PATCH 04/14] conf/ucm: bytcr-rt5651: Configure all volumes at 0dB Hans de Goede
@ 2018-07-20  7:27 ` Hans de Goede
  2018-07-20  7:27 ` [PATCH 06/14] conf/ucm: bytcr-rt5651: Change Speaker/Headphone en/disable sequences to fix switching Hans de Goede
                   ` (9 subsequent siblings)
  14 siblings, 0 replies; 23+ messages in thread
From: Hans de Goede @ 2018-07-20  7:27 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.

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 d6e8e48d..4bcc6a6c 100644
--- a/src/conf/ucm/bytcr-rt5651/bytcr-rt5651.conf
+++ b/src/conf/ucm/bytcr-rt5651/bytcr-rt5651.conf
@@ -123,14 +123,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"
@@ -160,4 +159,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.17.1

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

* [PATCH 06/14] conf/ucm: bytcr-rt5651: Change Speaker/Headphone en/disable sequences to fix switching
  2018-07-20  7:27 [PATCH 00/14] conf/ucm: bytcr-rt5651: Various improvements + long-name profiles addition Hans de Goede
                   ` (4 preceding siblings ...)
  2018-07-20  7:27 ` [PATCH 05/14] conf/ucm: bytcr-rt5651: Start with all outputs and inputs disabled Hans de Goede
@ 2018-07-20  7:27 ` Hans de Goede
  2018-07-20  7:27 ` [PATCH 07/14] conf/ucm: bytcr-rt5651: Use generic SSP enable + disable sequence Hans de Goede
                   ` (8 subsequent siblings)
  14 siblings, 0 replies; 23+ messages in thread
From: Hans de Goede @ 2018-07-20  7:27 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.

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

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

* [PATCH 07/14] conf/ucm: bytcr-rt5651: Use generic SSP enable + disable sequence
  2018-07-20  7:27 [PATCH 00/14] conf/ucm: bytcr-rt5651: Various improvements + long-name profiles addition Hans de Goede
                   ` (5 preceding siblings ...)
  2018-07-20  7:27 ` [PATCH 06/14] conf/ucm: bytcr-rt5651: Change Speaker/Headphone en/disable sequences to fix switching Hans de Goede
@ 2018-07-20  7:27 ` Hans de Goede
  2018-07-20 13:49   ` Pierre-Louis Bossart
  2018-07-20  7:27 ` [PATCH 08/14] conf/ucm: bytcr-rt5651: Fix ADC and Mic capture volumes Hans de Goede
                   ` (7 subsequent siblings)
  14 siblings, 1 reply; 23+ messages in thread
From: Hans de Goede @ 2018-07-20  7:27 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,
this is identical to the replaced code, call the generic disable sequence
on shutdown (this is new) and move the rt5651 enable sequence to
a new rt5651/EnableSeq.conf file for easy reuse in board-specific
UCM profiles.

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 | 155 --------------------
 src/conf/ucm/rt5651/EnableSeq.conf          |  46 ++++++
 src/conf/ucm/rt5651/Makefile.am             |   4 +
 6 files changed, 55 insertions(+), 157 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 4bcc6a6c..45889d82 100644
--- a/src/conf/ucm/bytcr-rt5651/bytcr-rt5651.conf
+++ b/src/conf/ucm/bytcr-rt5651/bytcr-rt5651.conf
@@ -7,159 +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 used when SSP2 is connected
-	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 when SSP0 is connected
-	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"
-
-	# 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.17.1

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

* [PATCH 08/14] conf/ucm: bytcr-rt5651: Fix ADC and Mic capture volumes
  2018-07-20  7:27 [PATCH 00/14] conf/ucm: bytcr-rt5651: Various improvements + long-name profiles addition Hans de Goede
                   ` (6 preceding siblings ...)
  2018-07-20  7:27 ` [PATCH 07/14] conf/ucm: bytcr-rt5651: Use generic SSP enable + disable sequence Hans de Goede
@ 2018-07-20  7:27 ` Hans de Goede
  2018-07-20  7:27 ` [PATCH 09/14] conf/ucm: bytcr-rt5651: Add support for mic input on various pins Hans de Goede
                   ` (6 subsequent siblings)
  14 siblings, 0 replies; 23+ messages in thread
From: Hans de Goede @ 2018-07-20  7:27 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.

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

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

* [PATCH 09/14] conf/ucm: bytcr-rt5651: Add support for mic input on various pins
  2018-07-20  7:27 [PATCH 00/14] conf/ucm: bytcr-rt5651: Various improvements + long-name profiles addition Hans de Goede
                   ` (7 preceding siblings ...)
  2018-07-20  7:27 ` [PATCH 08/14] conf/ucm: bytcr-rt5651: Fix ADC and Mic capture volumes Hans de Goede
@ 2018-07-20  7:27 ` Hans de Goede
  2018-07-20  7:27 ` [PATCH 10/14] conf/ucm: bytcr-rt5651: Split into 1 .conf file per input / output Hans de Goede
                   ` (5 subsequent siblings)
  14 siblings, 0 replies; 23+ messages in thread
From: Hans de Goede @ 2018-07-20  7:27 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.

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

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

* [PATCH 10/14] conf/ucm: bytcr-rt5651: Split into 1 .conf file per input / output
  2018-07-20  7:27 [PATCH 00/14] conf/ucm: bytcr-rt5651: Various improvements + long-name profiles addition Hans de Goede
                   ` (8 preceding siblings ...)
  2018-07-20  7:27 ` [PATCH 09/14] conf/ucm: bytcr-rt5651: Add support for mic input on various pins Hans de Goede
@ 2018-07-20  7:27 ` Hans de Goede
  2018-07-20  7:27 ` [PATCH 11/14] conf/ucm: bytcr-rt5651: Add mono speaker output profile Hans de Goede
                   ` (4 subsequent siblings)
  14 siblings, 0 replies; 23+ messages in thread
From: Hans de Goede @ 2018-07-20  7:27 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.

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

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

* [PATCH 11/14] conf/ucm: bytcr-rt5651: Add mono speaker output profile
  2018-07-20  7:27 [PATCH 00/14] conf/ucm: bytcr-rt5651: Various improvements + long-name profiles addition Hans de Goede
                   ` (9 preceding siblings ...)
  2018-07-20  7:27 ` [PATCH 10/14] conf/ucm: bytcr-rt5651: Split into 1 .conf file per input / output Hans de Goede
@ 2018-07-20  7:27 ` Hans de Goede
  2018-07-20  7:27 ` [PATCH 12/14] conf/ucm: bytcr-rt5651: Add long-name UCM profiles Hans de Goede
                   ` (3 subsequent siblings)
  14 siblings, 0 replies; 23+ messages in thread
From: Hans de Goede @ 2018-07-20  7:27 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.

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

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

* [PATCH 12/14] conf/ucm: bytcr-rt5651: Add long-name UCM profiles
  2018-07-20  7:27 [PATCH 00/14] conf/ucm: bytcr-rt5651: Various improvements + long-name profiles addition Hans de Goede
                   ` (10 preceding siblings ...)
  2018-07-20  7:27 ` [PATCH 11/14] conf/ucm: bytcr-rt5651: Add mono speaker output profile Hans de Goede
@ 2018-07-20  7:27 ` Hans de Goede
  2018-07-20  7:27 ` [PATCH 13/14] conf/ucm: bytcr-rt5651: Add bytcr-rt5651-mono-spk-in2-mic-hp-swapped config Hans de Goede
                   ` (2 subsequent siblings)
  14 siblings, 0 replies; 23+ messages in thread
From: Hans de Goede @ 2018-07-20  7:27 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.

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

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

* [PATCH 13/14] conf/ucm: bytcr-rt5651: Add bytcr-rt5651-mono-spk-in2-mic-hp-swapped config
  2018-07-20  7:27 [PATCH 00/14] conf/ucm: bytcr-rt5651: Various improvements + long-name profiles addition Hans de Goede
                   ` (11 preceding siblings ...)
  2018-07-20  7:27 ` [PATCH 12/14] conf/ucm: bytcr-rt5651: Add long-name UCM profiles Hans de Goede
@ 2018-07-20  7:27 ` Hans de Goede
  2018-07-20  7:27 ` [PATCH 14/14] conf/ucm: bytcr-rt5640: Improve human readable input/output names Hans de Goede
  2018-07-20 13:51 ` [PATCH 00/14] conf/ucm: bytcr-rt5651: Various improvements + long-name profiles addition Pierre-Louis Bossart
  14 siblings, 0 replies; 23+ messages in thread
From: Hans de Goede @ 2018-07-20  7:27 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.

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

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

* [PATCH 14/14] conf/ucm: bytcr-rt5640: Improve human readable input/output names
  2018-07-20  7:27 [PATCH 00/14] conf/ucm: bytcr-rt5651: Various improvements + long-name profiles addition Hans de Goede
                   ` (12 preceding siblings ...)
  2018-07-20  7:27 ` [PATCH 13/14] conf/ucm: bytcr-rt5651: Add bytcr-rt5651-mono-spk-in2-mic-hp-swapped config Hans de Goede
@ 2018-07-20  7:27 ` Hans de Goede
  2018-07-20 13:51 ` [PATCH 00/14] conf/ucm: bytcr-rt5651: Various improvements + long-name profiles addition Pierre-Louis Bossart
  14 siblings, 0 replies; 23+ messages in thread
From: Hans de Goede @ 2018-07-20  7:27 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.

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

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

* Re: [PATCH 04/14] conf/ucm: bytcr-rt5651: Configure all volumes at 0dB
  2018-07-20  7:27 ` [PATCH 04/14] conf/ucm: bytcr-rt5651: Configure all volumes at 0dB Hans de Goede
@ 2018-07-20 13:48   ` Pierre-Louis Bossart
  2018-08-08  9:02     ` Hans de Goede
  0 siblings, 1 reply; 23+ messages in thread
From: Pierre-Louis Bossart @ 2018-07-20 13:48 UTC (permalink / raw)
  To: Hans de Goede, alsa-devel; +Cc: Takashi Iwai

On 7/20/18 2:27 AM, Hans de Goede wrote:
> 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.

Was there anything wrong with the line-in? It's been a while and I fried 
my board but I think it worked ok. The settings came from Bard Liao.

> 
> 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 5dcb11e6..d6e8e48d 100644
> --- a/src/conf/ucm/bytcr-rt5651/bytcr-rt5651.conf
> +++ b/src/conf/ucm/bytcr-rt5651/bytcr-rt5651.conf
> @@ -117,16 +117,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"
> @@ -145,6 +142,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"
> 

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

* Re: [PATCH 07/14] conf/ucm: bytcr-rt5651: Use generic SSP enable + disable sequence
  2018-07-20  7:27 ` [PATCH 07/14] conf/ucm: bytcr-rt5651: Use generic SSP enable + disable sequence Hans de Goede
@ 2018-07-20 13:49   ` Pierre-Louis Bossart
  2018-08-08  9:03     ` Hans de Goede
  0 siblings, 1 reply; 23+ messages in thread
From: Pierre-Louis Bossart @ 2018-07-20 13:49 UTC (permalink / raw)
  To: Hans de Goede, alsa-devel; +Cc: Takashi Iwai

On 7/20/18 2:27 AM, Hans de Goede wrote:
> Use the generic SSP enable sequence from bytcr/PlatformEnableSeq.conf,
> this is identical to the replaced code, call the generic disable sequence
> on shutdown (this is new) and move the rt5651 enable sequence to
> a new rt5651/EnableSeq.conf file for easy reuse in board-specific
> UCM profiles.

Nit-pick: could we remove patch 2 then since it's essentially a no-op.

> 
> 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 | 155 --------------------
>   src/conf/ucm/rt5651/EnableSeq.conf          |  46 ++++++
>   src/conf/ucm/rt5651/Makefile.am             |   4 +
>   6 files changed, 55 insertions(+), 157 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 4bcc6a6c..45889d82 100644
> --- a/src/conf/ucm/bytcr-rt5651/bytcr-rt5651.conf
> +++ b/src/conf/ucm/bytcr-rt5651/bytcr-rt5651.conf
> @@ -7,159 +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 used when SSP2 is connected
> -	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 when SSP0 is connected
> -	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"
> -
> -	# 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)
> 

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

* Re: [PATCH 00/14] conf/ucm: bytcr-rt5651: Various improvements + long-name profiles addition
  2018-07-20  7:27 [PATCH 00/14] conf/ucm: bytcr-rt5651: Various improvements + long-name profiles addition Hans de Goede
                   ` (13 preceding siblings ...)
  2018-07-20  7:27 ` [PATCH 14/14] conf/ucm: bytcr-rt5640: Improve human readable input/output names Hans de Goede
@ 2018-07-20 13:51 ` Pierre-Louis Bossart
  2018-07-22  8:52   ` Takashi Iwai
  14 siblings, 1 reply; 23+ messages in thread
From: Pierre-Louis Bossart @ 2018-07-20 13:51 UTC (permalink / raw)
  To: Hans de Goede, alsa-devel; +Cc: Takashi Iwai

On 7/20/18 2:27 AM, Hans de Goede wrote:
> Hi All,
> 
> Here is a set of patches to the bytcr-rt5651 UCM profiles. This series
> also adds a bunch of long-name profiles so that users automatically
> only see the inputs / outputs which their device actually has.
> 
> The long-names are based on the long-names set by the kernel after
> the rt5651 patch series which is currently queued in -next:
> https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git/log/?h=for-next
> 
> With these UCM profile patches and the kernel changes in place all
> inputs and outputs as well as jack-detect will work 100% OOTB on
> supported bytcr-rt5651 devices, without the user needing to do any
> manual config or mixer settings.

Impressive work, thanks. I only had minor comments but it's already 
great, so here's my tag for the series

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

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

* Re: [PATCH 00/14] conf/ucm: bytcr-rt5651: Various improvements + long-name profiles addition
  2018-07-20 13:51 ` [PATCH 00/14] conf/ucm: bytcr-rt5651: Various improvements + long-name profiles addition Pierre-Louis Bossart
@ 2018-07-22  8:52   ` Takashi Iwai
  2018-08-05 16:46     ` Takashi Iwai
  0 siblings, 1 reply; 23+ messages in thread
From: Takashi Iwai @ 2018-07-22  8:52 UTC (permalink / raw)
  To: Pierre-Louis Bossart; +Cc: Hans de Goede, alsa-devel

On Fri, 20 Jul 2018 15:51:55 +0200,
Pierre-Louis Bossart wrote:
> 
> On 7/20/18 2:27 AM, Hans de Goede wrote:
> > Hi All,
> >
> > Here is a set of patches to the bytcr-rt5651 UCM profiles. This series
> > also adds a bunch of long-name profiles so that users automatically
> > only see the inputs / outputs which their device actually has.
> >
> > The long-names are based on the long-names set by the kernel after
> > the rt5651 patch series which is currently queued in -next:
> > https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git/log/?h=for-next
> >
> > With these UCM profile patches and the kernel changes in place all
> > inputs and outputs as well as jack-detect will work 100% OOTB on
> > supported bytcr-rt5651 devices, without the user needing to do any
> > manual config or mixer settings.
> 
> Impressive work, thanks. I only had minor comments but it's already
> great, so here's my tag for the series
> 
> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

OK, Hans, care to resubmit v2?  Then I'll happily merge them.


Thanks!

Takashi

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

* Re: [PATCH 00/14] conf/ucm: bytcr-rt5651: Various improvements + long-name profiles addition
  2018-07-22  8:52   ` Takashi Iwai
@ 2018-08-05 16:46     ` Takashi Iwai
  2018-08-06  7:41       ` Hans de Goede
  0 siblings, 1 reply; 23+ messages in thread
From: Takashi Iwai @ 2018-08-05 16:46 UTC (permalink / raw)
  To: Hans de Goede; +Cc: alsa-devel, Pierre-Louis Bossart

On Sun, 22 Jul 2018 10:52:45 +0200,
Takashi Iwai wrote:
> 
> On Fri, 20 Jul 2018 15:51:55 +0200,
> Pierre-Louis Bossart wrote:
> > 
> > On 7/20/18 2:27 AM, Hans de Goede wrote:
> > > Hi All,
> > >
> > > Here is a set of patches to the bytcr-rt5651 UCM profiles. This series
> > > also adds a bunch of long-name profiles so that users automatically
> > > only see the inputs / outputs which their device actually has.
> > >
> > > The long-names are based on the long-names set by the kernel after
> > > the rt5651 patch series which is currently queued in -next:
> > > https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git/log/?h=for-next
> > >
> > > With these UCM profile patches and the kernel changes in place all
> > > inputs and outputs as well as jack-detect will work 100% OOTB on
> > > supported bytcr-rt5651 devices, without the user needing to do any
> > > manual config or mixer settings.
> > 
> > Impressive work, thanks. I only had minor comments but it's already
> > great, so here's my tag for the series
> > 
> > Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> 
> OK, Hans, care to resubmit v2?  Then I'll happily merge them.

This seems to be forgotten?


thanks,

Takashi

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

* Re: [PATCH 00/14] conf/ucm: bytcr-rt5651: Various improvements + long-name profiles addition
  2018-08-05 16:46     ` Takashi Iwai
@ 2018-08-06  7:41       ` Hans de Goede
  0 siblings, 0 replies; 23+ messages in thread
From: Hans de Goede @ 2018-08-06  7:41 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel, Pierre-Louis Bossart

Hi,

On 05-08-18 18:46, Takashi Iwai wrote:
> On Sun, 22 Jul 2018 10:52:45 +0200,
> Takashi Iwai wrote:
>>
>> On Fri, 20 Jul 2018 15:51:55 +0200,
>> Pierre-Louis Bossart wrote:
>>>
>>> On 7/20/18 2:27 AM, Hans de Goede wrote:
>>>> Hi All,
>>>>
>>>> Here is a set of patches to the bytcr-rt5651 UCM profiles. This series
>>>> also adds a bunch of long-name profiles so that users automatically
>>>> only see the inputs / outputs which their device actually has.
>>>>
>>>> The long-names are based on the long-names set by the kernel after
>>>> the rt5651 patch series which is currently queued in -next:
>>>> https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git/log/?h=for-next
>>>>
>>>> With these UCM profile patches and the kernel changes in place all
>>>> inputs and outputs as well as jack-detect will work 100% OOTB on
>>>> supported bytcr-rt5651 devices, without the user needing to do any
>>>> manual config or mixer settings.
>>>
>>> Impressive work, thanks. I only had minor comments but it's already
>>> great, so here's my tag for the series
>>>
>>> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
>>
>> OK, Hans, care to resubmit v2?  Then I'll happily merge them.
> 
> This seems to be forgotten?

I was on vacation, I'm back now and I will create a v2 of the patch-set
soon.

Regards,

Hans

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

* Re: [PATCH 04/14] conf/ucm: bytcr-rt5651: Configure all volumes at 0dB
  2018-07-20 13:48   ` Pierre-Louis Bossart
@ 2018-08-08  9:02     ` Hans de Goede
  0 siblings, 0 replies; 23+ messages in thread
From: Hans de Goede @ 2018-08-08  9:02 UTC (permalink / raw)
  To: Pierre-Louis Bossart, alsa-devel; +Cc: Takashi Iwai

Hi Pierre-Louis,

Thank you for the reviews.

On 20-07-18 15:48, Pierre-Louis Bossart wrote:
> On 7/20/18 2:27 AM, Hans de Goede wrote:
>> 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.
> 
> Was there anything wrong with the line-in? It's been a while and I fried my board but I think it worked ok. The settings came from Bard Liao.

I don't have any devices with a line-in so I could not test,
also line-in support really should be added in a different
commit and mixed in with the 0Db changes.

I believe it is best if someone who can actually test this
adds line-in support on top of this series.

Regards,

Hans



> 
>>
>> 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 5dcb11e6..d6e8e48d 100644
>> --- a/src/conf/ucm/bytcr-rt5651/bytcr-rt5651.conf
>> +++ b/src/conf/ucm/bytcr-rt5651/bytcr-rt5651.conf
>> @@ -117,16 +117,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"
>> @@ -145,6 +142,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"
>>
> 
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

* Re: [PATCH 07/14] conf/ucm: bytcr-rt5651: Use generic SSP enable + disable sequence
  2018-07-20 13:49   ` Pierre-Louis Bossart
@ 2018-08-08  9:03     ` Hans de Goede
  0 siblings, 0 replies; 23+ messages in thread
From: Hans de Goede @ 2018-08-08  9:03 UTC (permalink / raw)
  To: Pierre-Louis Bossart, alsa-devel; +Cc: Takashi Iwai

Hi,

On 20-07-18 15:49, Pierre-Louis Bossart wrote:
> On 7/20/18 2:27 AM, Hans de Goede wrote:
>> Use the generic SSP enable sequence from bytcr/PlatformEnableSeq.conf,
>> this is identical to the replaced code, call the generic disable sequence
>> on shutdown (this is new) and move the rt5651 enable sequence to
>> a new rt5651/EnableSeq.conf file for easy reuse in board-specific
>> UCM profiles.
> 
> Nit-pick: could we remove patch 2 then since it's essentially a no-op.

Ok, I've squashed the 2 together for v2 of this series which I'm
about to post.

Regards,

Hans

> 
>>
>> 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 | 155 --------------------
>>   src/conf/ucm/rt5651/EnableSeq.conf          |  46 ++++++
>>   src/conf/ucm/rt5651/Makefile.am             |   4 +
>>   6 files changed, 55 insertions(+), 157 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 4bcc6a6c..45889d82 100644
>> --- a/src/conf/ucm/bytcr-rt5651/bytcr-rt5651.conf
>> +++ b/src/conf/ucm/bytcr-rt5651/bytcr-rt5651.conf
>> @@ -7,159 +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 used when SSP2 is connected
>> -    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 when SSP0 is connected
>> -    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"
>> -
>> -    # 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)
>>
> 
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

end of thread, other threads:[~2018-08-08  9:03 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-20  7:27 [PATCH 00/14] conf/ucm: bytcr-rt5651: Various improvements + long-name profiles addition Hans de Goede
2018-07-20  7:27 ` [PATCH 01/14] conf/ucm: bytcr-rt5645: Use the generic bytcr/PlatformEnableSeq.conf Hans de Goede
2018-07-20  7:27 ` [PATCH 02/14] conf/ucm: bytcr-rt5651: Add support for boards using SSP0 Hans de Goede
2018-07-20  7:27 ` [PATCH 03/14] conf/ucm: bytcr-rt5651: Do not use both DAC1 and HPVOL inputs for HP Hans de Goede
2018-07-20  7:27 ` [PATCH 04/14] conf/ucm: bytcr-rt5651: Configure all volumes at 0dB Hans de Goede
2018-07-20 13:48   ` Pierre-Louis Bossart
2018-08-08  9:02     ` Hans de Goede
2018-07-20  7:27 ` [PATCH 05/14] conf/ucm: bytcr-rt5651: Start with all outputs and inputs disabled Hans de Goede
2018-07-20  7:27 ` [PATCH 06/14] conf/ucm: bytcr-rt5651: Change Speaker/Headphone en/disable sequences to fix switching Hans de Goede
2018-07-20  7:27 ` [PATCH 07/14] conf/ucm: bytcr-rt5651: Use generic SSP enable + disable sequence Hans de Goede
2018-07-20 13:49   ` Pierre-Louis Bossart
2018-08-08  9:03     ` Hans de Goede
2018-07-20  7:27 ` [PATCH 08/14] conf/ucm: bytcr-rt5651: Fix ADC and Mic capture volumes Hans de Goede
2018-07-20  7:27 ` [PATCH 09/14] conf/ucm: bytcr-rt5651: Add support for mic input on various pins Hans de Goede
2018-07-20  7:27 ` [PATCH 10/14] conf/ucm: bytcr-rt5651: Split into 1 .conf file per input / output Hans de Goede
2018-07-20  7:27 ` [PATCH 11/14] conf/ucm: bytcr-rt5651: Add mono speaker output profile Hans de Goede
2018-07-20  7:27 ` [PATCH 12/14] conf/ucm: bytcr-rt5651: Add long-name UCM profiles Hans de Goede
2018-07-20  7:27 ` [PATCH 13/14] conf/ucm: bytcr-rt5651: Add bytcr-rt5651-mono-spk-in2-mic-hp-swapped config Hans de Goede
2018-07-20  7:27 ` [PATCH 14/14] conf/ucm: bytcr-rt5640: Improve human readable input/output names Hans de Goede
2018-07-20 13:51 ` [PATCH 00/14] conf/ucm: bytcr-rt5651: Various improvements + long-name profiles addition Pierre-Louis Bossart
2018-07-22  8:52   ` Takashi Iwai
2018-08-05 16:46     ` Takashi Iwai
2018-08-06  7:41       ` Hans de Goede

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.