Snes9x gives sub 60fps under opengl/software/Xvideo in Linux

If you're having problems with Snes9x, or think you've found a bug, this is the place to be.
User avatar
BearOso
Official GTK/Linux Porter/Dev
Posts: 460
Joined: Tue Oct 02, 2007 12:50 am

Post by BearOso »

the_randomizer wrote: Crap. Pulse audio is installed on the system; gonna have to find a way to delete it.
It's going to be pain to do so. I don't suggest trying that immediately.
342 Frames in 5.0 seconds = 68.392 FPS
300 Frames in 5.0 seconds = 59.556 FPS
300 Frames in 5.0 seconds = 59.554 FPS
300 Frames in 5.0 seconds = 59.556 FPS
300 Frames in 5.0 seconds = 59.556 FPS
300 Frames in 5.0 seconds = 59.555 FPS
300 Frames in 5.0 seconds = 59.557 FPS
Ok, it looks like you're getting vsync, but these numbers are really low and might be the cause of your sound skipping problem. Try setting your input rate in the sound settings to somewhere between 31740-31750. Could you tell me what resolution this is so I can see if it matches one of the GTF or CVT standards?
Edit 10:56: Looks like I'm SOL; installed/re-installed it multiple times but to no avail. I go to Snes9x to find that OpenGL isn't in the menu anymore.
Looks like I can't install this, or can I? Crap.
Does glxgears or glxinfo still run? If so, click the "About" button in Snes9x Preferences and see if the "Features enabled" still includes OpenGL. If the glxgears and glxinfo programs now fail, driconf might have corrupted your /etc/drirc or ~/.drirc files when it failed to start.
the_randomizer
Snes9x Orange Belt
Posts: 222
Joined: Sat Oct 17, 2009 4:18 am

Post by the_randomizer »

Resolution is maxed out to 1280x800, which is the max resolution I can set on this particular netbook. glxgears still runs AFAIK, but I haven't tried using glxinfo yet. If for some reason OpenGL isn't listed and, if those files are corrupted, I'm pretty sure I'm SOL...Will give those a try momentarily.

Edit 5:27 PM - OpenGL is indeed listed under "about". Will give 31750hz a whirl.

Edit 5:33 - Nope. OpenGL no longer is listed, neither glxgears/glxinfo run in the terminal. Lovely.

"Couldn't get RGB double buffered visual"
Lisa: "I hope you all know you're sponsoring a murderous pirate!"
Sponsor: "A pirate!!? Well, that's hardly the image we need for Long John Silvers!"
the_randomizer
Snes9x Orange Belt
Posts: 222
Joined: Sat Oct 17, 2009 4:18 am

Post by the_randomizer »

How do you fix the corrupted files? Clean reinstallation?


Tried re-installing, installing, removing over and over again. Kega Fusion, Nestopia, Snes9x don't run properly.
Lisa: "I hope you all know you're sponsoring a murderous pirate!"
Sponsor: "A pirate!!? Well, that's hardly the image we need for Long John Silvers!"
User avatar
BearOso
Official GTK/Linux Porter/Dev
Posts: 460
Joined: Tue Oct 02, 2007 12:50 am

Post by BearOso »

If you have a .drirc file in your home directory, delete it.

Then try running

Code: Select all

apt-file search /etc/drirc
to see what package that file belongs to in case it's corrupted.

You can also try to reinstall mesa, dri, and glx libraries and some X dependencies that driconf might have messed up by running

Code: Select all

sudo apt-get install --reinstall libgl1-mesa-dri libgl1-mesa-glx x11-utils
On an offhand thought, you didn't actually download and install anything from that site you linked, right? Because if you're using the Cr-48 notebook you mentioned, those ARM architecture packages would royally screw things up. :-)
the_randomizer
Snes9x Orange Belt
Posts: 222
Joined: Sat Oct 17, 2009 4:18 am

Post by the_randomizer »

BearOso wrote:If you have a .drirc file in your home directory, delete it.

Then try running

Code: Select all

apt-file search /etc/drirc
to see what package that file belongs to in case it's corrupted.

You can also try to reinstall mesa, dri, and glx libraries and some X dependencies that driconf might have messed up by running

Code: Select all

sudo apt-get install --reinstall libgl1-mesa-dri libgl1-mesa-glx x11-utils
On an offhand thought, you didn't actually download and install anything from that site you linked, right? Because if you're using the Cr-48 notebook you mentioned, those ARM architecture packages would royally screw things up. :-)
I'm pretty sure I got one that was for Intel CPUs (i386), but if I did.....s***. but I'll try running those commands. In case I made a PEBKAC error and installed the wrong one, is the damage irreparable?

Edit: Tried the commands and when using that last one, and they seem to be installing now.


*Sigh* Oy gevalt. This is infuriating.

If the damage is irreparable, is there a way of reinstalling ubuntu?


Edit 4:41 PM - Tried completely removing driconf, rebooting, reinstall driconf and the last command you gave me; rebooted once more and tried it out...nothing.

"XDRilnfo returned with non-zero exit code"
Lisa: "I hope you all know you're sponsoring a murderous pirate!"
Sponsor: "A pirate!!? Well, that's hardly the image we need for Long John Silvers!"
User avatar
BearOso
Official GTK/Linux Porter/Dev
Posts: 460
Joined: Tue Oct 02, 2007 12:50 am

Post by BearOso »

the_randomizer wrote: *Sigh* Oy gevalt. This is infuriating.

If the damage is irreparable, is there a way of reinstalling ubuntu?
The damage is never irreparable as long as you can log in to a shell. Depending on your prowess with dealing with the problems, it may or may not be easier to just reinstall everything.
Edit 4:41 PM - Tried completely removing driconf, rebooting, reinstall driconf and the last command you gave me; rebooted once more and tried it out...nothing.

"XDRilnfo returned with non-zero exit code"
Ok, let's try a series of steps:

* If you're continuing to use a file you downloaded to install driconf, get rid of it. Install driconf properly by doing:

Code: Select all

sudo apt-get install --reinstall driconf
driconf isn't that important here. This is just to overwrite a faulty package you may have installed.

* Now, run the line I gave you in my last post:

Code: Select all

sudo apt-get install --reinstall libgl1-mesa-dri libgl1-mesa-glx x11-utils
* Reboot. This is in case your DRI modules were messed up.

* Open a terminal window and run

Code: Select all

xdriinfo
and copy/paste the output to a post here.

* If you look in the /var/log directory, you'll find either a file labelled Xorg.log or Xorg.0.log. Upload that file to something like pastebin and post a link to it here. This will be the most helpful thing in determining exactly where the GLX drivers are failing to load.
the_randomizer
Snes9x Orange Belt
Posts: 222
Joined: Sat Oct 17, 2009 4:18 am

Post by the_randomizer »

BearOso wrote:
the_randomizer wrote: *Sigh* Oy gevalt. This is infuriating.

If the damage is irreparable, is there a way of reinstalling ubuntu?
The damage is never irreparable as long as you can log in to a shell. Depending on your prowess with dealing with the problems, it may or may not be easier to just reinstall everything.
Edit 4:41 PM - Tried completely removing driconf, rebooting, reinstall driconf and the last command you gave me; rebooted once more and tried it out...nothing.

"XDRilnfo returned with non-zero exit code"
Ok, let's try a series of steps:

* If you're continuing to use a file you downloaded to install driconf, get rid of it. Install driconf properly by doing:

Code: Select all

sudo apt-get install --reinstall driconf
driconf isn't that important here. This is just to overwrite a faulty package you may have installed.

* Now, run the line I gave you in my last post:

Code: Select all

sudo apt-get install --reinstall libgl1-mesa-dri libgl1-mesa-glx x11-utils
* Reboot. This is in case your DRI modules were messed up.

* Open a terminal window and run

Code: Select all

xdriinfo
and copy/paste the output to a post here.

* If you look in the /var/log directory, you'll find either a file labelled Xorg.log or Xorg.0.log. Upload that file to something like pastebin and post a link to it here. This will be the most helpful thing in determining exactly where the GLX drivers are failing to load.
That's good to know, I can access the terminal just fine. Will give these a try and post the information in less than five minutes....It's telling me "libGL is too old", but here's the log file; if I can't use the command "xdriinfo" there's something seriously jacked up. Congratulations to me for screwing up Linux.

Download link - http://www.filefactory.com/file/ca72ef1/n/Xorg.0.log
Lisa: "I hope you all know you're sponsoring a murderous pirate!"
Sponsor: "A pirate!!? Well, that's hardly the image we need for Long John Silvers!"
User avatar
BearOso
Official GTK/Linux Porter/Dev
Posts: 460
Joined: Tue Oct 02, 2007 12:50 am

Post by BearOso »

Hmm. This might be what's doing it:

Code: Select all

[     4.858] (II) LoadModule: "glx"
[     4.858] (II) Loading /usr/lib/xorg/extra-modules/libglx.so
[     4.917] (II) Module glx: vendor="NVIDIA Corporation"
[     4.917] 	compiled for 4.0.2, module version = 1.0.0
[     4.917] 	Module class: X.Org Server Extension
[     4.917] (II) NVIDIA GLX Module  173.14.28  Wed Sep 29 10:17:05 PDT 2010
[     4.917] (II) Loading extension GLX
and then

Code: Select all

[     5.111] (EE) Failed to initialize GLX extension (Compatible NVIDIA X driver not found)
There's not a NVIDIA GPU on the Cr-48 as far as I'm aware--unless I'm mistaken.

Could you run:

Code: Select all

find /usr/lib/xorg -name "*glx*"
And see if any other files appear?
You could try deleting /usr/lib/xorg/extra-modules/libglx.so and see if it helps. It's not being used anyway and might be taking precedence over another existing module.
the_randomizer
Snes9x Orange Belt
Posts: 222
Joined: Sat Oct 17, 2009 4:18 am

Post by the_randomizer »

BearOso wrote:Hmm. This might be what's doing it:

Code: Select all

[     4.858] (II) LoadModule: "glx"
[     4.858] (II) Loading /usr/lib/xorg/extra-modules/libglx.so
[     4.917] (II) Module glx: vendor="NVIDIA Corporation"
[     4.917] 	compiled for 4.0.2, module version = 1.0.0
[     4.917] 	Module class: X.Org Server Extension
[     4.917] (II) NVIDIA GLX Module  173.14.28  Wed Sep 29 10:17:05 PDT 2010
[     4.917] (II) Loading extension GLX
and then

Code: Select all

[     5.111] (EE) Failed to initialize GLX extension (Compatible NVIDIA X driver not found)
There's not a NVIDIA GPU on the Cr-48 as far as I'm aware--unless I'm mistaken.

Could you run:

Code: Select all

find /usr/lib/xorg -name "*glx*"
And see if any other files appear?
You could try deleting /usr/lib/xorg/extra-modules/libglx.so and see if it helps. It's not being used anyway and might be taking precedence over another existing module.
The GPU is an Intel GMA 3150, which is embedded on the CR48 CPU (an Intel Atom N4x0/Pineview single core) as far as I know. I don't know how to remove "/usr/lib/xorg/extra-modules/liblgx.so", as I'm not too familiar with that sort of thing. But the overriding drivers would certainly explain the funky behavior (i.e. not being able to select OpenGL in Snes9x, etc). I just love it when I screw something up... :oops:
Lisa: "I hope you all know you're sponsoring a murderous pirate!"
Sponsor: "A pirate!!? Well, that's hardly the image we need for Long John Silvers!"
User avatar
BearOso
Official GTK/Linux Porter/Dev
Posts: 460
Joined: Tue Oct 02, 2007 12:50 am

Post by BearOso »

the_randomizer wrote: The GPU is an Intel GMA 3150, which is embedded on the CR48 CPU (an Intel Atom N4x0/Pineview single core) as far as I know. I don't know how to remove "/usr/lib/xorg/extra-modules/liblgx.so", as I'm not too familiar with that sort of thing. But the overriding drivers would certainly explain the funky behavior (i.e. not being able to select OpenGL in Snes9x, etc). I just love it when I screw something up... :oops:
Just run:

Code: Select all

sudo rm /usr/lib/xorg/extra-modules/libglx.so
And also run the "find" line I gave you to see if there's another driver available besides it. Otherwise we'll have to find out where the Mesa driver went.
the_randomizer
Snes9x Orange Belt
Posts: 222
Joined: Sat Oct 17, 2009 4:18 am

Post by the_randomizer »

BearOso wrote:
the_randomizer wrote: The GPU is an Intel GMA 3150, which is embedded on the CR48 CPU (an Intel Atom N4x0/Pineview single core) as far as I know. I don't know how to remove "/usr/lib/xorg/extra-modules/liblgx.so", as I'm not too familiar with that sort of thing. But the overriding drivers would certainly explain the funky behavior (i.e. not being able to select OpenGL in Snes9x, etc). I just love it when I screw something up... :oops:
Just run:

Code: Select all

sudo rm /usr/lib/xorg/extra-modules/libglx.so
And also run the "find" line I gave you to see if there's another driver available besides it. Otherwise we'll have to find out where the Mesa driver went.
Okay, after searching the file, there were two with the name "libglx.so", one in /usr/lib/xorg/modules/extensions and the other in /usr/nvidia-173/xorg
Lisa: "I hope you all know you're sponsoring a murderous pirate!"
Sponsor: "A pirate!!? Well, that's hardly the image we need for Long John Silvers!"
User avatar
BearOso
Official GTK/Linux Porter/Dev
Posts: 460
Joined: Tue Oct 02, 2007 12:50 am

Post by BearOso »

the_randomizer wrote: Okay, after searching the file, there were two with the name "libglx.so", one in /usr/lib/xorg/modules/extensions and the other in /usr/nvidia-173/xorg
Ok, then. Did you run the last line I gave you, and does the GLX module load properly now that you got rid of the extra nvidia one? If not, post the new Xorg.0.log.
the_randomizer
Snes9x Orange Belt
Posts: 222
Joined: Sat Oct 17, 2009 4:18 am

Post by the_randomizer »

BearOso wrote:
the_randomizer wrote: Okay, after searching the file, there were two with the name "libglx.so", one in /usr/lib/xorg/modules/extensions and the other in /usr/nvidia-173/xorg
Ok, then. Did you run the last line I gave you, and does the GLX module load properly now that you got rid of the extra nvidia one? If not, post the new Xorg.0.log.
Yep, that got rid of the extra .so file, so that's a start; I can't run glxgears/glxinfo, so I'll attach the Xorg.0.log file here. http://www.filefactory.com/file/ca77cdd/n/Xorg.0.log
Lisa: "I hope you all know you're sponsoring a murderous pirate!"
Sponsor: "A pirate!!? Well, that's hardly the image we need for Long John Silvers!"
User avatar
BearOso
Official GTK/Linux Porter/Dev
Posts: 460
Joined: Tue Oct 02, 2007 12:50 am

Post by BearOso »

It's still loading a NVIDIA driver from somewhere.
Run:

Code: Select all

sudo apt-get --purge remove nvidia-173 nvidia-173-dev
to see if that gets rid of it.
the_randomizer
Snes9x Orange Belt
Posts: 222
Joined: Sat Oct 17, 2009 4:18 am

Post by the_randomizer »

BearOso wrote:It's still loading a NVIDIA driver from somewhere.
Run:

Code: Select all

sudo apt-get --purge remove nvidia-173 nvidia-173-dev
to see if that gets rid of it.


"Unable to locate package dev"...uh-huh, yet when I search the file, the only files it finds are "libglx.so.173.18.28" and "nvidia_drv.so". Whatever you say, Linux, it "doesn't" exist. Would it be disastrous to simply delete it by putting it in the trash and then empty the trash?

Edit 4:20 PM: I managed to get rid of the nVidia driver, now I can FINALLY load the GPU config panel (under system->Control Center) so that finally loads properly :D Now, the question of getting Snes9x to recognize OpenGL. Do I need to reboot to take effect?

Edit 4:25 PM - Rebooted the system and OpenGL can be selected once more! And now I need to apologize to you if I caused any stress.

One last question about Sne9x, my resolution is 1280x800 and the HZ set at 31750, what should the audio output be (SDL/ALSA/etc), or rather, what about the ms be set at?
Lisa: "I hope you all know you're sponsoring a murderous pirate!"
Sponsor: "A pirate!!? Well, that's hardly the image we need for Long John Silvers!"
User avatar
BearOso
Official GTK/Linux Porter/Dev
Posts: 460
Joined: Tue Oct 02, 2007 12:50 am

Post by BearOso »

I tend to use a 64ms buffer size to be safe and don't notice the lag, but perception varies from person-to-person.

If OSS actually works while PulseAudio is running and you get sound without you needing to do anything extra, then go for that. That will only work if the intel hda chip in your notebook is recent enough to have hardware mixing. Otherwise, use ALSA.

Make sure sound sync is enabled. If you're still getting sound hiccups, lower the input rate by 10hz more.
the_randomizer
Snes9x Orange Belt
Posts: 222
Joined: Sat Oct 17, 2009 4:18 am

Post by the_randomizer »

BearOso wrote:I tend to use a 64ms buffer size to be safe and don't notice the lag, but perception varies from person-to-person.

If OSS actually works while PulseAudio is running and you get sound without you needing to do anything extra, then go for that. That will only work if the intel hda chip in your notebook is recent enough to have hardware mixing. Otherwise, use ALSA.

Make sure sound sync is enabled. If you're still getting sound hiccups, lower the input rate by 10hz more.
Current config -

Latency - 64ms-128ms
Input Frequency - 31690 to 31740Hz (10Hz increments)
Output Mode - ALSA (cannot use OSS, yet it works every now and then, which is weird IMHO).
Sound Sync - enabled

Too bad I don't know how to disable Pulse Audio, as I'm still experience perceptible skipping every 20-25 seconds. I'm also convinced that CR48 simply isn't powerful enough to run Snes9x at full speed with vsync and spu async are enabled, but prove me wrong. If it can run Kega Fusion, which has similar system requirements, then why not Snes9x?


Edit 4/4/2011 5:57 PM -

Updated Glxgears info

295 frames in 5.0 seconds = 58.879 FPS
298 frames in 5.0 seconds = 59.502 FPS
290 frames in 5.0 seconds = 57.682 FPS
298 frames in 5.0 seconds = 59.411 FPS
290 frames in 5.0 seconds = 57.610 FPS
Lisa: "I hope you all know you're sponsoring a murderous pirate!"
Sponsor: "A pirate!!? Well, that's hardly the image we need for Long John Silvers!"
the_randomizer
Snes9x Orange Belt
Posts: 222
Joined: Sat Oct 17, 2009 4:18 am

Post by the_randomizer »

I should also note that if I switch from OSS to ALSA, and then back to OSS, it no longer works until I reboot Ubuntu. Not a big deal but confusing nonetheless. In addition, OSS seems to produce a lot of audio crackling, but doesn't skip. Yet ALSA and SDL skip every 20 seconds or so.

Again, frequencies tried

31700
31710
31720
31730
31740
31750
31760

All the same = skipping still persists.
Lisa: "I hope you all know you're sponsoring a murderous pirate!"
Sponsor: "A pirate!!? Well, that's hardly the image we need for Long John Silvers!"
User avatar
BearOso
Official GTK/Linux Porter/Dev
Posts: 460
Joined: Tue Oct 02, 2007 12:50 am

Post by BearOso »

Kega Fusion probably has a an aggressive dynamic resampler, which would work actively to prevent buffer overflows and underruns. This is an approach none of the Snes9x ports have yet adopted but may offer in the future.

Your glxgears info indicates that the drivers aren't doing a very good job keeping up with the vertical blanking interval. This is likely the cause of the sound skipping. You can try lowering the input rate as low as it will go, and if the skipping gets any better, that confirms it.

On the positive side, you're using older intel drivers. Newer ones are known to improve performance fairly significantly, so things might get better in the future.

I also haven't yet asked: Are you running a Compiz, or "Desktop Effects" as Ubuntu calls it? This will absolutely ruin consistency.
the_randomizer
Snes9x Orange Belt
Posts: 222
Joined: Sat Oct 17, 2009 4:18 am

Post by the_randomizer »

BearOso wrote:Kega Fusion probably has a an aggressive dynamic resampler, which would work actively to prevent buffer overflows and underruns. This is an approach none of the Snes9x ports have yet adopted but may offer in the future.

Your glxgears info indicates that the drivers aren't doing a very good job keeping up with the vertical blanking interval. This is likely the cause of the sound skipping. You can try lowering the input rate as low as it will go, and if the skipping gets any better, that confirms it.

On the positive side, you're using older intel drivers. Newer ones are known to improve performance fairly significantly, so things might get better in the future.

I also haven't yet asked: Are you running a Compiz, or "Desktop Effects" as Ubuntu calls it? This will absolutely ruin consistency.

I was running them, but I went into Change Desktop Background->Visual Effects and clicked "none" to make sure I wasn't running anything unnecessary. And since the drivers for the Intel GPU are old, what is the most efficacious way of updating without me slaughtering the drivers this time? I seem to have bad luck with Linux. I also made sure the vsync mode was set to "Always synchronize with vertical refresh/application chooses the minimum swap interval" under the DRI control panel. Still, maybe it's just me, but having to set it to 31540Hz seems a little extreme.
Lisa: "I hope you all know you're sponsoring a murderous pirate!"
Sponsor: "A pirate!!? Well, that's hardly the image we need for Long John Silvers!"
Post Reply