thesofproject / sof

Sound Open Firmware
Other
570 stars 322 forks source link

[BUG][BYT][CHT] Linux 5.11 Cherrytrail/rt5640 emits persistent beeping sound after a short while #3868

Closed fxthomas closed 2 years ago

fxthomas commented 3 years ago

I had this issue while trying to debug https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/530 on an HP Detachable x2 ultrabook, where we're trying to see if the SOF driver is somehow more stable than SST.

This issue happens with raw ALSA (neither Pipewire/Pulseaudio running) as well as with both PW/PA.

The following sequence reproduces the issue 100% of the time:

As far as I can tell the beep only goes away when starting (if running raw ALSA) or restarting (if already running) the Pipewire/Pulseaudio server, which restores proper playback until the next beep.

The default SST driver is stable for basic audio output in S16LE, despite issues in other areas.

Environment 1) Branch name and commit hash of the 2 repositories: sof (firmware/topology) and linux (kernel driver).

Logs:

I'm not familiar at all with SOF, so if this is the wrong place for a report do let me know!

Newbytee commented 2 years ago

SOF v2.2 will be the last upstream release with support for this platform

To clarify, does this mean releases following this will have zero support for these platforms whatsoever and users of these will have to figure out some way of staying on v2.2?

plbossart commented 2 years ago

the SOF releases will keep providing firmware for BYT, but the version will remain pegged to 2.2 for that SOC. 2.2 is really a long-term support branch, the main development branch is transitioning and will be based on the Zephyr RTOS for newer platforms.

sedit10n commented 1 year ago

Hello this issue is still present now in Dec. with all updates on Ubuntu / Jammy confirmed on setzer/hp chromebook Lubuntu 5.15.0-57-lowlatency, but the beeping will stop after some time and it will recover and continue playing audio after about 30 seconds.

plbossart commented 1 year ago

snd_sof.sof_debug=1 remains a requirement for a work-around. There is no planned fix at this time.

sedit10n commented 1 year ago

Thank you, will retest that. I can confirm that is also present in 6.0.0-1009-oem #9-Ubuntu and not limited to

Friptick commented 1 year ago

Confirming still present as of today on fully upgraded vanilla Ubuntu 20 LTS, even with debug workaround. A regression? (I had killed it with the debug hack on a previous Ubuntu install but had to reinstall Ubuntu and now it's back.)

$ cat /etc/modprobe.d/sof.conf
options snd_sof sof_debug=1
$ cat /sys/module/snd_sof/parameters/sof_debug
1
$ cat /sys/module/snd_intel_dspcfg/parameters/dsp_driver
0 

Anything I forgot to do?

Now trying what I understand is the last resort: options snd-intel-dspcfg dsp_driver=2. Will edit with update.

Update. No surprises, that fixed it. A bit disappointing that a supposedly solid release of the supposedly mainstream distro would have this issue. But I guess it must be hard to get every device to cooperate simultaneously, so no complaints. Thanks for your work.

sturn42 commented 1 year ago

You'll want to add the debug workaround to /etc/modprobe.d/alsa-base.conf

On Wed, Dec 21, 2022, 6:02 PM Friptick @.***> wrote:

Confirming still present as of today on fully upgraded vanilla Ubuntu 20 LTS, even with debug workaround. A regression? (I had killed it with the debug hack on a previous Ubuntu install but had to reinstall Ubuntu and now it's back.)

$ cat /etc/modprobe.d/sof.conf options snd_sof sof_debug=1 $ cat /sys/module/snd_sof/parameters/sof_debug 1 $ cat /sys/module/snd_intel_dspcfg/parameters/dsp_driver 0

Anything I forgot to do?

Now trying what I understand is the last resort: options snd-intel-dspcfg dsp_driver=2. Will edit with update.

— Reply to this email directly, view it on GitHub https://github.com/thesofproject/sof/issues/3868#issuecomment-1362201419, or unsubscribe https://github.com/notifications/unsubscribe-auth/APG6YTWRRQLBEVJFGIXLUYTWOOD75ANCNFSM4YC77CXA . You are receiving this because you were mentioned.Message ID: @.***>

nrndda commented 1 year ago

I can also confirm that there is a regression somewhere. Latest stable kernel and sof with sof_debug=1 produces sound freezes.

~ $ uname -a
Linux nrndda-hp608g1.lan 6.1.1-gebdb69c5b054-dirty #1 SMP PREEMPT Thu Dec 22 05:07:26 MSK 2022 x86_64 Intel(R) Atom(TM) x5-Z8550 CPU @ 1.44GHz GenuineIntel GNU/Linux
~ $ cat /sys/module/snd_sof/parameters/sof_debug
1
~ $ cat /sys/module/snd_intel_dspcfg/parameters/dsp_driver
0
~ $ journalctl -b | grep -i sof
kernel: Loading firmware: intel/sof/sof-cht.ri
kernel: sof-audio-acpi-intel-byt 808622A8:00: Firmware info: version 2:2:0-57864
kernel: sof-audio-acpi-intel-byt 808622A8:00: Firmware: ABI 3:22:1 Kernel ABI 3:23:0
kernel: sof-audio-acpi-intel-byt 808622A8:00: unknown sof_ext_man header type 3 size 0x30
kernel: sof-audio-acpi-intel-byt 808622A8:00: Firmware info: version 2:2:0-57864
kernel: sof-audio-acpi-intel-byt 808622A8:00: Firmware: ABI 3:22:1 Kernel ABI 3:23:0
kernel: Loading firmware: intel/sof-tplg/sof-cht-cx2072x.tplg
kernel: sof-audio-acpi-intel-byt 808622A8:00: Topology: ABI 3:22:1 Kernel ABI 3:23:0
~ $ ls -l /lib/firmware/intel/ | grep -i sof
lrwxrwxrwx 1 root root   10 Nov  6 16:52 sof -> sof-v2.2.2
lrwxrwxrwx 1 root root   15 Nov  6 16:52 sof-tplg -> sof-tplg-v2.2.2
drwxr-xr-x 1 root root  14K Nov  6 16:52 sof-tplg-v2.2.2
drwxr-xr-x 1 root root  780 Nov  6 16:52 sof-v2.2.2
~ $ eix sof-firmware
[I] sys-firmware/sof-firmware
     Available versions:  2.1.1-r1 2.2 (~)2.2.2
     Installed versions:  2.2.2(16:52:28 06.11.2022)
~ $ journalctl -b-4 -p4 | grep -i alsa
pipewire[836]: spa.alsa: hw:cx2072x: (0 missed) snd_pcm_avail after recover: Broken pipe
pipewire[836]: spa.alsa: hw:cx2072x: (62 missed) snd_pcm_avail after recover: Broken pipe
plbossart commented 1 year ago

There's been no change on the firmware and SOF sides, so likely a problem somewhere else. that's what git bisect is for I am afraid.

nrndda commented 1 year ago

Do not know where to find clues. Tried bisecting and found that even 5.18 has this freeze. Also tried SOF 2.1.1 and also the same. Built kernel with SOF debug and dumped trace but this also did not give any clues. Looks like DMA scheduling loops itself. Good part: https://pastebin.com/RPagwrgx Bad part: https://pastebin.com/7T5FVB98 Also tried SST driver alone and it's completely useless. Sound distortions. So SOF is the best shot for now. Can use it even with freezes, just pause-wait-unpause.

nrndda commented 1 year ago

After I stepped upon this bug, put intel_idle.max_cstate=2 and disabled intel_iommu. Still testing but even without sof.debug=1 no sound freezes yet. This is all with latest 6.2-rc1 kernel and 2.2.3 SOF.

laurentpayot commented 1 year ago

@Friptick Thanks a lot, adding the line options snd-intel-dspcfg dsp_driver=2 at the end of my /etc/modprobe.d/alsa-base.conf file fixed the beep sound issue on my Asus Chromebook C301SA (Braswell CPU) with Xubuntu 22.10 :tada:

Now trying what I understand is the last resort: options snd-intel-dspcfg dsp_driver=2. Will edit with update.

Update. No surprises, that fixed it.

risky777 commented 1 year ago

I would like to add my expirience with this on intel-z3735 and xubuntu-2204. In alsa-base.conf i activated sof and debug but there was still buzz-sound. In qmplay2 I redirected sound to alsa instead of pulse, this way buzz was much shorter. Then in qmplay2 for video I activated ffmpeg with opengl instead of ffmpeg-vaapi with vulcan, and it seems that buzz-sound doesn't happen anymore.

MrAndeos commented 1 year ago

Just to add my own experience, I had this buzzing problem on an Acer Aspire Switch 10 tablet (Intel Atom Z3745), even with fully updated Ubuntu 22.04.1. Adding options snd-intel-dspcfg dsp_driver=2 to /etc/modprobe.d/alsa-base.conf made the sound stop working entirely (there were no output devices found), but adding options snd_sof sof_debug=1 instead seems to have fixed the issue.

Mik3Rizzo commented 1 year ago

I'd share my experience too. I had this problem on an Asus VivoBook E200HA (Intel Atom x5-Z8300) with fully updated Lubuntu 22.04 (kernel 5.19). Adding options snd-intel-dspcfg dsp_driver=2 to /etc/modprobe.d/alsa-base.conf as @Friptick suggested solved my problem.

remrcll commented 1 year ago

Adding options snd-intel-dspcfg dsp_driver=2 to /etc/modprobe.d/alsa-base.conf as @Friptick suggested solved my issue on CHUWI Hi10HQ64G with Ubuntu 22.04.2 LTS, Intel Atom x5-Z8350 too.

jwrdegoede commented 1 year ago

Adding options snd-intel-dspcfg dsp_driver=2 to /etc/modprobe.d/alsa-base.conf as @Friptick suggested solved my issue on CHUWI Hi10HQ64G with Ubuntu 22.04.2 LTS, Intel Atom x5-Z8350 too.

Right I believe that the SOF driver is never going to get fixed on this older devices. Fedora has stopped setting CONFIG_SND_INTEL_BYT_PREFER_SOF for a long long time already. I think we should just remove CONFIG_SND_INTEL_BYT_PREFER_SOF from the upstream kernel all together and have the kernel always default to SST (dsp_driver=2) on BYT + CHT hardware.

@plbossart what do you think, shall I submit a patch upstream dropping CONFIG_SND_INTEL_BYT_PREFER_SOF ?

plbossart commented 1 year ago

@plbossart what do you think, shall I submit a patch upstream dropping CONFIG_SND_INTEL_BYT_PREFER_SOF ?

Yes, I agree @jwrdegoede, we've unfortunately dropped the ball on SOF+Baytrail.