nV News Forums


nV News Forums (http://www.nvnews.net/vbulletin/index.php)
-   NVIDIA Linux (http://www.nvnews.net/vbulletin/forumdisplay.php?f=14)
-   -   SDLMAME OpenGL vsync problem (http://www.nvnews.net/vbulletin/showthread.php?t=132606)

mocharhw 05-07-09 12:39 PM

SDLMAME OpenGL vsync problem
These are my current specs:
7600GS card
177.xx nvidia driver
Ubuntu Intrepid
LCD flat panel on DVI output
Analog television on S-Video output
Twinview, one giant spanning screen mode
Composite disabled in xorg.conf

I seem to have a problem with obtaining tear-less video in SDLMAME. It doesn't matter what sync options I select or deselect in the nvidia-settings utility. All of my SDLMAME games have a moving tear line in them. This is more pronounced on side-scrolling games of course. It happens in windowed and fullscreen modes.

I don't have problems with other OpenGL apps such as games or MythTV in windowed mode using OpenGL rendering. These programs sync very smooth without tearing.

I've put in a question to the SDLMAME fourm about this, but received no response. There doesn't seem to be much complaining about it from other SDLMAME users, so I have to assume either I'm the only one having the problem or everyone else just accepts it as normal.

Is this a problem with my use of an older nvidia driver? Would I see any difference by upgrading my card or driver? Does it have something to do with Twinview? I don't understand what the difference is between SDLMAME's OpenGL rendering and MythTV's rendering or (put your favorite Linux game here) rendering.

For example, many SDLMAME roms run at NTSC frame rates yet for some reason I have a tear line in them. I also see the same tear line from games that don't run at tight NTSC frame rates, like 54 Hz or whatever. MythTV's output is NTSC of course, and it is smooth even on my LCD flat panel which does not adhere to NTSC timing either. According to the nvidia-settings util my LCD runs at 60.042 Hz or something like that.

So what are the differences, and is there any way to get smooth video out of SDLMAME?


mocharhw 05-12-09 12:03 AM

Re: SDLMAME OpenGL vsync problem
I figured it out on my own. In case anyone gives a crap, the culprit is nvidia's Twinview. When you run Twinview with 2 different monitors that have different vertical scan frequencies, it's impossible to vsync when an application is spanned across both screens. This is explained in the nvidia README file.

I was running SDLMAME in fullscreen mode, and although there was no image on the second monitor, it was still spanning to it somehow because I would see the second monitor go blank while running a game. This is what gave me the clue about what was happening. This is probably not SDLMAME's fault, but again a problem with Twinview or possibly Xorg trying to use the entire area since X just sees both monitors as one huge screen.

Anyways, the answer if anyone cares (if you use Twinview) is to run SDLMAME in windowed mode, maximized of course, and select the waitvsync option. And of course don't forget to select the vsync options in the nvidia control panel.

AaronP 05-12-09 01:08 AM

Re: SDLMAME OpenGL vsync problem
You can control which display device it syncs to by using the __GL_SYNC_DISPLAY_DEVICE environment variable.

mocharhw 05-12-09 10:41 AM

Re: SDLMAME OpenGL vsync problem

Originally Posted by AaronP (Post 2003375)
You can control which display device it syncs to by using the __GL_SYNC_DISPLAY_DEVICE environment variable.

Yes, agreed. However, there is something different about SDLMAME (or perhaps it's X or Twinview), when SDLMAME is run in "fullscreen", the game window shows up on the primary monitor as expected, but the second monitor goes black. This indicates to me that for some reason SDLMAME "fullscreen" mode is spanning both (all) screens, even though the game image is only shown on the primary display. This is exactly why __GL_SYNC_DISPLAY_DEVICE does not work when SDLMAME is in fullscreen mode. You are forced to run windowed in order to make SDLMAME stay on the primary screen, and thus sync to it.

All times are GMT -5. The time now is 11:58 AM.

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