Before we begin you need to gather the following items. All these items can be ordered from Hardkernel:
- ODROID-N2 (2GB of RAM) - ODROID-N2 Case - 64GB Micro SD Card x2 - HDMI Cable x1 - Power Supply 12V/2A x1 - GameSir Wired Controller x1 - A 16GB or 32GB eMMC Memory Module - A Micro SD to USB Adapter - An eMMC to Micro SD Adapter
Introduction and Tutorial Goals
This tutorial covers the process of setting up an ODROID-N2 with 2GB of RAM and iInstalling Batocera Linux so we can use our ODROID-N2 as a TV retro gaming console. I lovingly call this device the Monku R4. I will cover setting up the operating system, setting up the ROMs and BIOS files, and I'll cover getting box art and screenshots for your ROMs. In my opinion this is the BEST retro gaming console you can build for your money. It runs a ton of emulators and it runs them all very well. Let's take a look at some of the emulators it will run. I've personally set one up to run the following emulators.
- Atari 2600
- Atari 5200
- Atari 7800
- FBA MAME
- Game Boy
- Game Boy Advance
- Game Boy Color
- Magnavox Odyssey
- MSX 1/2
- NEO-GEO Pocket
- NEO-GEO Pocket Color
- Sega 32X
- Sega CD
- Sega GameGear
- Sega Genesis
- Sega Master System
- Sega SG-1000
- Turbo Grafx 16
- Turbo Grafx 16 CD
- Virtual Boy
- WonderSwan Color
- ZX Spectrum
A note about cost: I say in the title that this is the best retro gaming console you can build for under $100, however, you would have to get only one 64GB SD card, and the smaller eMMC module to keep the price around $100. I do recommend getting the dual pack of 64GB SD cards because you can make a backup. Now that you have an idea of what you're working with, and just to be clear the ODROID-N2 is much more powerful than the ODROID-XU4 (Sorry ODROID-XU4 fans), I'm tailoring this tutorial to use an eMMC module as the bootable OS drive to get even more performance out of the ODROID-N2. You can decide to run things entirely off a micro SD card or a larger eMMC module, if you see fit. I won't cover these in detail but you can take different parts of the tutorial and apply them to an SD-card-only or eMMC-only implementation. The separation we have between the OS and the ROMs allows us to keep the SD card separate from the OS and on a Fat32 filesystem. This means we can pop out the SD card and plug it into any computer and edit it, as needed. It is a bit more difficult to do the same thing with a bootable ext4 Linux filesystem for the Mac OS or Windows PC. TIP: If you are opting for a single storage install, only eMMC or only SD, then you will most likely have to login to your device via SSH at some point in the setup process to configure it. The default root password for the device is Linux.
Setting Up the eMMC Module
Let's take a look at the hardware we'll need to write to the eMMC module. Below is a picture of the eMMC to micro SD adapter. Below that is a picture of the adapter and the eMMC module. I'll be using a 32GB module, but you really only need a 16GB module because we're going to use it to house the OS. If you want to perform a more advanced setup with ROMs in multiple locations, eMMC and SD, then you'll probably want a 32GB or larger eMMC.
If you are new to eMMC modules I recommend going through the following tutorial as I'll only cover the image writing process here and not any eMMC specific steps.
You'll want to get a copy of the latest version of Batocera Linux for the ODROID-N2. Batocera Linux is based on Recalbox Linux so if you're familiar with RecalBox then you are ahead of the game. Use the links below to locate the latest version of Batocera Linux for the ODROID-N2 and download it. TIP: While this tutorial focuses on the ODROID-N2 you can use it as a general guide for installing Batocera Linux on other hardware like the ODROID-XU4.
Once you've got your image ready it's time to get some software that you can use to flash the eMMC module. If you are using a Mac I recommend getting Balena Etcher. It works great and I highly recommend it. If you're using Windows you can grab a copy of Win32 Disk Imager. Though not as pretty as Balena Etcher, Win32 Disk Imager gets the job done. For Linux users you'll have to perform the following steps. Don't worry it's not too bad.
1. Insert your SD card into your computer. 2. Locate the device, by running sudo fdisk -l. It will probably be the only disk about the right size. Note down the device name; let us suppose it is /dev/sdx. If you are in any doubt, remove the card, run sudo fdisk -l again and note down what disks are there. Insert the SD card again, run sudo fdisk -l and it is the new disk. 3. Unmount the partitions by running sudo umount /dev/sdx*. It may give an error saying the disk isn't mounted - that's fine. Copy the contents of the image file onto the SD card by running
$ sudo dd bs=1M if=your_image_file_name.img of=/dev/sdxOf course, you'll need to change the name of the image file, as appropriate. You'll also need to adjust the destination argument, of, to match the target device in your environment. ALERT: Ensure the drive, device, drive letter you are flashing are correct. Make sure you are not overwriting another important drive! I'll include images of the process as it looks on Mac. You may be prompted to gain admin privileges on Mac and Windows.
Select the image file that you want to flash to the eMMC module. The image file depicted below is not the file you'll be using for this tutorial. You'll be using your Batocera Linux ODROID-N2 image file.
On a Windows PC, if you're using the software tool listed above, you would see something like the following before clicking the Write button. Again wait for the tool to finish writing the image to the eMMC module. Also, the image file depicted below is not the file you'll be using for this tutorial. You'll be using your Batocera Linux ODROID-N2 image file. ALERT: Make sure that you choose the correct drive letter. Triple check the letter so you don't overwrite another important drive!!
Next let's boot up the device and test out the OS. The image below shows the ODROID-N2 with a red arrow next to the eMMC module slot and a blue arrow next to the SD card slot. If you're going the micro SD card route you'll need to remove the card while setting up the case.
Connect the eMMC module to the ODROID-N2 as shown below and prepare a static free surface for the device. You'll want to get your 12V/2A power supply ready.
Make sure you have the white switch on the back of the ODROID-N2 pushed all the way to the right to boot off of the eMMC module. Push it all the way to the left to boot off of the micro SD card. In our case we'll be going with pushing it to the right to boot off of the eMMC module. We'll still be able to access the micro SD card as a drive.
Plug in the power supply, plug in the HDMI cable, hold your breath and with any luck you'll be looking at a screen similar to the one depicted below. Nice!
Turn off the ODROID-N2 by exiting out of the device using a keyboard. Or, if you have your game controller handy you can configure it via the Batocera Linux UI and then power down the device. I'll be covering how to configure things in detail in just a bit. That brings us to the end of this section of the tutorial next up we'll be setting up the case and then moving on to some configuration and customization topics.
Putting Together the Case
The case is actually ingeniously designed as you'll come to see. One thing that is cool is that the whole thing rests on a heat sink. That's right, the bottom of the N2 is a big heatsink but it also acts as a really solid base for the device. TIP: Use black electrical tape and place 4 pieces on the base of the ODROID-N2's heatsink, the two main pieces of metal that actually touch the surface it's resting on. Place one piece near each of the four corners. This will create a softer contact with different surfaces and also prevents sliding. Lay out the ODROID-N2 and the parts of the case as shown below.
There is a little ridge on the left and right edge of the ODROID-N2, take the smaller case top - the one on the left in the image above - and slide it onto the ODROID-N2 being careful to keep it on the guide ridges. The image below shows the smaller front part of the case in position and the guide ridges.
Next slide in the larger case top till the two meet. Make sure to keep it straight while pushing it gently along the guide ridges. The two case top pieces will meet and click together with a small clasp. Viola, the case is done!
Case closed, lol. Ok so now that we have the ODROID-N2 properly housed and protected, replace your SD card, if you're using that method, in the slot on the back of the case. Boot up the device one more time to make sure everything is in order. That brings us to the end of this section. Next up we're going to work on configuring our micro SD card as an external filesystem that Batocera Linux uses for accessing ROMs. I'll also cover setting up controllers, advanced Batocera Linux configuration options, and grabbing ROM box art in this tutorial.
Configuring the Controller and Micro SD Card
First let's get the controller configured. If your controller isn't working the way you expect, you can use a USB keyboard to navigate the main menu. Try pressing the start button or equivalent on your controller this will bring up the main menu. You can also use a keyboard and press the spacebar to bring up the main menu. The GameSir controller we recommend here has a start button. You should see something similar to what's depicted in the image below. Select the Controller Settings menu option. TIP: If you are using a keyboard to navigate the menu system, the enter key is used to make selections, the esc key is used to go back to a previous menu, and the space bar is used to close/open the menu system. Next you'll want to select the Configure a Controller menu option. Selecting this option will bring up a controller configuration screen. You can exit this screen by hitting the start button or the space bar a second time if you already have your controller configured or you accidentally selected this option again after configuration. You will be prompted to hit certain buttons on the controller in series and then you're all set. That's it. It's very easy to do. Below is a picture of the controller configuration prompt. TIP: Pressing the blue GameSir controller button and the start button at the same time will exit out of the current running emulator. You may need to configure this differently for different controllers. TIP: If your wired GameSir controller isn't being recognized by the system hold the blue button down for a few seconds until the little red square on the front of the controller moves over to the second position. If it still isn't recognized try position three, then position four.
Next thing we're going to do is setup the micro SD card to work with Batocera Linux. I recommend using a 64GB card and getting a pack of two. There are links above for the ones I use. They are affordable and reliable. Plug in the micro SD card and then bring up the main menu using the start button or space bar. Select the System Settings options as depicted below.
This will bring up a selection box that lets you choose from a few different storage locations. Pick the entry that has the same name as the micro SD card you put into the ODROID-N2. The system will now reboot after you select the drive. During this reboot Batocera Linux will create, on your micro SD card, a new filesystem that will hold all the ROMs, BIOS files, and configurations for the emulators you want to set up. That brings us to the conclusion of this section of the tutorial. We now have a bootable version of Batocera Linux running on our ODROID-N2 device. We have a configured game controller, and we know how to navigate the menu system. We also have an external file system, our micro SD card, prepped and ready for ROMs and BIOS files.
Adding ROMs and BIOS Files
Now we are ready to add ROMs and BIOS files to the micro SD card that we set up with the Batocera Linux external filesystem in the last section of the tutorial. You will need an adapter to connect the micro SD card to your PC or Mac so that you can copy and paste the files into the proper directory. Below is a picture of the contents of the root folder which is named batocera.
Notice that you have some other options to use on your Batocera Linux device like Kodi for music and videos. For our purposes though we're mostly concerned with the ROMs folder. Open up the ROMs folder and you will see a directory for each supported system. Now I'm not 100% sure if every emulator runs on every piece of hardware that Batocera Linux can be installed on but certainly all the best ones do. Copy and paste your ROMs into their corresponding directory. If you have a question about where to place ROMs for a certain system just look it up online and you should be able to locate the proper folder. You can also read the _info.txt file in each ROM folder to see what system it supports.
Next you're going to have to locate the proper BIOS files for each system. I can't post them here but they are easy enough to find online with a little searching. Back out of the roms folder and open up the bios folder. In the folder there will be a text file called readme.txt. Open it up to see what BIOS files go where in the bios folder. Most should be placed directly into the bios folder, some will be placed into the same directory as the ROMs, the readme.txt file will tell where to place them and what files you need. TIP: Not every emulator is finicky about BIOS files and will run fine with good files even if they don't have the same MD5 hash. Test each system to see which ones are having a problem. For the problem systems, carefully review your BIOS files. You'll have to find an online tool or utility to get an MD5 hash, Mac and Linux users should have an MD5 CLI command. Once you locate the correct files place them into the proper folder and retry that system until it works.
You can actually ask Batocera Linux which BIOS files are missing. Go to the Game Settings option of the main menu as shown below.
Scroll down the Game Settings menu option and locate the Missing Bios menu option as shown below.
A popup will appear with a break down of the missing BIOS files for each system. You can use it as a reference for the systems that you are having trouble with.
There is just one other thing I want to cover in this section of the tutorial, advanced system settings. If you navigate back to the System Settings menu. Navigate down to the Developer menu and select it and you'll be taken to a menu where you can adjust some lower level settings. I recommend the following settings.
VRAM: 50MB Show Framerate: OFF VSYNC: OFF Preload UI: OFF Threaded Loading: OFF Async Image Loading: OFF Optimize Images VRAM Use: ON Optimize Video VRAM Use: ON
The images below show the Developer menu and the advanced configuration options.
I've found that without using some of the above settings the system can crash sometimes during fast scrolling. Also I decided to use a smaller amount of RAM so that the emulators have more RAM to use. The UI seems to run fine with 50MB, background music and ROM art work great.
Getting ROM Box Art and Screenshots
The next step in our project is to setup all the ROM box art and screenshots. Go to https://www.skraper.net/ and download the latest copy of the software. You'll also need to get an account at https://www.screenscraper.fr/. Please donate to both sites, if possible. They are awesome and really help make retro gaming consoles even more amazing by providing access to box art and screenshots for a ton of games. Once you have your account setup fire up the Skraper UI program and enter in your screenscraper.fr account information. Test the account to make sure that it is working properly. You should have a screen similar to the one depicted below.
Click on the wizard button on the lower right hand side of the program's UI. You will be prompted to enter in your screenscraper.fr, and select the target ROMs folder you want to process. You should have your micro SD card connected to your computer and you'll want to find and select the roms folder where you pasted in your ROM files. The software will automatically determine each system that has ROMs and run a check against each game to see if there is any artwork available for that game. TIP: Don't run the wizard against all your systems. Things can break and then you won't get the proper results. Run the software one system at a time. Sometimes if you don't get ROM art results wait a few hours and try that system again. This approach worked for me and I was able to get nice results for all of my systems. The wizard button is depicted below.
The type of artwork that the software builds is really quite awesome. Take a look below at a sample of the default graphic it will generate for you.
Once you have collected all the ROM box art and screenshots you have to adjust one UI Settings option. Select the UI Settings main menu option and scroll down to the Parse Gamelists Only option and set it to on. This will make it so that the UI only shows the games in the gamelist.xml file. If you use the box art scraping software you will have good XML files and should use this option. You can always adjust the games in the XML files by hand if necessary.
That wraps up our build tutorial for the Monku R4 / ODROID-N2 retro gaming console. A screenshot of what the UI looks like is shown below. I hope you enjoyed it and that it helps you to build an awesome retro gaming system. For advanced emulator configurations look at the next section in the tutorial.
Advanced Emulator Settings
This section is an add on and contains information on how to get specific emulators up and running and ensure they are stable.
Problem: Games start to load up and then crash after a few seconds.
Solution: Get the US set of BIOS files and make sure they have the same hash code as required by Batocera Linux. You can check BIOS issues using the menu options listed in the tutorial above to see which files the system expects.
Problem: Games either crash with no display or they get to an emulator error screen saying there was a loading issue.
Solution: Use a single game to get into the emulator menu where you can then load different ROMs and change the cartridge type. For me the game that worked the best was Asteroids. It will error out but in the emulator menu you can select the directory to look for ROMs, this should be a separate directory than the Batocera Linux one. You should only have your launch title in the Batocera aware directory. You can also change what cartridge type should be used to load in a ROM using the emulator options. Choosing the Atari standard usually fixes any ROM loading issues. It is a bit strange but setting it up this way will ensure that games load and you have control over how they are loaded up.
Problem: The emulator runs in a small square on the bottom left hand side of the screen.
Solution: Cancel out the game load by hitting the B button. You should be able to get into the emulator options. Under the video/screen settings choose full screen. Then back out to the main menu and go to the settings management option to save your settings. This will ensure that the emulator will start off in full screen mode every time.
Problem: Your Sega Genesis games are crashing and are not stable.
Solution: Load up the SD card on a Windows machine or a Mac. Go to the folder batocera/system/batocera.conf. Scroll to the bottom of the file until you see megadrive entries. Add in the following lines: megadrive.core=picodrive megadrive.emulator-libretro This will force the system to run the ROMs using a different emulator that isn't selectable from the UI menus. Your games will be more stable and you should have no more issues.
Problem: Your Nintendo 64 emulator crashes on exit and Batocera Linux fails to load up again.
Solution: Set the default emulator and core for Nintendo 64 ROMs to emulator libretro and core parallel_n64. This combination has worked great for me. I can exit out of the N64 emulator and get back into Batocera Linux to choose a new system to run.
You can login into your box over the network using the default root login, username: root, password: linux.
This article was adapted from middlemind.net, for more information or to view the original source please see: http://middlemind.net/tutorials/odroid_go/mr4_build.html