chromebook-linux-audio icon indicating copy to clipboard operation
chromebook-linux-audio copied to clipboard

Audio on ELDRID (HP 14c-cc0) not recognized

Open mikee512 opened this issue 8 months ago • 20 comments

Describe the bug After running script and reboot no audio is detected (dummy output). I have tried a number of 5.13 and 5.16 kernel and am able to get audio output (no microphone) with some. No luck on 6.8. This is a dual boot chomebook with ubuntu using mrchromebox firmware.

Boardname If you don't know where to find this, run cat /sys/class/dmi/id/product_name ELDRID

Logs Generate logs with `

debug-logs-Eldrid-2025-05-01_16h09m.tar.gz

bash debugging.sh` and attach the output here.

(ps when debugging.sh fails with no libinput the package I need to install is libinput-tools, not libinput, no big deal). Thanks!

mikee512 avatar May 01 '25 20:05 mikee512

Incompatible syntax 7 in sof-rt5682.conf

Your distro uses a version of alsa-lib that is too old to support the UCM

WeirdTreeThing avatar May 01 '25 22:05 WeirdTreeThing

Thanks for the fast reply! This is ubuntu 24.04 with all updates applied. alsa-lib is not listed as a package, alsa-ucm-conf is 1.2.10, the latest I see on the alsa website is 1.2.14. Does syntax become obsolete in a minor version ? How do I get a newer version or is ubuntu just not yet supported ?

mikee512 avatar May 02 '25 01:05 mikee512

Use ubuntu 25.04. And alsa-lib is libasound on ubuntu/debian

WeirdTreeThing avatar May 02 '25 01:05 WeirdTreeThing

I upgraded to 24.10 on my way to 25.04 and it solves the playback issue. 25.04 is currently disabled for upgrade from what I see, I can't upgrade right now. The speakers are now working, thanks! The microphone is not working and it likely the same as issue 272. I dont see a resolution to that, is there microphone support for eldrid ? I have problems with the touchscreen as well and read that it may have to do with using mrchromebox RWLEGACY firmware for dual boot. I'd like to keep dual boot until support runs out. Any ideas on if the mic can be made to work ? Thanks again.

mikee512 avatar May 02 '25 17:05 mikee512

Touchscreen is a RW_LEGACY issue. As for mic, I haven't created a solution yet.

WeirdTreeThing avatar May 02 '25 17:05 WeirdTreeThing

Is there anything I can do to help with the mic solution ?

mikee512 avatar May 03 '25 16:05 mikee512

Nope

WeirdTreeThing avatar May 05 '25 15:05 WeirdTreeThing

I have been trying to figure out the difference between how chrome handles the mic and linux. Is this a matter of the tplg file and dmic config in there ? I do some differences but linux does not like the chrome tplg file. I do see a couple differences in the setup of dmic between the two but I only get "tokenxx' decode from alsatplg so not sure what the diff actually is. Do you where I can get the sources for the tplg files ? I suspect they might be proprietary. Also not sure if this is the right direction to try and get this to work. I'll keep poking at it but there is a LOT to learn. Thanks!

mikee512 avatar May 09 '25 17:05 mikee512

Looking at coreboot mainboard/google/volteer/variants/eldrid/overridetree.cb it indicates the mic is 2ch_pdm1, speakers are max98357a and headphones are rt5682. The tplg file is sof-tgl-max98357a-rt5682.tplg but there do appear to be pdm1 variants but no luck with them.

mikee512 avatar May 09 '25 17:05 mikee512

found the token definitions in the kernel but I can't get alsatplg --decode followed by alsatplg --compile to produce the same output on the existing /lib/firmware tplg file. The resulting tplg file wont load so I must be missing something. It does produce the same output when roundtripping a tplg file it produced. Maybe the ABI but it doesn't look good.

mikee512 avatar May 09 '25 18:05 mikee512

The topology on linux will always expose both PDMs mapped onto the same device (hence the 4 channel internal mic) and it is up to the audio server to remap those channels into the correct device. PDM0 is channels 0-1 and PDM1 is channels 2-3.

WeirdTreeThing avatar May 09 '25 21:05 WeirdTreeThing

Thanks! I'll start looking at the ucm and see if I can figure out the server side.

mikee512 avatar May 09 '25 22:05 mikee512

I already have splitting working. The problem is I hardcode the mic to use PDM0. ChromeOS solves this by having a different UCM for each board and each variant of each board, which I do not want to do.

WeirdTreeThing avatar May 09 '25 22:05 WeirdTreeThing

where do I hardcode to PDM1 :)

mikee512 avatar May 09 '25 22:05 mikee512

alsaucm -c hw:0 dump text

Verb.HiFi { Comment Default Device.Mic { Comment "Internal Microphone" Values { CaptureCTL "_ucm0001.hw:sofrt5682" CaptureChannels 2 CapturePCM "_ucm0001.dmic_stereo_in:sofrt5682,99,0,1" CapturePriority 100 PlaybackCTL "_ucm0001.hw:sofrt5682" } } ...

does this mean the mic is connected to rt5682 ? It should be pdm1, I think.

mikee512 avatar May 09 '25 23:05 mikee512

I see /usr/share/alsa/ucm2/conf.d/sof-rt5682/HiFi.conf and its reference to common/pcm/split.conf. Is this where the reference to pdm0 is ? I dont yet see it but still digesting ...

mikee512 avatar May 09 '25 23:05 mikee512

OK changing SectionDevice."Mic" Channel0 -> 2 and Channel1 -> 3 in sof-rt5682/HiFi.conf gets the mic working. Thanks! I know this is not a proper solution but I now have a working 2 in 1.

mikee512 avatar May 10 '25 01:05 mikee512

Yeah the channel mapping. The UCM doesn't understand what a "PDM" is.

WeirdTreeThing avatar May 10 '25 13:05 WeirdTreeThing

You could just add two mic entries, one for channel 0,1 and the other for channel 2,3 and let the user pick the one that works. Not ideal but at least it gives them an option without having to hack ucm.

mikee512 avatar May 10 '25 17:05 mikee512

That's probably what I'll end up doing.

WeirdTreeThing avatar May 10 '25 17:05 WeirdTreeThing

I've done this. Give it a try.

WeirdTreeThing avatar May 17 '25 18:05 WeirdTreeThing

Closing as the main issue has been solved, and the mics should be working.

WeirdTreeThing avatar Jul 07 '25 13:07 WeirdTreeThing