Wednesday, November 12, 2014

Budget Retro Gaming Console Build

The following is an explanation of a budget console (PC) build to be used solely for playing retro video games. (NES, SNES, Genesis, N64, PSX, etc) The idea is to make this as cheap as possible, while retaining the ability to emulate all of these systems.

Background

I have used the very popular Raspberry Pi computer for a number of projects.  In a word, its awesome.  The simplicity and the huge community of users make it a great way to get into linux and PC projects as well.  

After a couple years of messing around with my RPi (model B), I found out about the RetroPie Project .  So I immediately installed the Distro and spent hours configuring and setting up the different emulators.  After a good bit of messing around, I had a RPi that was set up as a retro gaming console.  After overclocking and overvolting I was able to even run certain PSX games (Crash Bash! Great game, tons of fun with friends).

I tried getting N64 to work but to no avail.  It was just a little too under powered.  To that same extent, most PSX games didn't run 100%.  

On top of the performance issues, the overclocking and overvolting made the 'Pi unstable.  60% of the time it would fail to boot properly.  Even with all of this in mind, I still considered it a success.  Its amazing what that tiny single board computer can do and all for $35!

So I eventually decided that if I was going to completely satisfy my love for retro gaming I would have to build another system.  Instead of just slightly upgrading to a 'Pi competitor with slightly higher performance, I chose to go all in and build a PC that could do what the 'Pi does and pick up where it left off.  

I chose all of my components and software based solely on what I had laying around and what I was familiar with.  I'm sure there are other ways, maybe even better ways, of doing this.  This is just what I did.  Hopefully this will help the next person looking to satisfy the hunger for Mario Party 64!

Requirements of Build

Cheap!  I wanted it to be as cheap as possible, so I used as many parts as I had laying around as possible.

HDMI - It's supposed to emulate a console, so it needs to seamlessly work with my TV.

No Mouse/Keyboard - Only control would come from gamepad.

Look like a console - This was optional.  Really I just wanted something that didn't look like a big desktop computer sitting next to my TV.

Hardware

Processor/Motherboard/RAM:


I bought my motherboard and processor as a bundle from TigerDirect at their retail store.  (Awful customer service, took 4 times of asking for help for someone to finally come over and unwillingly help me.  YMMV)  For $89 I got:

AMD A6 5400K (Dual Core 3.6GHz)

GIGABYTE GA-F2A58-HD2  (micro ATX)

Plus $30 for 4GB of RAM  (I don't remember what it was, but it really won't matter as long as it matches the rest)

So I'm up to $119 (plus tax).  You can probably do a little better than this if you shop around.  

Drives:

I had a 160GB 2.5" HDD laying around, so I used that.  You can buy one if you'd like.  (Check craigslist.  I have since bought a couple 80GB for $5!)  Just make sure its a working SATA drive.  

Optical drive?  Hell no!  What is this 1995?  USB/Network will do everything you need.  If you really feel the need to have one, (or you use an emulator that can read actual disks) then go ahead and grab one.

Case/PSU

XION XON-720P   $30 on eBay.  (link is to newegg for $40)

You could go with any case, I thought this one looked "console-ish".  

Grand Total: $150  (plus tax)  

Could have been cheaper, but I'm not going to complain.  The CPU is actually wayyyyyyy over kill for this application.  You could probably get away with something cheaper and smaller (mini ITX)

Additional Hardware:  


USB keyboard
USB mouse
USB gamepads  

Get them wherever you'd like.  For the controllers, I use:  Logitech F310,  They work without any drivers or messing around.  Likely, you can use any USB controllers you'd like.  I had these around.  But I'm pretty sure Best Buy sells them locally.  

Software

OS


I'm a Mac and Linux guy so I used Ubuntu 14.04.1 x64.  You can probably(?) do this with OSX or  Windows but I have no knowledge of it, so I'm going to explain this as if you are building along with me from a fresh install of Ubuntu.

Why Ubuntu?  Its free!  And awesome.  And it worked.  That simple.  I tried Debian and I could not get it to run smooth on this processor.  I was probably doing something incorrect, but whatev's.  Ubuntu is also very "familiar looking" if this is your first run with Linux OS.  (Hopefully its not your last.)  

Note: Only use the x64 if it'll work with your system.  If you use the hardware I listed, then you'll be fine.  But it may not work on other hardware.

Emulator(s)

RetroArch (libretro)

RetroArch is what is included in the RetroPie distro.  I was familiar with it's setup/config so I stuck with it.  It works well.  To be honest, I have yet to find a game that didn't work on it. 

It's capable of emulating a bunch of different systems.  For the purpose of this article, I am only going to cover: NES, SNES, Genesis, PSX (the tough one), and N64.  But you can emulate any other supported system following the same instructions.


Front End

EmulationStation

The "front end" is going to be the software that you see when you first start up the "console".  It'll be where you select which system, and then which game you want to play.

EmulationStation looks great.  It's simple yet effective, plays nice with RetroArch (important), and has a built in rom "scraper".  I'll discuss this last part later.

But what about the OS?  The OS is hiding in the background.  Remember we want this to look like a game console and not a PC.  On the RetroPie, the GUI (graphical user interface) of the OS doesn't even start up upon boot.  That's done for 2 reasons: 1. it's not needed and 2. it's a waste of resources.  On the 'Pi, resources are a premium.  No need to dedicate them to something you won't even really be using.  

For this build, the OS and the GUI will run in the background.  EmulationStation will not run without the GUI being present.  I can't tell you why or how to fix that.  I'm sure someone can.  I tried. I failed.  I found a way around it.  (That may be my life's motto.)

Pics of EmulationStation in action:

EmulationStation System Select Screen

EmulationStation Game Select Screen


Build

Assemble the computer.  Follow the instructions given with the motherboard and processor.  There is tons of info out there on the google-machine that'll help with this.  No need for me to half explain it.

My advice:  Take your time!  Read and then reread.  One screw up and you'll be starting over from scratch.

Once the PC is built and ready to roll, we'll start installing software.  You'll need access to another computer in order to get the OS.  Grab a beer, the software is the hard part.  



Finished Product


Note:  Make sure your keyboard, mouse, and network connection are plugged in for the next part:

OS Install


On a separate computer: 


Chris: "Google, how do I install Ubuntu from USB?"  

Google: "You're an idiot.... Read This!"

Chris: "Next time I'm using Bing."

Google: "I Doubt it"


As you can see, Google can be a jerk sometimes and Ubuntu has a nice tutorial on how to make a USB install disk.  I used the Mac method, but they all do the same thing.  Just make sure you use the 14.04 image that you downloaded above.

After the USB is created, plug it into your fresh PC build and turn it on.  

If it didn't explode, you're off to a good start.  If it did, better luck next time.

Assuming the HDD you plugged in is empty, then it should immediately boot from the USB.  If not you'll have to press F12 during the boot process and change the boot order.  (Once again plenty of instructions on the internet for this.)

Eventually you'll see the Ubuntu install screen.  Follow the onscreen instructions:  

  1. Choose to erase the existing hard drive and install Ubuntu.  We don't want the PC to prompt which OS to choose at the beginning of the boot process.  
  2. Choose to download updates during install
  3. User Name: [your first name] (e.g. chris, You will need to type this a lot so make it short)
  4. Computer Name: emulator (case sensitive, Using this will make it easier to follow my instructions)
  5. Put in password
  6. Write down password
  7. Remember login name and password!
  8. Choose automatic login
  9. After the install you will be prompted to restart your computer.  You will need to remove the USB drive and hold the power button on the PC to restart it.  
At this point you should be staring at the Ubuntu Desktop.  Now we are going to set it up for our needs.

First and foremost, go to the top right corner and click on system preferences (or settings, whatever it says).  Go to appearance and change the desktop background to BLACK.

Then while you're in there, change the Launcher to autohide and turn off the "lock" function and the require password after awakening.  We won't have a keyboard to put a password in.  

Note:  After you select a game to run in EmulationStation, it's window is closed and there is a slight pause before the emulator window is opened.  During this pause, the desktop is shown.  Changing the background to black and autohiding the launcher simply makes the "desktop" less apparent.  

Next, go to the little finder icon (insert real name here) at the top of the launcher.   Type Terminal.  Grab the terminal icon and drag it to the left and side to the launcher.  It should place a terminal shortcut on the launcher bar.  If it didn't, try again.   We're going to use this a lot and it makes it easier to find this way.  

Alternatively, you can use the ctrl + alt + t shortcut to bring up a terminal window, but who has the time now a days?


Important Notes: This is mainly for new linux users, but its a good reminder:  Linux is case sensitive.  Everything you type into the terminal needs to be exact in terms of spelling and upper/lower case.  If you put something into terminal or a configuration file and something doesn't work or you get errors, 99% of the time its some sort of input error.  

Also going forward.  If you see code for the terminal.  (like: sudo apt-get update)  The end of each line needs to be followed by the enter key.  The only exception is when installing a bunch of dependencies.  In this case, you'll just put everything you want to install in and press enter at the end.  
little note: Pathways in linux need to start with forward slash (/).  

Example:  /home/chris/retroarch/roms  

home/chris/retroarch/roms will not work.  Stupid mistakes like this will cost you hours in trouble shooting.  

Next Step:


Open this article up on the "console" PC.  That way you'll be able to copy and paste all of the terminal commands rather than risk typing them in wrong.  


Actual Next Step:

Open the terminal. Type: (or copy and paste in terminal)

sudo apt-get update

(Followed by enter remember?  You'll need your password.)

Then when that finishes type:

sudo apt-get upgrade


This will update and upgrade all of the dependencies for your operating system.  It'll likely take a while to finish.  Grab another beer.  This is important for moving forward to ensure everything is up to date and ready to roll.  (the beer that is)

Note: From now on, I will only give the lines to put into terminal.  Unless stated, they are all separate lines followed by enter.  Got it?  

Now lets get RetroArch (Libretro Resource)
Next in the terminal:  

sudo add-apt-repository ppa:libretro/stable    (This will ask you if its OK to add, just say yes.) 

sudo apt-get update

sudo apt-get install retroarch

sudo apt-get install libretro*

(both of the last two might take a bit to finish)


At this point we have downloaded and installed RetroArch.  Its there but needs to be configured in order to work.  

Now we need EmulationStation:  (emulationstation resource)


In terminal:

sudo apt-get update

sudo apt-get upgrade

sudo apt-get install -y libsdl2-dev libboost-system-dev libboost-filesystem-dev libboost-date-time-dev libfreeimage-dev libfreetype6-dev libeigen3-dev libcurl4-openssl-dev libasound2-dev libgl1-mesa-dev cmake git

Note: Copy this whole list and paste in terminal, then press enter.

When that is finished:

sudo apt-get install build-essential -y

git clone https://github.com/Aloshi/EmulationStation

cd EmulationStation

git checkout unstable

cmake .

make

sudo make install


This will take a while.  Just grab 2 beers and sit back and wait.  

Once this is finished you have all of the software needed for this project.  Lets check:

Open up the file and folders app from the launcher bar.  (Second one down from the top typically)  

Navigate to /home/[username]/EmulationStation 

There should be an emulationstation icon in that folder. (you can click it but it'll kick you out saying that you don't have any thing configured yet)

Next, navigate to /usr/bin/ (you'll have to click computer then usr, then bin)

You should see a retroarch icon in that folder.  Click on that little guy.  

Hopefully this opens up RetroArch.

Next Step

You can read up on how to configure RetroArch here.  

And how to configure EmulationStation here

The next post will go into this in more detail since it can get confusing.  



Homework:  Buy more beer.  












Thursday, October 18, 2012

S&W M&P 22 Review

I wanted to do a quick firearm review.

Recently I purchased a Smith and Wesson M&P 22 pistol.  This pistol is a .22lr version of their popular M&P line of pistols.  I good buddy of mine is a police officer in Charlotte and he carries the .40 cal version of this pistol.  After getting a chance to shoot his, I knew I had to get one.



I decided to go with the 22 simply because of the cost per round.  In bulk, a .22lr rounds can be picked up for around 3-4 cents each.  Compared to around 27-28 cents per round for .40 cal.

In short, this means a lot more rounds down range for a lot less money.  Since this is my first pistol, I wanted something I could shoot A LOT.

The M&P 22 offers the same shape and fit as it's larger caliber brothers.  It fits most of the same holsters.  Personally I went with the Blackhawk Serpa, as recommended by the friendly Charlotte cop.

The gun fits perfectly and tightly.  The button needed to release the firearm automatically places your trigger finger in the safe position when the gun is pulled out.  Great design, totally worth the $35 you find it online for.  

I also went ahead and purchased an extra 10 round magazine, which I promptly converted to a 12 round by removing the plastic spacer.  For some reason, these magazines are impossible to find so they cost about $30 themselves which is ridiculous.  Hopefully someone starts making some aftermarket ones soon.   

I have fired CCI's, Golden Bullets, Federals, and Winchester rounds through it; all in "bulk packs" (>250 rounds).  Out of approximately 2000 rounds through this gun I have had 6 failure to fires, 4 stovepipe jams, and 3 failure to chamber the next round.  

All in all, not bad.  The failure to chambers only happened with the Winchesters, and I have no idea why.  Perhaps the shape of the bullet?  No idea.  I'm not going to complain.  99% of the time, when I pull the trigger, the gun fires.

I will say, the Golden Bullets, made by Remington, are truly terrible.  They are cheap, but that's about all they have going for them.  First, they are absolutely filthy.  Firing 25 of them makes the inside of the gun look like I fired 200.  Secondly, they are definitely the least accurate of the aforementioned list.  Admittedly, I don't expect much from any of the bulk rounds.   If I was looking for accuracy, I'd pay more money.  But still, I had more "fliers" with Golden Bullets, than any other brand.  

The gun is only as accurate as who's holding it, and that's definitely true for this gun.  The Safety trigger that is only this firearms, in my opinion, accentuates poor trigger control.  I found myself for the first 300 rounds shooting low and left.  After asking for some advise from my gun enthusiast friends, I improved greatly.  
15 Yards, Grouping Left
I'm not a great shot and I don't ever claim to be.  I like to shoot, and would be more than capable of defending my household if needed, but I am not putting 1" groupings down  at 25 yards with this gun.  (Not even 15 yards, unless I'm really, really trying!).  I think I drink too much caffeine; a little too jittery.  


15 Yards, Much better!

All in all I would highly recommend this gun to anyone looking for a reliable .22 semi auto in a full sized frame or anyone looking for a cheap to shoot understudy for their M&P 9/40.  


Sunday, August 19, 2012

MendelMax 1.5 Build

Just finished my Dark Knight themed MendelMax 1.5.   Great printer design.  I highly recommend it.  Aside from drilling and tapping a few holes, it was extremely easy to build.


I use an old xbox 360 power supply and RAMPS 1.4, both of which are mounted under the build platform.    I painted the Prusa MK1 heated PCB bed gloss black (make sure you use high temp paint).

 

The wiring is cleaned up with TechFlex 3/8" wire loom.   Check it out on ebay.  I paid $4 for 10' which was plenty and it makes the printer look so much more professional.  Great stuff.

A little more expensive than the standard Prusa i2, but definitely worth it in the end.

Friday, August 3, 2012

Slic3r on Raspberry Pi

Installing Slic3r on Raspberry Pi

After installing PrintRun on my RPi, I wanted to get a slicing software running.  Skeinforge is written in Python so I'm sure it would install pretty easy.  The problem is Skeinforge is so slow at slicing.  Even on my normal computer, it takes at minimum a couple minutes to export G-Code for an STL that would take a few seconds on Slic3r.  

Note:  Slic3r is fast and for the majority of slicing that I do, it works flawlessly.  Unfortunately it is still in it's infancy for certain features, such as support material.  Therefore, Skeinforge is a necessary evil you will likely eventually need.  

Installation


I followed these install instructions for the most part.  Another fellow Reprap-er anwe79 suggested a few more needed dependencies to get it up and going.  I will list the full install process to make it easier.  

First:


sudo apt-get install git build-essential libgtk2.0-dev libwxgtk2.8-dev libwx-perl libmodule-build-perl libnet-dbus-perl
then
sudo apt-get install cpanminus
This next part may not be needed but just go ahead and make sure you have them:
sudo apt-get install curl
curl -L http://cpanmin.us | perl - --sudo App::cpanminus

Next is the extra needed dependencies that aren't listed on the original tutorial:
sudo apt-get install libextutils-cbuilder-perl
sudo apt-get install gcc-4.7
sudo apt-get install g++-4.7
Now you will be ready to go forward and get Slic3r:
git clone https://github.com/alexrj/Slic3r.git
cd Slic3r
Now you need some misc. perl dependencies:
sudo apt-get install libwx-perl
This next part installs some dependencies through cpanm.
sudo cpanm Boost::Geometry::Utils Math::Clipper \
    Math::ConvexHull Math::Geometry::Voronoi Math::PlanePath Moo Wx
NOTE: This will take forever! Just press enter and let it go. Don't mess around. After you get back to the main terminal prompt, scroll back through and check for errors. If you see errors then you need to check out the build log. Insert the correct build.log directory, should be something like /root/something/build.log

sudo nano buildLogDirectory
This will open the build log in nano and you can see where the problem is. For example it may say gcc-4.7 not installed. Therefore other dependencies won't install either.
Note: At times when installing dependencies, you'll need to update. Watch the terminal, it'll tell you when to update. Feel free to reboot whenever you'd like. Just remember to cd back to Slic3r when you return to the terminal like above.
At the end of all of this, you should have a working Slic3r. You can navigate through a file manager to the Slic3r folder and find Slic3r.py and execute or you can type ./slic3r.pl in terminal.
Once again, I'm not expert, this is simply the way I got it working on my RPi. Once again follow along to the RepRap developers forum topic here. Good Luck!

Wednesday, August 1, 2012

Raspberry Pi Contained!


I found an old portable DVD player I had laying around. I noticed it had a video in port. So I plugged in the 'Pi and it worked. I gutted out the unneeded parts and threw the 'Pi inside. Now I'm not tethered to my HDMI cable/tv. (just the keyboard, mouse, power cables)

If you have one laying around, just tear out the drive, the buttons, and the battery hookup and with a little trimming you'll be all set.

Tuesday, July 31, 2012

Reprap printing from Raspberry Pi

Raspberry Pi controlling my RepRap

I just received my Raspberry Pi a few days ago and after seeing fellow RepRap-er RichRap's success, I wanted to start printing from it.  Since the RPi runs Linux (Specifically a specialty distro of Debian called Raspbian) I wanted to lay out the steps it took for me to get running.

Items needed:

4GB SD card or larger. (Raspberrypi.org suggests atleast 2GB, but trust me you'll need more with the extra dependencies needed to run the needed Reprap programs)
Raspberry Pi
Micro USB powersupply (Its crucial to have at least 1A capacity, anything less and you'll have issues)
Powered USB Hub (make sure it provides plenty of power, mine is capable of 2A)
Keyboard
Mouse
RepRap.  (I'm running RAMPS 1.4 w/Marlin Firmware, but anything that'll connect to Pronterface should be fine.)

Initial RPi set up:


First and foremost, upon initial starting up your RPi, expand the partition to the full SD capacity.  It'll save you a lot of hassle later on.

Optional:  Overclock the RPi.  This isn't 100% neccessary but it will make future steps quicker.  There are multiple tutorials on this but it's pretty easy. 

From your root terminal enter:

sudo nano /boot/config.txt

This brings up the config file and allows you to overclock easily. 
Scroll down to the bottom of the screen and type:

arm_freq=800
sdram_freq=500


Then press Cntrl O to write the file.
Then press Enter.

This will bring you back to the first menu, so now you can exit by pressing Cntrl X.
You should be back at the normal terminal screen now so it's time to reboot:
Type reboot and press enter.

Once you reboot you should be running an overclocked Pi.  You can adjust the arm_freq higher (up to ~900.)  I have mine currently running at 850.  It worked at 900, but I started to have some booting issues. 

Installing Dependencies:

You'll need a few dependencies to run Pronterface.
Once again go back to root terminal and type: 

sudo apt-get install python-serial

Note:  After all terminal commands you need to press enter.  This should be obvious so I won't list that in the directions from this point on


This will install PySerial.  Once this is done type:

sudo apt-get install python-wxgtk2.8

This will install wxPython.
Both of these will take a bit to download and install so be patient.  You'll know your done when you get back to the main terminal prompt.

Now is a good time to reboot.  Once again this can be done from terminal by simply typing "reboot" or "sudo reboot" if your not in sudo.

Downloading Pronterface:


Open up the web browser and navigate over to PrintRun on github.  Click downloads and save. (I'm sure there is a way to do this from terminal, I just didn't know how.)

Now open up the file manager and open up /home/pi  and find kliment's folder. 


Scroll all the way down until you see pronterface.py and double click.  Then click execute and wait a few seconds. 

Pronterface should now be up and running.  

Connecting to printer.


On another computer change the baud rate on your firmware to 115200 if it isn't already.  250000 won't work.

Some of these steps may not be needed but they don't take too much time so just go ahead and follow along.

Close Pronterface if you have it open. 

Reboot (I like to make sure everything is fresh and clean before trying to connect.  I had some issues before.)

Plug in your printer.  Then open Pronterface.  You should see the appropriate port in the port box.

Assuming you haven't run any other serial com ports yet, it should end in 0.   

Now click connect.

This is where I've had some difficulties.  I'm not sure if they stem from power issues or if its a bug in the system some where.

It may take a bit to connnect.  Or it may not connect.  Sometimes I need to close pronterface and restart a couple times before it finally connects.  But eventually it will connect. 

From this point on, it's the same as it would be on any other computer.  Set your temps, load your G codes and print yourself a yoda. 

I have attempted to install Slic3r but no luck so far.  I'm sure Skeinforge would be easier to install since it's python, but thats slow on my regular computer so I figure it'll put it off for now. 

Next we'll download the Android IDE.


This is pretty easy, since some very smart cats putting together the Raspbian distro included it in the available packages.  All you have to do is go to the terminal again and type

sudo apt-get install arduino

This should install Arduino.   Then once again everything is just like any other computer. 

One thing to note, the compiler used in this Arduino IDE is slow, so be patient.  It'll get there. 

Now its time to buy one of these 7" screens and integrate it all into my new MendelMax build.  With a wireless adapter, soon i'll be remotely logging in and starting a print before I leave work. 

Follow along with all of the RPi RepRap development here.


Tuesday, July 17, 2012