RetroArch - Native 15khz CRT Support Bounty Suggestion [$50]


Oh, ok. I didn’t think xrandr was usable without an X server running. If it is, I don’t suppose there’s any issue. I guess we can test it out soon enough :slight_smile:


This Is what I have read. You should be able to link the display to xrandr in terminal using the following command.

DISPLAY=:0 xrandr

After this xrandr should be able to control and see your dislay outputs.


I was surprised I hadn’t checked back on this for a moment and ended up downloading the newest nightly for a totally unrelated reason and saw this was implemented. It’s working perfectly now in every scenario! Great work again @Alphanu this is awesome to finally have


Is this 15khz CRT support supposed to work with any video driver (gl, d3d9, d3d11, vulkan…) or is specific driver oriented? I’m asking this because I can’t get it working other than gl driver.


It uses RAs back-end video driver so should work with all. However, having said that windows does have issues with D3D and interlaced resolutions. Myself and @Retrorepair have had it working with D3D but you need to install the latest Directx run-time/SDK. However having said that GL has always given the best results.

There will be Wiki updated soon with all the relevant information for setting things up.


Ok guys this is it. I still need to tidy the code and put it in the correct places before I submit the next PR.

I have super fast Linux switching. Modlines to match and sync odd hz like Mortal Kombat. All this working without the need for VSYNC.

During my lag test I managed to get a huge result of 0.2 frames. This is shown at the end of the video.

@Twinaphex to generate and install these modlines that corretly mimic the original hardware I am having to use the system(); function. This can be changes to say execlp(); if preferred? Let me know so I can ammend anything before submision. Or if these are not allowed I’ll need to go back to the drawing board.


Hi there, let me consult some of the Linux users first on IRC/Discord.


I talked with bparker a little and the reliance on external system()/execlp() was indeed an issue. However, I looked into xrandr itself, and it’s actually a pretty straightforward utility that just hooks into the RandR protocol, so we may be able to just take the handful of functions we actually need and incorporate them directly into RA.


I compiled a version of Retroarch with this functionality for Raspberry Pi. I’m guessing it doesn’t work on that platform?


Where did you get the code? The one in the libretro repository only supports Windows currently, but the Linux support that Alphanu is currently working on should work on RPi.


Well, i was long away due to personal life but i finally had the time to try the latest nightly. I’m very impressed with the results. Everything seems to work perfectly except for one issue, after exiting retroarch, the resolution remains the same. I remember this being fixed in the past, i think. Is this intentional or a bug? Of course this issue causes problems with frontends like hyperspin.


@ilitirit I am currently calking with the guys over at the pi2jamma group The RPi is a bit of a special case. It uses fbturbo as its video server which causes issues. The guys here have some resolution switching working using scripts. most arcade game have the correct resolutions but consoles do not. Aslo its all only 240p there are compiling new kernels and testing 480i resolutions but 480i its still a way off yet.

My plan was and still kinda of is be to get RA ported to the RPi properly. Once all the Linux kinks are out of the way. As I would like a RPi in my arcade machine.

@Foxhole You are correct, resolution restore is and should be working. There is a small issue here which will need to be commented on in the documentation. Resolution restore will have detected your windows current resolution. However it does not detect your current screen refresh. You can always create an issue for this on github.

So what does resolution restore do. Simple answer it will set your resolution that you had before running RA but it will only look to set 60hz in that resolution. So if you are running a 50hz desktop resolution to maximize the CRT view it won’t be able to restore it. So I would suggest you have [email protected] installed as you desktop resolution.

Now if you are already running a 60hz desktop resolution I am not sure why this does not work for you. In all myself and @Retrorepair 's tests this has been working perfectly since being incorporated.

@hunterk When it comes to xrandr I am aware it uses RandR and I could use X11/Xlib.h and all the other #includes needed to try and set the resolution. Now the only issue here is, that this not all that is happening to set the res. In short I would pretty much need to rewrite xrandr and incorporate it into RA. This is because I need to be able to set the video porches for horizontal and vertical which there are 3 of not including the resolution size. Also I need to set the pixel/dot clock and then resize the video frame buffer. All this is needed to be able to generate the resolutions we require. In this case exact resolutions with perfect refresh rates.

To be fair right now this Linux version is the most accurate to the native machines possible. Most of the cores do not need VSYNC all if you have the right setup. This means the CRTs resolution and hz are nigh-on an exact match to what the original hardware would have switch your CRT to. It is much better and more accurate than the windows version that must have VSYNC on.

The old saying is don’t fix what isn’t broken.

Now if I’m being honest with myself unless we can find a happy middle ground with the devs I’ll have to leave what I have and let someone else take over. I barely have the time to do what I am doing know. So I think the best I can do is hand over my source code and let whoever takes over attempt to incorporate full X11 switching from source. Trying to keep this current accuracy.

@markwkidd Can we sign off this bounty? I have completed what was tasked. Cheers


I’m using [email protected] as the desktop, so that’s not the case. It used to restore the resolution just fine in the older versions. I’m currently using the latest nightly. Can any one else try the latest nightly and check if the resolution is restored?


Are you ready to submit a PR for your Linux work? Even if it needs some amendments regarding xrandr I think it would be a good thing to have that code as a PR

I see you saying at least in terms of rpi that you are planning to keep continuing to work on this which is also a good sign for donors who get asked to sign off on the collection.

I personally do feel that you have met the criteria for the bounty. I will try to check directly with twinaphex and make that argument. It would also be good if you would be willing to stick around and try to help with whatever xrandr decision is made.

But again in terms of the bounty if you will put in the Linux code as a PR then I will personally start making the case that you have completed the criteria. I can tell you have worked hard on this and for more than just the cash value


Yes, understandable. If you can push your existing Linux switching code into a branch, we can work on making it independent from external xrandr.

I am happy to support releasing the funds, as you’ve done everything that was required and more. :slight_smile:


@markwkidd I will tidy the code up a little then submit the PR or if yould rather it will be up on my github as a separate branch to be cloned. I have been working on it for myself realy, I guess with everyone else wanting it, it help push me along. Of course I’ll be around for any discussions regarding xrandr and any code areas that might not make sense.

Also I’ll keep this post updated with any progress when it comes to the RPi.

@hunterk I’ll also stick around and help out with all the docs. There is still a lot more to add and there will be a little bit for Linux too. things like core options and enabling 1.0x max run speed.


I think a PR would be best unless @hunterk feels otherwise


Hi, Yesterday I downloaded the latest RA stable (1.7.2), which was realeased with the new CRT Super Resolution feature: Nonetheless, this option does not appear on the “video” settings menu. That’s strange, because some weeks ago I tried one nightly build and the option was there!

PS.: I tried all the stable versions for Windows (x64 .zip and .exe / x86 .zip and .exe).


It should be at the bottom of the video options page, but it’s also considered an “advanced option,” so you’ll need to make sure “show advanced options” is set to “true” in settings > user interface.


That’s right! @hunterk I forgot this Thanks!