ayufan-rock64 / linux-build

Rock64 Linux build scripts, tools and instructions
MIT License
562 stars 98 forks source link

rock64/mali optimised libsdl2-dev packages #253

Open danboid opened 6 years ago

danboid commented 6 years ago

Could you please add a rock64 optimised and easily installable libsdl2-dev package(s) to your ubuntu repo please?

libsdl2-dev from the official ubuntu repos fails to install because it depends upon libgles2-mesa-dev which in turn tries to install libegl1-mesa-dev which contains an egl.so that clashes with the mali egl library.

Here are some apps and games we could build and hopefully run under rock64 Linux if we have rock64 mali linked/optimised libsdl2-dev packages:

An open source Dreamcast emulator that supports GLES2 accel:

https://github.com/reicast/reicast-emulator

A PSP emu that does the same:

https://www.ppsspp.org/

Hurrican, then open source Turrican update / tribute:

https://sourceforge.net/projects/hurrican/

mupen64(plus)

https://github.com/mupen64plus

and maybe even Dolphin - the open source Gamecube and Wii emulator, which again supports GLES

https://dolphin-emu.org/

mrfixit2001 commented 6 years ago

@danboid FYI - the emulation apps you've listed (except dolphin, because it's too hardware demanding) are all available in the recalbox release and run using GLES. https://forum.pine64.org/showthread.php?tid=6351

danboid commented 6 years ago

Hi mrfixit!

Thanks for pointing out recalbox! I'd not heard of it before.

I've just given it a quick go but I'll give my feedback on the pine64 forum as we're getting OT.

danboid commented 5 years ago

The libmali rockcpu GPU driver package conflicts with some of the xorg dev packages. In order to install the xorg dev packages or anything that may require those packages (such as libsdl2-dev) you first need to forcefully remove the mali driver:

sudo dpkg --purge --force-all libmali-rk-utgard-450-r7p0

After installing all your required xorg etc dev packages, you can forcefully re-install the Mali driver, a regular apt install won't work due to the gles2 mali/mesa library conflict:

sudo apt-get -o Dpkg::Options::="--force-overwrite" install libmali-rk-utgard-450-r7p0
mrfixit2001 commented 5 years ago

@danboid - definitely true. I outlined some of the install steps to force override package installs in my retropie writeup on the pine64 forums. Not a lot can be done about it tho, because there are libraries and files that are included in multiple packages that overlap the Mali package. That's why in the simplified Debian build I made available (https://github.com/mrfixit2001/debian_builds) I didn't install Mali as a package. I installed the headers and libraries and links manually. This way other packages can be cleanly installed. Then when you're done with installing all your packages I provided a script to run that fixes any links that got overwritten by other packages. My builds are different from ayufan's in a number of ways, and the kernel is primarily geared towards emulation and media playback. Ayufan's are much better at other solutions that this board can be utilized for. But I hope this provides some insights.

danboid commented 5 years ago

@mrfixit2001

Your rock64 Debian build sounds interesting so I have a few questions:

Are you going to upload the source (for your patches, build scripts etc) to GH or elsewhere?

Do you (plan to) have a repo for rock64/mali optimised packages such as mpv, ffmpeg, SDL and the custom kernel source/headers etc?

Have you got playback of 4K h264 (30 fps) files working reliably with mpv under your distro?

Does SDL (1 and 2) gles2 'just work' with the mali driver (under your distro) or does it require patching and/or a custom build (different from the standard Debian arm64 packages) to get working properly?

Thanks

mrfixit2001 commented 5 years ago

@danboid

At some point yes, I'll be propping up repos for all my stuff. Maybe not the debian image because I kept that pretty "stock", so frankly it's really just the debian bootstrapper with a minimal file system overlay (for mali and my boot-script) and a partition creation script which includes my kernel.

The source for my recalbox port needs to go into recalbox's gitlab (just waiting on them to provide a branch), but the rest will be on my github eventually.

I've got a robust retropie port I'm working on right now with a lot of custom patches that optimize emulator performance. Once that package is complete I'll be sharing it all out. I'm trying to include my custom patches into my recalbox release as I go as well, but the two builds don't always use the same emulator versions.

I don't plan to have dedicated repos for smaller libraries, because things like SDL, FFMPEG, and RKMPP are not my specialty. For the media libraries I'm using patches from the LE repo, as they are optimized: https://github.com/LibreELEC/LibreELEC.tv/tree/master/packages/multimedia SDL, however, can be a bit special, depending on your implementation. For retropie support I have found using the retropie SDL repo is best. Recalbox goes directly to the libsdl source and then adds some patches specifically to support their back-end.

One piece of advice... when compiling from source, while patches are important at times, the "magic" is truly in the build flags. So don't just concentrate on the patches and diffs, read the packages for those compiler settings.