The NEW Build Your Own Arcade Controls

Main => Software Forum => Linux => Topic started by: bitbytebit on November 01, 2010, 05:08:32 pm

Title: Howto setup Linux with waitvsync and nothrottle options using KMS + Radeons
Post by: bitbytebit on November 01, 2010, 05:08:32 pm
Update: Now a liveCD .iso is available in 32 and 64 bit versions to do all this automatically

I have gotten the waitvsync option to work under Linux with Radeon cards, specifically with the R6xx/R7xx GPU's (should work with older ones too, not sure if it works with newer ones because I don't have one).

This requires a process of basically getting the newest Linux-2.6 tree from the Linux GIT and compiling a fresh new X Windows from GIT, including Mesa3d and libdrm.  Fortunately I've gotten that process mostly automated and have a good install instructions file to help people achieve this.  It also involves using my switchres program and special lrmc modeline generator too, you will need the whole setup for the Vertical Refresh to be setup right for each game.  I have a patch to xrandr to do the proper modeline switching, a patch to the Linux kernel to allow lower dotclocks than 12Mhz, and some other detailed things that need to be done for this to work right.  It's definitely brand new, they just got support for this into the kernel that works within the last few weeks.  Also there's module options to the drm stuff that allow it to work without some flaws that you see if trying this in the newest Ubuntu (which is the closest to this of any of the distributions, but there's flaws there in the default install).  I used a basic Gentoo base directory and setup without installing much else besides the core system .tgz file, have the few packages I installed listed to help X windows to compile completely and run SDL, directFB and MAME.  With all this, depending on your arcade monitor capabilities, you can get near perfect resolution and refresh rates with the mame following the roms refresh rate (using throttle=0 and waitvsync=1).  

http://arcade.groovy.org (http://arcade.groovy.org)
Title: Re: Howto setup Linux with waitvsync and nothrottle options using KMS + Radeons
Post by: bitbytebit on November 02, 2010, 06:48:05 am
Here's a new patch for the xserver which is simple, yet basically doesn't add the default modelines it usually does if the EDID doesn't exist for your monitor (which mostly would be an arcade monitor).

Code: [Select]
diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index b2daec7..ff5ca2c 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -1633,6 +1633,10 @@ xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY)
            xf86ForEachDetailedBlock(edid_monitor,
                                     handle_detailed_monrec,
                                     &p);
+       } else {
+           xf86DrvMsg(scrn->scrnIndex, X_INFO,
+                  "No EDID on output %s\n", output->name);
+           add_default_modes = FALSE;
        }

        if (xf86GetOptValFreq (output->options, OPTION_MIN_CLOCK,
Title: Re: Howto setup Linux with waitvsync and nothrottle options using KMS + Radeons
Post by: bitbytebit on November 05, 2010, 03:13:44 am
I've now gotten it to where you no longer need any patches for X Windows, still need the newest GIT version but only necessary to patch the Linux kernel 2.6.37-rc1 or above.  The patch for the kernel now allows arcade modelines output to the framebuffer console and removes any extra modelines from X Windows besides your modeline you want for the default X Windows setup.  The xrandr program is used, unpatched, to set the modeline used for each mame game upon runtime dynamically.  With the newest Linux kernel patched and X Windows on Radeon cards this is quite nice and you can get exact refresh rates and no tearing using the waitvsync option with nothrottle. 
Title: Re: Howto setup Linux with waitvsync and nothrottle options using KMS + Radeons
Post by: bitbytebit on November 09, 2010, 02:06:04 am
I've got ubuntu 10.10 kernel packages up on the sourceforge site for testing, 32 and 64 bit versions, that have the arcade monitor patches applied to allow display on the console and X Windows usage of Radeon (and possibly Nvidia cards) with arcade resolutions.  They need testing, give me feedback on if they work or what needs fixing with them.