In this post I’ll go over what I would consider to be the most important aspects to know while building your very own RetroPie on a Raspberry Pi as it’s not all as straight forward as you may think.
There are many posts out on the net describing just how to setup a RetroPie on a Raspberry Pi but I notice that most of them take you through the obvious, generic setup steps without going in to too much detail about any issues you may come across along the way..
After spending three solid months of building my SD card image and creating my very own kit, I came across some unforeseen hurdles along the way and I would like to share with you my experiences and problems and how I overcome them.
The above images show my very first RetroPie kit for sale. I aimed for using top quality, brand new hardware to give the customer a great experience. Who wants old and warn out parts, right?!
As well as taking you through the software setup I will also cover the hardware that I decided to purchase and why I chose to purchase it.
The above images show screenshots of my final setup. This is the front-end know as Emulation Station.
Of course, yours may look very different to mine and this would depend on what theme you choose to apply and what emulators you choose to have available to the end user.
Usually when you see a RetroPie being built on the internet you will hear about how cheap it is to get started. Although this is the case in general, I decided that I needed to show the Pie a little more love and create a slightly better quality product, but at the same time I was aiming for a reasonable profit margin.
In total my build cost me around £80 GBP ($97 USD) so certainly not the most expensive RetroPie on the market today.
My Raspberry Pi model of choice was the 3B. Of course I could have used a 3B+ but it just seemed that the 3B was more readily available to me on Amazon and Ebay that’s close to where I live, here in UK.
Besides, the 3B+ features compared to the 3B just wasn’t needed for this build as it has Gigabit Ethernet (in which I wouldn’t be using) but a slightly faster CPU cores which I guess couldn’t hurt to have.
Raspberry Pi 4 prices at this time just didn’t seem to be worth it for this build and may be a bit over-kill. Although some emulators could well work a lot better on a Pi 4.
Ultimately, the choice is yours.
Case and Vinyl Stickers/Decals
I decided to go with the official Raspberry Pi case so I was sure I was getting a good quality product. The case looks and feels great and for less than $4 its ideal for the task in hand.
Although it’s very plain and boring, I decided to pimp out the case with some vinyl decals that just screams “RetroPie” 🙂
HDMI and Power Cables
I didn’t want to cheap-out on the HDMI cable so I went with a gold plated and braided 1 meter cable. I’m now thinking that I should have gone for the 2 meter cable as it does sometimes feel too short when hooked up to the TV and doesn’t leave much room to work with.
The USB power cable with plug for me HAD to have a power switch on it. I still don’t know why the Raspberry Pi doesn’t have a power button but this cable fixes that problem great!
Again, the cable seemed a little short at 1 meter but I couldn’t find and other cable lengths for sale on Amazon or Ebay.
Micro SD Card and USB Flash Drive
Because I would be storing my game ROM’s on a USB drive, I didn’t need a huge capacity SD card. For me it had to be a Kingston. It’s one of the best manufacturers out on the market today for these types of memory storage.
For less than $5 I went with the 32GB micro SD card. The linux operating system, coupled with the emulators, other tools and around 8,000 box art game covers totalled my SD image to around 7GB so this card had plenty of room to work with.
The Sandisk Cruzer Blade 128GB USB drive was my choice for storing my game ROM’s on to. Another great manufacturer in the market today for making top quality memory devices. This cost me a little under $20 but each time I buy one of these devices, the price seems to increase so I guess there’s a lot of demand for these USB drives.
Reasons to store game ROM’s on separate USB drive
Of course you can always get a higher capacity micro SD card and store your game ROM’s on that. To me though this seems like a shortcut that I wasn’t willing to take. There are many benefits to running your game ROM’s on a separate USB drive.
Micro SD Card Reader
Nothing special about this device although I have had some nasty, cheap USB SD card readers in the past. The one I settled for was good quality and I never had any problems with it. My advice here in purchasing a USB SD card reader is to not get the cheapest you possibly can as the quality will be poor, and for an extra $1 it’s possible to get one that will work, work well! and last for years.
We all know that when it comes to great quality games console controllers we look at the top manufacturers such as Sony and Microsoft to set the baseline.
But with generic PC/USB controllers this standard doesn’t exist.
It’s very easy to get hold of cheap controllers and the quality usually reflects the price. Even the not-so-cheap controllers are not usually excellent quality and so in that situation we feel a little short changed with our purchase.
After buying many controllers to find the make and model that I thought would complement the quality of the RetroPie, I will share with you what I found to work best for me.
In my opinion then GioTeck.com make an excellent quality controller. After trying the VX1, VX2 and the VX3, I would have to recommend the VX2 the most. It just feels great, everything is where it should be and it has a cool design.
That being said, I would have to recommend the VX3 the least as I feel that GioTeck kind of let the ‘cheapness’ creap in a little here as the plastic and other materials don’t have that same quality feeling to it.
However, the VX3’s were easier for me to get a hold of and in a brand new condition and so for that reason I decided to go with the VX3’s for now.
All of these controllers ship in either a wired or wireless model and I can only give my opinion on the wired controllers as I haven’t tried any wireless controllers from GioTeck as of yet.
I was first introduced to these Shanwan fake controllers as I started to build my Pie. These things are EVERYWHERE and plague the internet. The problem is, they’re REALLY good fakes! My first experience with Shanwan was with a PS3 wireless controller. It shipped in a Sony box, and with instructions and I had no clue as to knowing it was a fake when it first arrived.
In fact, the GioTeck VX3 Controllers that I decided to go with were also Shanwan fakes which I ordered from Ebay but I believed them to be genuine when I first purchased them.
After paying for the items I then went ahead and messaged the seller. I simply stated that if these controllers were Shanwan fakes or not brand new then could they please cancel my order as I would only need to return them.
I don’t usually reach out to Ebay sellers (or anyone else for that matter!) with this kind of message but I had been sent so many fakes at this point it just wasn’t funny.
They responded back in a short period of time and assured me that these controllers were genuine and that they only receive items from trusted UK suppliers. Well I took the sellers word for it as he/she seemed genuine enough to me. But these were in-fact Shanwan fakes when they arrived!!
I guess that with internet shopping taking over from the ‘bricks-and-mortar’ stores there’s just no where to go to avoid this kind of thing happening these days.
There are usually two choices available when selecting your Operating System of choice for creating a RetroPie. That would be Raspbian, and NOOBS.
Many newbies would like to go the NOOBS route. I HIGHLY suggest you don’t go this route and you take the Raspbian OS approach.
Later down this post I talk about a tool called PiShrink which is needed to create duplicate SD cards. PiShrink doesn’t work with a NOOBS install as it has a very different partition structure to that of Raspian. At the time of writing, NOOBS isn’t supported by PiShrink but that could change in the future of course.
Flashing RetroPie '.img' Image File
The internet standard for getting your RetroPie Operating System on your SD Card seems to be the balena etcher tool and I so I would recommend using this to get setup.
I would only use this for the very first install as I would recommend the dd command in linux to create the backup, then the PiShrink tool for shrinking the image, then dd tool again for writing the shrunken image back to SD card while making regular backups in which I explain below.
Balena Etcher is available for Windows, MacOS and Linux and so makes a great common ground no matter which of these three systems you prefer.
Once you’ve grabbed yourself a copy of Balena Etcher then make your way over to RetroPie.org.uk and get a pre-made RetroPie image for your particular Raspberry Pi.
Get into routine with PiShrink and regular backups!
The ABSOLUTE KEY.. to selling your very own RetroPie images, comes down to this one thing! Can I make copies of my SD card image?
If you can’t make a 1 for 1 copy of the SD card image that you’ve put your blood, sweat and tears into, then how are you going to sell RetroPies? It’s obviously not feasible to spend months on an image, to then have to start all over from the beginning on the next image.
This is where PiShrink comes to the rescue! PiShrink can be found over on Github here.
If it wasn’t for this excellent linux tool then my RetroPie for sale wouldn’t exist and so a HUGE thanks goes to the developer of PiShrink.
The problem with SD card capacity
What most people don’t realise is that two seemingly identical SD cards do not hold the exact amount of data. So if you create a dump of your image from one SD card, it may not fit on to another similar SD card. Even though they both state they are 32GB etc, these two cards are not exactly identical to the bit!
After creating a dump of your image, we then run the PiShrink tool on the image file. PiShrink compresses the image down to around 7GB but this all depends on what data you have on your image of course.
We then write our newly created, compressed image file to another micro SD card.
Now, when we place that new SD card into the Raspberry Pi and boot up, linux will expand the file system to the full size of the SD card. This usually happens within around 10-15 seconds of booting up for the very first time, and then the system will reboot.
Routine Backups (dumps)
Every once in a while you will need to create an SD card dump of your image during the process of building. I usually done this at the end of the day. I strongly feel that this is very important task and shouldn’t be overlooked.
There have been MANY times that I messed up my image, and if I didn’t have backups then I would be loosing days, weeks or even months of hard work! We don’t want that to happen.
If you create a backup every night then the worst case scenario is that you would loose one days work, max.
How to create a backup using pishrink and dd in linux
Firstly you will need to take out any USB memory device from the computer. This makes things easier for me to explain, and we don’t accidentally read/write a wrong memory card.
Now plug in your SD card into the USB SD card reader and plug the reader into your computer. It doesn’t matter if there’s anything on the card or not at this point.
We need to unmount any partitions that auto-mounted. If there are no partitions/files on the memory card then this may not need to be done but it’s worth doing anyway.
We cannot successfully read/write our SD card if partitions from it are mounted.
Open a linux terminal and enter:
This will un-mount the first partition on the SD card, assuming that sdb is your USB device. Now we need to un-mount the second partition on the SD card with the following command:
sudo umount /dev/sdb2
sudo dd if=/dev/sdb of=retropie.img bs=4M
This will create a binary image file of your SD card. This is known as a dump. This process may take sometime. For me it takes around 40 minutes.
Once we have our full SD card dump we now need to shrink the image file so it will fit on any other SD card with similar memory capacity.
Head on over to Github and grab PiShrink and install it by following the instructions from the author.
Now we will use PiShrink to shrink our image file with the following command:
sudo pishrink.sh retropie.img shrunk.img
This firstly creates a copy of the image file, then shrinks the copy. I believe it’s always a good idea to keep your original backup but if you’re running out of disk space on your PC/laptop then you can always in-place shrink the file with the following command:
sudo pishrink retropie.img
Write shrunk image file to SD card
We will need to close any windows that may pop-up, and run the commands to un-mount partitions 1 and 2 again.
Use the following command to write the shrunk image to our new SD card:
This shouldn’t take as long to write as it will only be around 7GB or so. Wait for the process to complete.
Once complete we simply place the SD card into the Raspberry Pi and boot it up. Wait 10-15 seconds for it to expand the file system and it should reboot automatically. Job Done! We now have a cloned SD card image.
Prepping the USB Flash Drive
CAUTION: retropie vs retropie-mount
This is a HUGE pitfall that you need to be aware of as I fell for this one the first time around.
After we have our RetroPie Operating System up and running we now need to create the file structure on our USB drive.
Once booted up in RetroPie, insert the USB drive into a spare USB socket in the Raspberry Pi. Wait a minute or so, then shut down the Pi. Insert the USB device into your PC/laptop. You will notice that a directory and file structure has been created for you by RetroPie. This is where you will need to place your BIOS ROM files, game ROM files and more.
In the root of your USB drive you will notice that the first directory is called “retropie”. If you place all of your files under this name, then when you boot up your Pie with the USB drive plugged in, RetroPie will COPY EVERYTHING over to the SD card!! Now, If you have a 128GB USB drive filled with ROM files and only a 32GB micro SD card, then things get very messy very quickly! As the linux operating system memory will get maxed out, linux will become unusable, and you will need to re-flash your backup dump to the SD card. This is why we need to create backups!
What we need to do is rename the folder from “retropie” to “retropie-mount”. Now when we boot up RetroPie, our USB drive will be mounted into the linux file system and NOT copied over.. pheww.
Aquiring game ROMs and BIOS ROM files
This part of the whole setup is a little shakey with regards to the law and most importantly, are you breaking it in your country?
You will need to do your research within your country as to whether aquiring game ROM’s and system BIOS ROM’s are legal but from what I gather, this is what is allowed/not allowed:
You are allowed ONE backup copy of a game ROM or system ROM.. if you already own it!
Let’s say you have a Nintendo 64 game cartridge of Goldeneye (a classic of course!) and you have a game ROM dump file of that particular game.
The backup file would be perfectly legal in this instance. But, if your game cartridge was shattered in to a million pieces, you will need to keep all of those broken pieces for the backup file to stay legal.
As with the system BIOS, I’m guessing this is the same. You will need to hold a genuine console in your possession for the BIOS ROM to stay legal.
Downloading BIOS ROM Files
Scroll down and find the BIOS section and if there’s an ‘md5’ number listed, then this is what your downloaded file needs to match. Note that not all systems need a BIOS file added.
To check the md5 of a file in linux, use the command:
where name_of_file_here.bin would be your BIOS file name. Then we just match the number with the number from the wiki page.
md5sum is usually already installed in your linux system.
MAME and Arcade ROMS
MAME is in constant development and is improving over time. However, as newer versions of the software are released, it require’s newer, and more powerful hardware to run the game ROM’s.
There are many problems with running MAME on a Raspberry Pi.
Firstly, MAME2003 has been chosen as the optimal version to work on this single board computer. But even this doesn’t stop many of the game ROM’s from working correctly, or not at all.
The unique thing about MAME is that each version has been created for a specific set of game ROM’s. All of these ROM’s need to be together in what is called a ROM set.
You will require the correct, specific ROM set for the specific version of MAME you are wanting to run.
MAME2003 has around 4007 ROM’s in it’s ROM set. After testing around 100 of these ROM’s on the RetroPie I found that over half of them did not work. I wasn’t willing to have such a huge collection of games where only but a few would work.
Many retro arcade machines had their game ROM’s stored in ROM chips (integrated circuits). This was fine for most games at the time as these game ROM’s didn’t require much memory.
However, some of the bigger games with bigger budgets had hard drives in the arcade machine. This allowed for more memory to be stored.
They usually had the games startup files stored in the ROM chips and the bulk of the games memory would then be ran from the hard drive.
Notice how the CHD file is over 5GB in size, yet “File Size” states 1.4MB (This is referring to the game ROM which holds the startup files).
You will need BOTH of these files for the game to run.
Parent And Child ROM’s
Some Arcade games work perfectly fine on their own. But some game ROM’s require other game ROM’s to work.
These are known as Parent and Child ROM’s.
Choosing Alternate Emulators
If the game fails to start then it’s a good idea to try another emulator.
To try another emulator all you have to do is press the correct button on the controller when the game is loading up, right after you selected it.
For me, it’s the circle button on the PS3 controller. I would continuously press this button and when the new screen appears I can select an alternate emulator for that particular game ROM.
Web scraping game covers / box art
Web scraping for box art is the process of using an automated script/tool to search the internet or a particular website and find the correct images for your game ROM’s.
The default website and the one I would recommend is TheGamesDB.
What I would say here is make sure you have all of your ROM’s ready to be scraped! This may seem obvious but there were so many time that I had spent hours scraping covers, only to move ROM’s around and then I would have to scrape all over again!
The reason for this is:
a) I re-ordered my ROM’s in to categories (folders) of Japan games and English language games.
b) Many of my ROM’s were not named in an agreed standard format. There are a few standards that ROM’s can be in and the one that come’s to mind first is No-Intro.
These standards were created as to be recognised by automation tools. The naming convention would have the country region in brackets, such as: “(USA)” and languages such as: “(En,Es,De)”.
So after renaming your whole ROM collection.. :/ or re-downloading a more conventionally named ROM collection (which is what I done and I would recommend).
Fixing Performance Issues
Chosen Theme & VRAM
I mentioned at the beginning of this post that I used a Raspberry Pi model 3B.
I did stumble upon some major problems in the early day’s of my RetroPie setup and if I hadn’t have been able to fix those problems then I most likely would have not continued on with the project.
The main problem was that scrolling through the emulators in the front-end (Emulation Station) was very slow and it needed several seconds to load art work. This could be seen as white boxes on the screen.
Through some research I found out that this could be caused by a theme that’s heavy on memory and that the issue only lies in the front-end with no problems during the games them selves.
I was using the theme “Back2Basics”. What I needed to do was change the VRAM settings. This was trial and error for me to find that ‘sweet spot’ and eventually I settled for 370 as the system was now working flawlessly at this point! 🙂
You can change the VRAM settings in Emulation Station by bringing up the Main Menu (Usually by pressing the ‘Start’ button), navigate to ‘Other Settings’ and you will find ‘VRAM Limit’.
Limit Menu Entries
Another performance limitation that I came across was the amount of menu items in Emulation Station. I discovered that at 25 entries, the system just crashed onto it’s knees. At 24 it was still a little shakey, and so I finally settled for 23.
With our shiny new HD TV’s at home, looking back at most of the graphics on these retro games will look very blocky because of the higher resolution.
I know that when I first started playing games on the RetroPie I thought to myself “Wow I don’t remember the graphics being this terrible!” That’s because they were not this bad back then!
Most (if not all) of the games that were not hand-held based were designed for a CRT (Cathode Ray Tube) glass monitor/TV and so these older displays blurred the graphics of the games.
In order to re-create that look and to blur the images a little we use shaders.
It’s up to you, the individual on which shader to apply to a certain emulator as it’s all personal preference.
There are many shaders to choose from and I would encourage you to experiment and see what suits you best.
Saying that, I will give you my personal preferences of what I thought worked best.
For CRT based games such as Arcades, Sega MasterSystem, SNES etc I used the “crt-pi” shader as this gave the lined effect of a glass CRT screen.
As for hand-held gaming console emulators such as the GameBoy Advance I was swaying between many.
The shader named “lcd3x.glsl” would give the graphics small squares and the image looked a little more rounded. However, I would need to sit far back from the TV to make it possible to play.
The other shaders I like is called “super-eagle.glsl” and “hq4x.glsl”. Non of these were perfect, but I guess these games were designed for screen sizes of a few inches, not 40-52 inch!
To change an emulators system-wide shader settings and have these changes set every time you start a game for that particular emulator, navigate to RetroPie’s config menu and select “retropie setup”. Once the dialog box appears with the blue background, navigate to: Configuration / tools > Configedit > Configure basic libretro emulator options > then select your chosen emulator. Make sure “Video Shader Enable” is set to “true”, then select your chosen “Video Shader File”.
RetroArch Menu (in-game menu)
If you just want to test out different shaders without making any permanent changes then you can do this in the RetroArch menu.
The RetroArch menu is accessed during a game. The buttons to press will depend on how you mapped your controller buttons, but for me I press the hot key and triangle on a PS3 controller.
Once in the menu, near the bottom of “Quick Menu” you can navigate to “shaders”, select “shader #0” > shaders, then select your chosen shader.
The Bezel Project
Because most of the games and gaming systems that we will be playing were released long before any widescreen TV’s were created and flooded our homes, the screen aspect ratio means that there will be black, empty borders on the left and right side of our screens.
The Bezel Project is a Github project for the RetroPie and once installed, it will create game art to fill in this black area and is an amazing final touch to the RetroPie and highly worth checking out and implementing.
It’s not difficult to get setup and you won’t be disappointed with the results.
The Bezel Project can be found here and a screenshot can be seen in the image below.
Run Command Splash Screens
When ever you start up a game ROM you may notice a very ugly looking screen about pressing a button for config options. It’s possible to add a different splash screen image of your liking to each emulator you have on the system.
All you need to do is find a picture that you want to show up and call the file name either “launching.png” or “launching.jpg”.
Next you will need to move/copy this image file over to the path: “/opt/retropie/configs/SYSTEM_NAME/” where SYSTEM_NAME would be the emulator you want that image to show up, when you begin to run a ROM.
There’s some really cool images made by fans that have been created specifically for this purpose but use your imagination here and see what you come up with.
Fore example: You could have an image of the SEGA logo show up for a few seconds when ever you start up a SEGA Mastersystem ROM.
Finnishing up (Optional Extra's)
If you’re gonna let the kids play on your RetroPie (This includes your friends, your parents, spouse, relatives, cat and dog) then it’s probably a good idea to lock things down as to avoid any unwanted changes to the system.
CHANGE THE DEFAULT PASSWORD FOR USER : PI
This one should certainly be done and I wouldn’t consider this to be an option but it needs to be said (can you tell by the uppercase heading?!).
Get into a terminal and enter the following command:
You will be prompted for your old password and to enter a new password twice. The default password for the default user of pi is: raspberry.
Disabling internet access
After spending so much time on your pie and getting everything working perfectly, the last thing you want to happen is any software updates. The emulators alone are usually in heavy development and so any software upgrades could potentially break things.
Before I came up with a solution, my first step was to remove my wifi settings from the configuration menu in the front-end (emulation station).
My solution was to bring down the ethernet and wireless adapters during the boot process.
All I did was added the following two lines:
ifconfig wlan0 down
ifconfig eth0 down
to the file:
before the line:
Then I tested this by rebooting the system. When emulation station has loaded up again I pressed F4 on the attached keyboard to bring up a console, then type the following on the command line:
If eth0 and wlan0 are not shown in ifconfig output then it looks good. No internet access available. You could always try to ping an online server if you’re REALLY paranoid, with the following command:
And use: Ctrl+Z to stop the command.
Place into Kiosk Mode
Another, very recommended setting is to place the system into Kiosk mode.
This should stop any unwanted changes to system settings by anyone who shouldn’t making those changes. It’s very easy to switch to the “Full” mode again for anyone who knows the button combination.
Instructions for your end-users
Add some killer background music
I’m a BIG Sega fan and it’s disappointing that the Dreamcast emulator isn’t up to scratch just yet and that the Saturn cannot be emulated on the Raspberry Pi due to hardware requirements.
I would like to build a “Retropie 2” in the future with the addition of Playstation 2, PSP, GameCube and many more emulators but I highly doubt it will be on a Raspberry Pi and it would be a costly build (but looking forward to it!).
The team of RetroPie, Emulation Station, RetroArch and everyone involved have made an amazing achievement here and I would like to take the time to thank them all for their work and keep our gaming history preserved. Thank you.
Hopefully by now you have a good understanding of what it takes to build a high quality, respectable looking and working RetroPie.
Some of the tasks that I mention here had taken me hours and even days to figure out, so I’m hoping that you won’t have to endure the same agony as me and hopefully the whole process should go a lot smoother for you.
I couldn’t possibly mention every tiny detail about the whole build but I’m pretty sure that I’ve covered the most important aspects and I’ve given some important info that will certainly help you in your retro gaming journey.
Good luck with your build.