PiGrrl + Retropie/Emulationstation

Our weekly LIVE video chat. Every Wednesday at 8pm ET!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
b1tsentry
 
Posts: 3
Joined: Tue Feb 04, 2014 1:55 am

PiGrrl + Retropie/Emulationstation

Post by b1tsentry »

Hello engineers.. sorry if this question has been asked already but I have a huge interest in the PiGrrl project and plan on building one. I really reeally wanna try to make this to work with Retropie and emulation station so I can run other emulators and have a slick interface. Is this possible with the current hardware design of PiGrrl and is Adafruit planning on making any Retropie images that might support it? Or maybe a tutorial on how to make the necessary config changes ourselves?


Thanks!

User avatar
pburgess
 
Posts: 4161
Joined: Sun Oct 26, 2008 2:29 am

Re: PiGrrl + Retropie/Emulationstation

Post by pburgess »

EDIT: oops, I'm sorry, my response below specifically refers to the GPIO-to-keyboard-input software part. I actually have no idea whether Retropie is compatible the PiGrrl, and would be somewhat skeptical of it working, actually. A lot of emulators favor OpenGL for graphics, which isn't compatible with the PiTFT display. So I'd file this under "possible but not likely."

Apparently it can work with Retropie 1.9 but not 2.0. This has to do with the 'retrogame' program that converts GPIO button inputs into simulated keyboard presses. Currently being discussed on Github.

If you'd like to be a guinea pig, I think I have a fix to make it work with Retropie 2.0.

User avatar
Chrom3Dome
 
Posts: 1
Joined: Mon Aug 11, 2014 5:05 am

Re: PiGrrl + Retropie/Emulationstation

Post by Chrom3Dome »

I volunteer myself as tribute!

User avatar
wolpak
 
Posts: 1
Joined: Fri Nov 14, 2014 2:46 pm

Re: PiGrrl + Retropie/Emulationstation

Post by wolpak »

I'd be interested in volunteering also if possible.

User avatar
dj505Gaming
 
Posts: 17
Joined: Sun Oct 19, 2014 2:51 pm

Re: PiGrrl + Retropie/Emulationstation

Post by dj505Gaming »

A picture of the RetroPie menu (you can see the Sega Genesis to the side)
A picture of the RetroPie menu (you can see the Sega Genesis to the side)
2015-02-02 15.png (249.9 KiB) Viewed 4826 times
Hello there! I see this is an old post and information posted now may not help, but I figured out how to run RetroPie on my PiGrrl! When I figure out how to run FBCP on the Pi's startup, I can post a writeable .img you can download and write to your Pi like a normal OS. The rc.local method of running programs on startup doesn't seem to be working, and neither does the .bashrc one because I have to actually end emulationstation with f4 and login without any display on the screen, any idea how I can get it to work? All i need to do is run a script on startup such as

Code: Select all

fbcp &
before Emulationstation begins. That way, the output from HDMI is capured on the Adafruit 2.8 inch TFT. It lags quite a bit and the controls aren't working because there's no set input to configure the controls because retrogame doesn't seem to be compatible with FBCP and I don't know how to fix any of those problems, but it's funcional.

EDIT: I suppose the CupCade system uses fbcp AND retrogame for controls, so I might build the image off CupCade if I can figure it out.

If you want to make this work yourself, instead of waiting for me to link you to a finished, ready to go,image, then I'll give you some instructions below.

First, you have to burn RetroPie to your SD card. I'm sure you know how to do that, so I'll move on.

SSH to your Pi with putty (Windows) or your terminal (Mac). If you can't find the IP, hook up your Pi to the HDMI, exit Emulationstation and it should say beside the ASCII mushroom with a ton of stats beside it.

Next, you have to install the dirvers for your screen. If you're using the 2.8 inch TFT, this will work. If you're using the 3.5 inch one, I'm not completely sure it will, but you can try it. Press F4 to exit Emulationstation and type this next series of commands to download the driver:

Code: Select all

cd ~

Code: Select all

wget http://adafruit-download.s3.amazonaws.com/libraspberrypi-bin-adafruit.deb

Code: Select all

wget http://adafruit-download.s3.amazonaws.com/libraspberrypi-dev-adafruit.deb

Code: Select all

wget http://adafruit-download.s3.amazonaws.com/libraspberrypi-doc-adafruit.deb

Code: Select all

wget http://adafruit-download.s3.amazonaws.com/libraspberrypi0-adafruit.deb

Code: Select all

wget http://adafruit-download.s3.amazonaws.com/raspberrypi-bootloader-adafruit-20140917-1.deb
You should have all the files downloaded. Then run

Code: Select all

sudo dpkg -i -B *.deb
to install your kernel. It may take a few minutes.

After it finishes, shut down your pi if the screen isn't on, shut down your pi with "sudo shutdown -h now", put the screen on, and tun it on again. If you happen to have the screen attatched already, just "sudo reboot".

Then enable the dirvers with:

Code: Select all

sudo modprobe spi-bcm2708

Code: Select all

sudo modprobe fbtft_device name=adafruitts rotate=270

Code: Select all

export FRAMEBUFFER=/dev/fb1
If it works, the screen should now be black instead of white.

After that, do:

Code: Select all

sudo nano /etc/modules
and add "spi-bcm2708" and "fbtft_device" without the "" under what's already there.
Now do

Code: Select all

sudo nano /etc/modprobe.d/adafruit.conf
and paste in

Code: Select all

options fbtft_device name=adafruitts rotate=270 frequency=32000000
Then you need to install fbcp by Tasanakor on GitHub.
Enter these in order.

Code: Select all

sudo apt-get install cmake

Code: Select all

git clone https://github.com/tasanakorn/rpi-fbcp

Code: Select all

cd rpi-fbcp/

Code: Select all

mkdir build

Code: Select all

cd build/

Code: Select all

cmake ..

Code: Select all

make

Code: Select all

sudo install fbcp /usr/local/bin/fbcp
fbcp should be installed. Just run

Code: Select all

fbcp &
and you should see everything that's on HDMI on your piTFT. Then all you need to do is figure out how to run fbcp when you turn on your pi automatically, make retrogame (a program that converts GPIO signals to keypresses like CupCade does automatically) work, and you should be set.

If you need any help, message me! Hope this helped anyone following this tutorial!

User avatar
spelexander
 
Posts: 7
Joined: Tue Feb 10, 2015 8:28 am

Re: PiGrrl + Retropie/Emulationstation

Post by spelexander »

Hey great tutorial, just wondering, in another thread you posted that you found the FBCP .man file with the copy rate. Would you be able to post the exact location of this file and directory.

Also did decreasing the value (25 * 1000) make any significant difference to performance? Because you would think lowering the time between each frame copy would increase fps.

Thanks in advance :)

User avatar
dj505Gaming
 
Posts: 17
Joined: Sun Oct 19, 2014 2:51 pm

Re: PiGrrl + Retropie/Emulationstation

Post by dj505Gaming »

The fbcp.main file was located in the downloaded rpi-fbcp file, so the directory would be <whereever you downloaded fbcp from github>/rpi-fbcp/main.c. Changing the values didn't make much difference for me, but I was able to slow it down instead of speed it up. Might make a difference for you tho! Good luck!

Edit: after editing main.c you'll have to rebuild and reinstall fbcp. Example:
Sudo nano rpi-fbcp/main.c
Cd build
Cmake ..
Make
Sudo install fbcp /usr/local/bin/fbcp

User avatar
spelexander
 
Posts: 7
Joined: Tue Feb 10, 2015 8:28 am

Re: PiGrrl + Retropie/Emulationstation

Post by spelexander »

Thanks for the reply, however still no luck finding the file unfortunately, i tried what you said and entered the command:

sudo nano https://github.com/tasanakorn/rpi-fbcp/main.c

however it just creates a new file. Is there anything you can see that i might be doing wrong?

User avatar
dj505Gaming
 
Posts: 17
Joined: Sun Oct 19, 2014 2:51 pm

Re: PiGrrl + Retropie/Emulationstation

Post by dj505Gaming »

What you did is you tried to edit the file through the URL to download the file. What you have to do is go "git clone http://github.com/tasanakorn/rpi-fbcp" and then do sudo nano rpi-fbcp/main.c
Your problem was you didn't have fbcp downloaded in the first place, you were trying to edit a nonexistent file through a web address :P good luck getting your PI working!

User avatar
spelexander
 
Posts: 7
Joined: Tue Feb 10, 2015 8:28 am

Re: PiGrrl + Retropie/Emulationstation

Post by spelexander »

Oh no! i do have the file downloaded and installed as i can run fbcp fine using fbcp & (although i can't get auto load to work), however i just can't locate the main.c file :(. I can't locate it with this command either:

sudo nano /rpi-fbcp/main.c

was that the specific command you used to edit it? Its unfortunate i don't have ssh or something else set up where i can look for the file more easily. Thanks for the help!

User avatar
dj505Gaming
 
Posts: 17
Joined: Sun Oct 19, 2014 2:51 pm

Re: PiGrrl + Retropie/Emulationstation

Post by dj505Gaming »

<accidental duplicate post>
Last edited by dj505Gaming on Mon Feb 16, 2015 4:11 pm, edited 1 time in total.

User avatar
dj505Gaming
 
Posts: 17
Joined: Sun Oct 19, 2014 2:51 pm

Re: PiGrrl + Retropie/Emulationstation

Post by dj505Gaming »

<accidental duplicate post again (my phone was having issues)>
Last edited by dj505Gaming on Mon Feb 16, 2015 4:13 pm, edited 1 time in total.

User avatar
dj505Gaming
 
Posts: 17
Joined: Sun Oct 19, 2014 2:51 pm

Re: PiGrrl + Retropie/Emulationstation

Post by dj505Gaming »

If you type "ls" or "dir" in the command line it lists all the files in the directory. Just do that until you find the file! Should work :)

User avatar
bluenazgul
 
Posts: 1
Joined: Tue Apr 07, 2015 4:41 am

Re: PiGrrl + Retropie/Emulationstation

Post by bluenazgul »

dj505Gaming wrote:
2015-02-02 15.png
Hello there! I see this is an old post and information posted now may not help, but I figured out how to run RetroPie on my PiGrrl! When I figure out how to run FBCP on the Pi's startup, I can post a writeable .img you can download and write to your Pi like a normal OS. The rc.local method of running programs on startup doesn't seem to be working, and neither does the .bashrc one because I have to actually end emulationstation with f4 and login without any display on the screen, any idea how I can get it to work? All i need to do is run a script on startup such as

Code: Select all

fbcp &
before Emulationstation begins. That way, the output from HDMI is capured on the Adafruit 2.8 inch TFT. It lags quite a bit and the controls aren't working because there's no set input to configure the controls because retrogame doesn't seem to be compatible with FBCP and I don't know how to fix any of those problems, but it's funcional.

EDIT: I suppose the CupCade system uses fbcp AND retrogame for controls, so I might build the image off CupCade if I can figure it out.

If you want to make this work yourself, instead of waiting for me to link you to a finished, ready to go,image, then I'll give you some instructions below.

First, you have to burn RetroPie to your SD card. I'm sure you know how to do that, so I'll move on.

SSH to your Pi with putty (Windows) or your terminal (Mac). If you can't find the IP, hook up your Pi to the HDMI, exit Emulationstation and it should say beside the ASCII mushroom with a ton of stats beside it.

Next, you have to install the dirvers for your screen. If you're using the 2.8 inch TFT, this will work. If you're using the 3.5 inch one, I'm not completely sure it will, but you can try it. Press F4 to exit Emulationstation and type this next series of commands to download the driver:

Code: Select all

cd ~

Code: Select all

wget http://adafruit-download.s3.amazonaws.com/libraspberrypi-bin-adafruit.deb

Code: Select all

wget http://adafruit-download.s3.amazonaws.com/libraspberrypi-dev-adafruit.deb

Code: Select all

wget http://adafruit-download.s3.amazonaws.com/libraspberrypi-doc-adafruit.deb

Code: Select all

wget http://adafruit-download.s3.amazonaws.com/libraspberrypi0-adafruit.deb

Code: Select all

wget http://adafruit-download.s3.amazonaws.com/raspberrypi-bootloader-adafruit-20140917-1.deb
You should have all the files downloaded. Then run

Code: Select all

sudo dpkg -i -B *.deb
to install your kernel. It may take a few minutes.

After it finishes, shut down your pi if the screen isn't on, shut down your pi with "sudo shutdown -h now", put the screen on, and tun it on again. If you happen to have the screen attatched already, just "sudo reboot".

Then enable the dirvers with:

Code: Select all

sudo modprobe spi-bcm2708

Code: Select all

sudo modprobe fbtft_device name=adafruitts rotate=270

Code: Select all

export FRAMEBUFFER=/dev/fb1
If it works, the screen should now be black instead of white.

After that, do:

Code: Select all

sudo nano /etc/modules
and add "spi-bcm2708" and "fbtft_device" without the "" under what's already there.
Now do

Code: Select all

sudo nano /etc/modprobe.d/adafruit.conf
and paste in

Code: Select all

options fbtft_device name=adafruitts rotate=270 frequency=32000000
Then you need to install fbcp by Tasanakor on GitHub.
Enter these in order.

Code: Select all

sudo apt-get install cmake

Code: Select all

git clone https://github.com/tasanakorn/rpi-fbcp

Code: Select all

cd rpi-fbcp/

Code: Select all

mkdir build

Code: Select all

cd build/

Code: Select all

cmake ..

Code: Select all

make

Code: Select all

sudo install fbcp /usr/local/bin/fbcp
fbcp should be installed. Just run

Code: Select all

fbcp &
and you should see everything that's on HDMI on your piTFT. Then all you need to do is figure out how to run fbcp when you turn on your pi automatically, make retrogame (a program that converts GPIO signals to keypresses like CupCade does automatically) work, and you should be set.

If you need any help, message me! Hope this helped anyone following this tutorial!
@dj505Gaming If you have an writeable image for RetroPi one the PiGRRL it would be perfect, i just received all my Adafruit Components today and plan to use the Adafurit Hardware Part and Guide complete but use RetroPi on it coz i think its the better Software

User avatar
albill
 
Posts: 1
Joined: Sun Sep 19, 2010 2:21 pm

Re: PiGrrl + Retropie/Emulationstation

Post by albill »

I followed this (and other posts here) and got emulation station working with my Pi 2 and a 3.5" PiTFT screen.

To get ES to launch on start, I did:

Code: Select all

sudo nano /etc/inittab
and in inittab, I made sure I had:

Code: Select all

#1:2345:respawn:/sbin/getty --noclear 38400 tty1
1:2345:respawn:/bin/login -f pi tty1 </dev/tty1 >/dev/tty1 2>&1
so the 'pi' account logged in on start.

I then did:

Code: Select all

sudo nano /etc/rc.local
and put:

Code: Select all

/usr/local/bin/fbcp &
before 'exit 0' at the end.

Since I added retrogame (I have a cupcade controller), I added:

Code: Select all

/usr/local/bin/retrogame &
to make it:

Code: Select all

/usr/local/bin/retrogame &
/usr/local/bin/fbcp &
exit 0
Now ES starts up and shows on my display when I start and I was able to configure my analog joystick and buttons on the cupcade in ES

Locked
Please be positive and constructive with your questions and comments.

Return to “Ask an Engineer! VIDEO CHAT (closed)”