Go Back   nV News Forums > Linux Support Forums > NVIDIA Linux

Newegg Daily Deals

Reply
 
Thread Tools
Old 01-24-10, 05:45 AM   #1
beat
Registered User
 
Join Date: Aug 2009
Posts: 3
Default Tear free 2D desktop, is it possible?

I've started using Ubuntu about 4 years ago and "consequently" I was using Compiz. Recently I moved to Arch Linux and decided to try a new WM, Openbox. The first thing I noticed is that there was a lot of tearing (http://en.wikipedia.org/wiki/Screen_tearing) when moving windows around. I tried to find a solution to this problem but I couldn't. I tried different xorg configurations, different drivers, different monitors, and even different graphics cards but the result was always the same, tearing. The thing is this is not related to the WM itself, it also happens in every other WM I've tried (even GNOME) except when I'm using Compiz.

The problem for me to find the root cause of this problem is that I know most people do have screen tearing but they don't even notice it. I tried to show it to my brother and he wasn't able to notice it. I just want to know if there is a solution to this problem or if this is just a consequence of not using hardware acceleration, like Compiz does by using OpenGL.

You can check a topic I created on the Arch Linux forums when I was trying to solve this issue.
http://bbs.archlinux.org/viewtopic.php?pid=605164

Right now I'm using an NVIDIA 9600GT graphics card with the 190.53 drivers.
I've also tried xcompmgr to add composite in an effort to make Xrender use hw acceleration in order to prevent tearing, but this didn't solve the problem.

I really have no idea on what to do since everything is a bit complex and I don't know how everything works.

Any help would be appreciated.

Regards.
beat is offline   Reply With Quote
Old 01-24-10, 06:03 AM   #2
Dragoran
Registered User
 
Join Date: May 2004
Posts: 711
Default Re: Tear free 2D desktop, is it possible?

There is no way to prevent it with the way X works, an opengl compositor like compiz can use opengl to sync to vblank which prevents tearing.
Dragoran is offline   Reply With Quote
Old 01-24-10, 01:45 PM   #3
AaronP
NVIDIA Corporation
 
AaronP's Avatar
 
Join Date: Mar 2005
Posts: 2,487
Default Re: Tear free 2D desktop, is it possible?

Dragoran is 100% correct: core X rendering protocol does not sync to vblank or provide any way of doing tear-free updates. This is one of the main reasons the Composite extension was created, but to avoid tearing you do need a composite manager that knows how to do tear-free rendering, which xcompmgr and other RENDER-based composite managers do not.
AaronP is offline   Reply With Quote
Old 01-26-10, 04:27 PM   #4
DuckGERN7
Registered User
 
Join Date: Jan 2010
Posts: 13
Question Re: Tear free 2D desktop, is it possible?

Hello AaronP,

I was about to make a thread about this, since this has been "bugging" me for some while now, but I haven't had the time to get some feedback or information on this yet.

I read a discussion on: http://ubuntuforums.org/showthread.php?t=1305320

It's kind of confusing.

I am using Karmic and I just n e e d Vsync for video playback but I also want to use Compiz.

That what Dragon suggested works fine for window movement, but doesn't work for videos while Compiz is running. If I turn Compiz off and use Meta only, without any desktop-effects, then Vsync for video playback works fine (you can even easily toggle it on or off via nvidia-settings). Doing this will kill Vsync for window movement, but at least the videos stay watchable.

So, Vsync does work, at least for videos, when Compiz is off. On the other hand, though, Vsync does work for window movement as well, when Compiz is on and Vsync is toggled on via cssm, BUT videos then tear like hell.

I don't like this kind of thing!

I have a second question:

What is VDPAU for actually? I mean, I know what it does but what should one use it for? Is there any way to play Blurays on Linux or is there some sort of VIDEO STORE to watch movies in HD that would require GPU acceleration? I'm just curious

Thank you in advance AaronP. I reg. here only because I have seen your support on these boards so far. Your knowledge is power and it would make me shake with fear, IF this would be some sort of anime or anything like that.

THANK YOU
DuckGERN7 is offline   Reply With Quote
Old 01-26-10, 11:18 PM   #5
AaronP
NVIDIA Corporation
 
AaronP's Avatar
 
Join Date: Mar 2005
Posts: 2,487
Default Re: Tear free 2D desktop, is it possible?

Quote:
Originally Posted by DuckGERN7 View Post
Hello AaronP,

I was about to make a thread about this, since this has been "bugging" me for some while now, but I haven't had the time to get some feedback or information on this yet.

I read a discussion on: http://ubuntuforums.org/showthread.php?t=1305320

It's kind of confusing.

I am using Karmic and I just n e e d Vsync for video playback but I also want to use Compiz.

That what Dragon suggested works fine for window movement, but doesn't work for videos while Compiz is running. If I turn Compiz off and use Meta only, without any desktop-effects, then Vsync for video playback works fine (you can even easily toggle it on or off via nvidia-settings). Doing this will kill Vsync for window movement, but at least the videos stay watchable.

So, Vsync does work, at least for videos, when Compiz is off. On the other hand, though, Vsync does work for window movement as well, when Compiz is on and Vsync is toggled on via cssm, BUT videos then tear like hell.
Compiz has an option to unredirect full-screen windows. That allows the video player to draw directly to the screen instead of having to redirect through Compiz, which will improve performance and reduce tearing. Obviously it only works when you're watching a video full-screen.

Quote:
Originally Posted by DuckGERN7 View Post
I don't like this kind of thing!

I have a second question:

What is VDPAU for actually? I mean, I know what it does but what should one use it for? Is there any way to play Blurays on Linux or is there some sort of VIDEO STORE to watch movies in HD that would require GPU acceleration? I'm just curious
VDPAU accelerates video decoding, which allows you to play HD video on platforms (like the HP Mini 311 I'm using right now) that otherwise wouldn't be able to play them. It also presents video to the screen, which lets applications like mplayer and xine provide smoother, tear-free video. Getting videos to play is a separate issue. I don't know of any online video stores that support Linux, but there are plenty of other ways to get HD video including ATSC TV tuners, which is what I suspect a lot of people use VDPAU for.
AaronP is offline   Reply With Quote
Old 01-27-10, 07:04 AM   #6
DuckGERN7
Registered User
 
Join Date: Jan 2010
Posts: 13
Thumbs up Re: Tear free 2D desktop, is it possible?

Hello AaronP,

thank you for the fast respond. I apologize for the questions in advance, I really want to know, though:

a) Where can I find the option to unredirect the videos in order to improve the tearing? It would be enough if it works in full-screen. At least that way we can watch movies without having to turn off Compiz. Is enabling Vsync within Compiz + within nvidia-settings still recommended or can this cause problems?

b) I read a lot about xorg not beeing able to do vsync and such, but without Compiz (only Meta) it works good with videos. How does that work?

c) VDPAU makes videos smoother and tear-free? Okay, then I will be officially using it from today. Edit: I have a fresh Karmic install but Mplayer crashes as soon as I select VDPAU and tells me something went wrong (CPU,RAM etc.). With Smplayer though, I can select it. Is there any way to check if it is running?

d) Is my 9800gt supported for VDPAU and will this feature be supported further (in the future) by Nvidia?

I ask because I want to help spread the word about Ubuntu and I have actually seen a lot of interest in our schools, with friends and with a few companies here in Europe. Many are impressed with the system as it is and what it offers BUT are mostly impressed by it's visuals (privat ppl only - schools and companies don't care) BUT it comes at the cost of Vsync, which in the end isn't acceptable. If VDPAU actually helps with this situation or maybe even gets rid of it, then this could actually be THE solution for ppl with Nvidia cards. I read ATI has much bigger problems (do they even have anything like VDPAU?).

e) About the ATSC TV tuners. Could I use a DVBT (HD) card in Ubuntu and profit from VDPAU somehow? I have tried Kaffeine and MeTV for TV and it works fine, besides the tearing, but both don't offer an option for VDPAU. What alternatives do I have?

f) Thank you for explaining so far and give the guys who made VDPAU a thx from me

The Duck.
DuckGERN7 is offline   Reply With Quote
Old 01-27-10, 10:58 AM   #7
Stephen Warren
Moderator
 
Stephen Warren's Avatar
 
Join Date: Aug 2005
Posts: 1,327
Default Re: Tear free 2D desktop, is it possible?

Quote:
Originally Posted by DuckGERN7 View Post
c) VDPAU makes videos smoother and tear-free? Okay, then I will be officially using it from today. Edit: I have a fresh Karmic install but Mplayer crashes as soon as I select VDPAU and tells me something went wrong (CPU,RAM etc.). With Smplayer though, I can select it. Is there any way to check if it is running?

d) Is my 9800gt supported for VDPAU and will this feature be supported further (in the future) by Nvidia?
The 9800 GT should support VDPAU.

If you're having problems, I suggest starting a new thread specifically for that, and providing full details; an nvidia-bug-report, details on where obtained MPlayer from, how you're running it etc. See the forum sticky posts for details of all the information that's required. Some of the MPlayer/ffmpeg developers do read this forum too, so they may have some insight on your crash. If it's a problem in the VDPAU driver, I can help diagnose it once you post the required information.
Stephen Warren is offline   Reply With Quote
Old 01-27-10, 11:21 AM   #8
crisalide
Registered User
 
Join Date: Dec 2008
Posts: 173
Default Re: Tear free 2D desktop, is it possible?

Quote:
Originally Posted by DuckGERN7 View Post
About the ATSC TV tuners. Could I use a DVBT (HD) card in Ubuntu and profit from VDPAU somehow? I have tried Kaffeine and MeTV for TV and it works fine, besides the tearing, but both don't offer an option for VDPAU. What alternatives do I have?
Yes, dvb-t video streams are either mpeg2 or h264 that VDPAU will decode. The same applies to dvb-s/s2 and dvb-c.

Both kaffeine and me-tv use xine-lib as engine. In order to get VDPAU working with these players, you need to install a fresh svn copy of xine-lib 1.2 (which includes VDPAU support) and you have to recompile the players against it. Or just wait until your distro provides updated packages.
crisalide is offline   Reply With Quote

Old 01-27-10, 02:20 PM   #9
AaronP
NVIDIA Corporation
 
AaronP's Avatar
 
Join Date: Mar 2005
Posts: 2,487
Default Re: Tear free 2D desktop, is it possible?

Quote:
Originally Posted by DuckGERN7 View Post
Hello AaronP,

thank you for the fast respond. I apologize for the questions in advance, I really want to know, though:

a) Where can I find the option to unredirect the videos in order to improve the tearing? It would be enough if it works in full-screen. At least that way we can watch movies without having to turn off Compiz. Is enabling Vsync within Compiz + within nvidia-settings still recommended or can this cause problems?
Run ccsm, then click "General Options" and check the box next to "Unredirect Fullscreen Windows". While you're there, click on the "Display Settings" tab, turn off "Detect Refresh Rate", and then set the "Refresh Rate" slider to double your screen refresh rate (e.g. 120 if you have a 60 Hz screen). That should help improve smoothness and reduce tearing for regular non-fullscreen stuff.

Quote:
Originally Posted by DuckGERN7 View Post
b) I read a lot about xorg not beeing able to do vsync and such, but without Compiz (only Meta) it works good with videos. How does that work?
This is referring to core X rendering, which indeed does not sync to vblank. The two main video presentation APIs, XVideo and VDPAU, both have their own separate vsync support. For XVideo, it's an option (which is enabled by default). VDPAU always syncs to vblank when your window is not redirected. In fact, if you disable the Composite extension entirely (with "nvidia-xconfig --no-composite"), VDPAU can use the video display hardware which is not even capable of tearing.
AaronP is offline   Reply With Quote
Old 01-27-10, 04:15 PM   #10
DuckGERN7
Registered User
 
Join Date: Jan 2010
Posts: 13
Thumbs up Re: Tear free 2D desktop, is it possible?

@Stephen: Thank you very much for the offer. I will report back to you within 24h with the needed information. My machine is beeing inspected right now (curious gf checking out Ubuntu).

@Crisilade: Do you know of any easy (step by step) guides for setting up both players? I need both because I prefer MEtv while my father holds on to Kaffeine. By the way, do you know if Karmic has the updated xine built in? If not, do you know if it will be in Lucid? Are there any infos on that? I wonder why VDPAU isn't in there @default anyway. It's one of those BIG features...

@AaronP: I will do what you suggested and report back to you once my Ubuntu machine is free. I am starting to understand things, finally. I guess I should have posted here in the first place, instead of reading through all those theories about what works how and why not bla...

Anyway, I have a question about the Refresh Rate: Why does it need to be set to double the rate my monitor has (60hz)? Is there something wrong with the detection?

My second question is about the API's: VDPAU is from Nvidia, right? Is XVideo from you guys as well? Or is that something that was made by someone for X?

My third and final question is: If I use "nvidia-xconfig --no-composite" it will turn off Compiz, right? It's like if I would manually shut it down, eh?


Thanks a bunch guys, I really appreciate your help! You wouldn't believe how much this helps a novice Jedi.
DuckGERN7 is offline   Reply With Quote
Old 01-27-10, 11:40 PM   #11
AaronP
NVIDIA Corporation
 
AaronP's Avatar
 
Join Date: Mar 2005
Posts: 2,487
Default Re: Tear free 2D desktop, is it possible?

Quote:
Originally Posted by DuckGERN7 View Post
Anyway, I have a question about the Refresh Rate: Why does it need to be set to double the rate my monitor has (60hz)? Is there something wrong with the detection?
The refresh rate detection thing gets incorrect information basically because it interacts badly with something the NVIDIA driver has to do to ensure that your screen configurations are unique. It's best just to turn it off.

It doesn't really need to be set to double, but setting it that way allows Compiz to queue up rendering without waiting on the CPU a lot.

Quote:
Originally Posted by DuckGERN7 View Post
My second question is about the API's: VDPAU is from Nvidia, right? Is XVideo from you guys as well? Or is that something that was made by someone for X?
NVIDIA designed and implemented it, but it's an open standard. XVideo was actually written by a guy who works for NVIDIA (though I don't think he was working here at the time), but it's also an open standard. Both standards were written specifically for X, though VDPAU has the ability to work on other platforms as well if somebody feels like implementing it.

Quote:
Originally Posted by DuckGERN7 View Post
My third and final question is: If I use "nvidia-xconfig --no-composite" it will turn off Compiz, right? It's like if I would manually shut it down, eh?
Not quite, just manually shutting Compiz down leaves the Composite extension enabled. Disabling it in xorg.conf is a bigger switch.
AaronP is offline   Reply With Quote
Old 01-28-10, 11:49 PM   #12
Chad_Petree
Registered User
 
Join Date: Jan 2010
Posts: 4
Default Re: Tear free 2D desktop, is it possible?

Is it true that if u have vdpau enabled u HAVE to disable compositing in order to stop the tearing problem? i did it and it worked BUT it disabled the effects in ubuntu i believe they're called meta, right? i miss them A LOT i want to be able to enable them =/

Quote:
Originally Posted by AaronP View Post
The refresh rate detection thing gets incorrect information basically because it interacts badly with something the NVIDIA driver has to do to ensure that your screen configurations are unique. It's best just to turn it off.
When u say refresh rating detection you're talking about the auto option? shouldnt my monitor and tv (plasma) be set to 60 hz? i find it odd that the default application for changing the resolution and screen refresh of the screen wont let me put more than 54 hz and i try setting the screen rate in the x server configuration panel , im able to do it, i change it from auto to 60 hz but when i reboot is on auto AGAIN! =/ and i also tried using "save to x configuration file" but i get a error message
Chad_Petree is offline   Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 12:11 PM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright 1998 - 2014, nV News.