Pipewire Firefox tiny video stutter

After switching to pipewire from pulseaudio i’ve noticed this new problem:

The problem is that youtube video (flatpak firefox) starts to stutter just a tiny bit when audio is on (there is no problems and no stutter in audio itself though, just in the video).
Even if video has silent audio - the problem still manifests, but as soon as you press “mute” button on the youtube player - the video stutter goes away.

take a video with smooth linear movement - the problem is easy to spot with them, like this one: https://www.youtube.com/watch?v=vigX3H7WX5Q

no mute - you can spot tiny stuttering from time to time (around once a second for me). mute the video - and stutter goes away.

does not matter what outputs you have, all outputs may be muted - it does not affect the problem.
This does not occur even on same test videos in vlc, with or without sound.

Pulseaudio does not have this problem

Tested this on 2 different machines - both show this behaviour

Since i just could not google anything about this, I assumed that it may be nixos-specific problem

2 Likes

This is known behavior, happens on Chromium also. It happens on every distro as far as I know. Either PipeWire fixes this on their end or browsers need to start using PW directly, not through pipewire-pulseaudio. As a workaround, I’d recommend using MPV for video playback.

1 Like

Interestingly I am facing this issue right now. This started happening I think around a week ago? Before that everything was working fine. Strange issue.

2 Likes

this is still a thing? I switched from Pipewire to Pulseaudio a pretty long time ago by now when I started running into this on Fedora and got into the habit of ripping out pipewire from every distro I ran from thereon (or, later, making it run solely as a wayland screen sharing service); I have it set up like this on NixOS at the moment, though I haven’t actually verified if this is still an issue at the moment, but if it is then yikes they’ve had 5+ years to make it work and it still doesn’t

Might be worth reporting to pipewire upstream again, there was one issue about it but that was with mpv using the pulse backend which was “resolved” by switching to the pipewire one which isn’t really an option on Firefox…

1 Like

hmm but the strange part is this didn’t happen to me like ever. I have been using NixOS with pipewire for like 3 years now I think? And not once did I face stuttering before. This only started like last week. So maybe some update broke this? Or maybe, I need to update my system :neutral_face:. I willl take today to update and rebuild my system and do some test on different video sites and report back here. Let’s hope the update (if any available for pipewire) fixes this :3

for me this was an issue for some time on the newer device, while older one worked fine (having it’s own issues)

but since unknown number of firmware and software updates I tried switching to pipewire again with 25.05, and issues went away.

Tried rebuilding to latest everything right now to see if some latest update reintroduced the bug, but things seeem to run the same.

That said - there still is always some tiny amount of stutter in firefox kwin wayland, say one frame drop every 10 seconds, that you can notice playing 60fps video with camera panning at uniform speed; and there seem to be nothing anyone can do about this. playing same video in VLC seem to have no stutter at all (or much less often at least). Dunno if this is firefox-related, or linux-firefox-related and if windows has this solved

Yeah that’s exactly my issue with it. Found that out a long time ago when doing my then-usual lack-of-frame-drop-verification stuff (I was really insistent on having absolutely no dropped frames in anything and I still kind am; at one point (but not with pipewire) I made myself sit in front of a machine barely letting myself blink my eyes checking for a frame drop that happened every 7 minutes in another test video, though that was probably really slow judder/framerate mismatch rather than dropped frames) with this video (but the one you linked in OP is even better).

Pulse seems to work just fine; this is basically because pipewire-pulse is a bit of a disaster and adds latency (and, apparently, clock jitter too?) to whatever is connected to it, and Firefox (which is not pipewire native) tries to sync the video against the audio but given that the audio sink is weird like that, the display part suffers accordingly. At least that’s the best explanation I’ve seen.

Surprised I haven’t reported this at pipewire freedesktop gitlab yet, since I’m not quite sure upstream is aware of this, which they really should be since it’s been there for over half a decade now (I got in a bit more recently than that, though)

I believe it’s compositor / display server independent, though; happens even with Xorg assuming your Xorg setup isn’t dropping a fuckload of frames in and of itself for unrelated reasons (cough modesetting on intel).

okay this is strange… I don’t have stuttering anymore after restarting…

I didn’t need to update or anything… I tried to check youtube and other video sites with different configurations for audio but it isn’t stuttering anymore… I took a few days to check if it stutters again but so far nothing…Very bizarre. I don’t have any idea why everything is working properly suddenly…