GalliumOS / galliumos-distro

Docs, issues, and artwork sources for GalliumOS
https://galliumos.org/
GNU General Public License v2.0
348 stars 11 forks source link

Internal microphone does not work on Braswell / Realtek ALC5645 #319

Open reynhout opened 7 years ago

reynhout commented 7 years ago

We're pulling in future mainline code from @plbossart's experimental repo, for the chtrt5650 drivers in 4.9.4-galliumos kernels. Watch for updates.


Workaround options: Bluetooth or USB microphones/headsets, including USB-to-3.5mm jacks.

evan-a-a commented 7 years ago

I'm working with @plbossart to obtain the information necessary to get the microphone working and will leave a comment here when it is operational.

drrwebber commented 7 years ago

I have the same problem with latest Alpha and Acer Chromebook 14

hmedina0 commented 7 years ago

Not working on TERRA, running 2.1

drrwebber commented 7 years ago

BTW - found that using Bluetooth headset is a workaround. Just switch device input to use BT headset. I've ordered a USB microphone - will update when I've tried that next.

reynhout commented 7 years ago

@drrwebber USB mics will work too. I should have added workaround options to the initial description; will do so now. Thanks for mentioning it!

xmbwd commented 7 years ago

@reynhout, @evan-a-a , I can help test any fixes on an Acer 14 EDGAR.

chuckhacker commented 7 years ago

Any ETA from @reynhout or @evan-a-a ?

Trying to use the GalliumOS Samsung 3 Chromebook in a classroom setting where we do need individual microphones to perform speech recognition. I can't dive too deeply into this one myself yet, even though it really just amounts to pulling code from upstream.

Going to try using the USB microphones as a workaround: https://www.amazon.com/gp/product/B0171MRGME for now until things are operational.

Ideally, the internal mics work.

reynhout commented 7 years ago

@chuckhacker no ETA. Pulling code from upstream won't work unless the problem is fixed in upstream. USB mics are the best answer for now.

drrwebber commented 7 years ago

I like that USB $20 boom mic - I should have ordered one of those! Instead I have the Samson Go Mic which is studio quality - but super portable.

What people need to know is that this is NOT a GalliumOS problem - its in the underlying ALSA support and the audio chipset in the Chromebook and its firmware - https://wiki.archlinux.org/index.php/Advanced_Linux_Sound_Architecture

Sadly no quick fix - ugly - so when ALSA solves this - then we all get this working again. In the meantime - USB mic' easy plug and play solution.

xmbwd commented 7 years ago

@drrwebber, does that mean that we are at the mercy of ALSA? Because if that is the case, it seems that this issue may never get fixed. Is that the current situation? If so, please confirm, as I may want to return my EDGAR. Despite it being a terrific value, it can't be a daily driver (especially for travel) without a working built in mic.

reynhout commented 7 years ago

@xmbwd We have a history of fixing audio (in/out) on ChromeOS devices even when it is not fixed upstream or in other distros, and it is a priority for us...but unfortunately we can't (ever) make any promises about specific models or timelines.

drrwebber commented 7 years ago

@xmbwd IDNK - but I did find this trouble shooting - https://wiki.archlinux.org/index.php/Advanced_Linux_Sound_Architecture/Troubleshooting#Microphone

And tried alsamixer in terminal - and PulseAudio tweaking.

I got as far as the crackling and poor sound quality input working with Audicity - I did not try the config changes they suggest - my external mic arrived and its so much better than any built-in mic.

I have the Acer Chromebook 14 and I'm keeping it - so good on all other fronts! So not sure if your EDGAR can be coaxed better on the microphone.

xmbwd commented 7 years ago

Thanks @reynhout, that distinction helps. I'm good waiting for you guys and completely understand.

And thanks @drrwebber as well.

chrisjohgorman commented 7 years ago

Does anyone have a link to the patches that @plbossart has for testing? I tried a 4.10.10 kernel to see if his commits in that kernel fixed this problem. Sadly they didn't. I'm also looking to fix #318 if anyone has patches to try for that one.

evan-a-a commented 7 years ago

@chrisjohgorman Microphone has not been resolved yet. For updates, follow the kernel bug report. https://bugzilla.kernel.org/show_bug.cgi?id=95681

mathnic commented 6 years ago

New kernel commit in that thread about analog mic on 5645: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?h=next-20180104&id=b70b309950418437bbd2a30afd169c4f09dee3e5

Is this relevant here? I have no idea if my mic on Edgar is analog or digital...

reynhout commented 6 years ago

@mathnic Good question! Fortunately, this patch is included in the 4.14.12-galliumos1 kernel currently in the testing repo.

I just tested the mic on TERRA (also Braswell & RT5645) on the new kernel. After some futzing with alsamixer, I can see meter movement when tapping the mic itself, so it's possible that careful tuning would yield a usable internal mic. Further futzing required, but I'm hopeful.

mathnic commented 6 years ago

Ah. Good to know it's in testing. I just did the update but no change in mic functionality. On Edgar, I've had mic response from tapping it for quite some time. Anyhow, I'll try some futzing myself:) Thanks for the new kernel and all good work!

boutell commented 6 years ago

No love so far on CELES. Mic input device opens but only records noise. Don't see much I can do in alsamixer?

maymage commented 6 years ago

@reynhout

As far as I can judge the patch from Hans de Goede

ASoC: Intel: cht_bsw_rt5645: Analog Mic support

has been merged to kernel 4.16-rc1

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/?h=v4.16-rc1&qt=grep&q=rt5645

I was installing 4.16-rc2 on my Edgar, mic not working.

However Edgar is rt5650, no rt5645. I found the corresponding mailing list conversation

https://www.spinics.net/lists/alsa-devel/msg71865.html

They report the mic should be usable, even with some noise. Hope, that helps.

maymage commented 6 years ago

@reynhout Ping

kamilsss655 commented 6 years ago

I also have the same problem.. internal microphone is not working

jacksonbenete commented 5 years ago

Any news?

chrisjohgorman commented 5 years ago

Sorry for the delay in replying, there is no news on the internal microphone for my laptop. The laptop is a braswell and the chip is a realtek 5650. I believe there has been progress with the realtek 5645. The kernel thread is https://bugzilla.kernel.org/show_bug.cgi?id=95681.

ghost commented 4 years ago

I can confirm in RELM that internal microphone does not work. Also, when connecting a hands-free pair in the 3.5mm jack, it defiantly takes in audio but you can barely listen to it (edit: using them in my android phone works fine.)

rusty122 commented 4 years ago

Haven't been able to test but I think this Linux patch might fix the microphone https://mailman.alsa-project.org/pipermail/alsa-devel/2019-October/156099.html

ghost commented 4 years ago

anyone in 5.5 was able to test?

chrisjohgorman commented 4 years ago

I tried the new kernel, but haven't got any sound into the machine via the microphone. It does show my sound card as having the quirk, but that's all I've got at the moment. (I must admit I haven't looked too deeply at it.) I am not too sure if I have a digital or analog microphone. It's a chtrt5650, so I think it has a digital microphone, which may mean loading some modules for it. Perhaps I will try some testing today to see if I can get anything from it.

Chris

On Fri, Jan 31, 2020 at 10:34 AM v0idifier notifications@github.com wrote:

anyone in 5.5 was able to test?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/GalliumOS/galliumos-distro/issues/319?email_source=notifications&email_token=AG76X47TKI2MLNG3LDR6THTRARAJLA5CNFSM4C45KEC2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEKPANKA#issuecomment-580781736, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG76X4YZQ5FXJZCQ6CKYSI3RARAJLANCNFSM4C45KECQ .

chrisjohgorman commented 4 years ago

Hope no one is bothered by my replying to my own post. I have done some digging into the microphone issue and have found.

Daniel Stuart found that cht_bsw_max98090_ti boards need a clock line, pmc_plt_clk_0, enabled in order to process audio properly. This fix covers rambi variant boards. (glimmer, clapper, swanky, enguarde, winky, kip, squawks, orco, ninja, heli, sumo, banjo, candy, gnawty, rambi and quawks)

- https://lore.kernel.org/alsa-devel/175edc67-e0e0-f690-704e-b74b110eda16@redhat.com/t/#m309436974c5acd96b8c226ca5d00b35de9bd7afa

Sam McNally found that Strago family Chromebooks use pmc_plt_clk_0 for the codec mclk, resulting in white noise with some digital microphones. This is me. I have a banon chromebook from the strago family. (banon, celes, edgar, reks, setzer, ultima, cyan, kefka, relm, terra, wizpig.)

https://github.com/torvalds/linux/commit/adebb11139029ddf1fba6f796c4a476f17eacddc#diff-7df2efc144fe15300a797d0a344ba324

I have looked at the coreboot code that Daniel brought to the picture and can see where the pmc_plt_clk_0 is referenced. As for the cyan chromebooks I can't see the code reference to the pmc_plt_clk_0. I'm sure that Sam is right in his argument, I just can't see the reference in the coreboot tree. The file devicetree.cb file shows the following under the sound header.

register "lpe_codec_clk_src" = "LPE_CLK_SRC_XTAL"

I don't really know where to go from here. The LPE_CLK_SRC_XTAL is present in ./soc/intel/braswell/chip.h and ./soc/intel/braswell/lpe.c as well as the devicetree.cb file. I just can't see where the pmc_plt_clk_0 is referenced. There is a

clk_reg = (u32 *) (PMC_BASE_ADDRESS + PLT_CLK_CTL_0);

which looks like it might be a hint for me. I am not sure what to do next. Perhaps a fresh set of eyes will help me look at this again tomorrow.

As to testing the patch, I have tried the kernel with CONFIG_SND_DMIC included and excluded with no difference. It does register the quirk, but does not help me get sound. I have reached out to Sam McNally for help, but he hasn't been available yet.

Chris

chrisjohgorman commented 4 years ago

Wanted to update folks on my discoveries with this bug. First off, it is half fixed at least. I cannot get the internal microphone to pickup talking, but if you hit the mic, it registers. If I use a set of headphones with a microphone on them, the card captures voice. My hope is someone with more alsa experience than me may be able to get the laptop mic to record in the future. My thanks to Sam McNally and Matt DeVillier for their help while I tried to fix this issue on my laptop.

ghost commented 4 years ago

With "captures voice" do you mean it's hearable or you can barely understand it? @chrisjohgorman

chrisjohgorman commented 4 years ago

I can understand the voice, but it is not up to par with my cell phone when it records. The voice sounds digital for lack of a better word.

On Tue, Feb 25, 2020 at 5:43 PM v0idifier notifications@github.com wrote:

With "captures voice" do you mean it's hearable or you can barely understand it? @chrisjohgorman https://github.com/chrisjohgorman

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/GalliumOS/galliumos-distro/issues/319?email_source=notifications&email_token=AG76X46CMCDBCPY7MNPJYNDREWNIPA5CNFSM4C45KEC2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEM52GRI#issuecomment-591110981, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG76X4YHBZQQ7TILQWJ6ETDREWNIPANCNFSM4C45KECQ .

ghost commented 4 years ago

is that with a special kernel or configuration?

chrisjohgorman commented 4 years ago

Yes IIRC, the change came in about linux 5.5-rc6. The kernel I got working was linux sound branch 5.6.0-rc1. I just looked and it is included with linux 5.4.22. I also built my own kernel config. On the downside I have experienced video lockups with the new kernel, so I am going to try backing off to an older kernel. I can email you the patch or kernel .config if you want.

On Wed, Feb 26, 2020 at 9:13 AM v0idifier notifications@github.com wrote:

is that with a special kernel or configuration?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

ghost commented 4 years ago

no thanks, i'd rather stay off a half-baked kernel for a barely-working microphone :p i've had enough issue with those recently.

ghost commented 4 years ago

@chrisjohgorman can you send me the patch and the .config now? :P i'm building my own kernel for other reasons so might as well try this. does it work on 5.4?

this is tracking the video lockups that at least i experienced on 5.5/5.6: https://gitlab.freedesktop.org/drm/intel/-/issues/1540

ghost commented 4 years ago

also.. why can't we find the commits/patches that chromeOS applied and apply them to our kernel? can some kernel savvy person answer that?

chrisjohgorman commented 4 years ago

I can send you the patch, but you will be disappointed. I did further testing and the stock 4.16.18 from galliumos works as well as 5.5.0-rc6 in getting my earbud microphone to work. Sorry. I spoke to one of the kernel developers from google and his setup for my machine had functional microphone sound for 4.19 and 5.4 kernels, whereas mine needs my earbud microphone to work.

For some reason his setup /sys/kernel/debug/clk/clk_summary contained...

pmc_plt_clk_0 1 1 0 19200000 0 0 50000

Note the 1 1, on my machine I could not get the 1 1, only 0 0.

I tried to examine this as a bois bug with the help of Matt DeVillier, but wasn't able to determine where the problem was and ended up reinstalling my system. You were wise to ignore this bug and I wish I hadn't tried to tackle it. That said I have attached the patch in case you want to try it out.

I hope you have better luck than I did on this.

Chris

On Mon, Apr 20, 2020 at 4:35 PM v0idifier notifications@github.com wrote:

also.. why can't we find the commits/patches that chromeOS applied and apply them to our kernel? can some kernel savvy person answer that?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/GalliumOS/galliumos-distro/issues/319#issuecomment-616794286, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG76X43A4RQT3BCCARCES2LRNSW2PANCNFSM4C45KECQ .

ghost commented 4 years ago

@chrisjohgorman It didn't get attached to the github comment. Might want to attach it in the github website, upload it to some kind of pastebin service or just email it to me v0id@riseup.net

JonasBBX commented 3 years ago

any updates on this im still facing this issue even in Linux mint (installed on my Acer Chromebook 14 via bootable USB)

plbossart commented 3 years ago

what is your device DMI name? There are a slew of devices using PMC_PLT_CLK_0, and this is triggered with a quirk:

https://elixir.bootlin.com/linux/latest/source/sound/soc/intel/boards/cht_bsw_max98090_ti.c#L407

dimqua commented 3 years ago

I have Acer Chromebook 14 too. @plbossart the device name is Edgar, it's not on the list you linked for some reason.

plbossart commented 3 years ago

I have Acer Chromebook 14 too. @plbossart the device name is Edgar, it's not on the list you linked for some reason.

if you get the headphone/headset to work, it's probably a different issue then. the MCLK would be required for the headset as well.

laurentpayot commented 3 years ago

if you get the headphone/headset to work, it's probably a different issue then. the MCLK would be required for the headset as well.

I have an Asus C301S with the same issue. I noticed recently that when pluging earphones their microphone was working (but distorted sound). Hope it helps.

plbossart commented 3 years ago

Man, I just realized I misunderstood this thread all along. I have a Braswell device with a Maxim 98080, I wasn't aware there was a version with the Realtek rt5645.

cujomalainey commented 3 years ago

Random question here, has anyone checked the UCMs for inconsistencies against the ones in chromeos? (Here is Edgars UCM). I don't think there should be many controls but might be worth checking. FWIW I was able to load and play a tone through DMIC and frequency was unchanged when i played it back using a vanilla kernel.

Leuthus commented 3 years ago

@mathnic Good question! Fortunately, this patch is included in the 4.14.12-galliumos1 kernel currently in the testing repo.

I just tested the mic on TERRA (also Braswell & RT5645) on the new kernel. After some futzing with alsamixer, I can see meter movement when tapping the mic itself, so it's possible that careful tuning would yield a usable internal mic. Further futzing required, but I'm hopeful.

I found that by moving to the Capture tab of alsa mixer and completely silencing ADC BOOST will get rid of all static sound, not sure if that helps anyone :)

ling-nyc commented 2 years ago

Has anyone managed to get the internal microphone working yet? I'm on the Acer Chromebook 14 (EDGAR) with a chtrt5650.