Skip to contentSkip to conversation

Factor out rt5645 + rt5650 shared UCM sequences

PATCH In review [email protected] 2 participants 8 messages Jan 6, 2019 – Jan 7, 2019

lore
Share & tools
lore
#0 lore raw

cover Factor out rt5645 + rt5650 shared UCM sequences

Hi,

When I submitted a patch to create a UCM config for chtrt5650 it was suggested that I also factor out command sequences that it shares with chtrt5645. The following patchset introduces a new component directory codecs/rt5645-common/ and refactors UCM profiles in:

- chtrt5645
- chtrt5645-mono-speaker-analog-mic
- chtrt5650
- ASUSTeKCOMPUTERINC.-T100HAN-1.0-T100HAN
- LENOVO-80XF-LenovoMIIX320_10ICR-LNVNB161216

I compiled and tested playback with the rt5650 configs but I don't have the devices to test the other configurations. Suggestions and feedback are welcome, I'm not very familiar with UCM configuration so there may definitely be better approaches for some of these changes.

- Russell

#1 lore raw

PATCH 1/5 Update chtrt5645 ucm variants to use bytcr/PlatformEnableSeq.conf component

From: Russell Parker <[email protected]>

The Lenovo Ideapad Miix 320, Asus T100HA, and chtrt5645 mono variant UCM configurations have not been updated to make use of the shared bytcr/PlatfromEnableSeq.conf sequence. This commit deletes those command sequences and loads the shared component directly.

src/conf/ucm/ASUSTeKCOMPUTERINC.-T100HAN-1.0-T100HAN/HiFi.conf +1 -115
index 78bf9823..61848358 100644
@@ -11,121 +11,7 @@ SectionVerb {
 	EnableSequence [
 		cdev "hw:chtrt5645"
 
-		# media mixer settings
-		#   compress
-		cset "name='media0_in Gain 0 Switch' on"
-		cset "name='media0_in Gain 0 Volume' 0"
-
-		#   normal
-		cset "name='media1_in Gain 0 Switch' on"
-		cset "name='media1_in Gain 0 Volume' 0"
-		#   swm loopback
-		cset "name='media2_in Gain 0 Switch' off"
-		cset "name='media2_in Gain 0 Volume' 0%"
-		#   deep buffer
-		cset "name='media3_in Gain 0 Switch' on"
-		cset "name='media3_in Gain 0 Volume' 0"
-
-		cset "name='media0_out mix 0 media0_in Switch' on"
-		cset "name='media0_out mix 0 media1_in Switch' on"
-		cset "name='media0_out mix 0 media2_in Switch' off"
-		cset "name='media0_out mix 0 media3_in Switch' on"
-
-		cset "name='media1_out mix 0 media0_in Switch' off"
-		cset "name='media1_out mix 0 media1_in Switch' off"
-		cset "name='media1_out mix 0 media2_in Switch' off"
-		cset "name='media1_out mix 0 media3_in Switch' off"
-
-		cset "name='pcm0_in Gain 0 Switch' on"
-		cset "name='pcm0_in Gain 0 Volume' 0"
-
-		cset "name='pcm1_in Gain 0 Switch' off"
-		cset "name='pcm1_in Gain 0 Volume' 0%"
-
-		# codec0_out settings (used if ssp2 is connected to aif1)
-		cset "name='codec_out0 mix 0 codec_in0 Switch' off"
-		cset "name='codec_out0 mix 0 codec_in1 Switch' off"
-		cset "name='codec_out0 mix 0 media_loop1_in Switch' off"
-		cset "name='codec_out0 mix 0 media_loop2_in Switch' off"
-		cset "name='codec_out0 mix 0 pcm0_in Switch' on"
-		cset "name='codec_out0 mix 0 pcm1_in Switch' off"
-		cset "name='codec_out0 mix 0 sprot_loop_in Switch' off"
-		cset "name='codec_out0 Gain 0 Switch' on"
-		cset "name='codec_out0 Gain 0 Volume' 0"
-
-		# modem_out settings (used if ssp0 is connected to aif2)
-		cset "name='modem_out mix 0 codec_in0 Switch' off"
-		cset "name='modem_out mix 0 codec_in1 Switch' off"
-		cset "name='modem_out mix 0 media_loop1_in Switch' off"
-		cset "name='modem_out mix 0 media_loop2_in Switch' off"
-		cset "name='modem_out mix 0 pcm0_in Switch' on"
-		cset "name='modem_out mix 0 pcm1_in Switch' off"
-		cset "name='modem_out mix 0 sprot_loop_in Switch' off"
-		cset "name='modem_out Gain 0 Switch' on"
-		cset "name='modem_out Gain 0 Volume' 0"
-
-		# input settings
-		# pcm1_out settings
-
-		# input used when SSP2 is connected
-		cset "name='codec_in0 Gain 0 Switch' on"
-		cset "name='codec_in0 Gain 0 Volume' 0"
-
-		# input used when SSP0 is connected
-		cset "name='modem_in Gain 0 Switch' on"
-		cset "name='modem_in Gain 0 Volume' 0"
-
-		cset "name='pcm1_out mix 0 codec_in0 Switch' on"
-		cset "name='pcm1_out mix 0 modem_in Switch' on"
-		cset "name='pcm1_out mix 0 codec_in1 Switch' off"
-		cset "name='pcm1_out mix 0 media_loop1_in Switch' off"
-		cset "name='pcm1_out mix 0 media_loop2_in Switch' off"
-		cset "name='pcm1_out mix 0 pcm0_in Switch' off"
-		cset "name='pcm1_out mix 0 pcm1_in Switch' off"
-		cset "name='pcm1_out mix 0 sprot_loop_in Switch' off"
-
-		cset "name='pcm1_out Gain 0 Switch' on"
-		cset "name='pcm1_out Gain 0 Volume' 0"
-
-		# disable codec_out1
-		cset "name='codec_out1 mix 0 codec_in0 Switch' off"
-		cset "name='codec_out1 mix 0 codec_in1 Switch' off"
-		cset "name='codec_out1 mix 0 media_loop1_in Switch' off"
-		cset "name='codec_out1 mix 0 media_loop2_in Switch' off"
-		cset "name='codec_out1 mix 0 pcm0_in Switch' off"
-		cset "name='codec_out1 mix 0 pcm1_in Switch' off"
-		cset "name='codec_out1 mix 0 sprot_loop_in Switch' off"
-		cset "name='codec_out1 Gain 0 Switch' off"
-		cset "name='codec_out1 Gain 0 Volume' 0%"
-
-		# disable codec_in1
-		cset "name='codec_in1 Gain 0 Switch' off"
-		cset "name='codec_in1 Gain 0 Volume' 0%"
-
-		# disable all loops
-		cset "name='media_loop1_out mix 0 codec_in0 Switch' off"
-		cset "name='media_loop1_out mix 0 codec_in1 Switch' off"
-		cset "name='media_loop1_out mix 0 media_loop1_in Switch' off"
-		cset "name='media_loop1_out mix 0 media_loop2_in Switch' off"
-		cset "name='media_loop1_out mix 0 pcm0_in Switch' off"
-		cset "name='media_loop1_out mix 0 pcm1_in Switch' off"
-		cset "name='media_loop1_out mix 0 sprot_loop_in Switch' off"
-
-		cset "name='media_loop2_out mix 0 codec_in0 Switch' off"
-		cset "name='media_loop2_out mix 0 codec_in1 Switch' off"
-		cset "name='media_loop2_out mix 0 media_loop1_in Switch' off"
-		cset "name='media_loop2_out mix 0 media_loop2_in Switch' off"
-		cset "name='media_loop2_out mix 0 pcm0_in Switch' off"
-		cset "name='media_loop2_out mix 0 pcm1_in Switch' off"
-		cset "name='media_loop2_out mix 0 sprot_loop_in Switch' off"
-
-		cset "name='sprot_loop_out mix 0 codec_in0 Switch' off"
-		cset "name='sprot_loop_out mix 0 codec_in1 Switch' off"
-		cset "name='sprot_loop_out mix 0 media_loop1_in Switch' off"
-		cset "name='sprot_loop_out mix 0 media_loop2_in Switch' off"
-		cset "name='sprot_loop_out mix 0 pcm0_in Switch' off"
-		cset "name='sprot_loop_out mix 0 pcm1_in Switch' off"
-		cset "name='sprot_loop_out mix 0 sprot_loop_in Switch' off"
+		<platforms/bytcr/PlatformEnableSeq.conf>
 
 		# Output Configuration
 		cset "name='DAC1 L Mux' IF1 DAC"
src/conf/ucm/LENOVO-80XF-LenovoMIIX320_10ICR-LNVNB161216/HiFi.conf +1 -115

122 lines not on this page · raw message

src/conf/ucm/chtrt5645-mono-speaker-analog-mic/HiFi.conf +1 -115

122 lines not on this page · raw message

src/conf/ucm/platforms/bytcr/PlatformEnableSeq.conf +2 -2
index b5ee2b41..6f5e899c 100644
@@ -29,7 +29,7 @@ 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)
+# 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"
@@ -40,7 +40,7 @@ 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)
+# 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"
Signature · 1 line
2.20.1
#2 lore raw

PATCH 2/5 Create shared {En, Dis}ableSeq.conf components for rt5645 variants

In reply to [email protected]

From: Russell Parker <[email protected]>

Factor out the common enable and disable sequences used in rt5645 variants, including the rt5650. Move the sequences into a new compoent directory codecs/rt5645-common/ along with a Makefile.

Some lines like
cset "name='Stereo1 ADC1 Mux' 1"
and
cset "name='I2S2 Func Switch' on"
are not set set in the chtrt5650 UCM sequences and thus are not present in the new component, in order to maximize reuse.

configure.ac +1 -0
index a0392bfe..307e7fc7 100644
@@ -761,6 +761,7 @@ AC_OUTPUT(Makefile doc/Makefile doc/pictures/Makefile doc/doxygen.cfg \
 	  src/conf/ucm/codecs/Makefile \
 	  src/conf/ucm/codecs/nau8824/Makefile \
 	  src/conf/ucm/codecs/rt5640/Makefile \
+	  src/conf/ucm/codecs/rt5645-common/Makefile \
 	  src/conf/ucm/codecs/rt5651/Makefile \
 	  src/conf/ucm/platforms/Makefile \
 	  src/conf/ucm/platforms/bytcr/Makefile \
src/conf/ucm/ASUSTeKCOMPUTERINC.-T100HAN-1.0-T100HAN/HiFi.conf +2 -60

76 lines not on this page · raw message

src/conf/ucm/LENOVO-80XF-LenovoMIIX320_10ICR-LNVNB161216/HiFi.conf +2 -60

76 lines not on this page · raw message

src/conf/ucm/chtrt5645-mono-speaker-analog-mic/HiFi.conf +2 -60

76 lines not on this page · raw message

src/conf/ucm/chtrt5645/HiFi.conf +2 -61

80 lines not on this page · raw message

src/conf/ucm/chtrt5650/HiFi.conf +3 -57

76 lines not on this page · raw message

src/conf/ucm/codecs/Makefile.am +1 -0
index 2b374acb..ac1a56dc 100644
@@ -1,4 +1,5 @@
 SUBDIRS=\
 rt5640 \
+rt5645-common \
 rt5651 \
 nau8824
src/conf/ucm/codecs/rt5645-common/DisableSeq.conf new file +15 -0
new file mode 100644
index 00000000..5127d1ae
@@ -0,0 +1,15 @@
+# Disable audio output path
+cset "name='codec_out1 mix 0 pcm0_in Switch' off"
+cset "name='media0_out mix 0 media1_in Switch' off"
+
+cset "name='media1_in Gain 0 Switch' off"
+cset "name='pcm0_in Gain 0 Switch' off"
+cset "name='codec_out1 Gain 0 Switch' off"
+
+# Disable audio input path
+cset "name='pcm1_out mix 0 media_loop2_in Switch' off"
+cset "name='media_loop2_out mix 0 codec_in0 Switch' off"
+
+cset "name='media_loop2_out Gain 0 Switch' off"
+cset "name='pcm1_out Gain 0 Switch' off"
+cset "name='codec_in0 Gain 0 Switch' off"
src/conf/ucm/codecs/rt5645-common/EnableSeq.conf new file +46 -0

46 lines not on this page · raw message

src/conf/ucm/codecs/rt5645-common/Makefile.am new file +4 -0
new file mode 100644
index 00000000..f351fa37
@@ -0,0 +1,4 @@
+alsaconfigdir = @ALSA_CONFIG_DIR@
+ucmdir = $(alsaconfigdir)/ucm/codecs/rt5645-common
+ucm_DATA = DisableSeq.conf EnableSeq.conf
+EXTRA_DIST = $(ucm_DATA)
Signature · 1 line
2.20.1
#3 lore raw

PATCH 3/5 Factor out rt5645 variants Speaker+Headphones shared UCM enable sequences

In reply to [email protected]

From: Russell Parker <[email protected]>

Move common enable sequences for rt5645 variants and rt5650 UCM configuratons into a shared component. The corresponding disable sequences are only two lines each and do not seem worth creating components for.

src/conf/ucm/ASUSTeKCOMPUTERINC.-T100HAN-1.0-T100HAN/HiFi.conf +2 -13
index 46508766..9616be27 100644
@@ -43,12 +43,7 @@ SectionDevice."Speaker" {
 	EnableSequence [
 		cdev "hw:chtrt5645"
 
-		cset "name='Headphone Switch' off"
-		cset "name='Headphone Channel Switch' off"
-
-		cset "name='Ext Spk Switch' on"
-		cset "name='Speaker Channel Switch' on"
-		cset "name='Speaker Playback Volume' 31"
+		<codecs/rt5645-common/SpeakerEnableSeq.conf>
 	]
 
 	DisableSequence [
@@ -75,13 +70,7 @@ SectionDevice."Headphones" {
 	EnableSequence [
 		cdev "hw:chtrt5645"
 
-		cset "name='Ext Spk Switch' off"
-		cset "name='Speaker Channel Switch' off"
-
-		cset "name='Headphone Switch' on"
-		cset "name='Headphone Channel Switch' on"
-		# 25/39 higher values cause crackling on some boards
-		cset "name='Headphone Playback Volume' 25"
+		<codecs/rt5645-common/HeadphonesEnableSeq.conf>
 	]
 
 	DisableSequence [
src/conf/ucm/LENOVO-80XF-LenovoMIIX320_10ICR-LNVNB161216/HiFi.conf +2 -13
index c16cceac..eda1272a 100644
@@ -43,12 +43,7 @@ SectionDevice."Speaker" {
 	EnableSequence [
 		cdev "hw:chtrt5645"
 
-		cset "name='Headphone Switch' off"
-		cset "name='Headphone Channel Switch' off"
-
-		cset "name='Ext Spk Switch' on"
-		cset "name='Speaker Channel Switch' on"
-		cset "name='Speaker Playback Volume' 31"
+		<codecs/rt5645-common/SpeakerEnableSeq.conf>
 	]
 
 	DisableSequence [
@@ -75,13 +70,7 @@ SectionDevice."Headphones" {
 	EnableSequence [
 		cdev "hw:chtrt5645"
 
-		cset "name='Ext Spk Switch' off"
-		cset "name='Speaker Channel Switch' off"
-
-		cset "name='Headphone Switch' on"
-		cset "name='Headphone Channel Switch' on"
-		# 25/39 higher values cause crackling on some boards
-		cset "name='Headphone Playback Volume' 25"
+		<codecs/rt5645-common/HeadphonesEnableSeq.conf>
 	]
 
 	DisableSequence [
src/conf/ucm/chtrt5645-mono-speaker-analog-mic/HiFi.conf +2 -13
index 45cc5186..0e868e26 100644
@@ -47,12 +47,7 @@ SectionDevice."Speaker" {
 		cset "name='Stereo DAC MIXL DAC R1 Switch' 1"
 		cset "name='Stereo DAC MIXR DAC R1 Switch' 0"
 
-		cset "name='Headphone Switch' off"
-		cset "name='Headphone Channel Switch' off"
-
-		cset "name='Ext Spk Switch' on"
-		cset "name='Speaker Channel Switch' on"
-		cset "name='Speaker Playback Volume' 31"
+		<codecs/rt5645-common/SpeakerEnableSeq.conf>
 	]
 
 	DisableSequence [
@@ -83,13 +78,7 @@ SectionDevice."Headphones" {
 		cset "name='Stereo DAC MIXL DAC R1 Switch' 0"
 		cset "name='Stereo DAC MIXR DAC R1 Switch' 1"
 
-		cset "name='Ext Spk Switch' off"
-		cset "name='Speaker Channel Switch' off"
-
-		cset "name='Headphone Switch' on"
-		cset "name='Headphone Channel Switch' on"
-		# 25/39 higher values cause crackling on some boards
-		cset "name='Headphone Playback Volume' 25"
+		<codecs/rt5645-common/HeadphonesEnableSeq.conf>
 	]
 
 	DisableSequence [
src/conf/ucm/chtrt5645/HiFi.conf +2 -13
index bc4801d8..1bb9830d 100644
@@ -43,12 +43,7 @@ SectionDevice."Speaker" {
 	EnableSequence [
 		cdev "hw:chtrt5645"
 
-		cset "name='Headphone Switch' off"
-		cset "name='Headphone Channel Switch' off"
-
-		cset "name='Ext Spk Switch' on"
-		cset "name='Speaker Channel Switch' on"
-		cset "name='Speaker Playback Volume' 31"
+		<codecs/rt5645-common/SpeakerEnableSeq.conf>
 	]
 
 	DisableSequence [
@@ -75,13 +70,7 @@ SectionDevice."Headphones" {
 	EnableSequence [
 		cdev "hw:chtrt5645"
 
-		cset "name='Ext Spk Switch' off"
-		cset "name='Speaker Channel Switch' off"
-
-		cset "name='Headphone Switch' on"
-		cset "name='Headphone Channel Switch' on"
-		# 25/39 higher values cause crackling on some boards
-		cset "name='Headphone Playback Volume' 25"
+		<codecs/rt5645-common/HeadphonesEnableSeq.conf>
 	]
 
 	DisableSequence [
src/conf/ucm/chtrt5650/HiFi.conf +2 -12
index 7142dece..c8bd397a 100644
@@ -43,12 +43,7 @@ SectionDevice."Speaker" {
 	EnableSequence [
 		cdev "hw:chtrt5650"
 
-		cset "name='Headphone Switch' off"
-		cset "name='Headphone Channel Switch' off"
-
-		cset "name='Ext Spk Switch' on"
-		cset "name='Speaker Channel Switch' on"
-		cset "name='Speaker Playback Volume' 31"
+		<codecs/rt5645-common/SpeakerEnableSeq.conf>
 	]
 
 	DisableSequence [
@@ -75,12 +70,7 @@ SectionDevice."Headphones" {
 	EnableSequence [
 		cdev "hw:chtrt5650"
 
-		cset "name='Ext Spk Switch' off"
-		cset "name='Speaker Channel Switch' off"
-
-		cset "name='Headphone Switch' on"
-		cset "name='Headphone Channel Switch' on"
-		cset "name='Headphone Playback Volume' 31"
+		<codecs/rt5645-common/HeadphonesEnableSeq.conf>
 	]
 
 	DisableSequence [
src/conf/ucm/codecs/rt5645-common/HeadphonesEnableSeq.conf new file +7 -0
new file mode 100644
index 00000000..6c231da7
@@ -0,0 +1,7 @@
+cset "name='Ext Spk Switch' off"
+cset "name='Speaker Channel Switch' off"
+
+cset "name='Headphone Switch' on"
+cset "name='Headphone Channel Switch' on"
+# 25/39 higher values cause crackling on some boards
+cset "name='Headphone Playback Volume' 25"
src/conf/ucm/codecs/rt5645-common/Makefile.am +2 -1
index f351fa37..7eff2e72 100644
@@ -1,4 +1,5 @@
 alsaconfigdir = @ALSA_CONFIG_DIR@
 ucmdir = $(alsaconfigdir)/ucm/codecs/rt5645-common
-ucm_DATA = DisableSeq.conf EnableSeq.conf
+ucm_DATA = DisableSeq.conf EnableSeq.conf HeadphonesEnableSeq.conf \
+		   SpeakerEnableSeq.conf
 EXTRA_DIST = $(ucm_DATA)
src/conf/ucm/codecs/rt5645-common/SpeakerEnableSeq.conf new file +6 -0
new file mode 100644
index 00000000..2cc62fc5
@@ -0,0 +1,6 @@
+cset "name='Headphone Switch' off"
+cset "name='Headphone Channel Switch' off"
+
+cset "name='Ext Spk Switch' on"
+cset "name='Speaker Channel Switch' on"
+cset "name='Speaker Playback Volume' 31"
Signature · 1 line
2.20.1
#4 lore raw

PATCH 4/5 Factor out rt5645 variants Headset+Digital Mic UCM shared {en, dis}able sequences

In reply to [email protected]

From: Russell Parker <[email protected]>

src/conf/ucm/ASUSTeKCOMPUTERINC.-T100HAN-1.0-T100HAN/HiFi.conf +4 -28
index 9616be27..e080e383 100644
@@ -92,31 +92,18 @@ SectionDevice."DMic".0 {
 	EnableSequence [
 		cdev "hw:chtrt5645"
 
-		cset "name='Int Mic Switch' on"
+		<codecs/rt5645-common/DigitalMicEnableSeq.conf>
 
 		cset "name='Stereo1 DMIC Mux' DMIC1"
 		cset "name='Stereo1 ADC2 Mux' DMIC"
 		cset "name='Mono ADC L2 Mux' DMIC"
 		cset "name='Mono ADC R2 Mux' DMIC"
-
-		cset "name='Sto1 ADC MIXL ADC1 Switch' off"
-		cset "name='Sto1 ADC MIXR ADC1 Switch' off"
-		cset "name='Sto1 ADC MIXL ADC2 Switch' on"
-		cset "name='Sto1 ADC MIXR ADC2 Switch' on"
-		cset "name='Mono ADC MIXL ADC1 Switch' off"
-		cset "name='Mono ADC MIXR ADC1 Switch' off"
-		cset "name='Mono ADC MIXL ADC2 Switch' on"
-		cset "name='Mono ADC MIXR ADC2 Switch' on"
 	]
 
 	DisableSequence [
 		cdev "hw:chtrt5645"
 
-		cset "name='Sto1 ADC MIXL ADC2 Switch' off"
-		cset "name='Sto1 ADC MIXR ADC2 Switch' off"
-		cset "name='Mono ADC MIXL ADC2 Switch' off"
-		cset "name='Mono ADC MIXR ADC2 Switch' off"
-		cset "name='Int Mic Switch' off"
+		<codecs/rt5645-common/DigitalMicDisableSeq.conf>
 	]
 }
 
@@ -132,10 +119,8 @@ SectionDevice."HSMic".0 {
 	EnableSequence [
 		cdev "hw:chtrt5645"
 
-		cset "name='Headset Mic Switch' on"
+		<codecs/rt5645-common/HSMicEnableSeq.conf>
 
-		cset "name='Sto1 ADC MIXL ADC1 Switch' on"
-		cset "name='Sto1 ADC MIXR ADC1 Switch' on"
 		cset "name='Sto1 ADC MIXL ADC2 Switch' off"
 		cset "name='Sto1 ADC MIXR ADC2 Switch' off"
 
@@ -143,23 +128,14 @@ SectionDevice."HSMic".0 {
 		cset "name='Mono ADC MIXR ADC1 Switch' on"
 		cset "name='Mono ADC MIXL ADC2 Switch' off"
 		cset "name='Mono ADC MIXR ADC2 Switch' off"
-
-		cset "name='RECMIXL BST1 Switch' on"
-		cset "name='RECMIXR BST1 Switch' on"
-
 	]
 
 	DisableSequence [
 		cdev "hw:chtrt5645"
 
-		cset "name='Headset Mic Switch' off"
+		<codecs/rt5645-common/HSMicEnableSeq.conf>
 
-		cset "name='RECMIXL BST1 Switch' off"
-		cset "name='RECMIXR BST1 Switch' off"
-		cset "name='Sto1 ADC MIXL ADC1 Switch' off"
-		cset "name='Sto1 ADC MIXR ADC1 Switch' off"
 		cset "name='Mono ADC MIXL ADC1 Switch' on"
 		cset "name='Mono ADC MIXR ADC1 Switch' on"
-
 	]
 }
src/conf/ucm/LENOVO-80XF-LenovoMIIX320_10ICR-LNVNB161216/HiFi.conf +4 -28
index eda1272a..714f4597 100644
@@ -92,7 +92,7 @@ SectionDevice."DMic".0 {
 	EnableSequence [
 		cdev "hw:chtrt5645"
 
-		cset "name='Int Mic Switch' on"
+		<codecs/rt5645-common/DigitalMicEnableSeq.conf>
 
 		cset "name='Stereo1 DMIC Mux' DMIC2"
 		cset "name='Stereo1 ADC2 Mux' DMIC"
@@ -100,25 +100,12 @@ SectionDevice."DMic".0 {
 		cset "name='Mono DMIC R Mux' DMIC2"
 		cset "name='Mono ADC L2 Mux' DMIC"
 		cset "name='Mono ADC R2 Mux' DMIC"
-
-		cset "name='Sto1 ADC MIXL ADC1 Switch' off"
-		cset "name='Sto1 ADC MIXR ADC1 Switch' off"
-		cset "name='Sto1 ADC MIXL ADC2 Switch' on"
-		cset "name='Sto1 ADC MIXR ADC2 Switch' on"
-		cset "name='Mono ADC MIXL ADC1 Switch' off"
-		cset "name='Mono ADC MIXR ADC1 Switch' off"
-		cset "name='Mono ADC MIXL ADC2 Switch' on"
-		cset "name='Mono ADC MIXR ADC2 Switch' on"
 	]
 
 	DisableSequence [
 		cdev "hw:chtrt5645"
 
-		cset "name='Sto1 ADC MIXL ADC2 Switch' off"
-		cset "name='Sto1 ADC MIXR ADC2 Switch' off"
-		cset "name='Mono ADC MIXL ADC2 Switch' off"
-		cset "name='Mono ADC MIXR ADC2 Switch' off"
-		cset "name='Int Mic Switch' off"
+		<codecs/rt5645-common/DigitalMicDisableSeq.conf>
 	]
 }
 
@@ -134,10 +121,8 @@ SectionDevice."HSMic".0 {
 	EnableSequence [
 		cdev "hw:chtrt5645"
 
-		cset "name='Headset Mic Switch' on"
+		<codecs/rt5645-common/HSMicEnableSeq.conf>
 
-		cset "name='Sto1 ADC MIXL ADC1 Switch' on"
-		cset "name='Sto1 ADC MIXR ADC1 Switch' on"
 		cset "name='Sto1 ADC MIXL ADC2 Switch' off"
 		cset "name='Sto1 ADC MIXR ADC2 Switch' off"
 
@@ -145,23 +130,14 @@ SectionDevice."HSMic".0 {
 		cset "name='Mono ADC MIXR ADC1 Switch' on"
 		cset "name='Mono ADC MIXL ADC2 Switch' off"
 		cset "name='Mono ADC MIXR ADC2 Switch' off"
-
-		cset "name='RECMIXL BST1 Switch' on"
-		cset "name='RECMIXR BST1 Switch' on"
-
 	]
 
 	DisableSequence [
 		cdev "hw:chtrt5645"
 
-		cset "name='Headset Mic Switch' off"
+		<codecs/rt5645-common/HSMicEnableSeq.conf>
 
-		cset "name='RECMIXL BST1 Switch' off"
-		cset "name='RECMIXR BST1 Switch' off"
-		cset "name='Sto1 ADC MIXL ADC1 Switch' off"
-		cset "name='Sto1 ADC MIXR ADC1 Switch' off"
 		cset "name='Mono ADC MIXL ADC1 Switch' on"
 		cset "name='Mono ADC MIXR ADC1 Switch' on"
-
 	]
 }
src/conf/ucm/chtrt5645-mono-speaker-analog-mic/HiFi.conf +2 -13
index 0e868e26..489390d5 100644
@@ -145,10 +145,8 @@ SectionDevice."HSMic".0 {
 	EnableSequence [
 		cdev "hw:chtrt5645"
 
-		cset "name='Headset Mic Switch' on"
+		<codecs/rt5645-common/HSMicEnableSeq.conf>
 
-		cset "name='Sto1 ADC MIXL ADC1 Switch' on"
-		cset "name='Sto1 ADC MIXR ADC1 Switch' on"
 		cset "name='Sto1 ADC MIXL ADC2 Switch' off"
 		cset "name='Sto1 ADC MIXR ADC2 Switch' off"
 
@@ -156,23 +154,14 @@ SectionDevice."HSMic".0 {
 		cset "name='Mono ADC MIXR ADC1 Switch' on"
 		cset "name='Mono ADC MIXL ADC2 Switch' off"
 		cset "name='Mono ADC MIXR ADC2 Switch' off"
-
-		cset "name='RECMIXL BST1 Switch' on"
-		cset "name='RECMIXR BST1 Switch' on"
-
 	]
 
 	DisableSequence [
 		cdev "hw:chtrt5645"
 
-		cset "name='Headset Mic Switch' off"
+		<codecs/rt5645-common/HSMicDisableSeq.conf>
 
-		cset "name='RECMIXL BST1 Switch' off"
-		cset "name='RECMIXR BST1 Switch' off"
-		cset "name='Sto1 ADC MIXL ADC1 Switch' off"
-		cset "name='Sto1 ADC MIXR ADC1 Switch' off"
 		cset "name='Mono ADC MIXL ADC1 Switch' on"
 		cset "name='Mono ADC MIXR ADC1 Switch' on"
-
 	]
 }
src/conf/ucm/chtrt5645/HiFi.conf +2 -13
index 1bb9830d..ac5f60e2 100644
@@ -136,10 +136,8 @@ SectionDevice."HSMic".0 {
 	EnableSequence [
 		cdev "hw:chtrt5645"
 
-		cset "name='Headset Mic Switch' on"
+		<codecs/rt5645-common/HSMicEnableSeq.conf>
 
-		cset "name='Sto1 ADC MIXL ADC1 Switch' on"
-		cset "name='Sto1 ADC MIXR ADC1 Switch' on"
 		cset "name='Sto1 ADC MIXL ADC2 Switch' off"
 		cset "name='Sto1 ADC MIXR ADC2 Switch' off"
 
@@ -147,23 +145,14 @@ SectionDevice."HSMic".0 {
 		cset "name='Mono ADC MIXR ADC1 Switch' on"
 		cset "name='Mono ADC MIXL ADC2 Switch' off"
 		cset "name='Mono ADC MIXR ADC2 Switch' off"
-
-		cset "name='RECMIXL BST1 Switch' on"
-		cset "name='RECMIXR BST1 Switch' on"
-
 	]
 
 	DisableSequence [
 		cdev "hw:chtrt5645"
 
-		cset "name='Headset Mic Switch' off"
+		<codecs/rt5645-common/HSMicDisableSeq.conf>
 
-		cset "name='RECMIXL BST1 Switch' off"
-		cset "name='RECMIXR BST1 Switch' off"
-		cset "name='Sto1 ADC MIXL ADC1 Switch' off"
-		cset "name='Sto1 ADC MIXR ADC1 Switch' off"
 		cset "name='Mono ADC MIXL ADC1 Switch' on"
 		cset "name='Mono ADC MIXR ADC1 Switch' on"
-
 	]
 }
src/conf/ucm/chtrt5650/HiFi.conf +4 -10
index c8bd397a..641dbc34 100644
@@ -118,22 +118,16 @@ SectionDevice."HSMic".0 {
 	EnableSequence [
 		cdev "hw:chtrt5650"
 
-		cset "name='Headset Mic Switch' on"
-		cset "name='RECMIXL BST1 Switch' on"
-		cset "name='RECMIXR BST1 Switch' on"
-		cset "name='Sto1 ADC MIXL ADC1 Switch' on"
-		cset "name='Sto1 ADC MIXR ADC1 Switch' on"
+		<codecs/rt5645-common/HSMicEnableSeq.conf>
+
 		cset "name='IN1 Boost' 1"
 	]
 
 	DisableSequence [
 		cdev "hw:chtrt5650"
 
-		cset "name='Headset Mic Switch' off"
-		cset "name='RECMIXL BST1 Switch' off"
-		cset "name='RECMIXR BST1 Switch' off"
-		cset "name='Sto1 ADC MIXL ADC1 Switch' off"
-		cset "name='Sto1 ADC MIXR ADC1 Switch' off"
+		<codecs/rt5645-common/HSMicDisableSeq.conf>
+
 		cset "name='IN1 Boost' 0"
 	]
 }
src/conf/ucm/codecs/rt5645-common/DigitalMicDisableSeq.conf new file +5 -0
new file mode 100644
index 00000000..751f38c0
@@ -0,0 +1,5 @@
+cset "name='Sto1 ADC MIXL ADC2 Switch' off"
+cset "name='Sto1 ADC MIXR ADC2 Switch' off"
+cset "name='Mono ADC MIXL ADC2 Switch' off"
+cset "name='Mono ADC MIXR ADC2 Switch' off"
+cset "name='Int Mic Switch' off"
src/conf/ucm/codecs/rt5645-common/DigitalMicEnableSeq.conf new file +10 -0
new file mode 100644
index 00000000..cb243b33
@@ -0,0 +1,10 @@
+cset "name='Int Mic Switch' on"
+
+cset "name='Sto1 ADC MIXL ADC1 Switch' off"
+cset "name='Sto1 ADC MIXR ADC1 Switch' off"
+cset "name='Sto1 ADC MIXL ADC2 Switch' on"
+cset "name='Sto1 ADC MIXR ADC2 Switch' on"
+cset "name='Mono ADC MIXL ADC1 Switch' off"
+cset "name='Mono ADC MIXR ADC1 Switch' off"
+cset "name='Mono ADC MIXL ADC2 Switch' on"
+cset "name='Mono ADC MIXR ADC2 Switch' on"
src/conf/ucm/codecs/rt5645-common/HSMicDisableSeq.conf new file +6 -0
new file mode 100644
index 00000000..ef42b176
@@ -0,0 +1,6 @@
+cset "name='Headset Mic Switch' off"
+
+cset "name='RECMIXL BST1 Switch' off"
+cset "name='RECMIXR BST1 Switch' off"
+cset "name='Sto1 ADC MIXL ADC1 Switch' off"
+cset "name='Sto1 ADC MIXR ADC1 Switch' off"
src/conf/ucm/codecs/rt5645-common/HSMicEnableSeq.conf new file +7 -0
new file mode 100644
index 00000000..6c26d687
@@ -0,0 +1,7 @@
+cset "name='Headset Mic Switch' on"
+
+cset "name='Sto1 ADC MIXL ADC1 Switch' on"
+cset "name='Sto1 ADC MIXR ADC1 Switch' on"
+
+cset "name='RECMIXL BST1 Switch' on"
+cset "name='RECMIXR BST1 Switch' on"
src/conf/ucm/codecs/rt5645-common/Makefile.am +3 -1
index 7eff2e72..06403d9b 100644
@@ -1,5 +1,7 @@
 alsaconfigdir = @ALSA_CONFIG_DIR@
 ucmdir = $(alsaconfigdir)/ucm/codecs/rt5645-common
 ucm_DATA = DisableSeq.conf EnableSeq.conf HeadphonesEnableSeq.conf \
-		   SpeakerEnableSeq.conf
+		   SpeakerEnableSeq.conf DigitalMicDisableSeq.conf \
+		   DigitalMicEnableSeq.conf HSMicDisableSeq.conf \
+		   HSMicEnableSeq.conf
 EXTRA_DIST = $(ucm_DATA)
Signature · 1 line
2.20.1
#5 lore raw

PATCH 5/5 Create device comoponent for rt5645 Internal Analog Mic UCM

In reply to [email protected]

From: Russell Parker <[email protected]>

Since the Internal Analog Microphone device configuration is identical for the rt5645 and rt5645 mono speaker UCMs, move the entire definition to a component.

src/conf/ucm/chtrt5645-mono-speaker-analog-mic/HiFi.conf +1 -43
index 489390d5..8497fa66 100644
@@ -89,49 +89,7 @@ SectionDevice."Headphones" {
 	]
 }
 
-SectionDevice."Mic".0 {
-	Comment "Internal Analog Microphone"
-
-	Value {
-		CaptureChannels "2"
-		CapturePriority "150"
-	}
-
-	EnableSequence [
-		cdev "hw:chtrt5645"
-
-		cset "name='Int Analog Mic Switch' on"
-
-		cset "name='Sto1 ADC MIXL ADC1 Switch' on"
-		cset "name='Sto1 ADC MIXR ADC1 Switch' on"
-		cset "name='Sto1 ADC MIXL ADC2 Switch' off"
-		cset "name='Sto1 ADC MIXR ADC2 Switch' off"
-
-		cset "name='Mono ADC MIXL ADC1 Switch' on"
-		cset "name='Mono ADC MIXR ADC1 Switch' on"
-		cset "name='Mono ADC MIXL ADC2 Switch' off"
-		cset "name='Mono ADC MIXR ADC2 Switch' off"
-
-		cset "name='RECMIXL BST2 Switch' on"
-		cset "name='RECMIXR BST2 Switch' on"
-
-	]
-
-	DisableSequence [
-		cdev "hw:chtrt5645"
-
-		cset "name='Sto1 ADC MIXL ADC1 Switch' off"
-		cset "name='Sto1 ADC MIXR ADC1 Switch' off"
-		cset "name='Mono ADC MIXL ADC1 Switch' off"
-		cset "name='Mono ADC MIXR ADC1 Switch' off"
-
-		cset "name='RECMIXL BST2 Switch' off"
-		cset "name='RECMIXR BST2 Switch' off"
-
-		cset "name='Int Analog Mic Switch' off"
-	]
-}
-
+<codecs/rt5645-common/AnalogMic.conf>
 
 SectionDevice."HSMic".0 {
 	Comment "Headset Microphone"
src/conf/ucm/chtrt5645/HiFi.conf +1 -42

49 lines not on this page · raw message

src/conf/ucm/codecs/rt5645-common/AnalogMic.conf new file +41 -0

41 lines not on this page · raw message

src/conf/ucm/codecs/rt5645-common/Makefile.am +1 -1
index 06403d9b..75924b40 100644
@@ -3,5 +3,5 @@ ucmdir = $(alsaconfigdir)/ucm/codecs/rt5645-common
 ucm_DATA = DisableSeq.conf EnableSeq.conf HeadphonesEnableSeq.conf \
 		   SpeakerEnableSeq.conf DigitalMicDisableSeq.conf \
 		   DigitalMicEnableSeq.conf HSMicDisableSeq.conf \
-		   HSMicEnableSeq.conf
+		   HSMicEnableSeq.conf AnalogMic.conf
 EXTRA_DIST = $(ucm_DATA)
Signature · 1 line
2.20.1
#6 lore raw
In reply to [email protected]

Dne 6.1.2019 v 04:47 [email protected] napsal(a):

Quoted 13 lines

Hi,

When I submitted a patch to create a UCM config for chtrt5650 it was suggested that I also factor out command sequences that it shares with chtrt5645. The following patchset introduces a new component directory codecs/rt5645-common/ and refactors UCM profiles in:

- chtrt5645
- chtrt5645-mono-speaker-analog-mic
- chtrt5650
- ASUSTeKCOMPUTERINC.-T100HAN-1.0-T100HAN
- LENOVO-80XF-LenovoMIIX320_10ICR-LNVNB161216

Quoted 4 lines

I compiled and tested playback with the rt5650 configs but I don't have the devices to test the other configurations. Suggestions and feedback are welcome, I'm not very familiar with UCM configuration so there may definitely be better approaches for some of these changes.

Thanks. I applied your changes to the alsa-lib's repo with only one minor modification - I changed rt5645-common directory name to rt5645. I don't see the reason to explicitly say that it's common code. All configs in the codecs/ tree are common, don't they?

Jaroslav

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

Dne 6.1.2019 v 04:47 [email protected] napsal(a):

Quoted 13 lines

Hi,

When I submitted a patch to create a UCM config for chtrt5650 it was suggested that I also factor out command sequences that it shares with chtrt5645. The following patchset introduces a new component directory codecs/rt5645-common/ and refactors UCM profiles in:

- chtrt5645
- chtrt5645-mono-speaker-analog-mic
- chtrt5650
- ASUSTeKCOMPUTERINC.-T100HAN-1.0-T100HAN
- LENOVO-80XF-LenovoMIIX320_10ICR-LNVNB161216

Quoted 4 lines

I compiled and tested playback with the rt5650 configs but I don't have the devices to test the other configurations. Suggestions and feedback are welcome, I'm not very familiar with UCM configuration so there may definitely be better approaches for some of these changes.

Quoted 4 lines

Thanks. I applied your changes to the alsa-lib's repo with only one minor modification - I changed rt5645-common directory name to rt5645. I don't see the reason to explicitly say that it's common code. All configs in the codecs/ tree are common, don't they?

I went with rt5645-common/ because it's common across multiple codecs -- the rt5650 chips are a lower-cost version of the rt5645 so I reused components from the shared folder for the chtrt5650 conf too. Apparently, the alc3278 may be similar to the rt5650 as Bossart mentioned in the earlier thread "Add UCM config for chtrt5650", so if UCM support is added the same sequences could be potentially used for that too.

Anyway, that was the naming motivation, but I'm not too picky.

Thanks!

- Russell

Quoted 6 lines

Jaroslav

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