Add xvideo support for linux (and other unix) port

Found a bug? Please report it, but remember to follow the bug reporting guidelines.
Missing a sane feature? Let us know!
But please do NOT request ports to other systems.

Moderator: ZSNES Mods

Post Reply
makz
New Member
Posts: 7
Joined: Wed Dec 29, 2004 3:11 am

Add xvideo support for linux (and other unix) port

Post by makz »

I've been using zsnes under linux for many years. I have tried everything to make it run faster and I've discovered that the greatest bottleneck of all are the video drivers.

I know that almost everybody has ultra new cutting edge super charged deluxe limited edition overclocked nvidia video cards and runs linux on their 8 core hyper threaded 128 bits CPUs, but there are some of us that don't have those resources.

Also I have found that video players use something called xv extension to draw the pictures and it gives a very decent speed because it's accelerated by hardware.

I was wondering if it could be possible to add xv support to zsnes. If I understand all you have to do (looking at it from a very simplified perspective) is conveting the bitmaps to yuv before sending them to the xv surface, if SDL has support for xv it may be easy and it will give a performance boost, since under linux the cpu can do calculations far faster than the video card can draw stuff.

What do you think about this?
Deathlike2
ZSNES Developer
ZSNES Developer
Posts: 6747
Joined: Tue Dec 28, 2004 6:47 am

Re: Add xvideo support for linux (and other unix) port

Post by Deathlike2 »

makz wrote:I was wondering if it could be possible to add xv support to zsnes. If I understand all you have to do (looking at it from a very simplified perspective) is conveting the bitmaps to yuv before sending them to the xv surface, if SDL has support for xv it may be easy and it will give a performance boost, since under linux the cpu can do calculations far faster than the video card can draw stuff.

What do you think about this?
I don't know what exactly happened to any discussion about xv, but SDL doesn't use xv at all.
Continuing [url=http://slickproductions.org/forum/index.php?board=13.0]FF4[/url] Research...
Deathlike2
ZSNES Developer
ZSNES Developer
Posts: 6747
Joined: Tue Dec 28, 2004 6:47 am

Post by Deathlike2 »

The short answer that this option is not good enough for the needs of ZSNES video rendering. Not every system has support for RGB overlays, and that's critical since it has to work on all *nix platforms.
Continuing [url=http://slickproductions.org/forum/index.php?board=13.0]FF4[/url] Research...
byuu

Post by byuu »

The short answer that this option is not good enough for the needs of ZSNES video rendering. Not every system has support for RGB overlays, and that's critical since it has to work on all *nix platforms.
I've used Xv. It works fairly well, but there are a few issues. First, RGB exists only in a few drivers. For the rest, you can convert the data to YUV pretty easily, but the chroma loss is fairly evident in a lot of SNES games. Things like the hearts in Zelda 3 tend to blur together as a result.

Next, lots of ATI cards have issues with it, and last I checked, the official ATI driver as well as the pure software video drivers (vesa and such) completely lack Xv support. So some systems will have to go without. Even with that, there's still pesky little issues like colorkey causing your video output to fail.

Lastly, vsync support is terrible. The official nvidia driver doesn't support vsync even if you ask it to. It ignores it. The official devs apparently added that as a workaround to a bug in Beryl. No joke. Other cards force vsync, etc. vsync of course will deadlock your emulator, which will cause sound stuttering.

I'd honestly go so far as to say it's not worth the trouble to implement, as you'd just end up getting countless 'bug reports' that are a problem with Xv drivers and not ZSNES itself. But if you're feeling particularly generous and want to try anyway, feel free to use and/or reference my code at src/ui/video/xv.cpp.
Post Reply