Raspberry π Labs resources, tutorials, help and downloads. The Raspberry Pi and logo are trademark of the Raspberry Pi foundation, and Raspberry π Labs is not releated with them.

RetroArch in Raspberry pi (SNES)

Dependencies

SDL

at least one libretro implementation
pkgconfig

Optional dependencies

libxml2 – For XML shaders and cheat support.
freetype – TTF font rendering
ffmpeg/libavcodec – FFmpeg recording
nvidia-cg-toolkit – Cg shaders

Some other libraries can be built support for as well, please refer to ./configure --help.

You can download either the official repository (https://github.com/Themaister/RetroArch) or my experimental repository (https://github.com/ToadKing/RetroArch-Rpi) (which at the moment is basically the same as the official one, but will have future Raspberry Pi changes before the main repository.)

I’ve tested the following emulator cores and they run at or near full speed:

RetroArch on the Raspberry Pi has some issues though:

  • Audio uses ALSA, and due to the alpha nature of the Raspberry Pi’s ALSA driver, audio is not perfect. Expect popping and static.

i will compile the SNES lib:

Building RetroArchPi

Once dependencies are installed, you can pull and install from Git:

 

retroarch.cfg  this file will be created in $HOME/.retroarch.cfg

if you got the following error:

Solution: Try configuring RetroArch to not use libpng.

To run the retroarch emulator do it with pi user and using a interactive terminal, never with Xwindows Terminals

 

update: fix for the problem : RetroArch [ERROR] :: Assertion failed at gfx/rpi.c:157.

split the memory 50% arm and 50% video with the raspi-config tool and will fix the problem

Thanks to toad king for his knowledge

Comments on: "RetroArch in Raspberry pi (SNES)" (50)

  1. Great Work!
    Can you help me where i get SDL and the pkg config ?

    Im tryin to run Openelec on my RPi with the rom collection browser..

    dou you have an idea what i have to do, that i can run a emulator in that browser ?

    • @kevin i never used Openelec and unfortunately OpenELEC isn’t based on Ubuntu, Debian or Arch. According to the Retroarch’s Main developer in order to get the emulator up and running the first step will be install an stable distro in this case Debian. :S on the other hand of you want to have both in the same debian here the link for OPENELEC 4 DEBIAN

      i hope this can help you! cheers

      • A good idea but i dont know if the memory split is the best solution.
        Maybe a bootloader would be more efficient

        But thanks anyway :)

    • Hi everyone, just to let you know I have created a automated script for the installation process, also a python console application (works, but need further dev) to help you find and run your roms. Check it out at
      http://www.frost-software.com/blog/2012/7/20/super-nintendo-for-the-raspberry-pi.html

      • @thomascrha i saw your script and what happen if the compilation fails? it can’t take decision about it
        example :

        if the retroarch compilation fails because the png support ?
        or if the retroarch fails to run because the share memory ?

  2. Hello,

    Everything is working as described but when I try to run it on my Rpi I have an assertion failure:
    RetroArch assertion failed at gfx/rpi.c L 157

    Can someone help me ?

    Thanks
    Yann

    • @yann do you have a log file for this error or more details about the error :D

      • Hello root,

        I tried different .smc files (eg: Super Mario World.smc) and get the same failure:
        No ROM file header found.
        ‘SUPER MARIOWORLD’ [checksum ok] (…)
        RetroArch [ERROR] :: Assertion failed at gfx/rpi.c:157.

        Any ideas ?

  3. @yann are you using rapbian? or arch?

  4. @yann ok at this moment i will compile the retroarch again using the latest raspbian whezzy out the box, let me try and i will back to you asap

  5. @yann no, i used the same conf at the very beginning without any problem let me finnish to compile and i will back to you

  6. @yann i did my research and i found the solution to your problem

    update: fix for the problem : RetroArch [ERROR] :: Assertion failed at gfx/rpi.c:157.

    split the memory 50% arm and 50% video with the raspi-config tool and will fix the problem

    • Thanks a lot root !
      In fact I changed this setting to get fuse compiling.
      I will try your setting tomorrow and give you my feedback.

      Thanks a lot for your help !!

    • Great !!
      It’s running !!! Thanks for that.

      The problem now is that I only see about the top left quarter of the screen…
      I tried the “-f” option to get full screen, but without any effect.
      Is my TV’s resolution the problem ? Is there a way to reduce display ?

      • @yann try to use the overlap option in the /boot/config.txt

        overscan_left=20
        overscan_right=20
        overscan_top=20
        overscan_bottom=20

        • This is a setting I already have. In fact my desktop looks good.
          It’s only retroarch that is running with some different resolution. I also tried the settings in the .cfg file, but they don’t have any effect…

          • @yann i got a widescreen TV, and the retroarch appears in the middle, like a square obviously is not a widescreen game but it runs reasonably

          • I updated to Raspbian, and now it works !

          • @yann how did you update it? with

          • I installed the Raspbian from the RPI Download link, and built all again.
            Now, everything seems OK.
            I had some trouble with my gamepad, but my manual settings did it !
            Thanks again for all your help.

          • @yann could you please share the setting for you gamepad? will be usefull for the rest of visitors

          • Here are my settings in retroarch.cfg:
            input_player1_joypad_index = “0”
            input_player1_a_btn = “1”
            input_player1_b_btn = “2”
            input_player1_x_btn = “0”
            input_player1_y_btn = “3”
            input_player1_l_btn = “h0left”
            input_player1_r_btn = “h0right”
            input_player1_start_btn = “9”
            input_player1_select_btn = “8”
            input_player1_left_axis = “-0″
            input_player1_up_axis = “-1″
            input_player1_right_axis = “+0″
            input_player1_down_axis = “+1″

            They are working if I turn off the Analog functions.

            As I configured it with retroarch-joyconfig, there were some controls inversed or missing…

  7. Hello everyone, just to let you know I have created a automated script for the installation process, also a python console application (works, but need further dev) to help you find and run your roms. Check it out at
    http://www.frost-software.com/blog/2012/7/20/super-nintendo-for-the-raspberry-pi.html

  8. CaelThunderwing said:

    http://img692.imageshack.us/img692/179/iuvcrpreview20120720041.png

    this is what i get when i try to run it pointing to the pocketsnes core (i used teh main git repo as the experimental one fails to compile with this as a message http://pastebin.com/75h4n88c )

    any idea? as i’d like to try and get to playing some ol fashioned Earthbound on my Pi :3

    • @caelthunderwing try running the configure like this

      ./configure –disable-libpng

      • CaelThunderwing said:

        i used this to get it fixed http://www.frost-software.com/blog/2012/7/20/super-nintendo-for-the-raspberry-pi.html

        strangely unless its in /emu/snes/games i get that %HOME/.retroarch.cfg error

        but OMG X_X anyway to fix sound? i had the unforunate mistake of having headphones on when i launched earthbound X_X

        • @CaelThunderwing try creating a blank file in /home/pi/ with the name .retroarch.cfg don’t forget the dot at the begging

          and about the script, i don’t have any against the automated version but, first need to fix some details in order to work FULLY well.

          unfortunately the sound is in ALPHA state so we have to wait a little bit more to run games with a decent sound

          • CaelThunderwing said:

            does everygame have nasty sound and are there adjustments i could make?

          • CaelThunderwing said:

            sorry i dont know how to make reply edits, BUT the Alsa driver for USB Soundcard is upto the task .

            just tested a generic USB Cheapie i got for 5$ off ebay, no wi have two scenarios for it,

            a: my buzzing i had at first is relate dto power issue (USB Hub may of remidied this!) or.

            b: the USB Extention cable i used for it is Bad. will test when i can. (i dont like using this hub for extended peroids gives me a bad vibe when i use it for the Pi. (since oddly the hub is delivering power INTO the USB Ports.)

            but when on the USB Hub. i had perfect Sound! so for now i supose we nee dto use a usb device for sound till support for the pi’s own audio hardware is improved.

          • @CaelThunderwing thanks for your feedback i got an USB audio card here too, i will try, but when i use the HDMI sound is sounds crappy :S

  9. [...] implementation on the Raspberry you can expect some creacking. For now,  one solution for that seems to be the use of an external USB soundcard until the problems with the ALSA implementation are [...]

  10. bigbobbie said:

    Hello,

    When I wanted to compile the SNES liberto, it failed to find the ‘zlib.h’ as the error is :

    src/port.h:67:23: error: zlib.h: No such file or directory

    Any help please?

  11. CaelThunderwing said:

    http://img404.imageshack.us/img404/2404/earthbboundpi.png

    looks like a smaaaal cutoff on RCA out.but that buzzing i mentioned the last time? it was the one USB soundcard i had, i have one that draws a lil less power and now i have perfect audio.

  12. Hi,

    anybody else facing the problem that the time in super mario games (snes or nes) is running to fast?

    • @mats what you mean running to fast?

      • In the game there is a time going down to 0. One step every second but in the emulated game the time goes down by one every 0,5 second. This means that 10 real seconds are only 5-7 seconds in the game…

  13. Using 2012-07-15-wheezy-raspbian I ran into the following when running

    $ aptitude install libsdl-console-dev

    Reading package lists…
    Building dependency tree…
    Reading state information…
    Reading extended state information…
    Initializing package states…
    Writing extended state information…
    Reading task descriptions…
    The following NEW packages will be installed:
    libpulse-dev{a} libpulse-mainloop-glib0{a} libsdl-console-dev
    libsdl-image1.2-dev{a} libsdl1.2-dev{a} libtiff4-dev{a} libtiffxx0c2{a}
    0 packages upgraded, 7 newly installed, 0 to remove and 3 not upgraded.
    Need to get 513 kB/1,506 kB of archives. After unpacking 4,264 kB will be used.
    Do you want to continue? [Y/n/?] Writing extended state information…
    Err http://mirrordirector.raspbian.org/raspbian/ wheezy/main libpulse-mainloop-glib0 armhf 2.0-3
    404 Not Found
    Err http://mirrordirector.raspbian.org/raspbian/ wheezy/main libtiffxx0c2 armhf 3.9.6-6
    404 Not Found
    Err http://mirrordirector.raspbian.org/raspbian/ wheezy/main libpulse-dev armhf 2.0-3
    404 Not Found
    Err http://mirrordirector.raspbian.org/raspbian/ wheezy/main libtiff4-dev armhf 3.9.6-6
    404 Not Found
    Reading package lists…
    Building dependency tree…
    Reading state information…
    Reading extended state information…
    Initializing package states…
    Writing extended state information…
    Reading task descriptions…

  14. Regarding the libpng compile error:
    Try adding this line to config.h:
    #define PNG_SKIP_SETJMP_CHECK

  15. Apparently it can’t find the gl library on mine:

    gfx/gl.o: In function gl_shader_init':
    /home/pi/Themaister-RetroArch-301848e/gfx/gl.c:181: undefined reference to
    gl_glsl_init’
    collect2: ld returned 1 exit status
    make: *** [retroarch] Error 1

    I’m running Raspbian.

  16. [...] output. I made quite good experiences with the HDMI output. For now, another solution for that seems to be the use of an external USB soundcard until the problems with the ALSA implementation are [...]

  17. I hope people are still checking this. I just installed everything I can run a rom, but nothing I press on my keyboard works. I figure it has something to do with the .retroarch.cfg file. It’s in the same dir as the executable.

    Am I missing something?

  18. Nathan Krueger said:

    Hey I have installed RetroArch and pocketsnes on my R Pi. Trouble is, when I load up to Super Mario World the keyboard does nothing and I have not way to control the game (I’ve tried pressing every key lol) Any ideas why this may be happening? I looked at the config file and saw the key mappings, and they aren’t working. Thanks!!!

    -Nathan

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">