Registered Member
|
I'm using a 260GTX with nvidia 340xx drivers (because nouveau is very bad for performance), and I'm so far unable to get both stutter and tear free playback with kwin.
If I leave compositing enabled, then playback stutters like crazy, no matter the settings I choose. Ticking "disable compositing for fullscreen windows" doesn't help to get rid off the stutters, but also breaks vsync. I was using a rule that blocked compositing for mpv, which fixed the stutters, but tearing is still a problem. Sometimes I'm lucky and it stays at the edge of the screen so that I don't notice it, but most of the time it's very jarring. None of mpv internal functions to sync to vsync seem to help once compositing is blocked. Some things I also tried is setting the vsync variables in /etc/profile
Now, why can't I have that with kwin? |
|
If the mpv window is unredirected (fullscreen; for compton maybe more, depending on the settings) it /is/ mpv's "fault" - nothing else has impact on the visual output.
An increasing troublemaker reg. nvidia (and apparently notably on only double buffering systems) seems KWIN_EXPLICIT_SYNC
This syncing points control of OpenGL and X11 command streams, not vertical synchronisation. also do *not* override swapcontrol for KWin ("__GL_SYNC_TO_VBLANK=1") - this will totally screw the internal timing estimations. For mpv, it's only relevant if you render into the OpenGL sink, not vdpau or xv. If you want v'sync on double buffer setups, "export __GL_YIELD=USLEEP" (upcase does matter), if there're issues on detecting triple buffering in kwin, do "export KWIN_TRIPLE_BUFFER=1". |
Registered Member
|
What I don't get is why it's mpv's fault when the only changing variable is compton vs kwin. kwin pretty much has to be doing something differently.
In any case, I tried first setting KWIN_EXPLICIT_SYNC=0, then added __GL_YIELD=USLEEP and then KWIN_TRIPLE_BUFFER=1, rebooting between each change. The behavior is unchanged: with unredirected window enabled there is tearing, with no unredirection there is stutter, but no tearing. The __GL lines in /etc/profile were removed before that, though I didn't notice any impact of doing so. And yes, I'm using --vo=opengl-hq edit: There is this message that says unredirection is not supported on every hardware. What happens in that case? |
|
> kwin pretty much has to be doing something differently.
Repeat after me: if the window is not redirected, the output goes from the client to the X11 server to the driver to the crtc to your screen. Other clients have *no* impact on it. One option would be server grabs (ie. kwin grabs the server, it cannot perform any updates then) but while that could cause stutter, there's hardly an option for tearing. mpv will toggle its swapcontrol depending on the presence of (known) compositors or similar. __VDPAU_NVIDIA_SYNC_DISPLAY_DEVICE is irrelevant if you use the OpenGL sync. don't export "KWIN_TRIPLE_BUFFER=1" unless you really configured the driver to perform triple buffering. I'm not sure about your opinion of "stutter" in this case, but please notice that it's *completely* impossible to avoid judder when playing 23.976Hz or 25Hz material synced to a 60Hz screen. No matter whether synced directly or via a compositor (except when the player injects interpolated frames to increase the framerate - or performs smart swapcontrol management to paint some frames unsynced) => do you get the same "stutter" with compton without allowing unredirection? |
|
PS: there might be a bug in the driver causing the stutter when the gl contexts of mpv and kwin interleave.
Try to "export KWIN_USE_BUFFER_AGE=0; kwin_x11 --replace &" |
Registered Member
|
Hence my question on what would happen in case not redirecting doesn't work.
Gotcha. Did enable triple buffering in the driver now, though that didn't help.
I am aware of that. I'm using mvtools to inject interpolated frames and reach 60fps, then mpv's interpolation (based on frame blending) takes care of any vsync fluctuations. I could remove the second step, but that doesn't change anything performance-wise. Of course, the whole setup is highly reliant on getting the correct vsync "signal". The stutters I'm seeing is not the 23.97 -> 60 judder (I know exactly how that one feels), but really hard stutters every few seconds. They are only happening on camera pans.
No, the only two options that have to be specified to get smooth playback turns out to be --backend glx (to prevent tearing) and --glx-no-rebind-pixmap (eliminate stutter). Other options don't seem to have any effect. |
|
> hard stutters every few seconds
You might be running seeing https://bugs.kde.org/show_bug.cgi?id=344433 then (I had imagined worse "stutter") |
Registered Member
|
glxgears run smoothly unless I maximize them. When maximized, the stutters are similar to the ones I see with mpv.
However, I've been having this with triple buffering off as well, while the bug report states disabling it makes things smooth again. |
|
Hmmm... what if you set the tearing prevention to full scene repaints?
|
Registered Member
|
Doesn't seem to change anything, still same type of stutters. I've also tried other strategies on that list.
|
Registered Member
|
Somehow I seem to have completely overlooked this post! It didn't change anything while having triple buffer enabled, but with it disabled + __GL_YIELD=USLEEP, the stutters are mostly gone. Mostly, because same scenes seem to be buttery smooth on one playthrough, then suddenly stutter on the next... Also, even though I've removed "Option=TripleBuffer" from my xorg.conf, KWIN_TRIPLE_BUFFER is set to 1. Switching it to 0 introduces more stuttering ... So, current manual config is: export KWIN_USE_BUFFER_AGE=0 export __GL_YIELD=USLEEP Rest is "as is". Sometimes, it now plays stuff smoothly. I guess that's some progress. Any idea what I could try going from here? |
Manager
|
current stable Nvidia driver is 350.20, might want to try it (didn't see it in Arch repo but not familiar with Arch)
also in the Arch extra repo they have the 352.41 unstable version |
Registered Member
|
That's impossible, I fear. My GPU is considered legacy, and I'm using the last driver that supports my GPU (the 340xx).
|
Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], ourcraft