This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 3 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
RetroPie on the Tinker Board
#1
Hello Fellow Tinkerers,

I've been doing some research lately, and I am at a loss with getting RetroPie to run on the Tinker Board. I am trying to piece together an understanding of how kernel and user space GPU drivers work together, what is required to run RetroArch and Emulationstation, and how this relates to this board's support for accelerated gles. 

I know that I don't have a full understanding...is there anyone here that wants to chime in and explain this?

I've run the RetroPie setup script right on the TinkerBoard, and when attempting to run it, I get the following output (which I believe comes from Emulationstation calling OpenGL:


Code:
libGL error: MESA-LOADER: failed to retrieve device information
libGL error: unable to load driver: rockchip_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: rockchip
libGL error: MESA-LOADER: failed to retrieve device information
libGL error: unable to load driver: rockchip_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: rockchip

terminate called after throwing an instance of 'std::logic_error'
    what(): basic_string::_M_construct null not valid
Aborted

I know that I must be doing something terrible wrong, or perhaps I am trying to do something that is not supported from software with this board yet.
I am using @Myy's custom kernel build with the latest Linaro build from Asus. 
Am I missing some user space drivers? Where can I find these drivers? Can I run RetroPie with acceleration on the GPU, or do I need to revert to using full software emulation? Why?
Reply
#2
I looked at the project and it seems they have a version targeting ODroid systems. These systems use Mali GPU (Utgard and Midgard) and drivers, so they're a very good match.

So, first, if you're going to install this software, try to get the version for ODroid systems, not for Raspberry Pi. The reason is that for the RPi, the GPU user-space libraries have been reverse engineered and integrated into Mesa, providing Desktop OpenGL capabilities to the system.

Mali *Midgard* user-space proprietary drivers are still only provided by ARM and the chipmakers, Rockchip in this case. These drivers libraries only provide EGL, OpenCL and OpenGL ES symbols, not OpenGL symbols. Also, running the Mali drivers under X11 on Rockchip systems is quite a challenge if you're not using the special XServer provided by Rockchip.

I'll admit that you're using the XServer provided by the default Tinker OS installation, or that you were able to install the XServer Debian package provided by Rockchip.


That said, besides the right XServer and Xorg drivers, you'll need to install :
  • The Mali Midgard user-space binary drivers for T-7xx chips (Provided by either Rockchip or ARM themselves)
  • A version of Emulation Station that's using OpenGL ES (meaning not the desktop version of OpenGL).
I looked at the CMakefile of Emulation Station, it clearly has a flag during the project configuration that will determine if the project must be linked against the Desktop OpenGL libraries or an OpenGL ES ones. It also seems to detect the mali drivers, if installed correctly in the right folders.

So, worst case, try to recompile it. I highly recommend that you install cmake-gui if you can, install ninja and the build-essentials, then do something like :


Code:
cd /tmp
git clone --depth 1 https://github.com/RetroPie/EmulationStation
cd EmulationStation
git submodule init
git submodule update
cd /tmp
mkdir BuildStation
cd BuildStation
cmake-gui /tmp/EmulationStation



Then click on Configure, in the CMake Gui interface and it will tell you if you're missing some libraries. If that's the case, install the appropriate "-dev" package using apt-get, then reclick on Configure and repeat until everything seems to go fine.
If everything goes fine, just click on Generate.
Then close the window and use the command associated with your Generator (make or ninja)

For a weird reason, this will generate the emulationstation binary in the source dir (/tmp/EmulationStation in this case) instead of generating it in the build dir... Anyway, try to execute /tmp/EmulationStation/emulationstation and see if it works better.

Now, I'll try to repair my X11 installation on my MiQi board this week and give mupen64 and emulationstation a try.
Reply
#3
A while back I tried compiling RetroPie for the tinker board and it just wouldn't work. I set the proper flags and such like mali and neon, and it still wouldn't work. I don't remember how far I got exactly but I know it wouldn't compile. If you get RetroPie to compile, that's only step 1 out of like 50. Each emulator is going to need to be compiled from source when you install them, and chances are, they either won't work correctly or won't work at all. RetroPie is not at all user friendly when it comes to advanced users and when you install an emulator you're going to have to find a bunch of script files to modify to change the build flags and such. It's a pain in the ass. I suggest compiling RetroArch instead, RetroPie is very very bad software. I don't know how it got so popular, but it is full of bad programming. It is just a GUI but a horrible one. It has the worst organization I've ever seen. I would just go with RetroArch since that already works (I suggest compiling though still for better compatibility) and then compiling each emulator yourself. It's easier to install new emulators manually with RetroArch. You just have to make sure the emulator you want has a libretro library for RetroArch to use.
Reply
#4
Retropie will never work unless it's completely recoded from scartch (This was said by a Retropie dev in their forums when asked)
Reply
#5
Why you say never work?

But I saw the Retro's developer had this branch on GitHub.
https://github.com/joolswills/RetroPie-S...nker_board
Reply
#6
Myy, thanks for your help! Ahh CMAKE, this definitely makes life easier. I'm going to forego the discussion about "it doesn't work", and at least give this a shot or find the wall that I can go to ASUS or the community to to solve together.

There's an ongoing discussion here: https://retropie.org.uk/forum/topic/7524...r-board/66. User BuZz has done some work on this, I tried contacting him before starting all this, but no luck.

I think the main discussion happening is that the kernel needs to be recompiled with fbdev support, but your RockMyy repo of the rebuilt kernel includes this, does it not? I am currently working with my build of your kernel. It looks like some people have compiled RetroPie with the X11 Mali driver, but emulation is impractically slow with that method. I'll install the Mali Midgard fbdev driver from the ARM website and see what luck I have. I'll get back soon but if I'm trying to do the impossible, feel free to interject. Thanks for your exceptional support Myy.
Reply
#7
Ok, Myy, I checked on your recommendations and re-built Emulationstation with the OpenGLES selection. Also, I noticed that I already have the Mali Midgard drivers, revision r9p0-r0p0:

Code:
~$ sudo find / -name *.so | grep mali
/usr/lib/arm-linux/gnueabihf/libmali.so
/usr/lib/arm-linux-gnueabihf/libmali-midgard-r9p0-r0p0.so

It looks like libmali.so is actually a symlink to the r9p0-r0p0 library. So, I didn't replace this driver with any new versions.

But, I am still getting the same libGL errors exactly as before....have I missed something? I know that I replaced emulationstation everywhere (just /usr/bin)

Code:
~$whereis emulationstation
emulationstation: /usr/bin/emulationstation /etc/emulationstation

Why is it still trying to use the OpenGL driver? I'm going to do a verbose build and see if that reveals anything..
Reply
#8
Could you provide the result of :

readelf -d /path/to/built/emulationstation
Reply
#9
Code:
linaro@linaro-alip:~/Downloads/RetroPie-Setup/tmp/EmulationStation$ readelf -d emulationstation


Dynamic section at offset 0x3a3e98 contains 41 entries:
 Tag        Type                         Name/Value
0x00000001 (NEEDED)                     Shared library: [libboost_system.so.1.62.0]
0x00000001 (NEEDED)                     Shared library: [libboost_filesystem.so.1.62.0]
0x00000001 (NEEDED)                     Shared library: [libboost_date_time.so.1.62.0]
0x00000001 (NEEDED)                     Shared library: [libboost_locale.so.1.62.0]
0x00000001 (NEEDED)                     Shared library: [libfreetype.so.6]
0x00000001 (NEEDED)                     Shared library: [libfreeimage.so.3]
0x00000001 (NEEDED)                     Shared library: [libSDL2-2.0.so.0]
0x00000001 (NEEDED)                     Shared library: [libpthread.so.0]
0x00000001 (NEEDED)                     Shared library: [libcurl.so.4]
0x00000001 (NEEDED)                     Shared library: [libvlc.so.5]
0x00000001 (NEEDED)                     Shared library: [libasound.so.2]
0x00000001 (NEEDED)                     Shared library: [libEGL.so]
0x00000001 (NEEDED)                     Shared library: [libstdc++.so.6]
0x00000001 (NEEDED)                     Shared library: [libm.so.6]
0x00000001 (NEEDED)                     Shared library: [libgcc_s.so.1]
0x00000001 (NEEDED)                     Shared library: [libc.so.6]
0x0000000c (INIT)                       0xe2898
0x0000000d (FINI)                       0x1c492c
0x00000019 (INIT_ARRAY)                 0x3b01e0
0x0000001b (INIT_ARRAYSZ)               316 (bytes)
0x0000001a (FINI_ARRAY)                 0x3b031c
0x0000001c (FINI_ARRAYSZ)               4 (bytes)
0x6ffffef5 (GNU_HASH)                   0x1b4
0x00000005 (STRTAB)                     0x18440
0x00000006 (SYMTAB)                     0x6fc0
0x0000000a (STRSZ)                      295590 (bytes)
0x0000000b (SYMENT)                     16 (bytes)
0x00000015 (DEBUG)                      0x0
0x00000003 (PLTGOT)                     0x3b4000
0x00000002 (PLTRELSZ)                   3240 (bytes)
0x00000014 (PLTREL)                     REL
0x00000017 (JMPREL)                     0xe1bf0
0x00000011 (REL)                        0x62b28
0x00000012 (RELSZ)                      520392 (bytes)
0x00000013 (RELENT)                     8 (bytes)
0x6ffffffb (FLAGS_1)                    Flags: PIE
0x6ffffffe (VERNEED)                    0x62978
0x6fffffff (VERNEEDNUM)                 7
0x6ffffff0 (VERSYM)                     0x606e6
0x6ffffffa (RELCOUNT)                   64558
0x00000000 (NULL)                       0x0

So that's cool...

I see libEGL.so...some library used by Mesa? Do I need to find where Mesa is built (I'm making an assumption that it is built along with the many other packages with the RetroPie build script) and include GLES options there too you think?

Maybe another point to note: before installing your custom kernel build, I ran the glxgears demo, and only got about 40FPS. Now running it, I get 200FPS.

When I run this demo, I guess it is based off this same graphics library, because I receive the exact same libGL errors I noted earlier when attempting to launch emulationstation (or maybe a process that emulationstation spawned).
Reply
#10
(08-18-2017, 03:26 AM)RPisces Wrote:
Code:
linaro@linaro-alip:~/Downloads/RetroPie-Setup/tmp/EmulationStation$ readelf -d emulationstation


Dynamic section at offset 0x3a3e98 contains 41 entries:
 Tag        Type                         Name/Value
0x00000001 (NEEDED)                     Shared library: [libboost_system.so.1.62.0]
0x00000001 (NEEDED)                     Shared library: [libboost_filesystem.so.1.62.0]
0x00000001 (NEEDED)                     Shared library: [libboost_date_time.so.1.62.0]
0x00000001 (NEEDED)                     Shared library: [libboost_locale.so.1.62.0]
0x00000001 (NEEDED)                     Shared library: [libfreetype.so.6]
0x00000001 (NEEDED)                     Shared library: [libfreeimage.so.3]
0x00000001 (NEEDED)                     Shared library: [libSDL2-2.0.so.0]
0x00000001 (NEEDED)                     Shared library: [libpthread.so.0]
0x00000001 (NEEDED)                     Shared library: [libcurl.so.4]
0x00000001 (NEEDED)                     Shared library: [libvlc.so.5]
0x00000001 (NEEDED)                     Shared library: [libasound.so.2]
0x00000001 (NEEDED)                     Shared library: [libEGL.so]
0x00000001 (NEEDED)                     Shared library: [libstdc++.so.6]
0x00000001 (NEEDED)                     Shared library: [libm.so.6]
0x00000001 (NEEDED)                     Shared library: [libgcc_s.so.1]
0x00000001 (NEEDED)                     Shared library: [libc.so.6]
0x0000000c (INIT)                       0xe2898
0x0000000d (FINI)                       0x1c492c
0x00000019 (INIT_ARRAY)                 0x3b01e0
0x0000001b (INIT_ARRAYSZ)               316 (bytes)
0x0000001a (FINI_ARRAY)                 0x3b031c
0x0000001c (FINI_ARRAYSZ)               4 (bytes)
0x6ffffef5 (GNU_HASH)                   0x1b4
0x00000005 (STRTAB)                     0x18440
0x00000006 (SYMTAB)                     0x6fc0
0x0000000a (STRSZ)                      295590 (bytes)
0x0000000b (SYMENT)                     16 (bytes)
0x00000015 (DEBUG)                      0x0
0x00000003 (PLTGOT)                     0x3b4000
0x00000002 (PLTRELSZ)                   3240 (bytes)
0x00000014 (PLTREL)                     REL
0x00000017 (JMPREL)                     0xe1bf0
0x00000011 (REL)                        0x62b28
0x00000012 (RELSZ)                      520392 (bytes)
0x00000013 (RELENT)                     8 (bytes)
0x6ffffffb (FLAGS_1)                    Flags: PIE
0x6ffffffe (VERNEED)                    0x62978
0x6fffffff (VERNEEDNUM)                 7
0x6ffffff0 (VERSYM)                     0x606e6
0x6ffffffa (RELCOUNT)                   64558
0x00000000 (NULL)                       0x0

So that's cool...

I see libEGL.so...some library used by Mesa? Do I need to find where Mesa is built (I'm making an assumption that it is built along with the many other packages with the RetroPie build script) and include GLES options there too you think?

Maybe another point to note: before installing your custom kernel build, I ran the glxgears demo, and only got about 40FPS. Now running it, I get 200FPS.

When I run this demo, I guess it is based off this same graphics library, because I receive the exact same libGL errors I noted earlier when attempting to launch emulationstation (or maybe a process that emulationstation spawned).

It's actually using EGL and SDL. EGL is provided by the Mali drivers and SDL... should use anything it can.

glxgears only use GLX and Desktop OpenGL, which is of no use when testing the Mali drivers. Use es2gears instead.

I'll try to give it a look today.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)