C1 RetroArch + EmulationStation

User avatar
memeka
Posts: 4420
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART
Has thanked: 2 times
Been thanked: 60 times
Contact:

C1 RetroArch + EmulationStation

Post by memeka »

Since it was difficult to modify RetroPie, I have created new scripts.
You can get them from: https://github.com/mihailescu2m/retrobuilder
Before running them, you need to download libsdl2 packages from http://oph.mdrjr.net/memeka/downloads/ and install them with "dpkg -i libsdl2*.deb"

Currently you can build:

* emulationstation
* mupen64plus (sdl2)
* ppsspp (sdl2)
* retroarch
* libretro-pcsx_rearmed
* libretro_snes9x_next
* libretro-vba_next

Contributions are welcomed. For those interested, each system is defined in an ".inc" file (actually a bash script), which may contain the following functions:

* module_deps (prints out a list of package dependencies, that is picked up and installed by the setup script)
* fetch (required; git clone or git pull, with the --rebase option)
* patch (called after git pull, patches the source and commits changes)
* build (required; for emulators that need more RAM when building/linking, there is a "swap on" and "swap off" function defined in the setup script)
* install (not implemented; needs --prefix option in build)
* uninstall (not implemented; needs --prefix option in build)
* configure (not implemented; should create emulation-station configs, and joystick configs)

All operations are logged by the setup script in the "log" folder (will be created if it does not exist).
In addition, the setup script implements the "remove" option, which erases the emulator folder and logs.

Although currently it works on debian/ubuntu, I have thought of those that use Arch and created hooks for other distros as well.

Other things that might be helpful:

* if your sound is not working, create a file /etc/asound.rc with:

Code: Select all

pcm.!default {
  type plug
  slave {
    pcm "hw:0,1"
  }
}
ctl.!default {
  type hw
  card 0
}
* if you are on a fresh minimal image, everything compiled but you cannot run the emulators, check and create a file in /etc/udev/rules.d such as 10-odroid-mali.rules containing:

Code: Select all

KERNEL=="mali",SUBSYSTEM=="misc",MODE="0777",GROUP="video"
KERNEL=="ump",SUBSYSTEM=="ump",MODE="0777",GROUP="video"
and add your user to the video group: sudo group add <youruser> video then reboot

* if you are on a fresh minimal image, everything compiled and starts, but keyboard is no working, check and create a file in /etc/udev/rules.d such as 10-odroid-input.rules containing:

Code: Select all

KERNEL=="event[0-9]*",MODE="0660",GROUP="plugdev"
KERNEL=="mouse[0-9]*",MODE="0660",GROUP="plugdev"
and add your user to the plugdev group: sudo group add <youruser> plugdev then reboot

------------------------------

* SDL2 package for Debian/Ubuntu - clone and build with "dpkg-buildpackage -us -uc -b -j5"
https://github.com/mihailescu2m/libsdl2-2.0.2-dfsg1 branch mali
Binaries still available at: http://oph.mdrjr.net/memeka/downloads/

* RetroPie scripts - install like Retropie (check petrockblog for details)
https://github.com/mihailescu2m/RetroPie-Setup branch odroid
Tested and working (pull requests for more are welcomed):
** update APT packages
** Bash Welcome Tweak
** EmulationStation (after installing the SDL2 package)
** EmulationStation theme simple
** Retroarch
** PSX libretro core
** vba_next libretro code (from unstable menu)

------------------------------

My new project is an arcade powered by the C1. For best performance, I want it to run everything in framebuffer, no X11 installed.
Retroarch was shown to work already on mali_fbdev. But I want my arcade interface to be EmulationStation, because it scrapes artwork as well, and looks so much better.
[youtube]https://www.youtube.com/watch?v=IzTReBWPmok[/youtube]

EmulationStation depends on SDL2.0, which does not have framebuffer or mali support. So I've started writing a mali fbdev + opengl driver for SDL2. I think there are also some linux games that use SDL that will be able to run in console with that.
This is the current status: it works! Not sure input (keyboard/mouse) works yet, I haven't tested the sound... but it's promising.
IMG_1624.JPG
IMG_1624.JPG (251.44 KiB) Viewed 38659 times
Here is a libretro core:
IMG_1625.JPG
IMG_1625.JPG (370.74 KiB) Viewed 38659 times
I am hoping to soon release an image with retroarch + emulationstation working on mali-fbdev.
Last edited by memeka on Fri Feb 27, 2015 5:54 am, edited 9 times in total.

User avatar
memeka
Posts: 4420
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART
Has thanked: 2 times
Been thanked: 60 times
Contact:

Re: C1 RetroArch + EmulationStation

Post by memeka »

Well, seems like stuff is working. Took a few hours to code the driver, but here's what I got:


User avatar
meveric
Posts: 11806
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1, N1, Go, H2 (N4100), N2, H2 (J4105), GoA, C4, GoA v1.1, H2+, HC4, GoS
Has thanked: 75 times
Been thanked: 577 times
Contact:

Re: C1 RetroArch + EmulationStation

Post by meveric »

looks good.. much better than the X11 performance :)
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.

floorislava
Posts: 1
Joined: Thu Jan 22, 2015 11:54 pm
languages_spoken: english
ODROIDs: ODROID-C1
Has thanked: 0
Been thanked: 0
Contact:

Re: C1 RetroArch + EmulationStation

Post by floorislava »

Exactly what I was hoping would be ported over. Let me know if you need any help testing.

DESE
Posts: 51
Joined: Sat Jan 17, 2015 3:49 pm
languages_spoken: english, spanish
ODROIDs: Odroid C1
Has thanked: 0
Been thanked: 0
Contact:

Re: C1 RetroArch + EmulationStation

Post by DESE »

meveric wrote:looks good.. much better than the X11 performance :)
How much do you think is better in percentage terms?. I'm looking to speed up neogeo games :geek:

User avatar
meveric
Posts: 11806
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1, N1, Go, H2 (N4100), N2, H2 (J4105), GoA, C4, GoA v1.1, H2+, HC4, GoS
Has thanked: 75 times
Been thanked: 577 times
Contact:

Re: C1 RetroArch + EmulationStation

Post by meveric »

The X11 drivers are totally crap right now.. glmark2-es2 can run with over 160 FPS (i think i've even seen 190FPS) in window mode.. the same benchmark in fullscreen runs under 40 FPS and in a Window resized to desktop it can drop to 20FPS.. scaling is a major issue with the X11 drivers.. that's what makes the difference in performance..
memeka already has retroarch and mame078 core working in framebuffer.. that's running fullspeed hardware accelerated.. gngeo (what you probably used up to now) uses SDL to software render which is awefully slow as well :)
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.

robotza
Posts: 66
Joined: Fri Jan 30, 2015 4:44 am
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 0
Contact:

Re: C1 RetroArch + EmulationStation

Post by robotza »

WOW this is excellent work. I also bought a C1 for the same reason , to build a MAME cabinet with a few systems on. The C1 progress looks really good!! , ive used Raspberry Pi in the past , but looking now for something with a little more muscle! Keep up the good work!

User avatar
meveric
Posts: 11806
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1, N1, Go, H2 (N4100), N2, H2 (J4105), GoA, C4, GoA v1.1, H2+, HC4, GoS
Has thanked: 75 times
Been thanked: 577 times
Contact:

Re: C1 RetroArch + EmulationStation

Post by meveric »

You should get an U3 or XU3 and you have all the muscle you need ;)
All that's WIP on C1 already exists for U3 and XU3 and probably runs alot faster..
(sorry i know that's not too constructive, i'm just disappointed with the C1)
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.

Floppie
Posts: 22
Joined: Sat Jan 31, 2015 5:18 am
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 0
Contact:

Re: C1 RetroArch + EmulationStation

Post by Floppie »

I'm very interested in this. I'd love to use a C1 to replace my Pi as an EmulationStation box and would love to put some time into coding/testing for the project. Does your code and setup live anywhere I could grab and run it?

robotza
Posts: 66
Joined: Fri Jan 30, 2015 4:44 am
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 0
Contact:

Re: C1 RetroArch + EmulationStation

Post by robotza »

Just donated some beer money :) Enjoy and keep up the good work

User avatar
memeka
Posts: 4420
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART
Has thanked: 2 times
Been thanked: 60 times
Contact:

Re: C1 RetroArch + EmulationStation

Post by memeka »

Current status:

MAME: mame078 ok, the rest not ok (not even the ones in meveric debs)
SEGA: picodrive ok, genesis plusgx probably ok
SNES: snes9x_next ok
GBA: vba_next ok
PSX: pcsx-rearmed ok, mednafen-pce-fast black screen

PSP: ppsspp not ok = too slow
N64: mupen64plus older version (meveric deb) not ok = too slow

User avatar
meveric
Posts: 11806
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1, N1, Go, H2 (N4100), N2, H2 (J4105), GoA, C4, GoA v1.1, H2+, HC4, GoS
Has thanked: 75 times
Been thanked: 577 times
Contact:

Re: C1 RetroArch + EmulationStation

Post by meveric »

you should try nestopia and gambatte which is for NES and GB/GBC not sure if you can get ScummVM core running.. not sure if it works without X11..
NDS could work too, but i'm not sure how many games would work.. it takes quite some CPU power..
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.

User avatar
memeka
Posts: 4420
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART
Has thanked: 2 times
Been thanked: 60 times
Contact:

Re: C1 RetroArch + EmulationStation

Post by memeka »

tell you the truth, i am interested only in the above .. maybe only add amiga and z80...
i am more interested in making ppsspp work well :) on the XU it works pretty slow ... ~10fps in gameplay in Tekken 6 :( on the C1 even worse...
Last edited by memeka on Sun Feb 01, 2015 8:34 am, edited 1 time in total.

User avatar
Cartridge
Posts: 610
Joined: Fri Sep 27, 2013 9:06 pm
languages_spoken: english, french natively
ODROIDs: The Perfect ODROID-U2, ODROID-U3+, C1, XU3
Has thanked: 2 times
Been thanked: 0
Contact:

Re: C1 RetroArch + EmulationStation

Post by Cartridge »

Sometimes, going for older revisions of the same software solves a bit of problems but may well affect the gameplay compatibility and/or performance. It's worth a shot for desperate measures.
Image
http://cartridgeports.cf/
ODROID's DO what WinDON'T "That's Blast Processing!"

User avatar
memeka
Posts: 4420
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART
Has thanked: 2 times
Been thanked: 60 times
Contact:

Re: C1 RetroArch + EmulationStation

Post by memeka »

do you guys know a good revision for PPSSPP (libretro version) and mupen64 (libretro version) ?

User avatar
Cartridge
Posts: 610
Joined: Fri Sep 27, 2013 9:06 pm
languages_spoken: english, french natively
ODROIDs: The Perfect ODROID-U2, ODROID-U3+, C1, XU3
Has thanked: 2 times
Been thanked: 0
Contact:

Re: C1 RetroArch + EmulationStation

Post by Cartridge »

https://github.com/hrydgard/ppsspp/releases/tag/v0.9.1 this is my suggestion but I'm not entirely sure if it'll speed things up. I've had good experience with this version in the past so compiling it for libretro might be worth a try.
Image
http://cartridgeports.cf/
ODROID's DO what WinDON'T "That's Blast Processing!"

User avatar
memeka
Posts: 4420
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART
Has thanked: 2 times
Been thanked: 60 times
Contact:

Re: C1 RetroArch + EmulationStation

Post by memeka »

just an addition: my work with mali-fbdev is applicable to U3 as well.
I tested PPSSPP on U3/fbdev and it's playable ... the issue with C1 remains the alpha channel in upstream PPSSPP and slowness in retroarch...

User avatar
meveric
Posts: 11806
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1, N1, Go, H2 (N4100), N2, H2 (J4105), GoA, C4, GoA v1.1, H2+, HC4, GoS
Has thanked: 75 times
Been thanked: 577 times
Contact:

Re: C1 RetroArch + EmulationStation

Post by meveric »

just as a hint.. Tekken 6 might not be the best game to test PPSSPP.. it's not really fast on any system.. you should go for Soul Calibur, Ultimate Ghost 'n Gouls or Disneys Cars for example... most of them should be able to run nearly full speed. (Tekken sucks anyway compared to a Soul Calibur ;))
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.

User avatar
memeka
Posts: 4420
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART
Has thanked: 2 times
Been thanked: 60 times
Contact:

Re: C1 RetroArch + EmulationStation

Post by memeka »

on U3 fbdev: soulcalibur works with >50fps (min 52, averages around 55), no frameskipping. tekken 6 is slower, needs enabling frameskipping.
how is it running on X11?

User avatar
meveric
Posts: 11806
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1, N1, Go, H2 (N4100), N2, H2 (J4105), GoA, C4, GoA v1.1, H2+, HC4, GoS
Has thanked: 75 times
Been thanked: 577 times
Contact:

Re: C1 RetroArch + EmulationStation

Post by meveric »

U3 X11 Soul Calibur is steady 60 FPS without frameskipping
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.

User avatar
memeka
Posts: 4420
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART
Has thanked: 2 times
Been thanked: 60 times
Contact:

Re: C1 RetroArch + EmulationStation

Post by memeka »

For those that want to try framebuffer emulation on Odroid C1, this is what you need:

1) Retroarch - retroarch already has mali-fbdev support, you need to use the --enable-mali_fbdev flag when configuring
2) EmulationStation - it needs SDL2, which does not have mali-fbdev support. You can download patched SDL2 debs for Ubuntu from here: http://oph.mdrjr.net/memeka/downloads/
For those interested in source, you need to add a new mali context driver, e.g. src/video/mali-fbdev - there are some modification in several files to add it to config options (e.g. --enable-mali_fbdev) which I am not posting here; I am posting though the source code for the context driver. You need 4 files:
* SDL_maliopengles.h - http://paste.debian.net/143651/
* SDL_maliopengles.c - http://paste.debian.net/143652/
* SDL_malivideo.h - http://paste.debian.net/143653/
* SDL_malivideo.c - http://paste.debian.net/143654/
With this patched SDL, you can now compile and run emulationstation.
One more thing to note about sound: EmulationStation has the mixer name hardcoded in es-app/src/VolumeControl.cpp as "Master". In my case, I am using a USB soundcard, so in addition to modifying /etc/asound.rc to set it as default, I had to change the EmulationStation mixer name in that file from the default "Master" to "Speaker" (you can see the mixer names in alsamixer).
3) PPSSPP - the libretro version works in retroarch, but I found it on all platforms slower than PPSSPPSDL. You can run PPSSPP from github (https://github.com/hrydgard/ppsspp) and use SDL2 - PPSSPPSDL. However, you also need to add the mali egl init code (found in SDL_malivideo) and replace the init code in native/base/PCMain.cpp There is an ongoing issue with PPSSPPSDL where alpha channel is not correctly rendered (i.e. you have black instead of transparency).

Note: since you are using evdev, you need to have read permissions for /dev/input/event* or else your input device (keyboard) won't work.

robotza
Posts: 66
Joined: Fri Jan 30, 2015 4:44 am
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 0
Contact:

Re: C1 RetroArch + EmulationStation

Post by robotza »

Do you perhaps know if Emulationstation 1 uses SDL2?

robotza
Posts: 66
Joined: Fri Jan 30, 2015 4:44 am
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 0
Contact:

Re: C1 RetroArch + EmulationStation

Post by robotza »

After some searching i see ES 1 uses SDL 1.2

Floppie
Posts: 22
Joined: Sat Jan 31, 2015 5:18 am
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 0
Contact:

Re: C1 RetroArch + EmulationStation

Post by Floppie »

So I'm trying to get retroarch to build - I found a set of configure options to make it happy (./configure --enable-mali_fbdev --disable-x11 --disable-oss --disable-pulse --disable-sdl --enable-floathard --with-gles_libs --enable-kms --enable-alsa --disable-cg --enable-gles --enable-zlib --disable-vg, and then with/without --enable-sdl2) but I'm having a problem with --with-gles_libs. The linker can't seem to find the library. Do you need to pass something to it (e.g. --with-gles_libs=XXXX)?

It built fine for me without it, but I couldn't run it - the EGL library couldn't get a display.

Any chance you can provide your retroarch ./configure command? If yours is the same as mine, I'll post the libraries I have installed.

BTW, EmulationStation compiles flawlessly with your patched SDL2 debs :)

User avatar
memeka
Posts: 4420
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART
Has thanked: 2 times
Been thanked: 60 times
Contact:

Re: C1 RetroArch + EmulationStation

Post by memeka »

Glad to see people interested in this

@robotza ES from git uses SDL2 and GLES1.

@Floppie I am using this: https://github.com/libretro/libretro-su ... h-build.sh
You don't need to specify --with-gles_libs, configure will find them (it should be used if configure does not find them)

Floppie
Posts: 22
Joined: Sat Jan 31, 2015 5:18 am
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 0
Contact:

Re: C1 RetroArch + EmulationStation

Post by Floppie »

Nice, this looks like it will be very helpful. Do you have any custom options included in yours or just ./retroarch-build.sh and let it figure it out?

Floppie
Posts: 22
Joined: Sat Jan 31, 2015 5:18 am
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 0
Contact:

Re: C1 RetroArch + EmulationStation

Post by Floppie »

Also, did you need to make any changes to get mali_fbdev_ctx.c to not throw an error about the missing fbdev_window type? I googled around for quite a while and found a suggestion to just add the struct definition to that file, which gets it to compile (with a warning), but retroarch segfaults on startup. It also can't find a screen, though, with my current setup, which I'm hoping is what's causing the segfault.

Floppie
Posts: 22
Joined: Sat Jan 31, 2015 5:18 am
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 0
Contact:

Re: C1 RetroArch + EmulationStation

Post by Floppie »

Also also - just so I know I'm not crazy - where did you get your -lgles_libs? I may have what I need, but I think we're separated by a significant number of timezones so want to get my questions in while I can :)

User avatar
memeka
Posts: 4420
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART
Has thanked: 2 times
Been thanked: 60 times
Contact:

Re: C1 RetroArch + EmulationStation

Post by memeka »

I had to add some #includes (e.g. linux/fb.h) ... I think you are missing some includes - make sure you are installing the mali-fbdev package from C1 repository ... it contains the includes as well...
-lgles_libs I don't specify at all, retroarch finds it by itself (I have the libs in the standard location /usr/lib/arm.../) ... just install the mali-fbdev package from http://deb.odroid.in/c1/pool/main/m/mal ... _armhf.deb

youka
Posts: 163
Joined: Wed Oct 09, 2013 8:38 pm
languages_spoken: english
ODROIDs: Odroid XU+E, U2, U3, XU3, XU4 + Cloudshell
Has thanked: 0
Been thanked: 0
Contact:

Re: C1 RetroArch + EmulationStation

Post by youka »

memeka wrote:For those interested in source, you need to add a new mali context driver, e.g. src/video/mali-fbdev - there are some modification in several files to add it to config options (e.g. --enable-mali_fbdev) which I am not posting here; I am posting though the source code for the context driver. You need 4 files:
* SDL_maliopengles.h - http://paste.debian.net/143651/
* SDL_maliopengles.c - http://paste.debian.net/143652/
* SDL_malivideo.h - http://paste.debian.net/143653/
* SDL_malivideo.c - http://paste.debian.net/143654/
Ohh! Nice job on adding the fbdev support on SDL. Any more info on how to get it all going (like if I just wanted to use SDL2 on its own with this support), or a patch for SDL2 itself? Sorry for asking (and if it's off topic), but I'm not all that clued up on SDL's source structure and I don't have the time to spend figuring it out either :/

User avatar
memeka
Posts: 4420
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART
Has thanked: 2 times
Been thanked: 60 times
Contact:

Re: C1 RetroArch + EmulationStation

Post by memeka »

use sdl2 normally, SDL_CreateWindow will create fbdev egl window automatically...

Floppie
Posts: 22
Joined: Sat Jan 31, 2015 5:18 am
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 0
Contact:

Re: C1 RetroArch + EmulationStation

Post by Floppie »

memeka wrote:I had to add some #includes (e.g. linux/fb.h) ... I think you are missing some includes - make sure you are installing the mali-fbdev package from C1 repository ... it contains the includes as well...
-lgles_libs I don't specify at all, retroarch finds it by itself (I have the libs in the standard location /usr/lib/arm.../) ... just install the mali-fbdev package from http://deb.odroid.in/c1/pool/main/m/mal ... _armhf.deb
Awesome, adding that repo and installing mali-fbdev is a huge improvement. It'll build now if I only pass --enable-mali_fbdev to ./configure - that package seems to have resolved the fbdev_window struct issue. This is all I get when I try to run it, though:

Code: Select all

./retroarch
RetroArch [WARN] :: config_load_file :: system_directory is not set in config. Assuming system directory is same folder as game: "".
RetroArch [WARN] :: gfx_ctx_init :: Failed to bind API (#0, version 0.0) on context driver "mali-fbdev".
RetroArch [WARN] :: gfx_ctx_init :: Failed to bind API (#0, version 0.0) on context driver "x-egl".
RetroArch [WARN] :: gfx_ctx_init :: Failed to bind API (#0, version 0.0) on context driver "kms-egl".
RetroArch [WARN] :: sdl_ctx_init :: [SDL_GL]: Failed to initialize SDL gfx context driver: No available video device
Segmentation fault
It is worth noting that it doesn't seem to find GLES unless I pass --enable-gles (although retroarch-config.sh takes care of that if enabled in the script):

Code: Select all

$ ./configure --enable-mali_fbdev
...
Checking presence of package libxml-2.0 ... yes
Checking presence of package vg ... no
Checking existence of -lOpenVG ... no
Checking presence of package libv4l2 ... yes
Checking function glFramebufferTexture2D in -lGL ... yes
Checking presence of package freetype2 ... yes
Checking presence of package x11 ... yes
...
versus

Code: Select all

$ ./configure --enable-mali_fbdev --enable-gles
...
Checking presence of package libxml-2.0 ... yes
Checking presence of package glesv2 ... no
Checking existence of -lGLESv2 ... yes
Checking presence of package vg ... no
Checking existence of -lOpenVG ... no
Checking presence of package libv4l2 ... yes
Checking presence of package freetype2 ... yes
Checking presence of package x11 ... yes
...
The second still segfaults, though :(

Code: Select all

$ ./retroarch
RetroArch [WARN] :: config_load_file :: system_directory is not set in config. Assuming system directory is same folder as game: "".
RetroArch [ERROR] :: gfx_ctx_mali_fbdev_init :: [Mali fbdev]: eglGetDisplay failed.
RetroArch [ERROR] :: gfx_ctx_mali_fbdev_init :: [Mali fbdev]: EGL error: 12288.
RetroArch [WARN] :: gfx_ctx_drm_egl_init :: [KMS/EGL]: Couldn't get device resources.
RetroArch [WARN] :: gfx_ctx_drm_egl_init :: [KMS/EGL]: Couldn't get device resources.
RetroArch [ERROR] :: gfx_ctx_drm_egl_init :: [KMS/EGL]: Couldn't find a suitable DRM device.
RetroArch [WARN] :: sdl_ctx_init :: [SDL_GL]: Failed to initialize SDL gfx context driver: No available video device
Segmentation fault
Do you do any --disables or anything?

User avatar
memeka
Posts: 4420
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART
Has thanked: 2 times
Been thanked: 60 times
Contact:

Re: C1 RetroArch + EmulationStation

Post by memeka »

no, but i don't have X11 installed.
in you case, disable X11.
Checking presence of package x11 ... yes
basically just leave GLES, EGL, mali-fbdev, and alsa/pulse (in my case pulse had better sound). Disable every other video driver (x11, wayland, ...).

Floppie
Posts: 22
Joined: Sat Jan 31, 2015 5:18 am
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 0
Contact:

Re: C1 RetroArch + EmulationStation

Post by Floppie »

OK, that might be what's screwing me up. Mine can't find EGL. I'm taking a look at the Mali runtime from the ARM site now, from the README-mali_fbdev_r4p0.md file.

Floppie
Posts: 22
Joined: Sat Jan 31, 2015 5:18 am
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 0
Contact:

Re: C1 RetroArch + EmulationStation

Post by Floppie »

OK, no go with the Mali runtime. Can you see what package is providing your EGL shared objects and headers?

User avatar
memeka
Posts: 4420
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART
Has thanked: 2 times
Been thanked: 60 times
Contact:

Re: C1 RetroArch + EmulationStation

Post by memeka »

mali-fbdev
/usr/lib/arm/.../libEGL.so

Floppie
Posts: 22
Joined: Sat Jan 31, 2015 5:18 am
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 0
Contact:

Re: C1 RetroArch + EmulationStation

Post by Floppie »

Hmm, I definitely have that.

Code: Select all

$ find /usr/lib | grep EGL
/usr/lib/arm-linux-gnueabihf/libEGL.so.1
/usr/lib/arm-linux-gnueabihf/libEGL.so.1.4
/usr/lib/arm-linux-gnueabihf/mali-egl/libEGL.so.1
/usr/lib/arm-linux-gnueabihf/mali-egl/libEGL.so.1.4
/usr/lib/arm-linux-gnueabihf/mali-egl/libEGL.so
/usr/lib/arm-linux-gnueabihf/libEGL.so
$ dpkg-query -L mali-fbdev | grep EGL
/usr/include/EGL
/usr/include/EGL/eglext.h
/usr/include/EGL/fbdev_window.h
/usr/include/EGL/egl.h
/usr/include/EGL/eglplatform.h
/usr/lib/arm-linux-gnueabihf/libEGL.so
/usr/lib/arm-linux-gnueabihf/libEGL.so.1.4
/usr/lib/arm-linux-gnueabihf/libEGL.so.1
I'm going to try to figure out if it's not looking in arm-linux-gnueabihf for whatever reason.

Floppie
Posts: 22
Joined: Sat Jan 31, 2015 5:18 am
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 0
Contact:

Re: C1 RetroArch + EmulationStation

Post by Floppie »

OK, figured out why it isn't finding it. check_pkgconf() in ./configure does --atleast-version=0.0. When I change the check_pkgconf() call for EGL to check for r4p0 (that's what is returned by pkg-config --modversion egl) it finds it, but the built binary still ends up like this:

Code: Select all

$ ./retroarch
RetroArch [WARN] :: config_load_file :: system_directory is not set in config. Assuming system directory is same folder as game: "".
RetroArch [ERROR] :: gfx_ctx_mali_fbdev_init :: [Mali fbdev]: eglGetDisplay failed.
RetroArch [ERROR] :: gfx_ctx_mali_fbdev_init :: [Mali fbdev]: EGL error: 12288.
RetroArch [WARN] :: gfx_ctx_drm_egl_init :: [KMS/EGL]: Couldn't get device resources.
RetroArch [WARN] :: gfx_ctx_drm_egl_init :: [KMS/EGL]: Couldn't get device resources.
RetroArch [ERROR] :: gfx_ctx_drm_egl_init :: [KMS/EGL]: Couldn't find a suitable DRM device.
RetroArch [WARN] :: sdl_ctx_init :: [SDL_GL]: Failed to initialize SDL gfx context driver: No available video device
Segmentation fault
The fact that it isn't found without passing r4p0 is still suspicious, though, because the GLES libs have that as their version as well...

User avatar
memeka
Posts: 4420
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART
Has thanked: 2 times
Been thanked: 60 times
Contact:

Re: C1 RetroArch + EmulationStation

Post by memeka »

lol
sdl_ctx_init :: [SDL_GL]: Failed to initialize SDL gfx context driver: No available video device
as i said before, you need to disable SDL and other video drivers, leave only mali_fbdev.

PS: when it works, can you also check if it still works on 16 bit more (edit /boot/boot.ini comment 32 bit mode and uncomment 16 bit)

Floppie
Posts: 22
Joined: Sat Jan 31, 2015 5:18 am
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 0
Contact:

Re: C1 RetroArch + EmulationStation

Post by Floppie »

OK, so - significantly better now. Based on OP I thought SDL2 needed to be enabled. It builds, it runs with default menu mod without segfaulting. It doesn't seem to display anything to the screen, though - I've tried switching VTs while running it, but haven't been able to actually get the menu to display.

Whatever, though, I really don't care about the retroarch menu. I'm interested in launching it from emulationstation and just copying all my configs from elsewhere. So I built the libretro-bsnes and tried to launch a ROM - this is what I get:

Code: Select all

$ retroarch --libretro /home/odroid/code/libretro-super/dist/unix/bsnes_balanced_libretro.so /home/odroid/roms/Super\ Nintendo/Super\ Mario\ World\ \(U\)\ \[\!\].smc
RetroArch [WARN] :: config_load_file :: system_directory is not set in config. Assuming system directory is same folder as game: "".
RetroArch [ERROR] :: find_video_driver :: Couldn't find any video driver named "ext"
find_video_driver: Available video drivers are:
find_video_driver: 	null
RetroArch [WARN] :: find_video_driver :: Going to default to first video driver...
[bSNES]: XML map:
cartridge region=NTSC
  rom name=program.rom size=0x80000
  ram name=save.ram size=0x800
  map id=rom address=00-7f,80-ff:8000-ffff mask=0x8000
  map id=ram address=70-7f,f0-ff:0000-ffff

[bSNES]: [Memory]: ID 7, Request "manifest.bml".
[bSNES]: Complete load request.
[bSNES]: [Memory]: ID 8, Request "program.rom".
[bSNES]: Load ROM.
[bSNES]: Complete load request.
[bSNES]: [Memory]: ID 9, Request "save.ram".
[bSNES]: Complete load request.
[bSNES]: [Memory]: ID 6, Request "".
[bSNES]: Complete load request.
[bSNES]: SRAM memory size: 2048.
RetroArch [ERROR] :: find_video_driver :: Couldn't find any video driver named "ext"
find_video_driver: Available video drivers are:
find_video_driver: 	null
RetroArch [WARN] :: find_video_driver :: Going to default to first video driver...
Segmentation fault
The same set of find_video_driver errors are thrown for the menu, as well.

If I strace it, here are the last few things I get before the segfault:

Code: Select all

connect(36, {sa_family=AF_LOCAL, sun_path="/run/user/1001/pulse/native"}, 110) = 0
send(35, "W", 1, MSG_NOSIGNAL)          = -1 ENOTSOCK (Socket operation on non-socket)
write(35, "W", 1)                       = 1
clock_gettime(CLOCK_MONOTONIC, {105538, 861743655}) = 0
write(35, "W", 1)                       = 1
futex(0x1056ba8, FUTEX_UNLOCK_PI_PRIVATE, 33) = 0
futex(0x10616b4, FUTEX_WAIT_REQUEUE_PI_PRIVATE, 1, NULL, 0x1056ba8) = 0
futex(0x1056ba8, FUTEX_UNLOCK_PI_PRIVATE, 33) = 0
clock_gettime(CLOCK_MONOTONIC, {105538, 864471671}) = 0
write(35, "W", 1)                       = 1
clock_gettime(CLOCK_MONOTONIC, {105538, 864868673}) = 0
write(35, "W", 1)                       = 1
futex(0x1056ba8, FUTEX_UNLOCK_PI_PRIVATE, 33) = 0
futex(0x10616b4, FUTEX_WAIT_REQUEUE_PI_PRIVATE, 3, NULL, 0x1056ba8) = 0
futex(0x1056ba8, FUTEX_UNLOCK_PI_PRIVATE, 33) = 0
futex(0x1056ba8, FUTEX_LOCK_PI_PRIVATE, 1) = 0
futex(0x1056ba8, FUTEX_UNLOCK_PI_PRIVATE, 33) = 0
mmap2(NULL, 790528, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xac519000
open("", O_RDONLY)                      = -1 ENOENT (No such file or directory)
open("/home/odroid/.config/retroarch/retroarch-content-history.txt", O_RDONLY) = 37
fstat64(37, {st_mode=S_IFREG|0664, st_size=0, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6fcf000
read(37, "", 4096)                      = 0
close(37)                               = 0
munmap(0xb6fcf000, 4096)                = 0
lstat64("/home", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat64("/home/odroid", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat64("/home/odroid/roms", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat64("/home/odroid/roms/Super Nintendo", {st_mode=S_IFDIR|0755, st_size=53248, ...}) = 0
lstat64("/home/odroid/roms/Super Nintendo/Super Mario World (U) [!].smc", {st_mode=S_IFREG|0644, st_size=524800, ...}) = 0
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0} ---
+++ killed by SIGSEGV +++
Segmentation fault
Also,
memeka wrote:PS: when it works, can you also check if it still works on 16 bit more (edit /boot/boot.ini comment 32 bit mode and uncomment 16 bit)
Yes, definitely can do.

User avatar
meveric
Posts: 11806
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1, N1, Go, H2 (N4100), N2, H2 (J4105), GoA, C4, GoA v1.1, H2+, HC4, GoS
Has thanked: 75 times
Been thanked: 577 times
Contact:

Re: C1 RetroArch + EmulationStation

Post by meveric »

bsnes_balanced_libretro.so

very bad core.. you shouldn't use it.. it's very slow and wrong compiler flags can cause the system to crash.

rather use snes9x or snes9x_next or catsfc they run much better and faster.
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.

User avatar
memeka
Posts: 4420
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART
Has thanked: 2 times
Been thanked: 60 times
Contact:

Re: C1 RetroArch + EmulationStation

Post by memeka »

i can confirm with 16bit mode, there is no more alpha issue.
i could run ppssppsdl, and i've got pretty good performance: ~55fps no frameskipping on soulcalibur, but tekken 6 is still slow ~20fps :(
i might have to look again at sdl2/ppssppsdl on mali to see if I can make some improvements.

is there any way to make xbmc videos work on 16bpp?

User avatar
meveric
Posts: 11806
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1, N1, Go, H2 (N4100), N2, H2 (J4105), GoA, C4, GoA v1.1, H2+, HC4, GoS
Has thanked: 75 times
Been thanked: 577 times
Contact:

Re: C1 RetroArch + EmulationStation

Post by meveric »

as i told you Tekken 6 is kinda crappy (and i don't only mean gameplay ;)) The performance is really bad compared to other games.
When i tried XBMC the very first time on ODROIDs (XBMC 11 Eden back then on the Ubuntu 12.04 image) there was an issue that it could not be started in 16bit mode (which we had back then) but the version in the Ubuntu repository could actually start even with 16bit mode.. so there might be a trick to get it to work afterall.. I edited the sources once to deactivate the check for 24bit, but this resulted only in a black window for XBMC.
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.

User avatar
memeka
Posts: 4420
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART
Has thanked: 2 times
Been thanked: 60 times
Contact:

Re: C1 RetroArch + EmulationStation

Post by memeka »

16 bit everything works, but I think the actual video in xbmc does not (but xbmc windows do work).
in ppsspp is interesting to see that with frameskipping DISABLED i get more performance.
e.g. i can get ~55 fps in soulcalibur (rarely can drop to 40, many 60fps) with frameskipping disabled, and i get ~35fps and jerking/lagging with frameskipping enabled (2-5) and autoskip.
tekken 6 also is faster with frameskipping disabled - i can get 40fps - but it's still not playable (it's 80% speed); with frameskipping enabled i get 30fps, and too much skipping also unplayable.
like i said, i suspect xbmc interface works, but the video overlay does not. i hope @odroid / @mdrjr can fix this :D or the alpha issue in 32bit mode...

User avatar
meveric
Posts: 11806
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1, N1, Go, H2 (N4100), N2, H2 (J4105), GoA, C4, GoA v1.1, H2+, HC4, GoS
Has thanked: 75 times
Been thanked: 577 times
Contact:

Re: C1 RetroArch + EmulationStation

Post by meveric »

i had similar issues with frameskipping it kinda depends on the game.. It's not the smartest way.. If it's can't do 60FPS is kinda goes down to lower fps an tries to fill in the gaps with frameskip but that means that sometimes rather than going without frameskip with 55 FPS it does 40 fps with frameskip and that can feel worse than 55 without frameskipping.
But many games actually work nice with frameskipping.
Also MultiThreading can be negative on performance as well.
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.

Floppie
Posts: 22
Joined: Sat Jan 31, 2015 5:18 am
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 0
Contact:

Re: C1 RetroArch + EmulationStation

Post by Floppie »

meveric wrote:bsnes_balanced_libretro.so

very bad core.. you shouldn't use it.. it's very slow and wrong compiler flags can cause the system to crash.

rather use snes9x or snes9x_next or catsfc they run much better and faster.
I tried all the bsnes ones. I'll give snes9x_next a shot.

User avatar
meveric
Posts: 11806
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1, N1, Go, H2 (N4100), N2, H2 (J4105), GoA, C4, GoA v1.1, H2+, HC4, GoS
Has thanked: 75 times
Been thanked: 577 times
Contact:

Re: C1 RetroArch + EmulationStation

Post by meveric »

i meant all bsnes.. also the bnes they are all terrible.
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.

Floppie
Posts: 22
Joined: Sat Jan 31, 2015 5:18 am
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 0
Contact:

Re: C1 RetroArch + EmulationStation

Post by Floppie »

I figured ;)

So that definitely worked - it loaded the ROM and was playing around. After much playing around with video driver ./configure options, this is what worked for me.

Code: Select all

git clean -xdf && ./configure --enable-mali_fbdev --disable-x11 --enable-gles --disable-kms --disable-sdl --disable-sdl2 --enable-alsa --disable-pulse --disable-jack --disable-xvideo --disable-vg --disable-cg --enable-opengl --enable-fbo --enable-freetype && make -j4
For the the non-experts among us, this blows away all files not being tracked by git, then runs the configure script with a slew of options, then builds retroarch with four concurrent compiler jobs (four because it's a quad core CPU).

Now, on to emulationstation and building the cores I care about. Thank you gentlemen for your assistance. It sounds like you already have your answer on 16 bit color, but I'll give it a shot anyway and report back.

robotza
Posts: 66
Joined: Fri Jan 30, 2015 4:44 am
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 0
Contact:

Re: C1 RetroArch + EmulationStation

Post by robotza »

Excellent , will test this weekend

dnom
Posts: 18
Joined: Sat Jan 31, 2015 1:00 am
languages_spoken: english
ODROIDs: C1, C2, C3, C4 ...
Has thanked: 0
Been thanked: 0
Contact:

Re: C1 RetroArch + EmulationStation

Post by dnom »

I'm trying to compile PPSSPPSDL but I'm a bit lost here:
memeka wrote:However, you also need to add the mali egl init code (found in SDL_malivideo) and replace the init code in native/base/PCMain.cpp
Sorry for being a total noob here but I can't figure out which part to replace with what.. :|

Post Reply

Return to “Projects”

Who is online

Users browsing this forum: No registered users and 1 guest