Retro Pie, Mame, and Romsets

Bart Simpson Playing Atari 2600 in Arcade

Retro Pie

I recently installed Retro Pie on an old Zotac Nano I have:
Zotac Nano Computer

What is Retro Pie ? It’s software that allows you to play tons of emulators of old game consoles, from home systems like the Atari 2600, Super NES, Super Nintendo, etc. to the old 70’s and 80’s arcade machines that you would find in the mall. It even has the ability to play emulators for old home computers like Commodore 64 and the Sinclair Z80.

More technically, the Retro Pie is a collection of emulators and scripts which use Emulation Station as a front end.
Retro Pie Arcade Stick Controller

Retro Pie Can Be Installed on Any Debian Based Linux Machine

Here’s a secret: while the Retro Pie is mainly geared to be installed on a Raspberry Pi, you don’t need a Raspberry Pi to install Retro Pie. You can install it on any PC that has a Debian based Linux operating system. Since I had installed Kubuntu on the Zotac Nano, I downloaded and installed the Debian/Ubuntu PC version of Retro Pie.

Downloading Roms for the Retro Pie

After installing Retro Pie according to the instructions, adding some themes (I settled on Cabsnazzy) and a set of Xbox 360 controllers, I downloaded some individual sample Roms to test the Mame emulator, an emulator that plays old arcade type games. What I discovered was that there are several different Mame emulators packaged with Retro Pie. For example, there is “mame4all”, “Mame 2000”, “Mame 2003 Libretto”, “Advance Mame”, etc.

What the Heck Are Romsets?!

Not any Mame rom will play in any Mame emulator. You need to install the correct “Romset version” of the Rom for each emulator. What does that mean ? Well, apparently various people have collected hundreds or even thousands of roms for a particular Mame version, customized them for that particular version of Mame, and packaged them into a “Rom Set”. The Rom Sets for each Mame Emulator are listed here at the Mame Retro Pie Wiki. To find a particular game and what RomSet it is in see here or here to download the entire lists of games for a particular Romset.

Where Are The Mame Romsets ??!!

The first test I did was to download the Rom Set for Mame 2003. This Rom Set is 0.78. The download links are found at archive.org. The non-merged set is the one that will work with Emulation Station.

For the Mame 2003 set (Romset 0.78, about 2 GB) the easiest way to download is in linux using the linux command line program “transmission-cli” which will download torrent files. Copy the TORRENT link shown on the archive.org page and use that with torrent-cli.

A Complicated Download Process for Mame Roms

For example, to download the 0.78 Rom set on your Linux command line type:

Once downloaded, unzip the downloaded file and move your selected roms to the correct subfolder in your Retro Pie install directory i.e., the “RetroPie/roms/mame-libreto/mame2003/” folder. Do NOT unzip any of the Roms. Copy the contents of the “samples” folder, to “RetroPie/roms/mame-libreto/mame2003/samples”.

Watch out for Mame Vector Roms

Note that any vector type games (e.g., Battle Zone, Lunar Lander, Red Barron) should use Advance Mame 3 which is optimized for vector graphics, not Mame 2003 or other Mame emulators where they will look fairly horrible, with the vector lines being blurry and black and white. Battle Zone will show black and white instead of the green that it should like the following screen shot:

Battlezone Screenshot

Advance Mame Romsets – a HUGE Download

For Advance Mame, you will need to download the Mame 0.106 Rom Set as shown on the Retro Pie Wiki.

Warning: The 0.106 Romset is HUGE – about 65.6 GB zipped.

Use 7Zip To Download A Huge Zipped Mame Romset Like The 0.106 Romset

Because of its size, the .106 Romset should be downloaded on Windows rather than Linux as the standard Linux zip programs do not handle multi-part zips well and a program that does, 7Zip only works on Windows.

Extract The Files from The Huge Rom using 7Zip File Manager

Once the .106 Romset is downloaded, download and install 7zip. Open the 7zip File Manager and navigate to the Romset download folder. For version 0.106 you will see that the zip has downloaded in 70 different parts! No worries, 7zip handles these as one zip file without having to actually combine them.

Double click on the “Mame0.106Non-Merged.zip” file:

Screeshot of 7ZIP Showing Mame 106 Files

Double clicking will reveal the contents of the “combined” zip file:

7ZIP Screenshot of Non-Merged Zipped Roms

Double click on that again and you’ll view the roms folder. Double click on the “roms” folder and you will see a list of the roms, most of them are zipped, but some are simply in subfolders:

7Zip Screenshot of Rom Subfolders

While you can extract all of the rom subfolder and zips for all of the games, you can also extract only those individual games that are needed. Just drag the individual subfolders or zip file for a particular game out of the 7Zip File Manage. Do NOT unzip any games roms that are themselves individual zips as they may not work in the emulator if they are unzipped and the Mame emalutor can read the zipped roms fine. For easy transferring to a linux machine, open up a WinSCP session and drop the rom subfolder or zip file into the appropriate folder on your Retro Pie machine (RetroPie/roms/mame-advmame/). As before, the files in “Mame 0.106 Non-Merged\Samples” would be copied over to the related samples folder (RetroPie/roms/mame-advmame/samples).

Unzipped Mame Rom Folders

That’s it – those are the basics of installing the correct romset for a particular Mame version.

Now enjoy some Mame !!

Spacewar Video Demo

most important and influential games in the early history of video games.”

Galaga Video Demo

NOTE: This post is for educational purposes only. The use of roms with the MAME or other video arcade emulators requires compliance with all copyright laws and licenses. Use of most Roms require an appropriate license. Read this FAQ for details.

ShareX Screenshot Tool and Torn Edge Effect

ShareX is a great free and open source screen shot tool that rivals TechSmith’s Snagit. ShareX is packed with features but not very user friendly. I wanted to have screen captures automatically add a “torn edge” effect to a screen shot similar to what Snagit can do easily. It took me awhile to figure out how to achieve the effect, and then some more time to figure out how to automatically apply it after a capture.

Torn Edge Effect

  1. Right click on the tray icon, select “Task Settings”.
  2. On the Task Settings dialog, click “Effects” under “Image”. Check the “Show image effects window after capture”. This will allow you to turn off the effect for a particular image:

  3. Click the “Image effects conafiguration …” button. On the dialog that appears, click “Add”->”Filters”->”Torn Edge”. Set the Depth to 8, Range to 5, Sides to Bottom, Right, and Curved Edges to False:

  4. Click “Add” again, then “Filters”->”Shadow”. Set those settings to Opacity 0.2, Size 10, Darkness 2, Color 165, 154, 154 (grey), and offset 5.0:

  5. If you’d like, experiment with the settings until you get the torn edge look you want.
     

  6. Make sure the Torn Edge and Shadow Boxes are checked, type the name “Torn Edge with Shadow” in the name text box in the top right, and click “Export” to export the settings to backup. Close the dialogs.
  7. Right click on the ShareX tray icon again, click on “After Capture Tasks” and click “Add image effects/watermark” to enable.

Image captures should now automatically result in the torn edge effect. You can follow the above steps to set other effects using the Image Effects Configuration” dialog.

Below is a YouTube video showing the same steps:

Updating an Old Music & Sound Intercom System with Skybell HD (Part 2 of 2) (or How to Have Skybell Ring a Virtual Doorbell Using Skybell Sniffer)

Introduction

In the first part of this two part post, I described how I used an old Music & Sound intercom system to power a Skybell HD without having to install a special adapter or a new transformer. This second part will describe how to have the Skybell ring a “virtual doorbell” by causing the Skybell button push to play a doorbell sound over speakers. This is an alternative to hard wiring the Skybell to an analog or electronic doorbell as intended by Skybell or using a service like IFTTT which results in a rather long delay between button push and response.

As background, when the button is pressed on the Skybell or when motion is detected, Skybell sends a message over Wifi through your router to the Skybell computers outside of your home network. While the messages can’t be read as they are encrypted, routers that allow ssh logins can run a tcpdump command to monitor network traffic and detect the button press. Once the button press is detected, a script can be triggered to play a sound file or perform any other action. This method results in a much quicker response time than monitoring Skybell’s cloud servers or using IFTTT.

Pre-Requisites

You will need the following to setup a virtual doorbell with Skybell:

  • A linux server running on your home network ( I use a Raspberry Pi)
  • A router which permits ssh logins (I have a router running dd-wrt firmware which permits ssh)

Installation

  1. Install Skybell Sniffer

  2. Install the Simple Skybell Sniffer following these instructions. This is a slight modification I made to a portion of a Skybell plugin to Homebridge which was developed by Thoukydides. My modification doesn’t require Homebridge and simply is intended to run as a service on a linux systemd based server (e.g., debian stretch). The Skybell Sniffer is a systemd service which runs a tcpdump on your router through an ssh command. The service monitors the tcpdump output and then runs the command you specify when it detects a message indicating that the Skybell button has been pressed. Since the message is detected before it leaves your network, the response time is much quicker (1 to 2 seconds) then having to rely on IFTTT or having to monitor Skybell’s cloud service.

    Once Skybell Sniffer is setup and running, we need to set up the action part of the process. The simplest action would be to play an MP3 file of a doorbell ringing and play that over a speaker connected to your Raspberry Pi through the 3.5 mm jack or through blue tooth. However, I have a number of Google Assistant minis and a few Chromecast audio devices throughout my house and I wanted to cast the doorbell sound over those devices. After some research I discovered harperreed’s Google Home Notifier Webservice. This service allows one to cast an mp3 file on any Google Assistant or Chromecast Audio device on your network. It also allows you to have Google Asssistant say any text you want, e.g., “You have a visitor at the door”, however I have found this service to be unreliable at times so I haven’t included it in this write-up but it is explained in the Google Home Notifier readme.

     

  3. Install Google Home Notifier

  4. [NOTE/UPDATE: I no longer use the Google Home Notifier as it was unreliable. I now use skybell-sniff to run a script that publishes an mqtt topic to Home Assistant. See this revised github post (geekvisit/simple-skybell sniffer) here as well as further instructions in this skybell-actions.sh file on github – this method is much recommended over the below which seems to break every few days. I’m leaving the below only for those who want to try an alternative method or don’t want to install Home Assistant. ]

    I downloaded Google Home Notifier Webservice, renamed “main.py” to “gnotify.py”, edited gnotify.py to specify the name of the Google Assistant device I wanted the doorbell to play on (e.g., “Living Room Mini”), downloaded a doorbell.mp3 sound file that I found on the web and placed it in the “static” subfolder, and then followed the “getting started” instructions to install:

    To have the Google Notifier start up each time the Raspberry Pi boots, I added the following to my crontab:

     

  5. Specify Doorbell Action

  6. I then edited the Skybell Sniffer “skybell-actions.sh” script (path is contained in the last line of /etc/default/skybell-sniff) to add the action I wanted to perform on the press of the door bell – playing the doorbell mp3 file I downloaded:

That was it. The system works fairly well and I have been using it for several months.

There are several advantages and disadvantages to this setup over a hard wired connection to a real doorbell as set forth in the Skybell documentation:

Advantages:

  • No separate analog or electronic doorbell required
  • Infinite actions, sounds, and notifications be triggered

Disadvantages:

  • Requires a full time Raspberry Pi to be running ( I don’t find this to be a problem as the pi is low in electricity usage and I already use one for HomeAssistant, I do recommend the Raspberry Pi 3 on up as the prior versions are less stable. I have found the 3 to be rock solid.)
  •  

  • Relatively complicated – several things can go wrong – wifi could fail, the Pi could fail, the PI could be unplugged, the software programs could stop, someone could turn off or down the speaker and/or Google Assistant/Chromecast Audio device

Despite the disadvantages, I have found this system to work relatively well over the course of several months. The biggest issue has been some instability in the google notifier but I believe I have ironed those out in the scripts. If the doorbell does appear to fail,then simply restart your google notifier by executing the following commands:

TIP: Configure your router so that the Google Home or Chromecast Device you are casting to is assigned a static IP based on the mac address shown in the Google Home app. This will solve an issue where the device may intermittently go offline.