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

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

Closed
fxthomas opened this issue Feb 23, 2021 · 118 comments
Assignees
Labels
bug Something isn't working as expected BYT Applies to Baytrail platform CHT Applies to Cherry Trail platform P2 Critical bugs or normal features won't fix This will not be worked on atm (e.g. a bug closed for lack of user request, hardware etc)

Comments

@fxthomas
Copy link

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:

  • Enable SOF with options snd-intel-dspcfg dsp_driver=3 on a 5.11 kernel
  • Check that the SOF driver is actually used with dmesg | grep sof
  • Play a relatively long sound file for a few minutes (aplay -D <device name> file.wav for example)
  • After sometimes (usually 2-3 minutes, though not always), speakers/headphones stop playing anything and emit a loud persistent "beeeep" that doesn't stop

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).
  2. Name of the topology file
    • Topology: ? (I don't know how to get that)
  3. Name of the platform(s) on which the bug is observed.
    • Platform: Atom x5-Z8530 (Cherrytrail) / rt5640

Logs:

  • There are no logs in dmesg at all
  • Regarding sof-logger, is there a way for me to compile it without bringing up the whole toolchain?

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

@fxthomas fxthomas added the bug Something isn't working as expected label Feb 23, 2021
@plbossart
Copy link
Member

Thanks for reporting this @fxthomas

Nothing really comes to my mind as a possible issue and our good friend @jwrdegoede has played quite a bit with SOF on CherryTrail.

Do you have the ability to test with the latest SOF development kernel (branch topic/sof-dev)?

@bardliao anything on the RT5640 that could help explain a sustained 'beeep'?

@bardliao
Copy link
Collaborator

I guess it is something related to clock. @fxthomas Could you check is the "Platform Clock" widget always on the right state? I.e. It should be On in playback and Off after playback. You can cat the "Platform Clock" node in /sys/kernel/debug/asoc//dapm/. @oder-chiou @shumingfan FYI.

@fxthomas
Copy link
Author

fxthomas commented Feb 24, 2021

Thanks for the quick answers!

Do you have the ability to test with the latest SOF development kernel (branch topic/sof-dev)?

The one that's in https://github.com/thesofproject/linux/tree/topic/sof-dev? Never done a custom kernel build before, but the docs look clear enough. I'm compiling it right now.

You can cat the "Platform Clock" node in /sys/kernel/debug/asoc//dapm/.

It's in /sys/kernel/debug/asoc/sof-bytcht rt5640/dapm/Platform Clock for me. With the same kernel it's off before playback, on during playback and beeping, off after restarting the sound server ; will test again when I have the topic/sof-dev build running.

@shumingfan
Copy link
Contributor

shumingfan commented Feb 25, 2021

@fxthomas Would you please dump the codec registers?

  1. dump registers when beep sound happened
  2. dump registers when playing with the default SST driver

dump codec registers:
cat /sys/kernel/debug/regmap/i2c-10EC5640:00/registers

BTW, is it possible to measure the MCLK frequency on your side?

@mengdonglin mengdonglin added the CHT Applies to Cherry Trail platform label Mar 2, 2021
@slawblauciak slawblauciak added the P2 Critical bugs or normal features label Mar 2, 2021
@jwrdegoede
Copy link
Contributor

I've been testing SOF + BYT/CHT with pipewire instead of pulseaudio as audioserver this weekend and I did notice some instabilities where sound stopped playing (no beep though) until I stopped all audio-playback for a while and then tried again.

There were also some issues with pipewire not properly executing the UCM enable-seq for capture, so the capture pipeline was not working while the gnome-control-center sound-pane did try to use it (for the input vu-meter) so that might have been part of what I was seeing.

I switched back to SST to try and debug pipewire issues without also having SOF in play, during this I learned: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/866 that pipewire defaults to 24 bits (or maybe even 32 when advertised?) where pulseaudo will always pick s16_le as format if available.

@fxthomas did you specify e.g. "-Dhw:1" when testing with aplay ? Otherwise you are still going through the audio-server (through the alsa-plugin for the audio-server) I believe and then you may have been testing with pipewire. Also did you specify a format with the -f param to aplay ?

I wonder if the SOF CI is testing with 24 / 32 bits sample sizes on BYT/CHT and I wonder if the bigger sample size may be causing issues with e.g. the stack on the DSP, or just some things becoming slower enough to sometimes be a problem ?

@lgirdwood
Copy link
Member

I wonder if the SOF CI is testing with 24 / 32 bits sample sizes on BYT/CHT and I wonder if the bigger sample size may be causing issues with e.g. the stack on the DSP, or just some things becoming slower enough to sometimes be a problem ?

Yes this will have impact on FW buffers and processing headroom. 24bit is on the CI test list for CHT, but it's likely not stressed like 16bit is (sinec it's the primary use case on the older HW). The CHT multi format test is here.

https://sof-ci.01.org/sofpr/PR3911/build8276/devicetest/?model=BYT_MB_NOCODEC&testcase=check-playback-all-formats

@jwrdegoede
Copy link
Contributor

jwrdegoede commented Mar 9, 2021

Yes this will have impact on FW buffers and processing headroom. 24bit is on the CI test list for CHT, but it's likely not stressed like 16bit is (sinec it's the primary use case on the older HW).

Ok, so that is what I expected, in that case it seems to me that it would be better if pipewire were to just use 16 bit formats on these device ? Also note that the SOF driver is even advertising 32 bit formats (S32_LE) I would not be surprised if pipewire actually picks that one.

If you agree that pipewire just using 16bit formats would be better, then the question becomes how we achieve this. I think that ideally the SOF driver should not advertise 24bit/32bit formats (on BYT/CHT) to userspace in that case. Or maybe have a module option to advertise these or not ?

@plbossart
Copy link
Member

@jwrdegoede The SOF driver just reports what the topology defines, there is no hard-coded format. I would be surprised if there was any difference, the dai is already configured to support 24 bits.

@fxthomas
Copy link
Author

fxthomas commented Mar 9, 2021

@fxthomas did you specify e.g. "-Dhw:1" when testing with aplay ? Otherwise you are still going through the audio-server (through the alsa-plugin for the audio-server) I believe and then you may have been testing with pipewire.

Yes, I used -D sysdefault:CARD=bytcrrt5640 in SST (and the equivalent for SOF), and also made sure pipewire/pulse were not running (systemd sockets/services stopped and no processes running).

Also did you specify a format with the -f param to aplay ?

In the linked pipewire issue comment I noted the aplay command-lines I used for testing with the SST driver, and these included -f and a few other settings.

For a quick summary, the only two that worked in the SST driver were:

$ ffmpeg -i input.mp3 -f s16le -c:a pcm_s16le -ar 48000 -ac 2 test_s16le_48000.raw
$ aplay -D sysdefault:CARD=bytcrrt5640 -f s16_le -r 48000 -c 2 -v test_s16le_48000.raw
$ ffmpeg -i input.mp3 -f s32le -c:a pcm_s32le -ar 96000 -ac 2 test_s32le_96000.raw
$ aplay -D sysdefault:CARD=bytcrrt5640 -f s24_le -r 48000 -c 2 -v test_s32le_96000.raw

In the SOF driver, the beeping occurs after some time whether I use aplay or Pipewire or Pulse in any mode.

Also I said (famous last words!):

will test again when I have the topic/sof-dev build running.

...but while it boots just fine I'm having some trouble figuring out how to enable SOF in this build, because it is apparently not as simple as the default 5.11 kernel I'm running. I need to read the docs, I'm just a poor newcomer to that world 😉

@plbossart
Copy link
Member

@fxthomas there is a kernel parameter to select SOF, by default SST is the default.

copy this to any file in /etc/modprobe.d/

options snd-intel-dspcfg dsp_driver=3

@plbossart
Copy link
Member

alternatively there's also a build config
CONFIG_SND_INTEL_BYT_PREFER_SOF

but I am not sure if it's in our development version just yet.

@fxthomas
Copy link
Author

fxthomas commented Mar 9, 2021

options snd-intel-dspcfg dsp_driver=3

That's the one I used, it worked on the official 5.11 kernel but not on the SOF branch when I tried. I'm rebuilding the branch right now from scratch, let's see if I can make that work better.

CONFIG_SND_INTEL_BYT_PREFER_SOF

Looks like it's there in thesofproject/linux@3620c5394b8b. If I can't make it work with the module option I'll try this one next.

@fxthomas
Copy link
Author

I finally got some success!

Some observations first:

  • I upgraded to v5.11.4-arch1 which still beeps after a couple of minutes, but no longer persistently: the beep stops after a couple of seconds (hey, that's an improvement!). I used that as a basis for the test below.
  • I was able to compile topic/sof-dev and enable the SOF driver on it, using the same configuration as v5.11.4-arch1 as a base, merged with kconfig-sof-default.sh from the SOF repository. I didn't experience any beeping, everything works well.
  • In both kernels all buffer formats (incl. e.g. S32LE) seem functional with the SOF driver, contrary to the SST driver, and Pipewire does not need special configuration.
  • @shumingfan The registers are below. I don't know how to measure MCLK, is this documented somewhere?
  • I don't see anything that catches my eye here, except perhaps for the fact that:
    • Some loaded modules are a little different in the two kernels (see the attached lsmod outputs), but the same kernel has the same modules when loaded in SST or in SOF mode. Is that normal?
    • aplay now stops with a write error when the beep occurs (it used to just hang there), see aplay-5.11.4-arch-sof-after3.log

Tests for v5.11.4-arch1 (SOF, pure ALSA):


Tests for v5.11.4-arch1 (SST, pure ALSA):


Tests for topic/sof-dev (SOF, pure ALSA):


Tests for topic/sof-dev (SOF, Pipewire 0.3.23, default configuration):


Tests for topic/sof-dev (SST, pure ALSA):

@plbossart
Copy link
Member

  • I upgraded to v5.11.4-arch1 which still beeps after a couple of minutes, but no longer
    persistently: the beep stops after a couple of seconds (hey, that's an improvement!). I used that as a basis for the test below.

that's still with the SST driver, yes?

  • I was able to compile topic/sof-dev and enable the SOF driver on it, using the same configuration as v5.11.4-arch1 as a base, merged with kconfig-sof-default.sh from the SOF repository. I didn't experience any beeping, everything works well.

Good.
You should see the same result with v5.11.4, there are no significant differences for Baytrail/Cherrytrail.

  • In both kernels all buffer formats (incl. e.g. S32LE) seem functional with the SOF driver, contrary to the SST driver, and Pipewire does not need special configuration.

  • @shumingfan The registers are below. I don't know how to measure MCLK, is this documented somewhere?

  • I don't see anything that catches my eye here, except perhaps for the fact that:

    • Some loaded modules are a little different in the two kernels (see the attached lsmod outputs), but the same kernel has the same modules when loaded in SST or in SOF mode. Is that normal?

yes, that's normal. there are two drivers registering for the same ACPI ID, so both will be loaded but only one selected with the run-time detection. So some modules are loaded but their probe will fail. They will still show as loaded modules.

Not following. is this with the SOF or SST driver?

@fxthomas
Copy link
Author

fxthomas commented Mar 11, 2021 via email

@plbossart
Copy link
Member

thanks @fxthomas
I must admit not having any clues on what might cause this beep issue with the SOF driver in v5.11, or what we did recently that could explain that it's no longer beeping.

In this kind of cases, I would try to bisect to try to find more leads.

a) start with commit 3620c5394b8b234ca77e562758127a6bb9e64720 ('ASoC: SOF: remove superfluous NULL check in debugfs read'). That's the last commit based on v5.11-rcX in our development tree
b) check plain vanilla v5.11, and then bisect until you find something...

It'll typically take 15 iterations but to reduce compilation time you can try generating a .config with our script, that compiles in 4mn on my host device since we've removed tons of things that aren't required for audio. see https://github.com/thesofproject/kconfig/blob/master/kconfig-sof-default.sh

Sorry I don't have a more direct way of helping.

@fxthomas
Copy link
Author

Got it, thanks for the pointers to the relevant commits and all the help anyway, I already have a much better view of how I troubleshoot this — and learned tons about the Linux audio stack along the way! I'll let you know when I get results from the bisect.

@plbossart
Copy link
Member

btw I was trying on a Cherrytrail+rt5640 (headset only, no speakers) and I didn't hear anything bad with topic/sof-dev either.
I only test with -Dhw:0,0 since that's the main path and there are known issues with the mixer in the firmware.

@fxthomas
Copy link
Author

Hmm, I'm actually back to square one. I was watching a video on the same kernel I compiled in my earlier tests from topic/sof-dev with the SOF driver + Pipewire 0.3.23, and the same beeping appeared after 30/40 min. That's much better than the official kernel, but the issue is still there.

At this point it very well could be an hardware issue, but there's not much of interest in the logs/dmesg...

@fxthomas
Copy link
Author

For more information, I took a recording by plugging the rt5640 output jack to an external recorder's input jack. Here is the output right before the beeping happens:

image

Zoom on the region:

image

Interestingly the L/R channels seem to swap after a while (I noticed this earlier, but on the spectrogram above the discontinuities are very visible), see a zoom at one of them:

image

(Recording available here. The sound is not very clean — you can hear a bit of noise that can't be heard directly with headphones on the machine, but the beeping is exactly as I heard multiple times on this bug)

@jwrdegoede
Copy link
Contributor

That part about the channel-swap is interesting, as discussed in #3699 I was seeing this during my testing too, but this got fixed recently. I just checked and the fix for that is not in the 1.6.1 firmware which you are using.

In my testing the swapping only happened between open/closing of the device but I never tested for long periods at a time, so maybe the swapping you are seeing is the same; and with some luck it is also the root-cause of the beep (so the swap triggering while playing causes the beep).

I asked one of the SOF devs to provide my with a test-build of the upcoming 1.7 firmware which does include the fix for this, so that I could confirm that the channel-swap issue is fixed.

It would be good if you can (re)test with that firmware bulld. I've attached that here. To install this, simply replace /lib/firmware/intel/sof/sof-cht.ri with the one from the attached zip and then reboot.

sof-firmware.zip

@fxthomas
Copy link
Author

It would be good if you can (re)test with that firmware bulld. I've attached that here.

Done, the beeping is still there but I didn't hear any channel swapping. Given the seemingly random nature of all this I'm not quite ready to call it, but it looks like a small improvement at least!

Looking at the curves in my earlier message I get the impression that the beep is just caused by a 2ms buffer (96 samples@48kHz in the recording) not getting updated somewhere in the driver stack and repeating ad infinitum. Does that particular number ring a bell?

image

Can runtime PM in one of the platform drivers (codec/LPE/something else I'm not aware of) cause this somehow? Is there a way I can see the PM state e.g. in /sys or /proc?

@lgirdwood
Copy link
Member

@fxthomas thanks, I've listened to the ogg file and it sounds like the DMA repeats the last period continually. Can you confirm the following for me.

  1. media player or aplay does not report XRUNs - no XRUNs means the host side DMA is working as expected and copying data from host buffer to DSP buffer.
  2. alsamixer works and you can change DSP volumes (note this is not codec volume, the DSP controls are named differently).
  3. Stream works again after pause - i.e. aplay -i stops and restarts the audio (it may even fix the tone).

I suspect here that the SSP port has an error condition and is not able to get new data from DMA.

diff --git a/src/drivers/intel/baytrail/ssp.c b/src/drivers/intel/baytrail/ssp.c
index de5dc1346..3711309e7 100644
--- a/src/drivers/intel/baytrail/ssp.c
+++ b/src/drivers/intel/baytrail/ssp.c
@@ -534,6 +534,8 @@ static void ssp_stop(struct dai *dai, int direction)
 {
        struct ssp_pdata *ssp = dai_get_drvdata(dai);
 
+       dai_err(dai,"SSSR is 0x%x", ssp_read(dai, SSSR));
+
        spin_lock(&dai->lock);
 
        /* stop Rx if neeed */

This will dump SSP status at stream stop. It will hopefully show an error condition.

@plbossart
Copy link
Member

@fxthomas we don't support pm_runtime for SOF on Cherrytrail, so this is likely a firmware issue indeed.

@fxthomas
Copy link
Author

we don't support pm_runtime for SOF on Cherrytrail, so this is likely a firmware issue

Thanks for confirming!

media player or aplay does not report XRUNs
Stream works again after pause - i.e. aplay -i stops and restarts the audio (it may even fix the tone).

I didn't see any XRUNs.

In the latest kernels (5.11.4+) aplay actually stops with a write error after 4-5 seconds beeping, see at the end of the log I posted in #3868 (comment):

aplay: pcm_write:2058: write error: Input/output error

The recording I shared was under Pipewire, where the beeping still stays persistent until I restart the PW service (presumably because it retries to establish the link continually).

alsamixer works and you can change DSP volumes (note this is not codec volume, the DSP controls are named differently).

How do I distinguish between the two? I see a lot of entries for controling DAC/ADC/mixer components like Stereo ADC MIXL ADC2, are these the ones I should be looking for?

This will dump SSP status at stream stop. It will hopefully show an error condition.

Unfortunately I don't have a drivers/intel directory in neither topic/sof-dev branch nor the official 5.11.6 sources. Should I look elsewhere?

@lgirdwood
Copy link
Member

I didn't see any XRUNs.

In the latest kernels (5.11.4+) aplay actually stops with a write error after 4-5 seconds beeping, see at the end of the log I posted in #3868 (comment):

aplay: pcm_write:2058: write error: Input/output error

ok, so this is useful (I can rule out a few of the questions I asked above) - we have a pipeline like

host dma -> buffer -> volume -> buffer -> I2S DMA

The DMA ALSA position is updated by the host DMA position, but the host DMA position may block if there is not free space in the pipeline (the pipeline is emptied by the DMA I2S - which sounds like it's repeating the last period consistently and not emptying the DATA).

The pipeline buffers above have 2 periods so the timing headroom might be tight if PW is writting close to the host DMA position. I assume you have exactly the same error if you do

aplay -Dhw:0,0 -v --test-position -f dat 48kHzStereoWavfile.wav

Fwiw, I recommend using audacity to generate a sine wave stereo wav file with 48kHz sample rate. This shows up really well when captured for debugging and shows exactly what's happening (as you know what comes next).

Btw, can you run sof-logger when the issue happens. See

https://thesofproject.github.io/latest/developer_guides/debugability/logger/index.html

The ldc files for logger are in here https://github.com/thesofproject/sof-bin

You will also need to build the logger, See
https://thesofproject.github.io/latest/getting_started/build-guide/build-from-scratch.html#step-4-build-topology-and-tools

@fxthomas
Copy link
Author

I assume you have exactly the same error if you do [...]

Yes, using --test-position has the same issue.

Fwiw, I recommend using audacity to generate a sine wave stereo wav file with 48kHz sample rate.

I will do that next time! 😉

Btw, can you run sof-logger when the issue happens.

I built 536800a (v1.6.1) that corresponds to the sof-firmware package I have installed from the official repos (source), using ./scripts/build-tools.sh (PKGBUILD used to do the build).

I then tried the following, but that does not seem to do anything on the official 5.11.6 kernel:

$ sudo sof-logger -l /usr/lib/firmware/intel/sof/v1.6.1/sof-cht-v1.6.1.ldc -n
         TIMESTAMP              DELTA C# COMPONENT          LOCATION                      CONTENT
$ sudo sof-logger -l /usr/lib/firmware/intel/sof/v1.6.1/sof-cht-v1.6.1.ldc -n -F verbose='*'
error: Unable to open out file '/sys/kernel/debug/sof/filter'
error: failed to apply trace filter, -13.
$ sudo ls /sys/kernel/debug/sof
cc_version  debug  dmac0  dmac1  dmac2	dram  etrace  exception  fw_version  inbox  iram  outbox  shim	ssp0  ssp1  ssp2  ssp3	ssp4  ssp5  stream

On the topic/sof-dev build I have from earlier it doesn't even work (but /sys/kernel/debug/sof/filter appears to be present this time!):

$ sudo sof-logger -l /usr/lib/firmware/intel/sof/v1.6.1/sof-cht-v1.6.1.ldc -n
         TIMESTAMP              DELTA C# COMPONENT          LOCATION                      CONTENT
error: Invalid filename length or ldc file does not match firmware

Do I need special debug kernel options to get sof-logger to work? The issue is far easier to reproduce on the official kernel, so if it is possible to enable it dynamically at runtime it'd be great!

Alternatively, do I need to rebuild it to work on a different kernel?

Sorry for the lot of questions, I hope that does not bother you too much!

@d03j
Copy link

d03j commented Mar 4, 2022

FWIW, installing v1.9 from https://github.com/thesofproject/sof-bin/archive/refs/heads/main.zip solved my issue. v2.0 doesn't seem to fix it.

@sturn42
Copy link

sturn42 commented May 1, 2022

Is it possible that the SOF firmware playing audio in stereo could be part of the problem? I am curious as I noticed the SST firmware plays back in mono when I changed to it.

@plbossart
Copy link
Member

@sturn42 That would be a bug of the SST firmware/driver or a configuration issue. On some platforms there's also a mono speaker only, so there is a downmix in the codec IIRC.
The I2S link is always configured as stereo btw. The word clock aka frame sync toggles and defines the position of left and right channels.

@wwangsa
Copy link

wwangsa commented May 3, 2022

Hi,
Hopefully my experiments helps at the higher level. I experienced the same issue with fxthomas and Pandemonious. I encountered continuous beep after several minutes of any video/music playback and the sound stops after the playback is paused. Finally, the problem went away with Manjaro Qonos 21.2.6 with Kernel 5.15.32-1 XFCE on Acer Chromebook (Edgar CB3-341 -- Intel Braswell). Before I landed with Manjaro XFCE, I installed several Ubuntu distributions and none of them working except the Gallium OS and somehow I believe this is related to the Intel Braswell (hardware accelaration) driver rather than kernel issue.

Here were my attempts:

  1. Ubuntu Budgie 21.10 and tried with different kernel 5.15, 5.16 and 5.17. Installed ubuntu-restricted-extras. YouTube video froze after several minutes followed by continous beep. MOV file is lagging. Has to use MPV player to play it smoothly. I installed the SOF driver but it only lower down the beep volume.
  2. Ubuntu Mate 21.10 and tried with different kernel 5.15, 5.16 and 5.17. Installed ubuntu-restricted-extras. YouTube video froze after several minutes followed by continous beep. MOV file is lagging.
  3. Gallium OS Xubuntu 18.04. Playback were smooth and similar experience like using chromebook. There is no issue with the sound and playback but the OS is not maintained. Lots of broken packages and I coudn't upgrade to the latest ubuntu.
  4. Manjaro Qonos Budgie live stick would not boot. It only shows black screen.
  5. Lubuntu 22.04 with kernel 5.15. MOV file plays fine but YouTube video froze after several minutes followed by continous beep.

@plbossart
Copy link
Member

@wwangsa I would bet the differences in results is largely due to the kernel configurations, some kernels enable the DSP firmware trace and some don't, but as can be read above the only current/known work-around is to enable the trace...

@Danct12
Copy link

Danct12 commented Jun 11, 2022

I haven't seen the issue coming back lately on Arch Linux, kernel 5.18.2 and SOF 2.1.1-1. I was able to play games and watch YouTube videos without running into this issue.

@nrndda
Copy link

nrndda commented Jun 11, 2022

Still present without snd_sof.sof_debug=1
Kernel 5.18.3
sof-audio-acpi-intel-byt 808622A8:00: Firmware info: version 2:1:1-3964a
sof-audio-acpi-intel-byt 808622A8:00: Firmware: ABI 3:21:0 Kernel ABI 3:19:1

@mengdonglin mengdonglin added the won't fix This will not be worked on atm (e.g. a bug closed for lack of user request, hardware etc) label Jun 21, 2022
@mengdonglin
Copy link
Collaborator

Move BYT and CHT platform to maintenance mode and SOF v2.2 will be the last upstream release with support for this platform. There will be no more FW bug fixing effort on this platform.

@Newbytee
Copy link

Newbytee commented Sep 22, 2022

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
Copy link
Member

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
Copy link

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
Copy link
Member

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

@sedit10n
Copy link

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
Copy link

Friptick commented Dec 21, 2022

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
Copy link

sturn42 commented Dec 22, 2022 via email

@nrndda
Copy link

nrndda commented Dec 22, 2022

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
Copy link
Member

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
Copy link

nrndda commented Dec 25, 2022

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
Copy link

nrndda commented Dec 27, 2022

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
Copy link

@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 🎉

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
Copy link

risky777 commented Jan 9, 2023

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
Copy link

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
Copy link

Mik3Rizzo commented Mar 14, 2023

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
Copy link

remrcll commented Apr 15, 2023

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
Copy link
Contributor

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
Copy link
Member

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as expected BYT Applies to Baytrail platform CHT Applies to Cherry Trail platform P2 Critical bugs or normal features won't fix This will not be worked on atm (e.g. a bug closed for lack of user request, hardware etc)
Projects
None yet
Development

No branches or pull requests