]> git.alsa-project.org Git - alsa-ucm-conf.git/commitdiff
bytcr-wm5102: Add support for different microphone routes
authorHans de Goede <hdegoede@redhat.com>
Sat, 21 Oct 2023 21:16:14 +0000 (23:16 +0200)
committerJaroslav Kysela <perex@perex.cz>
Tue, 31 Oct 2023 15:38:55 +0000 (16:38 +0100)
Unlike all designs supported sofar the Lenovo Yoga Tab 3 YT3-X90 does not
have its internal microphone (intmic) on IN3L with the headset microphone
on IN1L. Instead this tablet has the intmic on IN1L and the hsmic on IN2L.

Add IN1-InternalMic.conf and IN2-HeadsetMic.conf config snippets
under ucm2/codecs/wm5102/ for this and check the components string
to determine which microphone routes should be used.

Link: https://lore.kernel.org/alsa-devel/20231021211614.115152-2-hdegoede@redhat.com/
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
ucm2/Intel/bytcr-wm5102/HiFi.conf
ucm2/codecs/wm5102/EnableSeq.conf
ucm2/codecs/wm5102/IN1-InternalMic.conf [new file with mode: 0644]
ucm2/codecs/wm5102/IN2-HeadsetMic.conf [new file with mode: 0644]

index 2afc7572a137be464163bfc24f0e6a3d91d70bec..46ef7d11c35ef294449d58e74b035e2119826856 100644 (file)
@@ -32,5 +32,23 @@ If.spk {
 }
 
 Include.hp.File "/codecs/wm5102/HeadPhones.conf"
-Include.mic.File "/codecs/wm5102/IN3-InternalMic.conf"
-Include.headset.File "/codecs/wm5102/IN1-HeadsetMic.conf"
+
+If.intmic {
+       Condition {
+               Type String
+               Haystack "${CardComponents}"
+               Needle "cfg-intmic:in1l"
+       }
+       True.Include.intmic1.File "/codecs/wm5102/IN1-InternalMic.conf"
+       False.Include.intmic3.File "/codecs/wm5102/IN3-InternalMic.conf"
+}
+
+If.hsmic {
+       Condition {
+               Type String
+               Haystack "${CardComponents}"
+               Needle "cfg-hsmic:in2l"
+       }
+       True.Include.hsmic2.File "/codecs/wm5102/IN2-HeadsetMic.conf"
+       False.Include.hsmic1.File "/codecs/wm5102/IN1-HeadsetMic.conf"
+}
index 87cb3bb9d63afca264a61b32d299629589c1d0c6..11166c0784298e13c1490564a0e4b7382a0ed9df 100644 (file)
@@ -7,8 +7,9 @@ EnableSequence [
        cset "name='HPOUT2L Input 1' AIF1RX1"
        cset "name='HPOUT2R Input 1' AIF1RX2"
 
-       # Both mics are quite soft by default, boost then
+       # mics are quite soft by default, boost then
        cset "name='IN1L Volume' 28"
+       cset "name='IN2L Volume' 28"
        cset "name='IN3L Volume' 28"
 
        cset "name='Headphone Switch' off"
diff --git a/ucm2/codecs/wm5102/IN1-InternalMic.conf b/ucm2/codecs/wm5102/IN1-InternalMic.conf
new file mode 100644 (file)
index 0000000..d9a70ce
--- /dev/null
@@ -0,0 +1,23 @@
+SectionDevice."Mic" {
+       Comment "Internal Microphone"
+
+       ConflictingDevice [
+               "Headset"
+       ]
+
+       EnableSequence [
+               cset "name='AIF1TX1 Input 1' IN1L"
+               cset "name='AIF1TX2 Input 1' IN1L"
+
+               cset "name='Internal Mic Switch' on"
+       ]
+
+       DisableSequence [
+               cset "name='Internal Mic Switch' off"
+       ]
+
+       Value {
+               CapturePriority 100
+               CapturePCM "hw:${CardId}"
+       }
+}
diff --git a/ucm2/codecs/wm5102/IN2-HeadsetMic.conf b/ucm2/codecs/wm5102/IN2-HeadsetMic.conf
new file mode 100644 (file)
index 0000000..8fbbcb1
--- /dev/null
@@ -0,0 +1,24 @@
+SectionDevice."Headset" {
+       Comment "Headset Microphone"
+
+       ConflictingDevice [
+               "Mic"
+       ]
+
+       EnableSequence [
+               cset "name='AIF1TX1 Input 1' IN2L"
+               cset "name='AIF1TX2 Input 1' IN2L"
+
+               cset "name='Headset Mic Switch' on"
+       ]
+
+       DisableSequence [
+               cset "name='Headset Mic Switch' off"
+       ]
+
+       Value {
+               CapturePriority 200
+               CapturePCM "hw:${CardId}"
+               JackControl "Headset Mic Jack"
+       }
+}