WeirdTreeThing / chromebook-linux-audio

Script to enable audio support on many Chrome devices
BSD 3-Clause "New" or "Revised" License
210 stars 38 forks source link

HP Chromebook 11 G5 internal microphone records loud sizzling sound only #76

Open TonyBoothNZ opened 6 months ago

TonyBoothNZ commented 6 months ago

I have an HP Chromebook 11 G5 (Setzer / Strago / Braswell) which is running Xubuntu 23.10 (kernel is 6.5.0-14). I have followed the instructions, up to and including running setup-audio, here: https://github.com/WeirdTreeThing/chromebook-linux-audio

When I record the microphone by speaking at a normal volume and then play it back I get quite a loud sizzling sound and can’t hear any trace of what was actually recorded. If I speak loudly right up against the microphone then there is some highly distorted evidence of my voice (there is sustained loudness at the points where I spoke and I can almost make out words) but otherwise it just sounds like the sizzling again.

Recording command: arecord -r 48000 /tmp/test.wav

Playback command: aplay /tmp/test.wav

The microphone volume is set at around 50% in the audiomixer (pavucontrol). If I set it lower then the crackling is quieter when I play it back but I still can’t make out what was recorded.

I have also tried arecord without the -r switch, same result (though I did not try speaking loudly right up against the microphone in that case).

I can play other audio (e.g. youtube videos through Firefox work).

My problem seems have a similar effect to a now-resolved problem experienced by another person: https://lore.kernel.org/alsa-devel/d42279d7-0350-563f-fca7-27f32cb9e9ee@redhat.com/. However, in that case the microphone was an analog microphone and as noted below mine is supposed to be digital.

My problem also seems somewhat similar to the won’t-fix issue here: https://github.com/WeirdTreeThing/chromebook-linux-audio/issues/48

I have attached some files (please let me know if other information would be useful):

HPChromebook11G5XUbuntu23.10rt5650Files.tar.gz

To briefly summarise the output of udevadm info -e:

The HP documentation says variously that the HP Chromebook 11 G5 contains:

When it was still running stock the Google Chromium OS I believe it was using the 3.18 kernel, in which case these might have been the relevant kernel driver files:

https://chromium.googlesource.com/chromiumos/third_party/kernel/+/chromeos-3.18/sound/soc/codecs/rt5645.h https://chromium.googlesource.com/chromiumos/third_party/kernel/+/chromeos-3.18/sound/soc/codecs/rt5645.c https://chromium.googlesource.com/chromiumos/third_party/kernel/+/chromeos-3.18/sound/soc/intel/boards/cht_bsw_rt5645.c

I have also found some Chromium OS ucm config files though I am not sure of version (I selected the only factory-strago branch I could find in the repository): https://chromium.googlesource.com/chromiumos/overlays/board-overlays.git/+/refs/heads/factory-strago-7458.B/overlay-setzer/chromeos-base/chromeos-bsp-setzer/files/audio-config/ucm-config/chtrt5650/HiFi.conf https://chromium.googlesource.com/chromiumos/overlays/board-overlays.git/+/refs/heads/factory-strago-7458.B/overlay-setzer/chromeos-base/chromeos-bsp-setzer/files/audio-config/ucm-config/chtrt5650/HiFi.conf

I would be grateful for any suggestions.

TonyBoothNZ commented 6 months ago

Should have added debug logs (apologies): debug-logs.tar.gz

WeirdTreeThing commented 5 months ago

I've had mixed results with braswell devices. It seems like the drivers will just randomly break over time. The only thing my script does for braswell/baytail is enable the sof driver because in my experience, it works better than the atom sst driver.

TonyBoothNZ commented 5 months ago

Well, the script gives me nice audio output so thank you for that! It's only the mic causing issues. I would like to dig through the ucm and driver code to work out what has gone wrong but despite doing some background reading over the last few days it's well above my level of competence. What do you think my odds are of getting a response if I post to an alsa or kernel list to ask about the issue? And which list/s would you recommend?

WeirdTreeThing commented 5 months ago

https://www.alsa-project.org/wiki/Mailing-lists alsa-user looks like what you are looking for. Just keep in mind that many people have moved on from this platform so may not get help at all.