[alsa-devel] Cherry Trail + RT5645 devices analog microphone not working.

Hans de Goede hdegoede at redhat.com
Wed Dec 27 20:12:54 CET 2017


Hi,

On 26-12-17 06:29, Bard Liao wrote:
>> -----Original Message-----
>> From: Hans de Goede [mailto:hdegoede at redhat.com]
>> Sent: Monday, December 25, 2017 8:03 PM
>> To: Bard Liao
>> Cc: Pierre-Louis Bossart; alsa-devel at alsa-project.org
>> Subject: Re: Cherry Trail + RT5645 devices analog microphone not working.
>>
>> Hi,
>>
>> On 25-12-17 03:15, Bard Liao wrote:
>>>> -----Original Message-----
>>>> From: Hans de Goede [mailto:hdegoede at redhat.com]
>>>> Sent: Sunday, December 24, 2017 6:43 PM
>>>> To: Bard Liao
>>>> Cc: Pierre-Louis Bossart; alsa-devel at alsa-project.org
>>>> Subject: Cherry Trail + RT5645 devices analog microphone not working.
>>>>
>>>> Hi Bard,
>>>>
>>>> I've been looking into getting the microphone to work on
>>>> some Cherry Trail + RT5645 devices with what appears to
>>>> be a simple analog microphone.
>>>>
>>>> You can see the microphone on one of the models I'm trying
>>>> to get it to work on soldered onto the right side of the PCB
>>>> here: https://i.imgur.com/bJzBQWe.jpg
>>>>
>>>> I'm using this ucm config:
>>>>
>>>> https://fedorapeople.org/~jwrdegoede/chtrt5645/
>>>>
>>>> Which is basically Pierre-Louis Bossart's config from:
>>>> https://github.com/plbossart/UCM
>>>>
>>>> Adjusted because the devices all have a mono speaker.
>>>>
>>>> I've been trying to get this to work myself and I can get
>>>> some sound while recording by adding:
>>>>
>>>>                    cset "name='RECMIXL BST2 Switch' on"
>>>>                    cset "name='RECMIXR BST2 Switch' on"
>>>>
>>>> But then I mainly get noise, I do get some sound from the
>>>> microphone if I talk really really loudly, but it is
>>>> barely above the noise-floor. I've the feeling that BST2
>>>> is only picking up the microphone via cross-talk and
>>>> that BST1 indeed is the correct input, but for some reason
>>>> I get complete silence when recording when only BST1 is
>>>> selected in the RECMIXR, and yes I've checked / set the
>>>> "IN1 boost volume".
>>>>
>>>> TL;DR: I'm trying to get an analog mic to work on 3
>>>> different models Cherry Trail + RT5645 devices and I've
>>>> been unable to get this to work. I've put a registerdump
>>>> of the rt5645 with gnome-sound-recorder running here:
>>>> https://fedorapeople.org/~jwrdegoede/rt5645-mic-red.dump
>>>>
>>>> Any insights / help with this would be very much
>>>> welcome.
>>>
>>> I don't have the schematic, but I think you probably need micbias
>>> for the capture. Please add both "micbias1" and "micbias2" in
>>> the audio route since I don't know which one is needed.
>>> for example
>>> static const struct snd_soc_dapm_route cht_rt5645_audio_map[] = {
>>> ...
>>> 	{"Int Mic", NULL, "micbias1"},
>>> 	{"Int Mic", NULL, "micbias2"},
>>> ...
>>> };
>>
>> Thank you for your reply. I've tested this, but unfortunately it
>> does not help.
>>
>> Do you perhaps have a cherrytrail device withrt5645 codec where you
>> can test an analog mic input with the upstream driver + latest ucm
>> file from Pierre-Louis with yourself ? I've the feeling that this is
>> not specific to the 3 devices I've access to but a general problem
>> in the driver and/or the ucm files.
> 
> Please try the attached patch. I don't have any cherrytrail device with
> rt5645 codec. But I verified the register settings on my rt5645 EVB.
> If the patch doesn't work, please dump register for me.
> Note that adding "micbias1" and "micbias2 in the audio route is also
> needed.

Thank you, modifying the RT5645_GEN_CTRL2 reg seems to help, for
some reason the patch does not work and neither MB1 and MB2 in reg
0x64 nor the RT5645_GEN_CTRL2 changes happen, but after manually
applying these with i2cset I can actual use the mic, although there
is still quite a bit of white noise in the background.

Attached is a regdump after making the manual changes to reg 0x64 and
reg 0xfb.

I did add the micbias audio routes:

@@ -2297,6 +2297,9 @@ static const struct snd_soc_dapm_route rt5645_dapm_routes[] = {
  	{ "DMIC2", NULL, "DMIC L2" },
  	{ "DMIC2", NULL, "DMIC R2" },

+	{ "Int Mic", NULL, "micbias1" },
+	{ "Int Mic", NULL, "micbias2" },
+
  	{ "BST1", NULL, "IN1P" },
  	{ "BST1", NULL, "IN1N" },
  	{ "BST1", NULL, "JD Power" },

But I believe that your tree has some patches which are not upstream yet,
the last patch you attached expects the micbias1 and micbias2 lines
in the widget lists to be of the "SND_SOC_DAPM_SUPPLY" type, but here:
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git/tree/sound/soc/codecs/rt5645.c?h=topic/rt5645

They are still of the SND_SOC_DAPM_MICBIAS type.

Regards,

Hans


> 
>>
>> Regards,
>>
>> Hans
>>
>> ------Please consider the environment before printing this e-mail.
-------------- next part --------------
000: 0000
001: 8888
002: c8c8
003: c8c8
004: c80a
005: 0000
006: 0000
007: 0000
008: 0000
009: 0000
00a: 7002
00b: 3827
00c: e000
00d: 0300
00e: 0000
00f: 0000
010: 0000
011: 0000
012: 0000
013: 0000
014: 3333
015: 0000
016: 4b00
017: 0000
018: 018b
019: afaf
01a: afaf
01b: 0011
01c: 3f3f
01d: 7f7f
01e: 5000
01f: 0000
020: a000
021: 0000
022: 0000
023: 0000
024: 0000
025: 0000
026: 0000
027: 3820
028: 3838
029: c0c0
02a: 1456
02b: 0404
02c: aaa0
02d: 0000
02e: 0000
02f: 1002
030: 0000
031: 5000
032: 0000
033: 0000
034: 0000
035: 0000
036: 0000
037: 0000
038: 0000
039: 0000
03a: 0000
03b: 0000
03c: 007b
03d: 0000
03e: 007b
03f: 0000
040: 001c
041: 0000
042: 001c
043: 0000
044: 0000
045: 5000
046: 0038
047: 0038
048: d806
049: 0000
04a: 0004
04b: 0000
04c: 031f
04d: 0000
04e: 0000
04f: 01ff
050: 0000
051: 0000
052: 01ff
053: f000
054: 0000
055: 0000
056: 0111
057: 0064
058: ef0e
059: f0f0
05a: ef0e
05b: f0f0
05c: ef0e
05d: f0f0
05e: f000
05f: 0000
060: 0000
061: 8006
062: e000
063: e8da
064: 4e24
065: 0c02
066: 0000
067: 0000
068: 0000
069: 0000
06a: 0000
06b: 0000
06c: 0aaa
06d: 0000
06e: 0000
06f: 0000
070: 8083
071: 8000
072: 8000
073: 1770
074: 3e00
075: 2409
076: 000a
077: 5800
078: 0000
079: 0123
07a: 8000
07b: 0000
07c: 0000
07d: 0000
07e: 0000
07f: 0000
080: 4000
081: 0f03
082: 3000
083: 0808
084: 1111
085: 0000
086: 0008
087: 0000
088: 0000
089: 0000
08a: 0120
08b: 0000
08c: 0003
08d: 0000
08e: 0004
08f: 1140
090: 0646
091: 0c06
092: 0000
093: 0108
094: 0222
095: 0000
096: 0000
097: 0000
098: 0000
099: 0000
09a: 2184
09b: 010a
09c: 0aea
09d: 000c
09e: 0400
09f: 0000
0a0: a0e8
0a1: 0059
0a2: 0001
0a3: 0000
0a4: 0000
0a5: 0000
0a6: 0000
0a7: 0000
0a8: 0000
0a9: 0000
0aa: 0000
0ab: 0000
0ac: 0000
0ad: 0000
0ae: 6000
0af: 0000
0b0: 6000
0b1: 0000
0b2: 0000
0b3: 001f
0b4: 020c
0b5: 1f00
0b6: 0000
0b7: 4000
0b8: 0000
0b9: 0000
0ba: 0000
0bb: 0000
0bc: 0000
0bd: 0200
0be: 0100
0bf: 1180
0c0: 8000
0c1: 0000
0c2: 0000
0c3: 2000
0c4: 0000
0c5: 0000
0c6: 0000
0c7: 0000
0c8: 0000
0c9: 0000
0ca: 0000
0cb: 0000
0cc: 0000
0cd: 0000
0ce: 0000
0cf: 1814
0d0: 0690
0d1: 1c17
0d2: 0000
0d3: b320
0d4: 0000
0d5: 0000
0d6: 0400
0d7: 0000
0d8: 0000
0d9: 0809
0da: 0000
0db: 0003
0dc: 0049
0dd: 001b
0de: 0000
0df: 0000
0e0: 0000
0e1: 0000
0e2: 0000
0e3: 0000
0e4: 0000
0e5: 0000
0e6: 8000
0e7: 0700
0e8: 8000
0e9: 0700
0ea: 0f20
0eb: 0000
0ec: b300
0ed: 0000
0ee: 0000
0ef: 0000
0f0: 001f
0f1: 020c
0f2: 1f00
0f3: 0000
0f4: 4000
0f5: 0000
0f6: 0000
0f7: 0000
0f8: 0000
0f9: 0000
0fa: 2061
0fb: 4070
0fc: 1800
0fd: 0004
0fe: 10ec
0ff: 6308
100: 0000


More information about the Alsa-devel mailing list