[clockworkpi-debian] compiling and running RetroPie/EmulationStation

After setting up the excellent debian bullseye (next stable debian version) on the clockworkpi by using clockworkpi-debian and the forum thread I set out to try to compile EmulationStation on this recent and up to date system.

GitHub - RetroPie/EmulationStation: A Fork of Emulation Station for RetroPie. Emulation Station is a flexible emulator front-end supporting keyboardless navigation and custom system themes. is a maintained and up to date version of EmulationStation targetted mainly at the raspberrypi.

Compiling it works out of the box by doing the following (copied from the README) :

sudo apt-get install libsdl2-dev libfreeimage-dev libfreetype6-dev libcurl4-openssl-dev rapidjson-dev \
  libasound2-dev libgles2-mesa-dev build-essential cmake fonts-droid-fallback libvlc-dev \
  libvlccore-dev vlc-bin
git clone --recursive
cd EmulationStation
cmake .

Then running it by launching :

mkdir ~/.emulationstation


Next step : configure it ! Hoping to get some other users to jump into the clean debian based version setup by @Joao_Manoel !


With some xml configuration (not a big fan, but hey…) I got something working :

It’s pretty snappy :

Finding a more appropriate theme is probably next. :soon:


A theme that is intended for 640x480 on small 4:3 screens seems to work OK :


Great stuff! It would be great if you were able to easily transfer your efforts over to the Devterm.

I’d be happy to. I don’t own a devterm, but if they had the same distribution base, it would be possible.

I would love for the two devices to converge and have a recent, up to date distribution to stand on. For common software, my best bet would be to have a debian packages repository with the customized software. But this would require the community and clockworkpi to get behind it to motivate those involved.

@arthur I have been playing with this too, I did get a version to run on the clockwork-debian binary image released by @Joao_Manoel. but I ran into some issues when building a custom image. I believe I have worked around those issues and possibly improved a bit on the setup a bit. I’m planning on opening up PR’s to @Joao_Manoel 's repo. I was able to get emulationstation up and running with getting emulators to work right, but the system would hang when I exited the emulator.

hey @uberlinuxguy, welcome to the forum and the community !

Glad to hear there is another user of the clockworkpi-debian image ! :tada:

Indeed missed out that point in my description, when exiting the game from retroarch I get the same “hang”.

Looking forward to trying out your developments, am happy to review them if you submit a PR.

@arthur, so you just did the Emulationstation from the retropie repo? Just curious because I am attempting the full retropie setup on the GameShell. I ran into a few… issues… mostly revolving around the binary driver requirement in retropie. Might require a patch to that too, but if the mesa lima drivers work ok and I can figure out what is causing the hang, this will seemingly work great.

Ok, so I finally got RetroPie to build on the debian version from @Joao_Manoel with no issues. I started looking at the hanging and it seems like it might be either audio or video related. There are a bunch of links in the past about ES and audio issues exiting emulators, but no solid leads on a fix yet. If I can get around the hang, I can build and publish an image. I did notice there isn’t a good way in the UI yet to setup WiFi. Might need to look into that too.

Been digging some more. It seems emulationstation isn’t re-grabbing the keyboard when it comes back from launching something. I feel like I may be right on the edge of figuring this out, but missing a key point. I don’t think it’s hanging per se, I think the keyboard (or the game pad in the GameShell’s case) is not getting redirected properly back to emulationstation. This may be a problem of the mode flipping on the console. Going to keep trying a few things to see if I am on the right track.

My suspicion has been confirmed. I hooked a usb controller up to the GS when it was “hanging” and was able to move around after exiting a game. So this is a problem with either emulationstation, the linux input system and/or the frame buffer code. More digging tomorrow but I am closer.

I’m beginning to suspect SDL is the issue. The version that comes with the version of debian we are using is newer than what is built by RetroPie if you let RetroPie handle SDL. The issue with letting RetroPie handle SDL is that other packages (ie. ffmpeg and such) installed by other things (ie. retroarch, and some of the emulators) depend on specific versions of SDL which are not available in the debian repos. This causes apt to break badly. I think I am going to investigate what is going on with the version of SDL in debian and see if I can get ES to do the right thing when it launches and comes back from a game. Looks like you can call SDL_QuitSubSystem() followed by an SDL_InitSubSystem() to do a re-init of the event system. I’m going to wrap the game calls in that and see if it helps/hurts.

Update 3:
Adding those calls did not help. So I went down the path of getting Retropie-Setup to compile and use it’s suggested version of SDL. After some noodling, I got that to compile and you know what… IT WORKED! No hanging. I am currently working on getting this scripted into the image build scripts from @Joao_Manoel so that running one command will build you a debian image with RetroPie for the GameShell. I hope to have something soon, we’ll see how long the test builds take. I have been building it on my GameShell but I think I may have been over exercising my SD card…


@uberlinuxguy congrats on getting retropie’s build scripts to work on clockworkpi-debian ! This is good news. When I did some retropie a few years back I wasn’t a big fan of that script, but it seems to be used by a large community so if it works here, it might gain some traction in this community (and clockwork-debian with it?). Maybe you could start a new thread explaining this approach to get some people involved. I’d be happy to test it out if you have some instructions!

On a side note: I’d love to see the “use SDL version from debian bullseye” approach still be explored as staying as close to debian might help with maintainability, but whatever works for now is good news.