17 December 2012 ~ 21 Comments

Connecting a Raspberry Pi to an old 15Khz Arcade Monitor

The Raspberry Pi has been used all over the world as an excellent emulator box to resuscitate old arcade machines, but with moderate success.

You see, if you’re a truly arcade aficionado like me, then you’ll aim for perfection. And perfection means you’ll use the jamma connector and the old 15Khz CRT instead of a more modern retro fitted VGA monitor like most people opt to do.

Old arcade CRT sets can only accept 15Khz horizontal frequencies using separate RGB signals and a sync line (well, not quite, there are 25 Khz monitors too but they’re uncommon). Ultimarc has an excellent article about arcade monitors if you want more details.

The problem with that is the Raspberry only outputs HDMI digital video or 15Khz composite video (no RGB), so there’s no easy / cheap solution to get pure 15Khz RGB signals out of the Pi to feed the arcade CRT.

You could try to demodulate the composite video into RGB signals but that’s complex and expensive, and you’d lose a lot of information, picture would be poor.

You could easily get a cheap HDMI to VGA active decoder on eBay or Amazon, and most work fine, but VGA signals are 31Khz and, even if they weren’t, you’d still need a level adapter / sync fix circuit (this article explains it).

So, at Codebits VI, as part of the Hardware Den space initiatives, we restored a few old arcades, keeping the old controls, jamma connector and CRT monitors, and using the Raspberry Pi as the brains for emulation in partnership with the The Arcade Man. Did it work? Hell yes, here’s proof:

IMG 2145

So here’s how we did it.

NewImage

Power Suppy

Everything is powered by the original Arcade power supply. These are some powerful power supplies I tell you, they can output 5V, -5V and 12V and up to 15A. You don’t need this much but heck, it’s already there, it’s built to last, it’s powerful and very stable, so we used it.

We stripped down a few USB to Mini USB and Micro USB cords and used them to connect the power supply pins to the Mini USB amp and the Raspberry Pi. Make sure you’re using the 5V (not the minus 5V) pin otherwise you may damage your electronics.

IMG 2111


HDMI to VGA

We wanted the best possible video quality so video composite was out. We bought a cheap HDMI to VGA decoder at Amazon. You can find several brands available (look at eBay too), they shouldn’t cost more than 10€. Read the comments before you buy one, they often mention the Raspberry Pi. We tried 3 different brands, they all worked. These are active decoders, meaning they have a small chipset inside and they’re able to decode the digital HDMI protocol and produce the analog VGA signals on the other end. A lot of people are buying these to connect their rPIs to normal VGA monitors.

The problem with these small decoders is in the details. Some of them work with a wide range of resolutions, some of them don’t. Some require a boost on the HDMI lines. Some provide EDID capabilities, some don’t (or they’re wrong). So you need to spend some time tweaking your RaspberryPi config in order to get the best results first.

This is our config.txt config:

hdmi_drive=2
# defines the HDMI type CEA/DMT, 0 will use the preferred group reported by the edid.
config_hdmi_boost=6
hdmi_ignore_edid=0xa5000080
hdmi_group=2
hdmi_mode=9
disable_overscan=1

#
# These are optional
#
# hdmi_force_hotplug=1
# hdmi_ignore_hotplug=1

arm_freq=1000
core_freq=500
sdram_freq=500
over_voltage=6

The most important settings here are the hdmi_ignore_edid which makes your RaspberryPi ignore edid and allows you to use pretty much any VGA resolution (this is important for game emulation) and hdmi_group (you want to use DMT).

Our Raspberry Pi is also overclocked (this is important too, depending on the games you wish to play).

VGA to RGB downscaler

VGA gives us 31Khz analog video, but we need 15Khz. On the “normal” PC emulation scene this is a well known (and solved) problem. Solution 1: Some graphic cards allow you to set 15Khz resolutions on the VGA connector which work great with Linux and Advmame or you can use Soft15Khz under Windows. Solution 2: You buy a dedicated 15Khz graphics card for arcade usage, Ultimarc sells the ArcadeVGA, very popular.

Problem is, you can’t connect a graphics card to the Raspberry Pi and, although the on board Broadcom chip supports them, there’s no way to get 15Khz resolutions through the decoded HDMI, then modulated VGA (probably fixed at 31Khz by the crappy Chinese adaptor).

The only way would be to use video downscaling. This part was hard to solve. We knew we had to downscale our 31Khz VGA signals to 15Khz RGB lines and this is no easy task, it requires powerful video algorithms and heavy processing using dedicated chips. Professional equipments to do this job usually cost hundreds of Euros (or more).

So we though we’d go through the old underground forums and dedicated pages for arcade parts in the hunt for a solution. And we found it.

Our pick is the GBS 8100. This beautiful piece of hardware takes VGA input at 31Khz, downscales the video and is able to output it at 15Khz over RGBS pins (which can be connected directly to the arcade CRT board, cable included), VGA db9, RCA composite video or S-Video. Furthermore it has an OSD menu system and you can calibrate brightness, contrast, video offsets and other details. Requires 5V to operate. And it costs approximately $30.

They are hard to find. We found two stores with stock and they both sent us working units within a few days with great customer service. They are:


Photo

USB Keyboard adapter

The best way to connect your arcade controls to your Raspberry Pi (including the coin mech) is by using a USB device that adapts the switches on the joysticks and buttons to normal keyboard keys. From the software point of view, your controls will show up as a normal HID USB keyboard.

There are several adapters available. We recommend these:

The I-Pac is the best choice for this job but it will require you to desolder the JAMMA wires and connect them to the device inputs. If you go for the J-Pac then you can just connect the JAMMA adapter to it and it should work, but you won’t be using the VGA stuff (it’s made for 15Khz graphics cards, see above), so it’s a waste of money and functionality.

This project on Kickstarter does pretty much the same, should be an interesting option when it’s available.

MG 7475

Mini USB Amp

The Raspberry Pi sound output can’t be used directly with the cabinet speakers, you’ll need an audio amp first. We bought a pair of HP USB mini speakers, connected the main speaker’s USB cable to the arcade power supply and the rPi audio output. Then we used the cable to the second speaker to connect it to the cabinet speaker. Works fine.

Photos or it didn’t happen

Here are some photos of the whole thing.

2012 11 16 20 11 25

 

IMG 2143

IMG 2095

NewImage

For left to right, Rob Bishop (Raspberry Pi foundation), Me and Luis Sobral (The Arcade Man).

Conclusion

This setup works flawlessly and we’re very happy with it. Picture quality is great and all things together, Raspberry Pi, HDMI to VGA adapter, VGA to CGA downscaler, USB controls adapter and Mini Amp, are under the 100€ mark. Add 70-90€ for an old working cabinet (which you can find at local warehouses from old arcade distributors) and a few more euros for some nice vinyls, buy a few damaged buttons / joysticks, and you’ve got yourself a fully working arcade cabinet for about 250€. Not bad.

Many thanks to The Arcade Man for providing the old cabinets, painting and restoring them with new controls and vinyls, great job (also, read about the Sega Rally project he did with the Artica guys). Thanks to Rob Bishop and the Raspberry Pi Foundation for the support and for being with us at Codebits this year, it was awesome. Thanks to all the volunteers and Codebits participants too.

The Raspberry is a wonderful retro gaming emulation machine. We’re using Advanced Mame for arcade games and Advance Menu for browsing the game library and menus. Right now we have a self configuring environment, the system boots in a nice, black minimalist menu sub-system, reads the roms on a special disk partition, then you can browse and chose your game using the cabinet controls, fool proof. A lot of roms work at full speed including great games like Shinobi, Megaman, Pang, R-Type, DoDonPachi, Bubble Bobble and many others. This was accomplished by a combination of overcooking, Advance Mame compilation and optimisation options, sound settings, optimal screen resolutions, and a lot of configuration tweaks.

The system is also running Amiga and C64 games in full screen, using the same menu system.

I’m now cleaning the code and scripts, and documenting some stuff too. Next post will be an URL to a fully bootable, read to use, SD card image for your Raspberry Pi and all sources and code on my Github repo too, so stay tuned.

  • http://twitter.com/josealun Rokkuman

    Excellent! Great info, this has made grow my interest in building a raspi arcade over the roof!
    I’m waiting anxiously for the next post with the sd card image

  • Johan Winäs

    You should have used a hdmi to scart converter, this skips the VGA stage and would improve your picture quality.
    http://www.alibaba.com/product-gs/577746912/hdmi_to_rgb_scart_converter.html
    The trick is that hdmi has 576i50 as a valid screenmode, making the hdmi port work in native PAL mode with 15Khz/50Hz refresh rate.
    I,m not a 100% sure that the raspberry pi hdmi transmitter would select the right mode, but either way it will skip the VGA conversion step.

    Other than that, great build and good work!

    • http://arrifana.org/blog/ Celso Martinho

      Hi Johan, I bought one of those HDMI to scart converters too before I went with the GBS 8100 and found that the description on those products is misleading. What they do (in fact) is composite video on the SCART connector, the RGB lines aren’t used at all. I even checked their chip, it does composite video only.

      This is the one I bought:

      http://www.amazon.co.uk/gp/product/B007WRPJX2/

      And even if they did RGB, you’d still need to use a (simple) circuit to adapt sync and line levels because the arcade CRT monitors are different from TV sets. See

      http://members.optusnet.com.au/eviltim/vga2arc/vga2arc.htm

    • Luis Correia

       The standard TV cabinets do not follow SCART video levels. Hence the double conversion.

  • Ludzinc

    I too can’t wait for the SD card image.  I managed (thanks to the power off the interwebs) to compile both AdvanceMAME and AdvanceMENU *but* only AdvanceMAME was successful.

    For noobs like me – is there any chance you can put out a tutorial on *how* to compile source on Raspberry Pi?  For my attempts above I just followed some ‘walkthroughs’ but I didn’t really understand what was important or why I was doing this.

    If I knew what dependencies were needed I might have had a chance nutting out my AdvanceMENU issues.

    Cheers,
    Simon

  • Pedro Marques

    Great job :) congrats t you and arcademan :)
    Celso how are the performance of games like Street Fight, Bomberman anda some other more “recent” ?
    i just can’t wait to change my old P4 with rasp

    • http://arrifana.org/blog/ Celso Martinho

      Borberman works fine. I haven’t tried Street Fight (not my cup of tea).

  • No

    Is it not possible to use the RCA-Video for the signal?

    • http://arrifana.org/blog/ Celso Martinho

      Not with Arcade cabinet CRTs. Conventional home TV CRTs have video composite but quality is poor too.

  • Yudmurt

    My arcade just waiting a image for pi.

  • Karlletting

    Nice work around. Do you guys think a later revision of the Raspberry PI will include maybe pins/jumpers for R,G,B, VSNYC, HSYNC, Ground, & 5+ or 9+ volt. So we can just uses these pins to connect up to an arcade monitor or old CRT (via scart)?

    • http://arrifana.org/blog/ Celso Martinho

      I don’t think the Raspi will ever support RGB analog video, it would probably add up to the cost.

  • Sehu2

     Excellent ! Waiting for the SD card image :)

  • Radfoo

    Looks great, really looking forward to seeing your next post with the SD card image.

    • Radfoo

      i’m inpatient, keeping checking back every couple of days, lol.

  • flex

    You’re a genious, I love you!
    Please release your SD image quickly! ;)

  • Andybarrn

    how do you end up powering the gbs-8100? trying to power mine from my cabinet, but don’t know much about power

  • flex

    I understand that you may not have time to publish your SD card image, however, can you simply explain what must be done to play DoDonPachi at full speed. I overclocked mine to 850 Mhz and compiled advancemame-0.84 with gcc-4.7 and I’m not at full speed yet… Thanks a lot!

  • http://www.poraora.com/ Shawn Jones

    This is really flawless. This guy is a genius. I would love to see your SD image. Please upload this as soon as possible. free virtual kids games

  • Steven

    Could you *please* provide your SD image ?

  • Temia Eszteri

    Nice work on this! Have you considered setting it up to run homebrew as well as emulators, or is that already an easy option?