You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
f I play anything on my speakers, the sound output will stop after one minute of playback (the media player is also unable to continue playing, the whole stream stops). And I can't get it back without rebooting. It's only when it's speakers, the DisplayPort output ports works.
The sound still works if I make powertop not enable Runtime PM on" PCI Device Intel Corporation Alder Lake PCH eSPI Controller" (/sys/bus/pci/devices/0000:00:1f.0/power/control))It seems to be because of running powertop --auto-tune. If I don't do that during boot, it stays on.
@madsl I havent' worked with powertop since the early 2010s, and I can't find a way to run this
root@plb-Latitude-9420:~# powertop --auto-tune
modprobe cpufreq_stats failedLoaded 750 prior measurements
RAPL device for cpu 0
RAPL device for cpu 0
Devfreq not enabled
glob returned GLOB_ABORTED
Leaving PowerTOP
Can you tell us more about your configuration, add the powertop logs and if possible add dynamic debug by adding this file sof-dyndbg.conf.txt as /etc/modprobe.d/sof-dyndbg.conf (reboot needed).
Maybe you're onto something, that it doesn't have anything to do with powertop. I might just have had bad luck in triggering it when I tested it out and created some false positives.
No, I did not edit it. It was the time it took before I ran systemctl --user restart pipewire. I checked many times before to be sure. It's the restart step that makes the kernel spew out all those lines, nothing happened before it (in dmesg).
Right, that points to some sort of streaming/DMA issue. The driver doesn't catch the error and somehow believes things are just fine.
The good thing is that we don't have an issue with low-level speaker-test utilities.
One possibility would be to disable the timer-based scheduling in pipewire. In the PulseAudio days, we used to have an option tsched=0, presumably the same option exists?
If not, we need to patch the kernel with this diff:
I re-installed a complete Fedora36 distro with PipeWire+audacious and it's been playing for 10mn alright. It's a similar setup with two RT1316 amplifiers and it's the same firmware on TGL and ADL.
Wondering if you could try with Fedora on a USB key to check if this problem also happens there?
Now I've tried same sof-firmware (2.0), same pipewire (0.3.49), and same alsa-ucm (1.2.6.1) as the Fedora live USB, but it still happened on my install. Then I started thinking - I still have that powertop --auto-tune thing during boot, and that's soon the only difference between the systems...
And lo and behold, if I disable powertop --auto-tune completely during boot, I don't get stream stops anymore.
powertop --auto-tune needs a bit of measurements of your battery before it will apply something with --auto-tune, and it will tell you this if you just start it normally (something about needs x more measurements). Could you try that on your Fedora, and see if you get --auto-tune to do something, and if applied, see if it affects you as well?
Would be nice if you could have powertop enabled, I think it saves you a lot of battery in the long run...
powertop should give you a list of options that were set as 'GOOD'. is there a way you can capture them and share?
I also wonder if there's a way to do some sort of dichotomy with all the options, i.e. start from an all BAD set of configurations, and gradually change some options to GOOD until you reach the problem with the stream stopping.
We don't have any hooks that I am aware of to tune the audio subsystem, so it's likely something external that has a side effect.
@madsl this is what I had in mind, the powertop 'Tunables' tab should show what's enabled. I changed all the 'bad' to 'good' and I don't see any effect on my system. If you can give it a try that would check what the auto-tune option is trying to do.
@madsl I am not aware of any relationship or dependencies between audio and wifi on Intel platform, maybe there's some sort of DMA issue due to bandwidth on the PCI bus. We'll keep this open for now to see if there are additional information but for now there's not much we can do on the audio side.
Activity
plbossart commentedon Jul 25, 2022
@madsl I havent' worked with powertop since the early 2010s, and I can't find a way to run this
Can you tell us more about your configuration, add the powertop logs and if possible add dynamic debug by adding this file
sof-dyndbg.conf.txt as /etc/modprobe.d/sof-dyndbg.conf (reboot needed).
Thanks!
plbossart commentedon Jul 25, 2022
@madsl there's also no link that I am aware of between PCI device 1f.0 (eSPI) and the 1f.3 (audio)
madsl commentedon Jul 25, 2022
I'll attach the commands that powertop --auto-tune runs on my machine, you can export it to a bash script with the help of this: https://github.com/jlmcgraw/apply_powertop_recommended_settings
I've commented out line 25 (as it is run on my 9320). If you uncomment that one and run the script, I think you'll be able to recreate the issue.
plbossart commentedon Jul 25, 2022
How do you generate sound @madsl, i.e. do you see any problems with
That should play noise on your speakers on a SoundWire-based device.
I have a TGL-based platform with those codecs and I see no issue.
madsl commentedon Jul 25, 2022
You did remember to uncomment that line before testing?
I've tested with audacious with pulseaudio set as output, and with chromium / firefox.
madsl commentedon Jul 25, 2022
I can't replicate it with speaker-test, no....
I'm using pipewire 0.3.56 with default options, and audacious with pulseaudio output as mentioned.
madsl commentedon Jul 25, 2022
Maybe you're onto something, that it doesn't have anything to do with powertop. I might just have had bad luck in triggering it when I tested it out and created some false positives.
How can we debug this further?
plbossart commentedon Jul 25, 2022
.... works forever.
same with aplay.
I really don't see how this could impact pipewire.
plbossart commentedon Jul 25, 2022
@madsl I think it's best if you retry with dynamic debug enabled and see if there's anything in the dmesg log that would cause the stream to stop.
madsl commentedon Jul 25, 2022
I sat PIPEWIRE_DEBUG=5 in the service, and retried:
Those early wakeup-lines just kept repeating, and it was when the first line came the sound stopped.
madsl commentedon Jul 25, 2022
dmesg:
plbossart commentedon Jul 25, 2022
oh, that's pretty scary @madsl, I've not seen this one before. Indeed if we have an IPC error it's game over usually.
Can you attach the full dmesg log (not paste) so that we can figure out when this happens?
Also we need to confirm which kernel you are using (we can figure out the firmware from the dmesg log).
madsl commentedon Jul 25, 2022
Then all those errors pops up in dmesg.
Attached are the dmesg:
dmesg_tgl_ipc.log
plbossart commentedon Jul 25, 2022
did you edit the log @madsl? There's a significant gap
makes it hard to see what happened when you start playing in step2) above.
madsl commentedon Jul 25, 2022
No, I did not edit it. It was the time it took before I ran systemctl --user restart pipewire. I checked many times before to be sure. It's the restart step that makes the kernel spew out all those lines, nothing happened before it (in dmesg).
21 remaining items
plbossart commentedon Jul 27, 2022
Right, that points to some sort of streaming/DMA issue. The driver doesn't catch the error and somehow believes things are just fine.
The good thing is that we don't have an issue with low-level speaker-test utilities.
One possibility would be to disable the timer-based scheduling in pipewire. In the PulseAudio days, we used to have an option tsched=0, presumably the same option exists?
If not, we need to patch the kernel with this diff:
madsl commentedon Jul 27, 2022
I did your kernel patch, but unfortunately it seems like the same issue is popping up. It stopped 4:25 in now.
plbossart commentedon Jul 27, 2022
I re-installed a complete Fedora36 distro with PipeWire+audacious and it's been playing for 10mn alright. It's a similar setup with two RT1316 amplifiers and it's the same firmware on TGL and ADL.
Wondering if you could try with Fedora on a USB key to check if this problem also happens there?
Thanks!
madsl commentedon Jul 27, 2022
Sure thing! You did a complete install, or did you test from USB? I'll try with Fedora-Workstation-Live-x86_64-36-1.5.iso
madsl commentedon Jul 27, 2022
Seems like you're right, it works there. I'll try going to an upstream kernel again and see if things get better on my local install.
madsl commentedon Jul 27, 2022
Hm, no dice. Tried with 5.18.14, same config as the sof-kernel, still happens. Guess I'll try to match firmware and pipewire version too then.
madsl commentedon Jul 27, 2022
Now I've tried same sof-firmware (2.0), same pipewire (0.3.49), and same alsa-ucm (1.2.6.1) as the Fedora live USB, but it still happened on my install. Then I started thinking - I still have that powertop --auto-tune thing during boot, and that's soon the only difference between the systems...
And lo and behold, if I disable powertop --auto-tune completely during boot, I don't get stream stops anymore.
powertop --auto-tune needs a bit of measurements of your battery before it will apply something with --auto-tune, and it will tell you this if you just start it normally (something about needs x more measurements). Could you try that on your Fedora, and see if you get --auto-tune to do something, and if applied, see if it affects you as well?
Would be nice if you could have powertop enabled, I think it saves you a lot of battery in the long run...
plbossart commentedon Jul 28, 2022
powertop should give you a list of options that were set as 'GOOD'. is there a way you can capture them and share?
I also wonder if there's a way to do some sort of dichotomy with all the options, i.e. start from an all BAD set of configurations, and gradually change some options to GOOD until you reach the problem with the stream stopping.
We don't have any hooks that I am aware of to tune the audio subsystem, so it's likely something external that has a side effect.
plbossart commentedon Jul 28, 2022
@madsl this is what I had in mind, the powertop 'Tunables' tab should show what's enabled. I changed all the 'bad' to 'good' and I don't see any effect on my system. If you can give it a try that would check what the auto-tune option is trying to do.
base-defconfig: add dev_freq for powertop support
madsl commentedon Aug 14, 2022
Seems like I found the magic setting that helped on my XPS 9320.
If I comment out powersave on my wifi in apply_recommended_power_settings.sh like this:
then I don't get the error anymore.
I guess that means that this might either be a wifi driver issue or a Dell firmware issue?
I'll attach my current apply_recommended_power_settings.sh
apply_recommended_power_settings.sh
plbossart commentedon Aug 19, 2022
@madsl I am not aware of any relationship or dependencies between audio and wifi on Intel platform, maybe there's some sort of DMA issue due to bandwidth on the PCI bus. We'll keep this open for now to see if there are additional information but for now there's not much we can do on the audio side.
base-defconfig: add dev_freq for powertop support
plbossart commentedon Feb 16, 2023
no update and no reproduction in 6+ months, closing. If additional data helps pin-point what the problem might be please reopen a new issue