Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Touchscreen and audio not working for Gallium 3.1 on HP Chromebook 14 x360 SONA (Kaby Lake) #606

Open
DawAnon opened this issue Feb 11, 2021 · 24 comments

Comments

@DawAnon
Copy link

DawAnon commented Feb 11, 2021

The title pretty much sums up the issue.

@DawAnon DawAnon changed the title Touchscreen not working for Gallium 3.1 on HP Chromebook 14 x360 SONA (Kaby Lake) Touchscreen and audio not working for Gallium 3.1 on HP Chromebook 14 x360 SONA (Kaby Lake) Feb 11, 2021
@newgall
Copy link

newgall commented Feb 13, 2021

Yeah you can install a blietooth speaker. I would like to know if your install is stable. I have kaby Lake too. Are we the only ones on here? I really wanted Gallium to be the bomb. Such a great and needed idea. Have you found anything else stable?

@DawAnon
Copy link
Author

DawAnon commented Feb 14, 2021

@newgall My install has been stable so far. Did you do anything in particular that made it start to flicker and lock up or was it random? I haven't personally tried any other distros except tails, which works great but is very limiting because it is designed with amnesia and strict privacy in mind. I think we are the only ones here as of now, which is disappointing because I really enjoy Gallium so far, but I'm no coder or programmer with the capabilities to make adjustments to it. Have you tried ArchLinux or Lubuntu?

@newgall
Copy link

newgall commented Feb 14, 2021

On the left side there is a menu with “Update GalliumOS” right at the top. I suggest to you that you NOT update. It seemed to go downhill after i updated it. I may have done the update once and been ok. It could be too just that it breaks down with time somehow.
I hope they are working on 4.0. Such a worthy project. Please report back here in a few weeks and let me know if your install is stable.
I think i tried a tails install once and didn't have full functionality, but its beginning to blur together. I cant recall if it was on the full custom firmware. I like the idea of tails since it should be secure.
I was thinking to get a dummy gmail and log into chromebook that way if this doesnt work out. Still playing with it and looking for a stable Distro. Of course google makes it hard they dont want us breaking free.

@xinato
Copy link

xinato commented Oct 15, 2021

I was able to get the Kabylake audio working on a Pantheon Device (Lenovo C630). I had to use the 5.10.0 kernel and compile in the drivers for the audio. I added the use case files for the ALSA device. See attached.
The use case files came from the original chromeos. They needed slight modification to adapt for changes in the ALSA ucm format since chromeos is an older version. Invoke the use case files with:

alsaucm -c kblda7219max.pantheon set _verb HiFi set _enadev Speaker ; pulseaudio -k
alsaucm -c kblda7219max.pantheon set _verb HiFi set _enadev Hea630)dphone ; pulseaudio -k

for speaker or headphone output respectively. I haven't figured out how to automate the switch based on headphone jack insertion.

Fixing the touchscreen has been much more difficult. Haven't figured that out yet.

soundsteps.txt

@xinato
Copy link

xinato commented Oct 15, 2021

Repost to fix typo

I was able to get the Kabylake audio working on a Pantheon Device (Lenovo C630). I had to use the 5.10.0 kernel and compile in the drivers for the audio. I added the use case files for the ALSA device. See attached.
The use case files came from the original chromeos. They needed slight modification to adapt for changes in the ALSA ucm format since chromeos is an older version. Invoke the use case files with:

alsaucm -c kblda7219max.pantheon set _verb HiFi set _enadev Speaker ; pulseaudio -k
alsaucm -c kblda7219max.pantheon set _verb HiFi set _enadev Headphone ; pulseaudio -k

for speaker or headphone output respectively. I haven't figured out how to automate the switch based on headphone jack insertion.

Fixing the touchscreen has been much more difficult. Haven't figured that out yet.

@paulmcauley
Copy link

paulmcauley commented Dec 17, 2021

Repost to fix typo

I was able to get the Kabylake audio working on a Pantheon Device (Lenovo C630). I had to use the 5.10.0 kernel and compile in the drivers for the audio. I added the use case files for the ALSA device. See attached. The use case files came from the original chromeos. They needed slight modification to adapt for changes in the ALSA ucm format since chromeos is an older version. Invoke the use case files with:

alsaucm -c kblda7219max.pantheon set _verb HiFi set _enadev Speaker ; pulseaudio -k alsaucm -c kblda7219max.pantheon set _verb HiFi set _enadev Headphone ; pulseaudio -k

for speaker or headphone output respectively. I haven't figured out how to automate the switch based on headphone jack insertion.

Fixing the touchscreen has been much more difficult. Haven't figured that out yet.

Hi xinato, I also have a Lenovo C630 (Pantheon) and cannot get the internal sound to work, so your help would be greatly appreciated.

Could you give some more details on what exactly you did to "compile in the drivers for the audio"? Did you just run the menuconfig before compiling and make sure snd_soc_kbl_da7219_max98357a was selected, or did you add some other drivers other than the ones from kernel.org? Could you provide your .config file? Here is what it looked like when I ran make menuconfig before compiling, where snd_soc_kbl_da7219_max98357a is selected as a module to install by default:
kbl menuconfig

Also, which distribution are you running? How did you handle the firmware in /lib/firmware -- are you using the newest firmware from kernel.org or did you copy over any firmware files from ChromeOS? Are you also running Mr. Chromebox's full UEFI? Also, what version of ALSA do you have installed?

I am trying to get it working on OpenSUSE Leap 15.3. Here is what I get when I run the 5.10 kernel I compiled:

barbara@localhost:~> uname -a
Linux localhost.localdomain 5.10.39-lp153.3.g0530e5c-default #1 SMP Thu Dec 16 22:40:45 GMT 2021 x86_64 x86_64 x86_64 GNU/Linux
barbara@localhost:~>

barbara@localhost:~> sudo lsmod | grep max
snd_soc_kbl_da7219_max98357a    24576  0
snd_soc_hdac_hdmi      45056  1 snd_soc_kbl_da7219_max98357a
snd_soc_da7219         81920  1 snd_soc_kbl_da7219_max98357a
snd_soc_max98357a      20480  0
snd_soc_core          307200  7 snd_soc_kbl_da7219_max98357a,snd_soc_da7219,snd_soc_hdac_hdmi,snd_soc_hdac_hda,snd_soc_max98357a,snd_soc_skl,snd_soc_dmic
snd_pcm               155648  9 snd_soc_kbl_da7219_max98357a,snd_soc_da7219,snd_hda_codec,snd_soc_hdac_hdmi,snd_compress,snd_soc_core,snd_soc_skl,snd_hda_core,snd_pcm_dmaengine
snd                   106496  12 snd_soc_kbl_da7219_max98357a,snd_seq,snd_seq_device,snd_hwdep,snd_hda_codec,snd_timer,snd_soc_hdac_hdmi,snd_compress,snd_soc_core,snd_pcm


 barbara@localhost:~> cat /proc/asound/cards
--- no soundcards ---

I get slightly more success with the newest 5.15 kernel from OpenSUSE backports. I get a soundcard detected, but it fails when I try to play audio via aplay:

barbara@localhost:~> uname -a
Linux localhost.localdomain 5.15.8-lp153.3.g0530e5c-default #1 SMP Wed Dec 15 08:12:54 UTC 2021 (0530e5c) x86_64 x86_64 x86_64 GNU/Linux



barbara@localhost:~> sudo lsmod | grep max
snd_soc_kbl_da7219_max98357a    28672  0
snd_soc_hdac_hdmi      45056  1 snd_soc_kbl_da7219_max98357a
snd_soc_da7219         90112  2 snd_soc_kbl_da7219_max98357a
snd_soc_max98357a      20480  1
snd_soc_core          372736  7 snd_soc_kbl_da7219_max98357a,snd_soc_da7219,snd_soc_hdac_hdmi,snd_soc_hdac_hda,snd_soc_max98357a,snd_soc_skl,snd_soc_dmic
snd_pcm               176128  9 snd_soc_kbl_da7219_max98357a,snd_soc_da7219,snd_hda_codec,snd_soc_hdac_hdmi,snd_compress,snd_soc_core,snd_soc_skl,snd_hda_core,snd_pcm_dmaengine
snd                   122880  12 snd_soc_kbl_da7219_max98357a,snd_seq,snd_seq_device,snd_hwdep,snd_hda_codec,snd_timer,snd_soc_hdac_hdmi,snd_compress,snd_soc_core,snd_pcm



barbara@localhost:~> cat /proc/asound/cards
 0 [kblda7219max   ]: kblda7219max - kblda7219max
                      Google-Pantheon-1.0


barbara@localhost:~> aplay -D plughw:0,0 /usr/share/sounds/alsa/test.wav
Playing WAVE '/usr/share/sounds/alsa/test.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
aplay: set_params:1407: Unable to install hw params:
ACCESS:  RW_INTERLEAVED
FORMAT:  S16_LE
SUBFORMAT:  STD
SAMPLE_BITS: 16
FRAME_BITS: 32
CHANNELS: 2
RATE: 44100
PERIOD_TIME: 125000
PERIOD_SIZE: (5512 5513)
PERIOD_BYTES: (22048 22052)
PERIODS: (3 5)
BUFFER_TIME: 500000
BUFFER_SIZE: 22050
BUFFER_BYTES: 88200
TICK_TIME: 0


dmesg also outputs the following:
snd_soc_skl 0000:00:1f.3: Blob NULL for id:0 type:3 dirn:0 ch:2, freq:48000, fmt:24
[ 1292.574421] snd_soc_skl 0000:00:1f.3: ASoC: error at snd_soc_dai_hw_params on SSP0 Pin: -22
[ 1292.593683]  SSP0-Codec: ASoC: soc_pcm_hw_params() failed (-22)
[ 1292.593697]  Kbl Audio Port: ASoC: dpcm_fe_dai_hw_params failed (-22)

I can access alsamixer and change many of the levels but have tried many different combinations and still get no sound. I also added myself to the audio group. This 5.15 kernel also prevents the computer from sleeping and shutting down properly, so I would rather use 5.10 like you if possible.

Thanks,

Paul

@paulmcauley
Copy link

paulmcauley commented Dec 20, 2021

Xinato,

I just saw your post at https://ask.fedoraproject.org/t/upgrade-from-5-14-18-300-kernel-to-5-15-4-201-kernel-broke-sound-pipewire and see the 5.15 kernel was not allowing sound for you either on the Lenovo C630 "Pantheon". Therefore, I compiled kernel 5.14.21 with the default included snd_soc_kbl_da7219_max98357a kernel module from kernel.org included and I now have sound on OpenSUSE Leap 15.3! I am using the Mr. Chromebox's full UEFI BIOS as well, and have no problems with sleep or shutdown either (though the fan does come on full after waking from sleep). As for firmwares in /lib/firmware, I am using the newest from kernel.org in addition to extra files copied over from ChromeOS as well. The additional files from ChromeOS needed in addition to the latest firmware from kernel org are:

/lib/firmware/9d71-GOOGLE-NAMIMAX-0-tplg.bin
/lib/firmware/dsp_lib_ghw_spt_release.bin
/lib/firmware/intel/dsp_fw_578A29B8-0890-446F-A80A-2FE202AE0DBA.bin

Then you need to create the following symbolic link:
ln -s /lib/firmware/intel/dsp_fw_kbl_v3420.bin /lib/firmware/intel/dsp_fw_kbl.bin

I have installed ALSA v.1.2.4 so also had to add the line Syntax 2 to the start of /usr/share/alsa/ucm2/kblda7219max.pantheon/kblda7219max.pantheon.conf to get it to be accepted.

I do, though, have the same problem as you whereby the sound does not automatically switch port when headphones are inserted/removed, but at least we are making progress! I also find the speaker volume steps are strange in KDE/PipeWire whereby only the smaller increments make a difference to the volume.

@xinato
Copy link

xinato commented Dec 21, 2021

Great work Paul!
The sound saga has been long and fraught with issues. The stack is so deep and the problems interlock between the different software components.

I am booting Fedora 35 off of a USB stick, not UEFI.

I am using the same firmware components as you from the Chromebook:

lib/firmware/9d71-GOOGLE-NAMIMAX-0-tplg.bin
/lib/firmware/dsp_lib_ghw_spt_release.bin
/lib/firmware/intel/dsp_fw_578A29B8-0890-446F-A80A-2FE202AE0DBA.bin

I also disabled the intel HDA driver in /etc/modprobe/chrome.conf with:

options snd_intel_dspcfg dsp_driver=2
blacklist snd_hda_intel
install snd_hda_intel /bin/false

The tplg file seems to have an issue that affects the dmic. It doesn't inform the higher layers of the correct audio formats. I got around that by modifying wireplumber's interface to the alsa device. This fix is not applicable to you. The issue is that the dmic advertises that it support S16_LE and S32_LE. My testing shows that S32_LE is broken.

I have attached my current kblda7219 files. Note that I don't keep the .pantheon suffix. That way alsa reads the file at bootup. Maybe pulse will also use the file if the name matches the device. I also modified the use case names to match the alsa documentation. I am able to record from the dmic at this point. My next goal is the headset mic, although that should be easier.
HiFi.conf.txt

I was hoping that the ucm changes would help wireplumber with the device switching, but I have not found the magic. I wrote a program that monitors the headset jack (event7 on my machine) and issues alsaucm commands to switch the speakers and headphones. This is a backup, since I am still working to get wireplumber to do the switching, The program works for headphones and speaker, but I still need to work on the mic changeovers.

Starting with kernel 5.15, the kernel developers broke the snd-soc-skl driver as it applies to this box. The NHLT table in the ACPI has some sort of problem. I have posted an issue, but no fix yet. In the mean time I am compiling snd-soc-skl and snd-soc-skl-sst-clk drivers from the 5.14.21 branch of the tree and using those modules in my later kernels.

So where are the issues:

hardware, using the firmware files from the Chromebook
NHLT file in ACPI tables, unresolved but doing work-arounds
snd-soc-skl hardware driver, using versions from old kernel, blacklist intel HDA
alsa configuration, using attached ucm
pipewire/wireplumber, modifying lua config files for alsa configuration, backup work-around with my use case switch program

@paulmcauley
Copy link

Hi Xinato,

Thanks for the details. Good to see someone has been investigating this deeply!

Why is the internal mic fix not applicable to me? I am using PipeWire and wireplumber.

What difference does it make if I remove the .pantheon suffix exactly? When I tried this I didn't get any sound at all. I was just using the alsaucm -c kblda7219max.pantheon set _verb HiFi set _enadev Speaker command. When I do this I just get a single "Headphones" entry in KDE Plasma 5.23 system tray sound settings. Do you get separate headphones and speaker entries to appear properly in the desktop system tray GUI? What desktop environment are you using?

I also got the port switching on headphone insertion/removal sort-of working using a bit of hack by modifying the acpid technique at https://github.com/nebulakl/cave-audio .
In /etc/acpi/events/plugheadphone I have:

event=jack/headphone HEADPHONE plug
action=alsaucm -c kblda7219max.pantheon set _verb HiFi set _enadev Headphones

In /etc/acpi/events/unplugheadphone I have:

event=jack/headphone HEADPHONE unplug
action=alsaucm -c kblda7219max.pantheon set _verb HiFi set _enadev Speaker

I also modified my HiFi.conf to put the Headphones DisableSequence at the start of the Speaker EnableSequence (and vice-versa) because I wasn't sure if the DisableSequences were being called using this switching method. I think this may have improved the reliability of the switching slightly, but I'm not sure. The switching is still not very reliable and if you unplug and plug in a headset too many times, or plug/unplug when audio is playing, the audio will stop working without a power-off.

Does your port switching method work reliably? Would be good if wireplumber did it and we didn't need any hacks!

@xinato
Copy link

xinato commented Dec 23, 2021

Hi Paul,
It looks like you have been following some of the same trails I have.

Reading your earlier post, I thought you were using Pulseaudio without Pipewire so my Pipewire research wouldn't help you. I attached /usr/share/wireplumber/main.lua.d/50-alsa-config.lua. This contains a matching rule that limits the format that Pipewire will use to connect to the alsa devices. This helps the dmic work. I have not finished working on the headset mic, but the same technique should work. 50-alsa-config.lua.txt

Alsa and Pipewire expect the ucm file to be named after the device. According to my conversations with the Pipewire developers, Wireplumber is supposed to use the UCM file to automatically switch the alsa context. I have not really gotten this to work yet, but it doesn't hurt to name the files what the developers expect them to be. You will notice that all the other distributed UCM files match the device names.

I am using gnome for the desktop. The gnome integration with Pipewire seems pretty shaky. I have not been able to get the desktop icons or controls to work yet, but that has not been my focus. Honestly, Pipewire is complicated and the documentation is difficult to find. I found a project called https://gitlab.freedesktop.org/ryuukyu/helvum that provides graphic visualization of the Pipewire map that has helped me see what is going on.

I appreciate your idea for the acpi events. I had not tripped over that before. That is likely easier than what I was trying with the program I wrote.

The reliability of switchover from speaker to headphones seems to be an artifact of the software stack. The switchover forces a change in the alsa layer between the da7291 codec and the max98357a codec without changing the alsa device name. Pipewire needs to keep the audio stream running despite the change in codec. This seems to work sometimes. Sometimes it requires a "systemctl --user restart pipewire pipewire-pulse" to get it resynced. This has not been bulletproof. It may be that we have to pause the stream, switch the alsa devices, and restart the stream.

@landv0gt
Copy link

landv0gt commented Jan 2, 2022

Since I was on this topic also a while now I want to give some feedback that maybe helps some others.

The steps described in the linked soundsteps.txt above (https://github.com/GalliumOS/galliumos-distro/files/7354046/soundsteps.txt) did it for me with two exceptions:

  • I never compiled any drivers into a kernel or something similar. I just copied the files as described from a recovery-image (downloaded from the web somewhere) into /lib/firmware
  • I also had to add "Syntax 2" into the ******.pantheon.conf-file to get the command alsaucm -c kblda7219max.pantheon set _verb HiFi set _enadev Speaker ; pulseaudio -k working.

What is my set-up:

  • Chromebook Lenovo C340-15
  • uname -a output: Linux linux-lappi 5.13.0-22-generic #22-Ubuntu SMP Fri Nov 5 13:21:36 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
  • I use a fresh ubuntu 21.10

I also experienced no sound with live-images of galliumOS and also ubuntu and searched for solutions since months. I gave up inbetween and now recently gave it another try and found this page here.

@xinato
Copy link

xinato commented Jan 10, 2022

I have an update on my progress getting touchscreen and audio working under Fedora 35.

Touchscreen is pretty straight forward. As root issue the following command to bind the touchscreen to the driver.

echo -n "i2c-SYTS7817:00" > /sys/bus/i2c/drivers/i2c_hid_acpi/bind

I do this with a on-shot systemd service file.

Audio is substantially more complex, but I have playback and microphones working with the base unit, headphones, and bluetooth speakers.

There are a lot of pieces. The currently running kernel for Fedora 35 is version 5.15.12. It seems that every version after 5.14.21 has a change to the handling of the NHLT data in the bios. This change fails with the Lenovo Yoga C-630 and snd_skl_kbl7219max, the driver for the sound card, refuses to load. To get around this problem, I built the drivers from 5.14.21 and load them as out-of-tree drivers. Its an extra step each time Fedora releases a new kernel version. I submitted a bug report to the kernel team, but there has been no action. See https://fedoraproject.org/wiki/Building_a_custom_kernel for how to compile out-of-tree modules.

The hda_intel driver is disabled as described above to allow operation of the snd_skl_kblda7219 driver.

I rewrote the alsa ucm file to use the newest syntax. The kablda7219max.pantheon file has elements in it that are meant for the ChromeOS Cras sound manager. Between that, and trying to sort out the microphone operation, I rewrote it. Alsa is looking for a UCM file that matches the name of the card when it loads and initializes. The latest version of alsa moved these files to /usr/share/alsa/ucm2/conf.d.

Fedora has standardized on the pipewire sound server. This uses wireplumber as a service manager to reconfigure the server as applications attach or as you plug and unplug devices, like bluetooth speakers. It also has a front end that implements the pulseaudio server so that things like Gnome and media players can attach to it. The documentation is challenging. There are still glitches in the implementation. But the pipewire team has been responsive.

In order to switch between devices, you use alsaucm to change the speaker and headphone, or the internal mic and the headset mic. For the speaker/headphone, the alsa drivers have to switch codecs. This can confuse pipewire resulting in crashed media players and a hung pipewire. I have found that if you pause the running media player, before the switch you can minimize this glitch.

For the internal mic/headset mic, you also have to change the default source device. This is done through pactl set-default-source.

The microphones advertise that they are capable of 32-bit sampling in the bios. Testing shows that they only work with S16_LE format. Pipewire defaults to connecting to them with S32_LE which does not work. Also, the microphone in the unit is a four microphone array. I modified the wireplumber alsa configuration to tame the format and channel mappings.

I used playerctl to find the running media players, pause them, and restart them. Both playerctl and pactl need to run as the user to work.

Of course, we want the device change-overs to happen automatically when we plug or unplug headphones or headset. The simplest way to detect plug events is with ACPID. But ACPID runs in system space. I wrote the event handlers for acpid to export the events via a socket interface to user space. I wrote a corresponding user-land server to catch the events, pause the media players, switch the operation, and restart the players.
The user land server can be started manually, or automatically on login.

files attached.
chromeos-630.zip

@paulmcauley
Copy link

paulmcauley commented Apr 30, 2022

On the Lenovo C630 Chromebook with the latest MrChromebox UEFI coreboot 4.16 Release (2022.04.09) you now shouldn't have to do anything to get the touchscreen to work.

@trenchcoatjedi
Copy link

Just found this thread. Got my hands on a Lenovo Chromebook Yoga C630 (Kaby Lake). I have tried all the suggestions in this thread to get the audio working but I have not had any success.

@xinato I did a fresh install of Fedora 36 to the internal memory and added all the files in your chromeos-630.zip file. The touchscreen hack works if I run it at the terminal as root but the .service file does not seem to load or do anything on boot. I will still have to test building kernel 5.14.21 with the out of tree drivers.

@paulmcauley I tried installing OpenSUSE and following your instructions but also had no luck.

I also saw this https://www.phoronix.com/scan.php?page=news_item&px=Linux-5.19-Sound I have tried compiling the AVS drivers in the linux-next kernel. The drivers load but there is no ALSA topology so there still is no audio. Intel will need to release the ALSA topologies for these boards eventually....

@xinato
Copy link

xinato commented May 20, 2023

I did not do much with this for a while because kernel changes to the skl sound driver in fall 22 made sound stop working. In kernel 6.2, driver support started working again when I combined it with this topology file and kernel 6.2.

I also tried the avs driver and found a couple of issues that I passed back to the developers. They seem to be getting close with it. It might be kernel 6.4 where av works for my nami-based machine.

@paulmcauley
Copy link

I did not do much with this for a while because kernel changes to the skl sound driver in fall 22 made sound stop working. In kernel 6.2, driver support started working again when I combined it with this topology file and kernel 6.2.

I also tried the avs driver and found a couple of issues that I passed back to the developers. They seem to be getting close with it. It might be kernel 6.4 where av works for my nami-based machine.

Hi Xinato, good that you still look at this. My sound on the Lenovo Chromebook C630 Pantheon stopped working on kernel 5.14, so now I am trying the skylake driver on the stock Fedora 38 kernel 6.2.15-300.fc38.x86_64 with no luck.

Could you give more detail on what you did to get it working on 6.2? Did you modify the kernel?

I tried the following:

First to get the topology bin file, first compiled the itt tool with mono .net 6 and then:

[mcauley@SPARE-LENOVO net6.0]$ ./itt -c ~/Downloads/nami-tplg.xml -o ~/Downloads/nami-tplg.conf
alsatplg -c nami-tplg.conf -o 9d71-GOOGLE-NAMIMAX-0-tplg.bin

[mcauley@SPARE-LENOVO Downloads]$ alsatplg -c nami-tplg.conf -o 9d71-GOOGLE-NAMIMAX-0-tplg.bin
ALSA lib dapm.c:247:(tplg_build_routes) undefined source widget/stream 'System Playback'
ALSA lib dapm.c:225:(tplg_build_routes) undefined sink widget/stream 'System Capture'
ALSA lib dapm.c:225:(tplg_build_routes) undefined sink widget/stream 'DMIC Capture'
ALSA lib dapm.c:225:(tplg_build_routes) undefined sink widget/stream 'Reference Capture'
ALSA lib dapm.c:247:(tplg_build_routes) undefined source widget/stream 'HDMI1 Playback'
ALSA lib dapm.c:247:(tplg_build_routes) undefined source widget/stream 'HDMI2 Playback'
ALSA lib dapm.c:247:(tplg_build_routes) undefined source widget/stream 'HDMI3 Playback'

I put this in /lib/firmware

I also linked sudo ln -s /lib/firmware/intel/dsp_fw_kbl_v3420.bin.xz /lib/firmware/intel/dsp_fw_kbl.bin.xz as on Fedora 38 this was linked to the AVS firmware file.

Did you use the same /lib/firmware/dsp_lib_ghw_spt_release.bin and /lib/firmware/intel/dsp_fw_578A29B8-0890-446F-A80A-2FE202AE0DBA.bin as from the ChromeOS firmware like before? Did you use the same UCM and wireplumber modifications as you uploaded before?

Using the UCM/Wireplumber config you posted before and additional firmware files from ChromeOS, I get the following related errors in dmesg:

[   62.913395] snd_soc_skl 0000:00:1f.3: Blob NULL for id:0 type:3 dirn:0 ch:2, freq:48000, fmt:24
[   62.913400] snd_soc_skl 0000:00:1f.3: ASoC: error at snd_soc_dai_hw_params on SSP0 Pin: -22
[   62.925985]  SSP0-Codec: ASoC: error at __soc_pcm_hw_params on SSP0-Codec: -22
[   62.925991]  Kbl Audio Port: ASoC: error at dpcm_fe_dai_hw_params on Kbl Audio Port: -22
[   67.983374] snd_soc_skl 0000:00:1f.3: Blob NULL for id:0 type:3 dirn:0 ch:2, freq:48000, fmt:24
[   67.983392] snd_soc_skl 0000:00:1f.3: ASoC: error at snd_soc_dai_hw_params on SSP0 Pin: -22
[   67.984098]  SSP0-Codec: ASoC: error at __soc_pcm_hw_params on SSP0-Codec: -22
[   67.984113]  Kbl Audio Port: ASoC: error at dpcm_fe_dai_hw_params on Kbl Audio Port: -22

Also, why do you suspect the AVS driver will work in Kernel 6.4? Do you have any links to what is happening?

Thanks,

Paul

@xinato
Copy link

xinato commented May 31, 2023

Hi Paul,
Sorry for the delay.

First, I did not modify the kernel for version 6.2. I am using Fedora's 6.2.15, although I have been testing with 6.3 and 6.4 with success.

I compiled the tplg file at https://github.com/thesofproject/avs-topology-xml/blob/for-skylake-driver/src/nami-tplg.xml and compiled it as you described. Congratulations on figuring out how to comile it. It took me a while.

The target file is /lib/firmware/9d71-GOOGLE-NAMIMAX-0-tplg.bin and be sure you remove any other copies in the firmware directory.

For the dsp firmware, : /lib/firmware/intel/dsp_fw_kbl.bin.xz -> avs/skl/dsp_basefw.bin.xz
The driver needs a recent update to the firmware that is in the avs version.

I hadd to play with the mixer settings, as the defaults did not work for me. But, I don't remember what I changed.

I hope this helps you!
.

@xinato
Copy link

xinato commented May 31, 2023

With regard to the avs driver, I have been corresponding with the Intel team working on the driver. I have done some testing on my machine and fed back the results to the team. There is still a bug that is preventing operation, but they understand it and they are fixing it upstream. I am hoping the bug is fixed in 6.4 (or maybe 6.5). My current testing on 6.4 shows the bug is still there.
It's great that the team is still paying attention to the skl driver and keeping it working. The release of the tplg file was huge and fixes the bug that forced me to patch the driver myself.

@xinato
Copy link

xinato commented Jun 3, 2023

Paul,
You might find this to be of value:
thesofproject/avs-topology-xml#5

@paulmcauley
Copy link

paulmcauley commented Jun 3, 2023

Paul, You might find this to be of value: thesofproject/avs-topology-xml#5

Thanks, that was useful. I gave up on the Skylake/skl driver and went for the AVS and now have (almost) everything working on the Lenovo Chromebook C630 Pantheon, Fedora 38, included Fedora kernel 6.3.4-201.fc38.x86_64, Mr. Chromebox Coreboot 4.20 firmware.

To cut a long story short, save yourself the hassle and just use the WeirdTreeThing audio script at https://github.com/WeirdTreeThing/chromebook-linux-audio by running ./setup-audio --force-avs-install

This script sets up all the UCM files, makes a Wireplumber modification, sets the modprobe, downloads compiled topology files. I have everything working better than ever, except for the in-built microphone ("no DMIC ep_blob found").

@trenchcoatjedi
Copy link

I had stopped working on this device a while ago but am tempted to pull it out and start working on it again now. Which distro has working audio now? Does the touchscreen and gyroscope work? There was zero support for those features in the past also.

@tonymurray
Copy link

I have a chromebook Spin 13 (acer) I could get the headphones (presumably mic) to work with tehe WeirdTreeThing script above.

No success yet with the touchscreen. I wanted to try linking "i2c-SYTS7817:00" but I cannot find that file anywhere. In ChromeOS (dual boot) I am unable to copy any files from the ChromeOS side in /sys/bus/i2c because they are either write-protected or perhaps in use.

Any tips?

@tonymurray
Copy link

tonymurray commented Nov 20, 2023

I got the touchscreento work on the Chromebook Spin 13 (Acer CP 713 1WN 54GA, Kubuntu 23.10) with the following command:
echo "i2c-ELAN0001:00" > /sys/bus/i2c/drivers/elants_i2c/bind

The following discussion was helpful:
https://bugzilla.kernel.org/show_bug.cgi?id=207759

@tonymurray
Copy link

Further information on Chromebook Spin 13. I got backlight control by changing the boot parameter acpi_backlight=vendor to acpi_backlight=intel

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

No branches or pull requests

7 participants