Alsa-Devel Archive on lore.kernel.org
 help / color / Atom feed
* [alsa-devel] [PATCH alsa-ucm-conf 0/7] DB410c/msm8916-wcd UCM fixes/additions
@ 2020-01-14 11:21 Stephan Gerhold
  2020-01-14 11:21 ` [alsa-devel] [PATCH alsa-ucm-conf 1/7] DB410c: Rename Handset to HeadsetMic Stephan Gerhold
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Stephan Gerhold @ 2020-01-14 11:21 UTC (permalink / raw)
  To: Jaroslav Kysela; +Cc: alsa-devel, patch, Srinivas Kandagatla, Stephan Gerhold

This is a collection of fixes/refactoring/additions for the DB410c UCM files.
My goal is to also make them usable for other MSM8916 devices, e.g.
the three MSM8916 smartphones which can run mainline Linux since
https://lore.kernel.org/linux-arm-msm/20190722092211.100586-1-stephan@gerhold.net/

For now this is just preparation - this patch series refactors the DB410c
UCM configuration into re-usable device fragments that can be included
when needed.

By the way: it seems like the UCM2 conversion (specifically,
commit 14facf88b56 ("DB410c: adapt to ucm2") breaks PulseAudio because
the Playback/CaptureChannels were moved from all the "SectionDevice"s to
"SectionVerb":

I: [pulseaudio] alsa-ucm.c: UCM available for card msm8916
I: [pulseaudio] alsa-ucm.c: Set UCM verb to HiFi
W: [pulseaudio] alsa-ucm.c: UCM file does not specify 'PlaybackChannels' or 'CaptureChannels'for device DigitalMic, assuming stereo duplex.
W: [pulseaudio] alsa-ucm.c: UCM file does not specify 'PlaybackChannels' or 'CaptureChannels'for device SecondaryMic, assuming stereo duplex.
W: [pulseaudio] alsa-ucm.c: UCM file does not specify 'PlaybackChannels' or 'CaptureChannels'for device PrimaryMic, assuming stereo duplex.
W: [pulseaudio] alsa-ucm.c: UCM file does not specify 'PlaybackChannels' or 'CaptureChannels'for device Handset, assuming stereo duplex.
W: [pulseaudio] alsa-ucm.c: UCM file does not specify 'PlaybackChannels' or 'CaptureChannels'for device Earpiece, assuming stereo duplex.
W: [pulseaudio] alsa-ucm.c: UCM file does not specify 'PlaybackChannels' or 'CaptureChannels'for device Headphones, assuming stereo duplex.
W: [pulseaudio] alsa-ucm.c: UCM file does not specify 'PlaybackChannels' or 'CaptureChannels'for device Speaker, assuming stereo duplex.
I: [pulseaudio] module-alsa-card.c: Found UCM profiles
E: [pulseaudio] alsa-ucm.c: No sink and source at HiFi: DigitalMic
E: [pulseaudio] alsa-ucm.c: No sink and source at HiFi: SecondaryMic
E: [pulseaudio] alsa-ucm.c: No sink and source at HiFi: PrimaryMic
E: [pulseaudio] alsa-ucm.c: No sink and source at HiFi: Handset
E: [pulseaudio] alsa-ucm.c: No sink and source at HiFi: Earpiece
E: [pulseaudio] alsa-ucm.c: No sink and source at HiFi: Headphones
E: [pulseaudio] alsa-ucm.c: No sink and source at HiFi: Speaker
I: [pulseaudio] alsa-ucm.c: Set ucm verb to HiFi

It seems like PulseAudio does not inherit them from "SectionVerb",
but I'm not sure if this is a problem in PulseAudio or alsa-lib.
Restoring Playback/CaptureChannels for all the "SectionDevice"s fixes the problem.

Stephan Gerhold (7):
  DB410c: Rename Handset to HeadsetMic
  DB410c: Split devices into re-usable fragments in codecs/msm8916-wcd
  codecs/msm8916-wcd: Speaker: Reset volume on disable
  codecs/msm8916-wcd: Headphones: Drop invalid RDAC2 MUX value
  codecs/msm8916-wcd: Earpiece: Add missing Enable/DisableSequence
  codecs/msm8916-wcd: SecondaryMic: Select correct input
  codecs/msm8916-wcd: Add ConflictingDevice for capture devices

 ucm2/DB410c/HiFi.conf                     | 128 +---------------------
 ucm2/codecs/msm8916-wcd/DigitalMic.conf   |  18 +++
 ucm2/codecs/msm8916-wcd/Earpiece.conf     |  22 ++++
 ucm2/codecs/msm8916-wcd/Headphones.conf   |  29 +++++
 ucm2/codecs/msm8916-wcd/HeadsetMic.conf   |  22 ++++
 ucm2/codecs/msm8916-wcd/PrimaryMic.conf   |  20 ++++
 ucm2/codecs/msm8916-wcd/SecondaryMic.conf |  22 ++++
 ucm2/codecs/msm8916-wcd/Speaker.conf      |  21 ++++
 8 files changed, 160 insertions(+), 122 deletions(-)
 create mode 100644 ucm2/codecs/msm8916-wcd/DigitalMic.conf
 create mode 100644 ucm2/codecs/msm8916-wcd/Earpiece.conf
 create mode 100644 ucm2/codecs/msm8916-wcd/Headphones.conf
 create mode 100644 ucm2/codecs/msm8916-wcd/HeadsetMic.conf
 create mode 100644 ucm2/codecs/msm8916-wcd/PrimaryMic.conf
 create mode 100644 ucm2/codecs/msm8916-wcd/SecondaryMic.conf
 create mode 100644 ucm2/codecs/msm8916-wcd/Speaker.conf

-- 
2.24.1

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

* [alsa-devel] [PATCH alsa-ucm-conf 1/7] DB410c: Rename Handset to HeadsetMic
  2020-01-14 11:21 [alsa-devel] [PATCH alsa-ucm-conf 0/7] DB410c/msm8916-wcd UCM fixes/additions Stephan Gerhold
@ 2020-01-14 11:21 ` Stephan Gerhold
  2020-01-14 11:21 ` [alsa-devel] [PATCH alsa-ucm-conf 2/7] DB410c: Split devices into re-usable fragments in codecs/msm8916-wcd Stephan Gerhold
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Stephan Gerhold @ 2020-01-14 11:21 UTC (permalink / raw)
  To: Jaroslav Kysela; +Cc: alsa-devel, patch, Srinivas Kandagatla, Stephan Gerhold

The "Handset" device actually configures the headset microphone,
as indicated in the comment.

The actual "Handset" microphone used for voice calls is usually
internal and connected to PrimaryMic.

Rename the current "Handset" device to "HeadsetMic" for clarity.

Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
---
 ucm2/DB410c/HiFi.conf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ucm2/DB410c/HiFi.conf b/ucm2/DB410c/HiFi.conf
index 848d02f..a0ef42c 100644
--- a/ucm2/DB410c/HiFi.conf
+++ b/ucm2/DB410c/HiFi.conf
@@ -75,7 +75,7 @@ SectionDevice."Earpiece" {
 	]
 }
 
-SectionDevice."Handset" {
+SectionDevice."HeadsetMic" {
 	Comment "Headset Microphone"
 
 	EnableSequence [
-- 
2.24.1

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

* [alsa-devel] [PATCH alsa-ucm-conf 2/7] DB410c: Split devices into re-usable fragments in codecs/msm8916-wcd
  2020-01-14 11:21 [alsa-devel] [PATCH alsa-ucm-conf 0/7] DB410c/msm8916-wcd UCM fixes/additions Stephan Gerhold
  2020-01-14 11:21 ` [alsa-devel] [PATCH alsa-ucm-conf 1/7] DB410c: Rename Handset to HeadsetMic Stephan Gerhold
@ 2020-01-14 11:21 ` Stephan Gerhold
  2020-01-14 11:21 ` [alsa-devel] [PATCH alsa-ucm-conf 3/7] codecs/msm8916-wcd: Speaker: Reset volume on disable Stephan Gerhold
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Stephan Gerhold @ 2020-01-14 11:21 UTC (permalink / raw)
  To: Jaroslav Kysela; +Cc: alsa-devel, patch, Srinivas Kandagatla, Stephan Gerhold

The DB410c use case configuration is also useful for other MSM8916 devices.

However, the available devices usually depend on the exact device model.
For example, DB410c has nothing connected to the Earpiece,
most MSM8916 smartphones do not have a DigitalMic, and some use
a custom speaker amplifier (connected via I2S) instead of the
speaker amplifier provided by PM8916.

Similar differences across devices are handled using re-usable
device fragments in the codecs/ directory. Do the same for msm8916-wcd
and move the device fragments to codecs/msm8916-wcd.

Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
---
 ucm2/DB410c/HiFi.conf                     | 128 +---------------------
 ucm2/codecs/msm8916-wcd/DigitalMic.conf   |  12 ++
 ucm2/codecs/msm8916-wcd/Earpiece.conf     |   8 ++
 ucm2/codecs/msm8916-wcd/Headphones.conf   |  30 +++++
 ucm2/codecs/msm8916-wcd/HeadsetMic.conf   |  16 +++
 ucm2/codecs/msm8916-wcd/PrimaryMic.conf   |  14 +++
 ucm2/codecs/msm8916-wcd/SecondaryMic.conf |  16 +++
 ucm2/codecs/msm8916-wcd/Speaker.conf      |  20 ++++
 8 files changed, 122 insertions(+), 122 deletions(-)
 create mode 100644 ucm2/codecs/msm8916-wcd/DigitalMic.conf
 create mode 100644 ucm2/codecs/msm8916-wcd/Earpiece.conf
 create mode 100644 ucm2/codecs/msm8916-wcd/Headphones.conf
 create mode 100644 ucm2/codecs/msm8916-wcd/HeadsetMic.conf
 create mode 100644 ucm2/codecs/msm8916-wcd/PrimaryMic.conf
 create mode 100644 ucm2/codecs/msm8916-wcd/SecondaryMic.conf
 create mode 100644 ucm2/codecs/msm8916-wcd/Speaker.conf

diff --git a/ucm2/DB410c/HiFi.conf b/ucm2/DB410c/HiFi.conf
index a0ef42c..4b82fbf 100644
--- a/ucm2/DB410c/HiFi.conf
+++ b/ucm2/DB410c/HiFi.conf
@@ -13,126 +13,10 @@ SectionVerb {
 	}
 }
 
+<codecs/msm8916-wcd/Speaker.conf>
+<codecs/msm8916-wcd/Headphones.conf>
 
-SectionDevice."Speaker" {
-	Comment "Speaker playback"
-
-	ConflictingDevice [
-		"Headphones"
-		"Earpiece"
-	]
-
-	EnableSequence [
-		cset "name='SPK DAC Switch' 1"
-		cset "name='RX3 MIX1 INP1' RX1"
-		## gain to  0dB
-		cset "name='RX3 Digital Volume' 128"
-	]
-
-	DisableSequence [
-		cset "name='SPK DAC Switch' 0"
-		cset "name='RX3 MIX1 INP1' ZERO"
-	]
-}
-
-
-SectionDevice."Headphones" {
-	Comment "Headphones playback"
-
-	ConflictingDevice [
-		"Speaker"
-		"Earpiece"
-	]
-	EnableSequence [
-		cset "name='RX1 MIX1 INP1' RX1"
-		cset "name='RX2 MIX1 INP1' RX2"
-		cset "name='RDAC2 MUX' RX2"
-		cset "name='HPHL' 1"
-		cset "name='HPHR' 1"
-		## gain to  0dB
-		cset "name='RX1 Digital Volume' 128"
-		## gain to  0dB
-		cset "name='RX2 Digital Volume' 128"
-	]
-
-	DisableSequence [
-		cset "name='RX1 Digital Volume' 0"
-		cset "name='RX2 Digital Volume' 0"
-		cset "name='HPHL' 0"
-		cset "name='HPHR' 0"
-		cset "name='RDAC2 MUX' ZERO"
-		cset "name='RX1 MIX1 INP1' ZERO"
-		cset "name='RX2 MIX1 INP1' ZERO"
-	]
-}
-
-SectionDevice."Earpiece" {
-	Comment "Earpiece playback"
-
-	ConflictingDevice [
-		"Speaker"
-		"Headphones"
-	]
-}
-
-SectionDevice."HeadsetMic" {
-	Comment "Headset Microphone"
-
-	EnableSequence [
-		cset "name='DEC1 MUX' ADC2"
-		cset "name='CIC1 MUX' AMIC"
-		cset "name='ADC2 Volume' 8"
-		cset "name='ADC2 MUX' INP2"
-	]
-
-	DisableSequence [
-		cset "name='ADC2 MUX' ZERO"
-		cset "name='ADC2 Volume' 0"
-		cset "name='DEC1 MUX' ZERO"
-	]
-}
-
-SectionDevice."PrimaryMic" {
-	Comment "Primary Microphone"
-
-	EnableSequence [
-		cset "name='DEC1 MUX' ADC1"
-		cset "name='CIC1 MUX' AMIC"
-		cset "name='ADC1 Volume' 8"
-	]
-
-	DisableSequence [
-		cset "name='DEC1 MUX' ZERO"
-		cset "name='ADC1 Volume' 0"
-	]
-}
-
-SectionDevice."SecondaryMic" {
-	Comment "Secondary Microphone"
-
-	EnableSequence [
-		cset "name='DEC1 MUX' ADC2"
-		cset "name='CIC1 MUX' AMIC"
-		cset "name='ADC2 Volume' 8"
-		cset "name='ADC2 MUX' INP2"
-	]
-
-	DisableSequence [
-		cset "name='DEC1 MUX' ZERO"
-		cset "name='ADC2 Volume' 0"
-		cset "name='ADC2 MUX' ZERO"
-	]
-}
-
-SectionDevice."DigitalMic" {
-	Comment "Digital Microphone"
-
-	EnableSequence [
-		cset "name='DEC1 MUX' DMIC1"
-		cset "name='CIC1 MUX' DMIC"
-	]
-
-	DisableSequence [
-		cset "name='DEC1 MUX' ZERO"
-	]
-}
+<codecs/msm8916-wcd/PrimaryMic.conf>
+<codecs/msm8916-wcd/HeadsetMic.conf>
+<codecs/msm8916-wcd/SecondaryMic.conf>
+<codecs/msm8916-wcd/DigitalMic.conf>
diff --git a/ucm2/codecs/msm8916-wcd/DigitalMic.conf b/ucm2/codecs/msm8916-wcd/DigitalMic.conf
new file mode 100644
index 0000000..35dfb1b
--- /dev/null
+++ b/ucm2/codecs/msm8916-wcd/DigitalMic.conf
@@ -0,0 +1,12 @@
+SectionDevice."DigitalMic" {
+	Comment "Digital Microphone"
+
+	EnableSequence [
+		cset "name='DEC1 MUX' DMIC1"
+		cset "name='CIC1 MUX' DMIC"
+	]
+
+	DisableSequence [
+		cset "name='DEC1 MUX' ZERO"
+	]
+}
diff --git a/ucm2/codecs/msm8916-wcd/Earpiece.conf b/ucm2/codecs/msm8916-wcd/Earpiece.conf
new file mode 100644
index 0000000..e9f8b9d
--- /dev/null
+++ b/ucm2/codecs/msm8916-wcd/Earpiece.conf
@@ -0,0 +1,8 @@
+SectionDevice."Earpiece" {
+	Comment "Earpiece playback"
+
+	ConflictingDevice [
+		"Speaker"
+		"Headphones"
+	]
+}
diff --git a/ucm2/codecs/msm8916-wcd/Headphones.conf b/ucm2/codecs/msm8916-wcd/Headphones.conf
new file mode 100644
index 0000000..7a2090e
--- /dev/null
+++ b/ucm2/codecs/msm8916-wcd/Headphones.conf
@@ -0,0 +1,30 @@
+SectionDevice."Headphones" {
+	Comment "Headphones playback"
+
+	ConflictingDevice [
+		"Speaker"
+		"Earpiece"
+	]
+
+	EnableSequence [
+		cset "name='RX1 MIX1 INP1' RX1"
+		cset "name='RX2 MIX1 INP1' RX2"
+		cset "name='RDAC2 MUX' RX2"
+		cset "name='HPHL' 1"
+		cset "name='HPHR' 1"
+		## gain to  0dB
+		cset "name='RX1 Digital Volume' 128"
+		## gain to  0dB
+		cset "name='RX2 Digital Volume' 128"
+	]
+
+	DisableSequence [
+		cset "name='RX1 Digital Volume' 0"
+		cset "name='RX2 Digital Volume' 0"
+		cset "name='HPHL' 0"
+		cset "name='HPHR' 0"
+		cset "name='RDAC2 MUX' ZERO"
+		cset "name='RX1 MIX1 INP1' ZERO"
+		cset "name='RX2 MIX1 INP1' ZERO"
+	]
+}
diff --git a/ucm2/codecs/msm8916-wcd/HeadsetMic.conf b/ucm2/codecs/msm8916-wcd/HeadsetMic.conf
new file mode 100644
index 0000000..538d895
--- /dev/null
+++ b/ucm2/codecs/msm8916-wcd/HeadsetMic.conf
@@ -0,0 +1,16 @@
+SectionDevice."HeadsetMic" {
+	Comment "Headset Microphone"
+
+	EnableSequence [
+		cset "name='DEC1 MUX' ADC2"
+		cset "name='CIC1 MUX' AMIC"
+		cset "name='ADC2 Volume' 8"
+		cset "name='ADC2 MUX' INP2"
+	]
+
+	DisableSequence [
+		cset "name='ADC2 MUX' ZERO"
+		cset "name='ADC2 Volume' 0"
+		cset "name='DEC1 MUX' ZERO"
+	]
+}
diff --git a/ucm2/codecs/msm8916-wcd/PrimaryMic.conf b/ucm2/codecs/msm8916-wcd/PrimaryMic.conf
new file mode 100644
index 0000000..6998458
--- /dev/null
+++ b/ucm2/codecs/msm8916-wcd/PrimaryMic.conf
@@ -0,0 +1,14 @@
+SectionDevice."PrimaryMic" {
+	Comment "Primary Microphone"
+
+	EnableSequence [
+		cset "name='DEC1 MUX' ADC1"
+		cset "name='CIC1 MUX' AMIC"
+		cset "name='ADC1 Volume' 8"
+	]
+
+	DisableSequence [
+		cset "name='DEC1 MUX' ZERO"
+		cset "name='ADC1 Volume' 0"
+	]
+}
diff --git a/ucm2/codecs/msm8916-wcd/SecondaryMic.conf b/ucm2/codecs/msm8916-wcd/SecondaryMic.conf
new file mode 100644
index 0000000..7811509
--- /dev/null
+++ b/ucm2/codecs/msm8916-wcd/SecondaryMic.conf
@@ -0,0 +1,16 @@
+SectionDevice."SecondaryMic" {
+	Comment "Secondary Microphone"
+
+	EnableSequence [
+		cset "name='DEC1 MUX' ADC2"
+		cset "name='CIC1 MUX' AMIC"
+		cset "name='ADC2 Volume' 8"
+		cset "name='ADC2 MUX' INP2"
+	]
+
+	DisableSequence [
+		cset "name='DEC1 MUX' ZERO"
+		cset "name='ADC2 Volume' 0"
+		cset "name='ADC2 MUX' ZERO"
+	]
+}
diff --git a/ucm2/codecs/msm8916-wcd/Speaker.conf b/ucm2/codecs/msm8916-wcd/Speaker.conf
new file mode 100644
index 0000000..2b1dd8a
--- /dev/null
+++ b/ucm2/codecs/msm8916-wcd/Speaker.conf
@@ -0,0 +1,20 @@
+SectionDevice."Speaker" {
+	Comment "Speaker playback"
+
+	ConflictingDevice [
+		"Headphones"
+		"Earpiece"
+	]
+
+	EnableSequence [
+		cset "name='SPK DAC Switch' 1"
+		cset "name='RX3 MIX1 INP1' RX1"
+		## gain to  0dB
+		cset "name='RX3 Digital Volume' 128"
+	]
+
+	DisableSequence [
+		cset "name='SPK DAC Switch' 0"
+		cset "name='RX3 MIX1 INP1' ZERO"
+	]
+}
-- 
2.24.1

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

* [alsa-devel] [PATCH alsa-ucm-conf 3/7] codecs/msm8916-wcd: Speaker: Reset volume on disable
  2020-01-14 11:21 [alsa-devel] [PATCH alsa-ucm-conf 0/7] DB410c/msm8916-wcd UCM fixes/additions Stephan Gerhold
  2020-01-14 11:21 ` [alsa-devel] [PATCH alsa-ucm-conf 1/7] DB410c: Rename Handset to HeadsetMic Stephan Gerhold
  2020-01-14 11:21 ` [alsa-devel] [PATCH alsa-ucm-conf 2/7] DB410c: Split devices into re-usable fragments in codecs/msm8916-wcd Stephan Gerhold
@ 2020-01-14 11:21 ` Stephan Gerhold
  2020-01-14 11:21 ` [alsa-devel] [PATCH alsa-ucm-conf 4/7] codecs/msm8916-wcd: Headphones: Drop invalid RDAC2 MUX value Stephan Gerhold
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Stephan Gerhold @ 2020-01-14 11:21 UTC (permalink / raw)
  To: Jaroslav Kysela; +Cc: alsa-devel, patch, Srinivas Kandagatla, Stephan Gerhold

For Headphones we reset the Digital Volume back to 0 when disabling
the device; do the same for the Speaker.

Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
---
 ucm2/codecs/msm8916-wcd/Speaker.conf | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ucm2/codecs/msm8916-wcd/Speaker.conf b/ucm2/codecs/msm8916-wcd/Speaker.conf
index 2b1dd8a..1e0dfa6 100644
--- a/ucm2/codecs/msm8916-wcd/Speaker.conf
+++ b/ucm2/codecs/msm8916-wcd/Speaker.conf
@@ -14,6 +14,7 @@ SectionDevice."Speaker" {
 	]
 
 	DisableSequence [
+		cset "name='RX3 Digital Volume' 0"
 		cset "name='SPK DAC Switch' 0"
 		cset "name='RX3 MIX1 INP1' ZERO"
 	]
-- 
2.24.1

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

* [alsa-devel] [PATCH alsa-ucm-conf 4/7] codecs/msm8916-wcd: Headphones: Drop invalid RDAC2 MUX value
  2020-01-14 11:21 [alsa-devel] [PATCH alsa-ucm-conf 0/7] DB410c/msm8916-wcd UCM fixes/additions Stephan Gerhold
                   ` (2 preceding siblings ...)
  2020-01-14 11:21 ` [alsa-devel] [PATCH alsa-ucm-conf 3/7] codecs/msm8916-wcd: Speaker: Reset volume on disable Stephan Gerhold
@ 2020-01-14 11:21 ` Stephan Gerhold
  2020-01-14 11:21 ` [alsa-devel] [PATCH alsa-ucm-conf 5/7] codecs/msm8916-wcd: Earpiece: Add missing Enable/DisableSequence Stephan Gerhold
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Stephan Gerhold @ 2020-01-14 11:21 UTC (permalink / raw)
  To: Jaroslav Kysela; +Cc: alsa-devel, patch, Srinivas Kandagatla, Stephan Gerhold

As of commit 9110d1b0e229c ("ASoC: msm8916-wcd-analog: Fix RX1 selection in RDAC2 MUX")
in the Linux kernel, the RDAC2 MUX mixer can be only set to RX1 or RX2.
Drop the invalid value from the UCM configuration.

Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
---
 ucm2/codecs/msm8916-wcd/Headphones.conf | 1 -
 1 file changed, 1 deletion(-)

diff --git a/ucm2/codecs/msm8916-wcd/Headphones.conf b/ucm2/codecs/msm8916-wcd/Headphones.conf
index 7a2090e..380787d 100644
--- a/ucm2/codecs/msm8916-wcd/Headphones.conf
+++ b/ucm2/codecs/msm8916-wcd/Headphones.conf
@@ -23,7 +23,6 @@ SectionDevice."Headphones" {
 		cset "name='RX2 Digital Volume' 0"
 		cset "name='HPHL' 0"
 		cset "name='HPHR' 0"
-		cset "name='RDAC2 MUX' ZERO"
 		cset "name='RX1 MIX1 INP1' ZERO"
 		cset "name='RX2 MIX1 INP1' ZERO"
 	]
-- 
2.24.1

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

* [alsa-devel] [PATCH alsa-ucm-conf 5/7] codecs/msm8916-wcd: Earpiece: Add missing Enable/DisableSequence
  2020-01-14 11:21 [alsa-devel] [PATCH alsa-ucm-conf 0/7] DB410c/msm8916-wcd UCM fixes/additions Stephan Gerhold
                   ` (3 preceding siblings ...)
  2020-01-14 11:21 ` [alsa-devel] [PATCH alsa-ucm-conf 4/7] codecs/msm8916-wcd: Headphones: Drop invalid RDAC2 MUX value Stephan Gerhold
@ 2020-01-14 11:21 ` Stephan Gerhold
  2020-01-14 11:21 ` [alsa-devel] [PATCH alsa-ucm-conf 6/7] codecs/msm8916-wcd: SecondaryMic: Select correct input Stephan Gerhold
  2020-01-14 11:21 ` [alsa-devel] [PATCH alsa-ucm-conf 7/7] codecs/msm8916-wcd: Add ConflictingDevice for capture devices Stephan Gerhold
  6 siblings, 0 replies; 8+ messages in thread
From: Stephan Gerhold @ 2020-01-14 11:21 UTC (permalink / raw)
  To: Jaroslav Kysela; +Cc: alsa-devel, patch, Srinivas Kandagatla, Stephan Gerhold

Since commit 7d2f70f248ab ("ASoC: msm8916-wcd-analog: Add earpiece")
in the Linux kernel, the Earpiece in msm8916-wcd is now supported.
Add the necessary Enable/DisableSequence for it.

Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
---
 ucm2/codecs/msm8916-wcd/Earpiece.conf | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/ucm2/codecs/msm8916-wcd/Earpiece.conf b/ucm2/codecs/msm8916-wcd/Earpiece.conf
index e9f8b9d..726b436 100644
--- a/ucm2/codecs/msm8916-wcd/Earpiece.conf
+++ b/ucm2/codecs/msm8916-wcd/Earpiece.conf
@@ -5,4 +5,18 @@ SectionDevice."Earpiece" {
 		"Speaker"
 		"Headphones"
 	]
+
+	EnableSequence [
+		cset "name='RX1 MIX1 INP1' RX1"
+		cset "name='RDAC2 MUX' RX1"
+		cset "name='EAR_S' 1"
+		## gain to  0dB
+		cset "name='RX1 Digital Volume' 128"
+	]
+
+	DisableSequence [
+		cset "name='RX1 Digital Volume' 0"
+		cset "name='EAR_S' 0"
+		cset "name='RX1 MIX1 INP1' ZERO"
+	]
 }
-- 
2.24.1

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

* [alsa-devel] [PATCH alsa-ucm-conf 6/7] codecs/msm8916-wcd: SecondaryMic: Select correct input
  2020-01-14 11:21 [alsa-devel] [PATCH alsa-ucm-conf 0/7] DB410c/msm8916-wcd UCM fixes/additions Stephan Gerhold
                   ` (4 preceding siblings ...)
  2020-01-14 11:21 ` [alsa-devel] [PATCH alsa-ucm-conf 5/7] codecs/msm8916-wcd: Earpiece: Add missing Enable/DisableSequence Stephan Gerhold
@ 2020-01-14 11:21 ` Stephan Gerhold
  2020-01-14 11:21 ` [alsa-devel] [PATCH alsa-ucm-conf 7/7] codecs/msm8916-wcd: Add ConflictingDevice for capture devices Stephan Gerhold
  6 siblings, 0 replies; 8+ messages in thread
From: Stephan Gerhold @ 2020-01-14 11:21 UTC (permalink / raw)
  To: Jaroslav Kysela; +Cc: alsa-devel, patch, Srinivas Kandagatla, Stephan Gerhold

At the moment, enabling "SecondaryMic" actually results in enabling
the HeadsetMic. The enable sequence for the secondary microphone
is similar, but ADC2 MUX must be set to INP3 and the volume set
through ADC3 Volume.

Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
---
 ucm2/codecs/msm8916-wcd/SecondaryMic.conf | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/ucm2/codecs/msm8916-wcd/SecondaryMic.conf b/ucm2/codecs/msm8916-wcd/SecondaryMic.conf
index 7811509..fdc5df8 100644
--- a/ucm2/codecs/msm8916-wcd/SecondaryMic.conf
+++ b/ucm2/codecs/msm8916-wcd/SecondaryMic.conf
@@ -4,13 +4,13 @@ SectionDevice."SecondaryMic" {
 	EnableSequence [
 		cset "name='DEC1 MUX' ADC2"
 		cset "name='CIC1 MUX' AMIC"
-		cset "name='ADC2 Volume' 8"
-		cset "name='ADC2 MUX' INP2"
+		cset "name='ADC3 Volume' 8"
+		cset "name='ADC2 MUX' INP3"
 	]
 
 	DisableSequence [
 		cset "name='DEC1 MUX' ZERO"
-		cset "name='ADC2 Volume' 0"
+		cset "name='ADC3 Volume' 0"
 		cset "name='ADC2 MUX' ZERO"
 	]
 }
-- 
2.24.1

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

* [alsa-devel] [PATCH alsa-ucm-conf 7/7] codecs/msm8916-wcd: Add ConflictingDevice for capture devices
  2020-01-14 11:21 [alsa-devel] [PATCH alsa-ucm-conf 0/7] DB410c/msm8916-wcd UCM fixes/additions Stephan Gerhold
                   ` (5 preceding siblings ...)
  2020-01-14 11:21 ` [alsa-devel] [PATCH alsa-ucm-conf 6/7] codecs/msm8916-wcd: SecondaryMic: Select correct input Stephan Gerhold
@ 2020-01-14 11:21 ` Stephan Gerhold
  6 siblings, 0 replies; 8+ messages in thread
From: Stephan Gerhold @ 2020-01-14 11:21 UTC (permalink / raw)
  To: Jaroslav Kysela; +Cc: alsa-devel, patch, Srinivas Kandagatla, Stephan Gerhold

At the moment, all capture devices are configured to go through DEC1,
so there is no way to use more than one of the microphones at a time.

Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
---
 ucm2/codecs/msm8916-wcd/DigitalMic.conf   | 6 ++++++
 ucm2/codecs/msm8916-wcd/HeadsetMic.conf   | 6 ++++++
 ucm2/codecs/msm8916-wcd/PrimaryMic.conf   | 6 ++++++
 ucm2/codecs/msm8916-wcd/SecondaryMic.conf | 6 ++++++
 4 files changed, 24 insertions(+)

diff --git a/ucm2/codecs/msm8916-wcd/DigitalMic.conf b/ucm2/codecs/msm8916-wcd/DigitalMic.conf
index 35dfb1b..3446506 100644
--- a/ucm2/codecs/msm8916-wcd/DigitalMic.conf
+++ b/ucm2/codecs/msm8916-wcd/DigitalMic.conf
@@ -1,6 +1,12 @@
 SectionDevice."DigitalMic" {
 	Comment "Digital Microphone"
 
+	ConflictingDevice [
+		"PrimaryMic"
+		"SecondaryMic"
+		"HeadsetMic"
+	]
+
 	EnableSequence [
 		cset "name='DEC1 MUX' DMIC1"
 		cset "name='CIC1 MUX' DMIC"
diff --git a/ucm2/codecs/msm8916-wcd/HeadsetMic.conf b/ucm2/codecs/msm8916-wcd/HeadsetMic.conf
index 538d895..2a96e49 100644
--- a/ucm2/codecs/msm8916-wcd/HeadsetMic.conf
+++ b/ucm2/codecs/msm8916-wcd/HeadsetMic.conf
@@ -1,6 +1,12 @@
 SectionDevice."HeadsetMic" {
 	Comment "Headset Microphone"
 
+	ConflictingDevice [
+		"PrimaryMic"
+		"SecondaryMic"
+		"DigitalMic"
+	]
+
 	EnableSequence [
 		cset "name='DEC1 MUX' ADC2"
 		cset "name='CIC1 MUX' AMIC"
diff --git a/ucm2/codecs/msm8916-wcd/PrimaryMic.conf b/ucm2/codecs/msm8916-wcd/PrimaryMic.conf
index 6998458..9d549ef 100644
--- a/ucm2/codecs/msm8916-wcd/PrimaryMic.conf
+++ b/ucm2/codecs/msm8916-wcd/PrimaryMic.conf
@@ -1,6 +1,12 @@
 SectionDevice."PrimaryMic" {
 	Comment "Primary Microphone"
 
+	ConflictingDevice [
+		"SecondaryMic"
+		"HeadsetMic"
+		"DigitalMic"
+	]
+
 	EnableSequence [
 		cset "name='DEC1 MUX' ADC1"
 		cset "name='CIC1 MUX' AMIC"
diff --git a/ucm2/codecs/msm8916-wcd/SecondaryMic.conf b/ucm2/codecs/msm8916-wcd/SecondaryMic.conf
index fdc5df8..d81324c 100644
--- a/ucm2/codecs/msm8916-wcd/SecondaryMic.conf
+++ b/ucm2/codecs/msm8916-wcd/SecondaryMic.conf
@@ -1,6 +1,12 @@
 SectionDevice."SecondaryMic" {
 	Comment "Secondary Microphone"
 
+	ConflictingDevice [
+		"PrimaryMic"
+		"HeadsetMic"
+		"DigitalMic"
+	]
+
 	EnableSequence [
 		cset "name='DEC1 MUX' ADC2"
 		cset "name='CIC1 MUX' AMIC"
-- 
2.24.1

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

end of thread, back to index

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-14 11:21 [alsa-devel] [PATCH alsa-ucm-conf 0/7] DB410c/msm8916-wcd UCM fixes/additions Stephan Gerhold
2020-01-14 11:21 ` [alsa-devel] [PATCH alsa-ucm-conf 1/7] DB410c: Rename Handset to HeadsetMic Stephan Gerhold
2020-01-14 11:21 ` [alsa-devel] [PATCH alsa-ucm-conf 2/7] DB410c: Split devices into re-usable fragments in codecs/msm8916-wcd Stephan Gerhold
2020-01-14 11:21 ` [alsa-devel] [PATCH alsa-ucm-conf 3/7] codecs/msm8916-wcd: Speaker: Reset volume on disable Stephan Gerhold
2020-01-14 11:21 ` [alsa-devel] [PATCH alsa-ucm-conf 4/7] codecs/msm8916-wcd: Headphones: Drop invalid RDAC2 MUX value Stephan Gerhold
2020-01-14 11:21 ` [alsa-devel] [PATCH alsa-ucm-conf 5/7] codecs/msm8916-wcd: Earpiece: Add missing Enable/DisableSequence Stephan Gerhold
2020-01-14 11:21 ` [alsa-devel] [PATCH alsa-ucm-conf 6/7] codecs/msm8916-wcd: SecondaryMic: Select correct input Stephan Gerhold
2020-01-14 11:21 ` [alsa-devel] [PATCH alsa-ucm-conf 7/7] codecs/msm8916-wcd: Add ConflictingDevice for capture devices Stephan Gerhold

Alsa-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/alsa-devel/0 alsa-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 alsa-devel alsa-devel/ https://lore.kernel.org/alsa-devel \
		alsa-devel@alsa-project.org
	public-inbox-index alsa-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.alsa-project.alsa-devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git