Skip to content
This repository has been archived by the owner on Apr 17, 2024. It is now read-only.

Audio for reef still doesn't work #6

Closed
jz5020 opened this issue Dec 20, 2021 · 45 comments
Closed

Audio for reef still doesn't work #6

jz5020 opened this issue Dec 20, 2021 · 45 comments

Comments

@jz5020
Copy link

jz5020 commented Dec 20, 2021

While I don't really know much about how audio works on Linux, after following the commands to get audio working on the reef Chromebook, I still haven't been able to get any sound output working on my installation of Ubuntu with KDE. At first, the first error that I had encountered was that the setup-audio script had been trying to pull the ChromeOS files off of /dev/mmcblk0p3 while on my Chromebook, the internal storage had always been mounted at /dev/mmcblk1. After modifying the script to account for this, the script completes without any further error, but upon a reboot of the system, after installing kmix, I still only get an output labeled "default and only sink". I've also tried running firefox with apulse firefox, where I had gotten errors such as can't open playback device "default". Error code -2 (No such file or directory) and ALSA lib confmisc.c:767:(parse_card) cannot find card '0'. Another thing that I had tried was to execute the commands set out in alsa-reload.service manually, where I was met with
ALSA lib parser.c:1934:(get_by_card_name) no soundcards found... ALSA lib main.c:412:(execute_sequence) unable to open ctl device 'hw:bxtda7219max' ALSA lib main.c:1971:(set_verb_user) error: failed to initialize new use case: HiFi alsaucm: error failed to set _verb=HiFi: No such device
after running alsaucm -c bxtda7219max set _verb HiFi set _enadev Speaker
Any help on this matter would be appreciated.

@MilkyDeveloper
Copy link
Collaborator

MilkyDeveloper commented Dec 20, 2021

Could you post the output of sudo dmesg?

@jz5020
Copy link
Author

jz5020 commented Dec 21, 2021

Alright, dmesg.txt

@MilkyDeveloper MilkyDeveloper added the KBL/SKL without SOF KBL and SKL do not support SOF. This requires using factory kernels. label Dec 23, 2021
@guest18941944
Copy link

guest18941944 commented Dec 27, 2021

Mine doesn't work either
I don't know what to do
The three commands on the website all failed
I am using an Acer Chromebook Spin 11, which is a Apollo Lake (REEF) device

@MilkyDeveloper
Copy link
Collaborator

Try running sof-setup-audio within Breath. I have a feeling it'll work :D

@MilkyDeveloper MilkyDeveloper added device newer than KBL with SOF and removed KBL/SKL without SOF KBL and SKL do not support SOF. This requires using factory kernels. labels Dec 27, 2021
@jz5020
Copy link
Author

jz5020 commented Dec 28, 2021

While I am really grateful for your efforts towards getting many other Chromebooks that otherwise wouldn't have been able to run Linux, it appears that running sof-setup-audio still does not fix the audio issues that I have been experiencing on my Acer Spin 11.
While running Firefox, the errors that I face after pulling up a YouTube video are:

ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5233:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM dmix
[apulse] [error] do_connect_pcm: can't open playback device "default". Error code -2 (No such file or directory)
[apulse] [error] do_connect_pcm: failed to open ALSA device. Apulse does no resampling or format conversion, leaving that task to ALSA plugins. Ensure that selected device is capable of playing a particular sample format at a particular rate. They have to be supported by either hardware directly, or by "plug" and "dmix" ALSA plugins which will perform required conversions on CPU.
[Child 1974, MediaDecoderStateMachine #1] WARNING: 7fed0dcd82f0 OpenCubeb() failed to init cubeb: file /build/firefox-ahszPM/firefox-95.0.1+build2/dom/media/AudioStream.cpp:324
[Child 1974, MediaDecoderStateMachine #1] WARNING: Decoder=7fed135d9100 [OnMediaSinkAudioError]: file /build/firefox-ahszPM/firefox-95.0.1+build2/dom/media/MediaDecoderStateMachine.cpp:4007
ATTENTION: default value of option mesa_glthread overridden by environment.
ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5233:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM dmix
[apulse] [error] do_connect_pcm: can't open playback device "default". Error code -2 (No such file or directory)
[apulse] [error] do_connect_pcm: failed to open ALSA device. Apulse does no resampling or format conversion, leaving that task to ALSA plugins. Ensure that selected device is capable of playing a particular sample format at a particular rate. They have to be supported by either hardware directly, or by "plug" and "dmix" ALSA plugins which will perform required conversions on CPU.

@MilkyDeveloper
Copy link
Collaborator

It appears there are no soundcards detected. Could I have the output of dmesg?

@jz5020
Copy link
Author

jz5020 commented Dec 29, 2021

Again, heres dmesg.txt. Thank you so much for the effort that you've put into this project!

@MilkyDeveloper
Copy link
Collaborator

@RodBarnes try running setup-audio. Reboot and post the output of sudo dmesg and ‘sudo alsa-info’

@RodBarnes
Copy link
Contributor

RodBarnes commented Mar 6, 2022

I ran setup-audio then ran sudo dmesg | nc termbin.com 9999. The output can be seen here. It is interesting to me that the audio is an issue since this is essentially the same kernel used by Chromium, right? (Or maybe I misunderstood.) In any case, it is interesting because the audio on AppleLake devices continues to be an issue there but MrChromebox recently reported to expect a fix "in a few weeks". See this article in the GalliumOS github.

@MilkyDeveloper
Copy link
Collaborator

This is the main error:
[ 8.848546] snd_soc_skl 0000:00:0e.0: Direct firmware load for 5a98-reef-sand-8-tplg.bin failed with error -2 [ 8.848567] snd_soc_skl 0000:00:0e.0: tplg fw 5a98-reef-sand-8-tplg.bin load failed with -2, trying alternative tplg name bxt_da7219_mx98357a-tplg.bin [ 8.848599] snd_soc_skl 0000:00:0e.0: Direct firmware load for bxt_da7219_mx98357a-tplg.bin failed with error -2 [ 8.848602] snd_soc_skl 0000:00:0e.0: tplg bxt_da7219_mx98357a-tplg.bin failed with -2, falling back to dfw_sst.bin [ 8.848624] snd_soc_skl 0000:00:0e.0: Direct firmware load for dfw_sst.bin failed with error -2 [ 8.848627] snd_soc_skl 0000:00:0e.0: Fallback tplg fw dfw_sst.bin load failed with -2 [ 8.848633] snd_soc_skl 0000:00:0e.0: Failed to init topology!

What’s the output of ls /lib/firmware, lsblk, and setup-audio; sync? Looks like the fw still hasn’t been copied, which puzzles me.

@MilkyDeveloper
Copy link
Collaborator

The thing is, the specific kernel used in ChromeOS has specific patches and a special config file. I’m halfway through retrieving those.

@RodBarnes
Copy link
Contributor

RodBarnes commented Mar 6, 2022

Output of ls /lib/firmware is here. Note that it lists 5a98-reef-sand-8-tplg.bin but neither of the two backups (bxt_da7219_mx98357a-tplg.bin or dfw_sst.bin) are listed.

Output of lsblk is here.

Output of setup-audio; sync is here.

@MilkyDeveloper
Copy link
Collaborator

MilkyDeveloper commented Mar 6, 2022

Maybe copying /lib/firmware/5a98-reef-sand-8-tplg.bin to /lib/firmware/intel/5a98-reef-sand-8-tplg.bin would work?

@RodBarnes
Copy link
Contributor

RodBarnes commented Mar 6, 2022

I did the copy, ran setup-audio; sync again, rebooted, and confirmed that 5a98-reef-sand-8-tplg.bin was still in /lib/firmware/intel. I then did speaker-test with the same result: cannot find card '0'.

BTW: I am still running this off the USB. Haven't installed yet as it seems reasonable to get this working first?

@MilkyDeveloper
Copy link
Collaborator

I think I'm going the wrong direction here, it seems like SOF is the way to go. Could you run sof-setup-audio and sudo alsa-info (when it asks for a link, say "y" and share it).

@RodBarnes
Copy link
Contributor

RodBarnes commented Mar 7, 2022

Ran sof-setup-audio, rebooted as it directed, then ran sudo alsa-info. I did say 'Y' to upload but it didn't report a link but a path: /tmp/alsa-info.txt.vS1ss5uoFf. The contents of that file are available here.

I also found the output of sof-setup-audio interesting (where it states "Reload ALSA and set the correct UCM") so providing that here.

@MilkyDeveloper
Copy link
Collaborator

I'll be fixing this issue for all Apollo Lake Chromebooks soon. It looks like the key to solving this is located in this thread over here.

@MilkyDeveloper
Copy link
Collaborator

MilkyDeveloper commented Mar 7, 2022

I added a new SOF script for Apollo Lake that might work. Run:

sudo wget https://raw.githubusercontent.com/cb-linux/breath/main/bin/apl-sof-setup-audio -O /usr/local/bin/apl-sof-setup-audio

and then

sudo chmod +x /usr/local/bin/apl-sof-setup-audio

Then, just run apl-sof-setup-audio on your chromebook.

@RodBarnes
Copy link
Contributor

RodBarnes commented Mar 7, 2022

I think the script has cr/lf in it? I got ^M errors when I attempt to execute it. I edited in nano and confirmed it as MS-DOS format. Fixed it by editing and removing the format.

Got an error during process:
dpkg-deb: error: paste subprocess was killed by signal.

Ended with a final error:
dd: failed to open '': No such file or directory

Output is here. This was generated by the [Send error] from the error dialog that appeared.

The script dd is looking for a bzimage.signed which it doesn't find. I changed it to ~/linux-build/bzImage.signed (since that's where the file resides and that's the path used in the next line with rm) but it still failed with the same error.

Ah, it's trying to ouput to $USB1 but that is empty at that point. I changed this to just $USB (which is set earlier) and tried again. This time it got farther and came to this error:
rm: cannot remove '/home/rod/linux-build/modules/lib/modules/*: Structure needs cleaning

Looks like the USB is now corrupted :-) So, flashing it back to original...

@MilkyDeveloper
Copy link
Collaborator

MilkyDeveloper commented Mar 8, 2022

I fixed the line ending issues and dd. Hopefully it should fix it. Do the whole spiel again; run:

sudo wget https://raw.githubusercontent.com/cb-linux/breath/main/bin/apl-sof-setup-audio -O /usr/local/bin/apl-sof-setup-audio

and then

sudo chmod +x /usr/local/bin/apl-sof-setup-audio

Then, just run apl-sof-setup-audio on your chromebook.

@RodBarnes
Copy link
Contributor

RodBarnes commented Mar 8, 2022

This time, it made it all the way through but I still got that initial error (details below). Other than that, no other errors appeared in the output and it otherwise went to completion. However, after the reboot, I still have no output device showing under "Settings > Sound" and running speaker-test produced the same results; i.e., cannot find card '0'.

Error details: During the process, I got the dpkg-deb error and immediately after it occurred, a dialog appeared prompting to generate a bug report. I clicked "Yes" which took me to bugs.launchpad.net. (I did ot submit it; I wasn't sure that was correct given we're doing dev testing here. If you want me to do so, I can rerun the test and submit it.) The summary of the report is "package firmware-sof-signed 1.7-1 failed to install/upgrade: trying to overwrite '/lib/firmware/intel/sof/sof-bdw.ri', which is also in package linux-firmware 1.201.4"

@MilkyDeveloper
Copy link
Collaborator

The dpkg-deb error wasn't a failure. It's a bug in the Ubuntu SOF firmware packages. When that inevitably occurs, it runs another command which fixes it. Filing a bug report was a good idea.

Please post the output of sudo alsa-info and dmesg whenever I test like this.

@RodBarnes
Copy link
Contributor

RodBarnes commented Mar 9, 2022

Repeated the test.
Output of alp-sof-setup-audio is here.
Submitted the bug report.
Output of sudo alsa-info is here.
Output of sudo dmesg is here.

@MilkyDeveloper
Copy link
Collaborator

It seems the kernel command line isn't getting properly applied. What's the text of the file kernel.flags in ~/linux-build? Could you run bash -x apl-sof-setup-audio?

@RodBarnes
Copy link
Contributor

On the Chromebook,~/linux-build/kernel.flags contains:
console=tty1 root=/dev/sda2 i915.modeset=1 rootwait rw fbcon=logo-pos:center,logo-count:1 loglevel=0 splash snd-intel-dspcfg.dsp_driver=3 snd_sof_pci.fw_path="intel/sof"

Output of bash -x apl-sof-setup-audio is here.

@MilkyDeveloper
Copy link
Collaborator

Alright, last time, I promise. Run:

sudo wget https://raw.githubusercontent.com/cb-linux/breath/main/bin/apl-sof-setup-audio -O /usr/local/bin/apl-sof-setup-audio

and then

sudo chmod +x /usr/local/bin/apl-sof-setup-audio

Run apl-sof-setup-audio on your chromebook.

@RodBarnes
Copy link
Contributor

RodBarnes commented Mar 9, 2022

Houston: WE HAVE LIFT-OFF! System sounds are working; using mpg123 was able to play an MP3.

I still don't see an output device under "Settings > Sound" so unable to set "Volume", "Balance", etc. Maybe this is a Gnome thing?

BTW: You should have received a donation from me a couple days ago. I greatly appreciate your efforts here; I do not mind doing this multiple times.

@MilkyDeveloper
Copy link
Collaborator

Huuuge thanks for the donation :D

I'll look into fixing the GNOME audio. GNOME uses PulseAudio, so it doesn't detect the minimal ALSA setup this project uses.

@RodBarnes
Copy link
Contributor

Quick question: Will these steps be necessary with future images? Or is this going to be baked in?

@MilkyDeveloper
Copy link
Collaborator

MilkyDeveloper commented Mar 9, 2022

For future images, users will need to run apl-sof-setup-audio. The reason I've isolated these into commands and not made these run by default is because there are multiple audio setups, some with SOF, some with SOF+Realtek, and others without SOF. For those that aren't reef, apl-sof-setup-audio wouldn't work.

@RodBarnes
Copy link
Contributor

RodBarnes commented Mar 14, 2022

Clarification: Maybe I am remembering incorrectly, but I am pretty sure that in my prior testing with the apl-sof-setup-audio script I executed the script as my user. Certainly, looking at the previous comments where it was successful, there is no indication of using sudo.

Plus, the instructions don't specify using sudo.

However, I noticed in the latest release that both apl-sof-setup-audio and sof-setup-audio are executable only for the owner and group. Changing them to be executable for other I was successful with running and setting up the audio. I assume this would also work if I ran it as sudo.

Maybe this was an oversight? Or maybe by design? I didn't want to just fork and make a change without checking if this was intentional for some reason.

@Tykymba
Copy link

Tykymba commented Mar 16, 2022

Omg, what about arch linux guys, is it possible to make sound work too?

@MilkyDeveloper
Copy link
Collaborator

You can adapt the bash so it has Arch support by using pacman. Feel free to open a PR.

@MilkyDeveloper
Copy link
Collaborator

@RodBarnes I've fixed this in the latest commit.

@RodBarnes
Copy link
Contributor

RodBarnes commented Mar 16, 2022

@MilkyDeveloper Hmmm... I just pulled and they still show as this:

rod@BRAWN:/media/rod/aa997f32-00b5-47dd-b0f5-7925584c27b6/usr/local/bin$ ls -al
total 28
drwxr-xr-x  2 root root 4096 Mar 16 15:02 .
drwxr-xr-x 10 root root 4096 Mar  9 00:57 ..
-rwxr-xr--  1 root root 3563 Mar 16 15:02 apl-sof-setup-audio
-rwxr-xr--  1 root root 1568 Mar 16 15:02 install-to-internal-storage
-rwxr-xr--  1 root root 2573 Mar 16 15:02 setup-audio
-rwxr-xr--  1 root root 2004 Mar 16 15:02 sof-setup-audio
-rwxr-xr--  1 root root 2989 Mar 16 15:02 updatekernel-on-emmc

Remembering that I ran into this issue in past projects where a change in permission on a file didn't flag it to get merged/staged, I tried cleaning out my store and doing a clean pull. Still got the same results: not executable by other.

@RodBarnes
Copy link
Contributor

RodBarnes commented Mar 17, 2022

@MilkyDeveloper UPDATE: Nope. Removing the trailing 's' fixed that issue so that the script completes, but after the reboot, it comes up with a Penguin logo, an entirely new screen I've never seen before, and then hangs. I have to hard-shutdown to get the system back. :-( So, I will hold my PR until you reply to this.

@MilkyDeveloper UPDATE: Typo in apl-sof-setup-audio line #62 has a trailing 's'. Doing a build test to confirm the fix then will submit the PR.

I just did a clean and clone (deleted my repository, cloned again). Then built and flashed the image. When I run apl-sof-setup-audio it reports:

Setting up firmware-sof-signed (1.7-1) ...
Downloading the Apollo Lake SOF Topology...
lsblk: /dev/sda2s: not a block device

and then ends. Looks like a typo with an extra 's' maybe?e fix then will submit the PR.

I just did a clean and clone (deleted my repository, cloned again). Then built and flashed the image. When I run apl-sof-setup-audio it reports:

Setting up firmware-sof-signed (1.7-1) ...
Downloading the Apollo Lake SOF Topology...
lsblk: /dev/sda2s: not a block device

and then ends. Looks like a typo with an extra 's' maybe?

@MilkyDeveloper
Copy link
Collaborator

I fixed the trailing s issue in the latest commit. Any extra info over the penguin screen? Maybe an image?

@RodBarnes
Copy link
Contributor

RodBarnes commented Mar 17, 2022

I picked an earlier point (commit 2e224b9 "Close #80 by automatically reinstall dbus in the postinstall") and built from there. But it did the same thing. I'll continue to work back to find a point where it is working again and attempt to identify what changed. But here's a screen shot.

To be clear: The image is fine, boots fine initially. After running apl-sof-setup-audio -- which then runs sof-setup-audio -- and then doing the reboot, the image boots into this condition.

@MilkyDeveloper
Copy link
Collaborator

Alright, so it's waiting for a root device, meaning the kernel parameter for the root device the script set is wrong. Are you running this off of the internal storage? I've yet to test that functionality.

@MilkyDeveloper
Copy link
Collaborator

MilkyDeveloper commented Mar 17, 2022

What would also be useful for debugging this issue would be providing the output of bash -x $(which apl-sof-setup-audio) on a newly flashed USB.

@RodBarnes
Copy link
Contributor

RodBarnes commented Mar 17, 2022

So, it works fine on commit ccb22a4 "Dummy commit to fix line endings". It may be notable that this is just prior to the docker-related changes.

I'll do another build of the later commit and get you the output you requested.

@MilkyDeveloper
Copy link
Collaborator

As of the latest commit, the script should be operational again :D

@RodBarnes
Copy link
Contributor

@MilkyDeveloper Confirmed. However, it still shows the penguin and a lot more stuff happening at boot now than it did before. Could you explain what all the additional is? When the sound was working before, it didn't show all of this. Just would like to understand...

@MilkyDeveloper
Copy link
Collaborator

MilkyDeveloper commented Mar 18, 2022

So, sound is working again now? The extra boot messages must be a kernel addition since I recently rebuilt the kernel with some extra modules. I find the logging to be useful for debugging. I’ll be replacing the Penguin with my own custom logo soon.

@RodBarnes
Copy link
Contributor

RodBarnes commented Mar 18, 2022 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants