Bug 229990 - Tearing video playback with xv video output
Summary: Tearing video playback with xv video output
Status: RESOLVED DUPLICATE of bug 229863
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: unspecified
Platform: Ubuntu Unspecified
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-08 20:27 UTC by RussianNeuroMancer
Modified: 2010-11-27 16:28 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description RussianNeuroMancer 2010-03-08 20:27:05 UTC
Version:            (using KDE 4.4.1)
Installed from:    Ubuntu Packages

Enabling XRender (OpenGL is not available at this moment in nouveau) composite mode gives tearing vido playback problem.
"UnredirectFullscreen=true" in [Compositing] section of ~/.kde/share/config/kwinrc solves problem, but only for fullscreen playback.
Disabling composing completly solves problem, but it not suitable.
In testing I use xv video output, because x11 and gl output methods have bad performance at all.
Comment 1 Martin Flöser 2010-03-08 20:34:43 UTC
sorry, but nouveau is so a new video driver, that we have to say it's a driver bug. I'd recommend you to report this issue to X developers.
Comment 2 RussianNeuroMancer 2010-03-08 20:40:07 UTC
Check it for example https://bugs.kde.org/show_bug.cgi?id=213669
Comment 3 Thomas Lübking 2010-03-08 21:07:59 UTC
(In reply to comment #2)
> Check it for example https://bugs.kde.org/show_bug.cgi?id=213669

that bug is about an intel driver and occasionally high and general CPU load what has precisely nothing to do with tearing, esp. not on xv output but is related to texture conversion.

for xv and the closed source nvidia driver you can enable video texture / blitter syncing in nvidia-settings and maybe lucky, for nouveau, i've no idea :-(

also (for the css driver) the performace of -vo sdl is up to -vo xv in gl and xrender - scaling or not (-vo x11 is of course a bad joke ;-P )

finally, as xrender does afaik not provide any sync information, i doubt that kwin could do anything about this :-\
Comment 4 Rex Dieter 2010-03-08 21:24:39 UTC
reclosing per comment #1
Comment 5 RussianNeuroMancer 2010-03-14 10:54:25 UTC
I also test this bug in this cases:
1. nvidia-current driver from Ubuntu repo (VSync on in nvidia-settings).
2. OpenGL mode (VSync on and off).
3. xv and vdpau output.
Same here.
Comment 6 Thomas Lübking 2010-03-14 20:49:51 UTC
"nvidia-settings -a SyncToVBlank=1" has little to no impact on the xv syncing.
(aside that you have to restart kwin afterwards) you'll have to set 
nvidia-settings -a XVideoTextureSyncToVBlank=1
nvidia-settings -a XVideoBlitterSyncToVBlank=1
and there's no guarantee for success
if you suffer from general tearing (aside xv) check whether nvidia-settings detects the proper refresh rate of your display, in doubt ("auto") set it yourself.

to get xv output synced by force (and regardless of proper refres rate detection), you'll have to use indirect rendering (and take the performance hit)

also i wonder about your GPU, as the sdl output (of mplayer, "-vo sdl") is (for me and composited or not) en par with the xv output with the current nvidia driver
Comment 7 RussianNeuroMancer 2010-03-14 21:58:32 UTC
> "nvidia-settings -a SyncToVBlank=1" has little to no impact on the xv syncing.
(aside that you have to restart kwin afterwards) you'll have to set 
> nvidia-settings -a XVideoTextureSyncToVBlank=1
> nvidia-settings -a XVideoBlitterSyncToVBlank=1
> and there's no guarantee for success
SyncToVBlank and XVideoTextureSyncToVBlank is already enabled.
When I try to apply "nvidia-settings -a XVideoBlitterSyncToVBlank=1" nvidia-setting just no answer (empty output). Also I can't find this option in nvidia-setting gui.

> if you suffer from general tearing (aside xv) check whether nvidia-settings
detects the proper refresh rate of your display, in doubt ("auto") set it
yourself.
Refresh rate detected by nvidia-settings is 60 Hz.
Refresh rate detected by nouveau is 59 Hz.
Refresh rate detected by mplayer when nvidia driver installed is 59.973 Hz.

> to get xv output synced by force (and regardless of proper refres rate
detection), you'll have to use indirect rendering (and take the performance
hit)
How can I do this?

> also i wonder about your GPU, as the sdl output (of mplayer, "-vo sdl") is (for me and composited or not) en par with the xv output with the current nvidia
driver
Same problem in sdl mode.

Just want to note that this problem occurs even I just move applications windows (in XReander and in OpenGL mode). So this is composite mode tearing problem, not just xv playback.
Comment 8 RussianNeuroMancer 2010-03-14 22:05:39 UTC
Also computer hardware: Intel Dual Core T4300, 2 Gb RAM, nVidia GT216 [GT240M 1 Gb RAM].
This should be enough for video playback and desktop effects.
Comment 9 Thomas Lübking 2010-03-14 22:29:03 UTC
your mighty powerfull super cpu has not the least relevance regarding tearing - in sync'd  mode the framerate would just drop.

> Just want to note that this problem occurs even I just move applications
this is however more important and makes this bug a dupe

mplayer will detect whatever the nvidia driver yells, so does kwin. the relevant question is whether your display _really_ runs at 60Hz or e.g. 50 or 75.

to enable indirect rendering uncheck the "direct rendering" box in the advanced tab
you could also just try to disable vsync
also do not use client (KWin) and nvidias global vsyncing at the same time ("__GL_SYNC_TO_VBLANK=0 kwin --replace" to disable the nvidia part just for kwin)

> When I try to apply "nvidia-settings -a XVideoBlitterSyncToVBlank=1"...
it's not supported by all GPUs

do you occasionally attach another monitor to the notebook (maybe a CRT or sth. at a different framerate?)

*** This bug has been marked as a duplicate of bug 229863 ***
Comment 10 RussianNeuroMancer 2010-03-14 22:53:23 UTC
> the relevant question is whether your display _really_ runs at 60Hz or e.g. 50 or 75.
get-edid and ddcprobe fail to recognize edid info. Any other ways?

> to enable indirect rendering uncheck the "direct rendering" box in the advanced
tab
Here you mean mplayer? I try it, but it not help.

> also do not use client (KWin) and nvidias global vsyncing at the same time
VSync enabled only in nvidia-settings. In OpenGL mode of kwin vsync disabled.

> do you occasionally attach another monitor to the notebook (maybe a CRT or sth.
at a different framerate?)
Yesterday, for the first time, but the problem, as you see, was long before that.
Comment 11 Thomas Lübking 2010-03-14 23:19:22 UTC
(In reply to comment #10)
> get-edid and ddcprobe fail to recognize edid info. Any other ways?
that doesn't sound too good, consult the tech spec of the display or google... :-\

> Here you mean mplayer? I try it, but it not help.
nope, kwin. mplayer has no GUI, thus no tabs :)
"kcmshell4 kwincompositing", last tab
 
> > also do not use client (KWin) and nvidias global vsyncing at the same time
> VSync enabled only in nvidia-settings. In OpenGL mode of kwin vsync disabled.
ok, you report a bug on kwin that nvidias vsyncing doesn't work? :-P

a) FYI, nvidias vsyncing requires a restart of any client application (opengl) to apply changes
b) a disfunctional nvidia vsync is not a kwin problem, sorry
c) disabling nvidias vsyncing and enabling kwins (don't use both) may fix your problem, but it's more likely a general issue related to the monitor (and a wrong assumption about it's refresh rate by the driver)

modern displays should not break when a wrong refresh rate is applied, so you could try to force one in nvidia-settings, but
- i've no idea whether this might try to apply a false refresh rate
- i do not take resposibility for damage by this
-> USE WITH CARE AND GATHER INFORMATION ABOUT THE DISPLAY before doing so

last note: disabling all vsync will most likely diminish this problem (just as no vsync is still better than a broken vsync on a wrong frequency)
Comment 12 RussianNeuroMancer 2010-03-15 01:50:20 UTC
> nope, kwin. mplayer has no GUI, thus no tabs :)
> "kcmshell4 kwincompositing", last tab
So, I see, there also bug of Russian transaltion of KDE :)

I tried many combination of settings of KWin, nVidia and MPlayer and found not bad combination for xv output. Enable XVideoTextureSyncToVBlank, enable kwin-opengl vsync, change OpenGL mode to shared memory, not use direct rendering in mplayer. Tearing is still for kwin, but not for xv and vdpau outputs. I hope that there is a solution for kwin.

> ok, you report a bug on kwin that nvidias vsyncing doesn't work? 
Funny of situation in if you enable vsync in kwin AND in nvidia-setting - video plays normally in xv (I mean without tearing problem), but when I disable sync in kwin OR nvidia-setting OR both of them, I get problem again. This tells me that the vsync kwin<->nvidia somehow works. It remains to understand - how?
Comment 13 Thomas Lübking 2010-11-27 16:28:47 UTC
support nvidias proprietary refreshrate through asking nvidia-settgins

r1201396