Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Audio stuttering after migration to pipewire
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
AECFXI
n00b
n00b


Joined: 28 Nov 2018
Posts: 33

PostPosted: Fri Mar 08, 2024 6:30 pm    Post subject: [SOLVED] Audio stuttering after migration to pipewire Reply with quote

About a year ago I attempted the pipewire migration but found that in some games or otherwise intensive system use, the audio would stutter. The stuttering behavior is moments of silence for a second to several seconds. When sound returns, it comes back correctly aligned video playback and there is no distortion during these events. Audio always returns. There is, separately from these events, short episodes of crackling from time to time.

The issue resisted all attempted fixes and was intermittent enough to just disregard, but recently when attempting to play Helldivers 2 via Steam this game was found to have extremely aggravated 'stuttering' where audio is mostly silent and cut out from the stutter effect during the tutorial mission.

Currently journalctl and dmesg appear clear of audio-related errors.

When revisiting the steps for using PipeWire for sound in the news publication, I find the only system error I am currently encountering:

Code:
matthew@integrity ~ $ systemctl --global enable --now pipewire.socket pipewire-pulse.socket wireplumber.service
Failed to enable unit, unit /etc/systemd/user/sockets.target.wants/pipewire.socket does not exist.
Failed to enable unit, unit /etc/systemd/user/sockets.target.wants/pipewire-pulse.socket does not exist.
Failed to enable unit, file "/etc/systemd/user/pipewire-session-manager.service": Permission denied
Failed to enable unit, unit /etc/systemd/user/pipewire.service.wants/wireplumber.service does not exist.


My system profile is "default/linux/amd64/17.1/desktop/plasma/systemd/merged-usr (stable)".

emerge --info pulseaudio: https://pastebin.com/aByUQV9b

emerge --info pipewire: https://pastebin.com/fSAez86J

make.conf: https://pastebin.com/Sda7U2Qw

Next immediate step I'm looking at is resolving systemctl failing to enable the associated services.


Last edited by AECFXI on Tue Mar 12, 2024 10:20 pm; edited 1 time in total
Back to top
View user's profile Send private message
AECFXI
n00b
n00b


Joined: 28 Nov 2018
Posts: 33

PostPosted: Tue Mar 12, 2024 8:12 pm    Post subject: Reply with quote

I was able to solve this myself.

Firstly, the output from $ systemctl --global enable --now pipewire.socket pipewire-pulse.socket wireplumber.service was due to the --global flag failing. Replacing it with the --user flag eliminated the errors in the output, however this did not effect my system because those services had long been enabled since when I first migrated.

The actually effective solution for me was to adjust /etc/pipewire/pipewire.conf to have the following line:

Code:
default.clock.min-quantum = 2048


Any lower power of 2 caused crackling and stuttering with Helldivers 2 playing, albeit each uptick of this value saw an improvement. With 2048, all audio crackling across the system has been completely eliminated along with the stuttering.

It is unclear if any of the other actions I performed helped resolve the issue. I have default.clock.rate = 192000 in pipewire.conf, and I set full preempt in my kernel config.
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 6098
Location: Dallas area

PostPosted: Tue Mar 12, 2024 8:23 pm    Post subject: Reply with quote

I have mine set this way.

Code:
    default.clock.min-quantum   = 16
    default.clock.max-quantum   = 2048
    default.clock.quantum-limit = 8192

_________________
PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland
Back to top
View user's profile Send private message
AECFXI
n00b
n00b


Joined: 28 Nov 2018
Posts: 33

PostPosted: Tue Mar 12, 2024 10:31 pm    Post subject: Reply with quote

Anon-E-moose wrote:
I have mine set this way.

Code:
    default.clock.min-quantum   = 16
    default.clock.max-quantum   = 2048
    default.clock.quantum-limit = 8192


That is also the default config file that I started out with, but by lowering default.clock.min-quantum even down to 1024 it re-introduces the crackling and stuttering on my system.

I can honestly not think of anything distinct about my setup that would be giving rise to needing to have such an aggressive min value. There was no unusual tinkering I did before developing stutter. My system specs are:

Gentoo kernel 6.6.13
Intel i7-12700K
MSI Mag Z690 Tomahawk
32gb DDR5 RAM
NVIDIA GeForce RTX 3080 12gb

Audio is going out through an HDMI cable to a Yamaha RX-V4A AV receiver.

I discovered the solution in this thread: https://www.reddit.com/r/linux_gaming/comments/11yp7ig/pipewire_audio_stuttering_when_playing_games_or/
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 6098
Location: Dallas area

PostPosted: Tue Mar 12, 2024 10:49 pm    Post subject: Reply with quote

Problem might be in wireplumber section, instead of pipewire.
_________________
PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum