FS#71982 - [pipewire/linux] Audio stuttering with PipeWire when using low timer frequency

Attached to Project: Arch Linux
Opened by Angelo Geulin (arvl) - Wednesday, 01 September 2021, 13:32 GMT
Last edited by David Runge (dvzrv) - Wednesday, 01 February 2023, 16:31 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Jan Alexander Steffens (heftig)
David Runge (dvzrv)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 3
Private No

Details

Description:
I recently moved from PulseAudio to PipeWire on two of my older machines (ThinkPad X220, Toshiba NB510).

I am getting heavy audio stuttering with PipeWire when the machines are under load. They are most noticeable
when playing heavier games, like Minecraft Java. The audio stuttering is also quite bad when running video
conferencing software, like Google Meet.

I did some testing and ruled out a configuration issue, as this was not an issue when running the same loads,
with the same default configs, on other distributions (Fedora, in my testing).

Digging a bit more, it is apparently caused by a difference in kernel configuration.

Fedora sets the following in the kernel:

CONFIG_HZ_1000=y
CONFIG_HZ=1000

Whereas, Arch sets the following:

CONFIG_HZ_300=y
CONFIG_HZ=300

Applying Fedora's timer frequency configuration, on the default arch kernel package solves the issue.
I'm no longer getting any stuttering with Minecraft or Google Meet.

I'm reporting this here to see if the maintainers are willing to apply this in the package as well.
Running `defconfig` from the kernel.org sources tell me 1000 Hz timer frequency is the default.
So why the use of 300 Hz?

I've also read that Professional audio software needs this higher frequency. So it made me a bit more curious.
https://wiki.archlinux.org/title/Professional_audio#Realtime_kernel
http://tedfelix.com/linux/linux-midi.html

I used the following package versions in my testing:
* linux v5.13.13
* PipeWire 0.3.34
* Minecraft v1.16.5

P.S. I'm aware this isn't a noticeable issue on newer machines. But on older machines, the difference is between being able to, and not being able to use increasingly popular professional audio software like PipeWire unfortunately.
This task depends upon

Closed by  David Runge (dvzrv)
Wednesday, 01 February 2023, 16:31 GMT
Reason for closing:  Upstream
Additional comments about closing:  Please contact either kernel maintainers or pipewire upstream if this is still an issue.
Comment by Eivind (mokkurkalve) - Saturday, 04 September 2021, 19:18 GMT
I don't know if this is relevant at all, and it concerns linux-zen kernel. But I've been using pipewire trough many kernels now, with no stuttering in any audio. I now tested 5.14.1.arch1-1 from [testing]. All good on usb-audio, but a terrible stuttering on all bluetooth-audio. I then downgraded back to 5.13.13.arch1-1 and all is good on all audio. No stuttering in bluetooth-audio.
Anybody knows anything or have seen a relevant bug report somewhere? I should probably go somewhere else than here, but this was the first relevant bug report I found...
EDIT: Sorry, I have: Audio device: Intel Corporation Comet Lake PCH-LP cAVS, driver snd_hda_intel. And AX201 bluetooth.
Comment by Angelo Geulin (arvl) - Saturday, 04 September 2021, 22:10 GMT
You can try looking for what commit caused your issue with git-bisect. I'm not sure what caused your issue, but it must be from an upstream change, rather than here on Arch.

Loading...