jmontleon / pixelbook-fedora

How to install Fedora on a Pixelbook with reasonable results
60 stars 12 forks source link

Sound broken with kernel 6.1 #51

Closed jmontleon closed 1 year ago

jmontleon commented 1 year ago

Audio is broken in 6.1 again.

jmontleon commented 1 year ago

Thanks for confirming this works for now, even if it's just a workaround. Continuing to try and help with the real fix in what capacity I can. I'm not a kernel or driver developer, so it's more likely to be fixed by folks who know what they're doing.

saxa commented 1 year ago

Ok, just to inform that the sound worked, and now after some time of use it still shows everything as working, but I can get no sound from the speakers anymore. So definetly something is still wrong.

joeknock90 commented 1 year ago

I'm unable to make sound work with patches to the kernel on Arch.

It is, however, entirely possible that I'm just an idiot.

jmontleon commented 1 year ago

@joeknock90 Sorry to hear it didn't work. I mentioned audio was broken on Arch and linked over to here on the kernel regression list when responding to a request for information today, and that the first patch wasn't working for you.

From the output you provided it looks like it applied, so I don't think you did anything wrong. Fedora, Slackware, and Arch at the least all seem to be displaying variations of the issue. Whether that means firmware, kernel configs, or something completely different is to blame I can't say.

saxa commented 1 year ago

Hi, I have today updated my fedora install on the 6.1.9 kernel. Linux rclaptop 6.1.9-201.pixelbook.fc37.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Feb 2 06:52:35 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux Sound seems to work in the control panel/sound by testing the speakers, but only after startup. Now when I have a bunch of windows open and trying to play a video it simply does not work anymore. I saw that Slackware also upgraded kernel in -current tree to 6.1.9 and will try to update the other machine later at home. Will report back if there the sound still works on 6.1.9 , but more and more to me this does not seem to be a kernel problem, but somewhere else. Maybe I am wrong.

saxa commented 1 year ago

I also noticed that when sound does not work the videos do not play, they start but then seem to be like paused. And another side effect was the shutoff, which on the yesterdays 6.1.8 update went away.

jmontleon commented 1 year ago

I usually see this if one of the HDMI outputs is selected instead of the Speakers, odd video behavior included. Any time sound breaks it usually resets to the HDMI output for whatever reason. Selecting speakers as the output causes video playback to work immediately.

saxa commented 1 year ago

I have speakers selected as output. Tried selecting various sources, but no sound goes out at all.

saxa commented 1 year ago

Now from nothing sound started to work I don't know if this helps but I have this in my dmesg:

[18114.921930] i2c_hid_acpi i2c-ACPI0C50:00: i2c_hid_get_input: incomplete report (74/60652) [18115.243007] i2c_hid_acpi i2c-ACPI0C50:00: i2c_hid_get_input: incomplete report (74/60490) [18215.245452] perf: interrupt took too long (3957 > 3955), lowering kernel.perf_event_max_sample_rate to 50000 [24076.783130] i2c_hid_acpi i2c-ACPI0C50:00: i2c_hid_get_input: incomplete report (74/60652) [25142.935210] HDMI HDA Codec ehdaudio0D2: No connections found for pin:port 5:0 [25142.935768] HDMI HDA Codec ehdaudio0D2: No connections found for pin:port 5:1 [25142.936358] HDMI HDA Codec ehdaudio0D2: No connections found for pin:port 5:2 [25142.937990] snd_soc_skl 0000:00:1f.3: ASoC: error at soc_dai_trigger on HDMI2 Pin: -32 [25142.938004] Kbl HDMI Port2: ASoC: trigger FE cmd: 1 failed: -32 [25157.383897] HDMI HDA Codec ehdaudio0D2: No connections found for pin:port 6:0 [25157.384473] HDMI HDA Codec ehdaudio0D2: No connections found for pin:port 6:1 [25157.385052] HDMI HDA Codec ehdaudio0D2: No connections found for pin:port 6:2 [25157.386314] snd_soc_skl 0000:00:1f.3: ASoC: error at soc_dai_trigger on HDMI1 Pin: -32 [25157.386331] Kbl HDMI Port1: ASoC: trigger FE cmd: 1 failed: -32 [26249.293161] perf: interrupt took too long (4960 > 4946), lowering kernel.perf_event_max_sample_rate to 40000

saxa commented 1 year ago

Ok, just upgraded my slackware64-current to the 6.1.9 kernel as supplied by the slackware tree and sound works as before.

savostyanov commented 1 year ago

On Arch the no sound issue persists with the 6.1.9 kernel.

huang-jy commented 1 year ago

For the benefit of those finding this issue new. Here's the regression mailing list discuss for you to follow: https://lore.kernel.org/regressions/CALFERdzKUodLsm6=Ub3g2+PxpNpPtPq3bGBLbff=eZr9_S=YVA@mail.gmail.com/

jmontleon commented 1 year ago

@joeknock90 @savostyanov fwiw you should be able to build a kernel that works using the first patch I posted on this issue. I installed arch on a thumb drive, built a custom 6.1.9 kernel, booted it and have working audio. Reboots work fine with it as well.

I followed https://wiki.archlinux.org/title/Kernel/Arch_Build_System

When I rebooted it booted into the stock kernel until I did: grub-mkconfig -o /boot/grub/grub.cfg

Maybe that's all you were missing.

image

joeknock90 commented 1 year ago

TESTING!

I use a unified kernel image so everything SHOULD update automatically with mkinitcpio and pacman hooks, but I'll verify. Also building with abs.

Will report.

jmontleon commented 1 year ago

Likewise I saw mkinitcpio etc. run from the hooks.

In section 5 they mention:

Boot loader
If you have modified pkgbase in order to have your new kernel installed alongside the default kernel you will need to update your bootloader configuration file and add new entries ('default' and 'fallback') for your custom kernel and the associated initramfs images.

I don't know my way around Arch, but from what I could see it looks like when you make a change like they suggest earlier in PKGBUILD you end up with files suffixed with whatever you choose in /boot. pkgbase=linux-custom

$ ls -1 initramfs-linux* vmlinuz-linux*
initramfs-linux-fallback.img
initramfs-linux.img
initramfs-linux-pixelbook-patched-fallback.img
initramfs-linux-pixelbook-patched.img
vmlinuz-linux
vmlinuz-linux-pixelbook-patched

So, if you're using grub, for instance, you need to run the mkconfig again to get entries for the new files.

mattblaha commented 1 year ago

With 6.1.9 on Fedora 37, my sound is back to working perfectly.

saxa commented 1 year ago

Ok my fedora 37 now it also works, but I still have sometimes some stops, seems so. But in general it is working. Linux rclaptop 6.1.9-201.pixelbook.fc37.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Feb 2 06:52:35 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

savostyanov commented 1 year ago

@jmontleon Thank you for the explanation. I used stock arch kernel 6.1.9 and did not realise that one needs to build a patched kernel for the sound to work. I will try to find time to do it but not before the next weekend. I will report back with results when I have something to report.

jmontleon commented 1 year ago

With 6.1.9 on Fedora 37, my sound is back to working perfectly.

When you say that, you have kernel-6.1.9-201.pixelbook.fc37.x86_64 from the pixelbook copr repo rather than the stock kernel-6.1.9-200.fc37.x86_64, yes? kernel-6.1.9-201.pixelbook.fc37.x86_64 has a workaround.

jmontleon commented 1 year ago

@savostyanov thanks for taking the time to try it out. They're trying to figure out what went wrong in the stock kernel on the kernel regression mailing list so it will work without workarounds like this, but so far no luck. I've been asked to try a few other things so still trying to give them a hand narrowing it down as time permits.

mattblaha commented 1 year ago

With 6.1.9 on Fedora 37, my sound is back to working perfectly.

When you say that, you have kernel-6.1.9-201.pixelbook.fc37.x86_64 from the pixelbook copr repo rather than the stock kernel-6.1.9-200.fc37.x86_64, yes? kernel-6.1.9-201.pixelbook.fc37.x86_64 has a workaround.

Yep. Sorry for not being clearer, I have the copr setup from the playbook.

[me@fedora ~]$ uname -r
6.1.9-201.pixelbook.fc37.x86_64
undt commented 1 year ago

I can confirm with a fresh install of Fedora, sound is now working again. No work around needed other than the usual from the EVE Google packages.

-------- Original Message -------- On 6 Feb 2023, 14:43, Jason Montleon wrote:

@.***(https://github.com/savostyanov) thanks for taking the time to try it out. They're trying to figure out what went wrong in the stock kernel on the kernel regression mailing list so it will work without workarounds like this, but so far no luck. I've been asked to try a few other things so still trying to give them a hand narrowing it down as time permits.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

jmontleon commented 1 year ago

I can confirm with a fresh install of Fedora, sound is now working again. No work around needed other than the usual from the EVE Google packages.

Again, you'll probably see:

$ uname -r
6.1.9-201.pixelbook.fc37.x86_64

This package contains a workaround...

undt commented 1 year ago

Yes, confirmed as:

6.1.9-201.pixelbook.fc37.x86_64

-------- Original Message -------- On 6 Feb 2023, 16:55, Jason Montleon wrote:

I can confirm with a fresh install of Fedora, sound is now working again. No work around needed other than the usual from the EVE Google packages.

Again, you'll probably see:

$ uname -r 6.1.9-201.pixelbook.fc37.x86_64

This package contains a workaround...

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

huang-jy commented 1 year ago

6.1.10-201.pixelbook.fc36.x86_64 just dropped and sound appears to work for me. It also fixed the panic issue raised in #54

jmontleon commented 1 year ago

I think I've narrowed it down to a power management problem.

Call trace from a debug kernel. https://gist.github.com/jmontleon/a6dff2ad949cc50bb8f162d7b306b320

If I unset CONFIG_PM in the kernel config I don't have to patch anything to get it working.

Pulling just codec->core.exec_verb = codec_exec_verb; from the snd_hda_codec_device_init and moving it back to snd_hda_codec_device_init prevents the codec_exec_verb code from running at startup, along with the power management stuff it contains, and then audio works.

I've passed most of this sans the call trace to the regression list already with some more details. I'm hoping someone with more familiarity can pin point it.

jmontleon commented 1 year ago

Confirmed it's a PM handling issue. Moving the one line back should fix it. There's more explanation here: https://lore.kernel.org/regressions/7df25a70-2ec8-88ae-14ae-8ff000217924@leemhuis.info/T/#m86a55cde4d936e8c65d166b30ab9b7efa1812685

saxa commented 1 year ago

Congrats Jason !!!

mattblaha commented 1 year ago

Congrats Jason !!!

Yeah, great work. Thanks for all this effort keeping my favorite laptop working. (With zero Chrome . . . )

jmontleon commented 1 year ago

The fix should be in 6.2.0: https://lkml.iu.edu/hypermail/linux/kernel/2302.2/03207.html

jmontleon commented 1 year ago

I believe I saw an email that suggests it should land in 6.1 stable soon too.

saxa commented 1 year ago

In fact I am waiting that, but I see its still WIP as some people complain in alsa on how they should solve that dynamic array things if I got it correctly. But so far seems that this issue is closed.

jmontleon commented 1 year ago

Should be 6.1.13: https://kernel.googlesource.com/pub/scm/linux/kernel/git/stable/linux-stable-rc.git/+log/refs/heads/linux-6.1.y/sound

jmontleon commented 1 year ago

Unpatched 6.2.0 Fedora package works fine: https://koji.fedoraproject.org/koji/buildinfo?buildID=2155885

Once we get a 6.1.13 package I'll try that, and then a 6.3.0 when we get one to hopefully close the loop early for the next release.

jmontleon commented 1 year ago

Confirmed 6.1.13-200.fc37.x86_64 works unpatched.

saxa commented 1 year ago

Great !

saxa commented 1 year ago

Huh, I know this has nothing to do in here, but today I updated my slackware install with the kernel 6.1.13 and for some reason the sound firmware is not loading. dmesg | grep snd [ 5.795981] snd_hda_intel 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if info 0x040100 [ 6.132125] snd_soc_skl 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if info 0x040100 [ 6.213027] snd_soc_skl 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915]) [ 7.324462] snd_soc_skl 0000:00:1f.3: ASoC: no sink widget found for AEC Capture [ 7.327248] snd_soc_skl 0000:00:1f.3: ASoC: Failed to add route echo_ref_out cpr 7 -> direct -> AEC Capture [ 7.334534] snd_soc_skl 0000:00:1f.3: Direct firmware load for intel/dsp_fw_kbl.bin failed with error -2 [ 7.339509] snd_soc_skl 0000:00:1f.3: Request firmware failed -2 [ 7.344555] snd_soc_skl 0000:00:1f.3: Load base fw failed : -5 [ 7.349514] snd_soc_skl 0000:00:1f.3: Failed to boot first fw: -5 [ 7.354279] snd_soc_skl 0000:00:1f.3: ASoC: error at snd_soc_component_probe on 0000:00:1f.3: -5 root@goopix:~# dmesg | grep kbl [ 6.164246] i915 0000:00:02.0: [drm] Finished loading DMC firmware i915/kbl_dmc_ver1_04.bin (v1.4) [ 7.329118] kbl_r5514_5663_max kbl_r5514_5663_max: ASoC: Parent card not yet available, widget card binding deferred [ 7.334534] snd_soc_skl 0000:00:1f.3: Direct firmware load for intel/dsp_fw_kbl.bin failed with error -2 [ 7.357525] kbl_r5514_5663_max kbl_r5514_5663_max: ASoC: failed to instantiate card -5 [ 7.362470] kbl_r5514_5663_max: probe of kbl_r5514_5663_max failed with error -5

I still have the firmware on my install. I thought that maybe during the install it was removed, but this is not the case. So any suggestions on how should I check why the firmware is not loading ?

jmontleon commented 1 year ago

Direct firmware load for intel/dsp_fw_kbl.bin failed with error -2, -2 is file not found if I'm not mistaken.

/lib/firmware/intel/dsp_fw_kbl.bin exists? And if it's a link whatever it's pointing to does?

saxa commented 1 year ago

I will take a look later tonight at all this stuff closer. Looking fast yesterday night those things all seemed ok, but since the package linux-firmware was upgraded I suspect that this could done some troubles.

saxa commented 1 year ago

Ok, looking at it nd seems a lot of symlinks in the /lib/firmware are broken on my slackware install.

saxa commented 1 year ago

Ok i had broken symlinks in /lib/firmware. Sound is working. Thanks @jmontleon

huang-jy commented 1 year ago

Can confirm stock 6.1.13 under F36 also works

saxa commented 1 year ago

Yup, but I just installed latest fedora updates and I have only a dummy driver on 6.1.14 kernel. 6.1.14-200.fc37.x86_64

jmontleon commented 1 year ago

6.1.14 is working fine for me. At least one other has confirmed 6.1.13 is working for them.

In all likelihood it's not the same problem initially reported, since it's been patched. Maybe a new issue (providing much more detail so there's hope of actually helping) would be better. The only reason this is still open is to remind me to check a 6.3 RC so we can be reasonably assured the next big update won't break us again.

If nothing else perhaps try one of the hard reset options: https://github.com/jmontleon/pixelbook-fedora#troubleshooting

saxa commented 1 year ago

I can confirm that 6.1.13 was working for me too, and I can confirm I have a working audio on 6.1.14 on my slackware install. So surely is not the kernel same issue. I also saw that the intel firmware has broken symlinks on slackware. But I checked that on my fedora install and they seem to be ok. So tomorrow I will try to check more things and see whats on.

lyncolnmd commented 1 year ago

I wasnt able to try 6.1.13 as thats on the LTS kernel package for Arch. However I have tried 6.2.1 and 6.2.2 and both are working perfectly on Arch

Sent from Outlook for Androidhttps://aka.ms/AAb9ysg


From: saxa @.> Sent: Sunday, March 5, 2023 4:45:40 PM To: jmontleon/pixelbook-fedora @.> Cc: lyncolnmd @.>; Comment @.> Subject: Re: [jmontleon/pixelbook-fedora] Sound broken with kernel 6.1 (Issue #51)

I can confirm that 6.1.13 was working for me too, and I can confirm I have a working audio on 6.1.14 on my slackware install. So surely is not the kernel same issue. I also saw that the intel firmware has broken symlinks on slackware. But I checked that on my fedora install and they seem to be ok. So tomorrow I will try to check more things and see whats on.

— Reply to this email directly, view it on GitHubhttps://github.com/jmontleon/pixelbook-fedora/issues/51#issuecomment-1455216193, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AOCMS63M6HF5Q3YFWNWRUBTW2UCQJANCNFSM6AAAAAAT35NW2Y. You are receiving this because you commented.Message ID: @.***>

saxa commented 1 year ago

Ok today I booted up my fedora install and the sound started working. So most probably was just a need of a hard poweroff. Great to hear that 6.2 kernel series works ok.

jmontleon commented 1 year ago

Thank you for confirming @lyncolnmd.

Fedora is not on 6.2.x yet, I think I saw a test day email coming up, so probably soon assuming no crazy issues. And they are producing 6.2 builds https://koji.fedoraproject.org/koji/buildinfo?buildID=2164262 6.3 RC1 posted yesterday and Fedora has a build today https://koji.fedoraproject.org/koji/taskinfo?taskID=98365186

I tested with both and they work, so this issue is resolved and there doesn't appear to be any new surprises in 6.3 so I'm going to close this.

@saxa if you can't sort out your problem please feel free to open a new issue, with dmesg output and anything else you think might be relevant.

saxa commented 1 year ago

@jmontleon thanks. Sure I will if needed.

savostyanov commented 1 year ago

On Arch with the unpatched 6.2.2-arch1-1 kernel the sound works out of the box. Many thanks!