retroarch on minimal X?

Post Reply
raidenii
Posts: 12
Joined: Tue Sep 17, 2019 9:04 am
languages_spoken: english
ODROIDs: N2
Has thanked: 2 times
Been thanked: 0
Contact:

retroarch on minimal X?

Unread post by raidenii » Tue Sep 17, 2019 9:21 am

Hi all,

Sorry for being a newbie on Linux graphics - I recently bought an ODROID N2 and would like to build it as a Retroarch-based emulation station. Instead of using existing images (like EmuELEC/batocera linux), I'd like to stick with official Ubuntu minimal image and start from there. Also, it seems that DRM driver is not currently available for Odroid N2, thus I can't use KMS or Wayland but X to launch Retroarch. (I've tried the DRM kernel; however, without console output it's not too much of a use)

So I created the SD card with Ubuntu 18.04 20190806 minimal image, did a apt-get update && apt-get upgrade after boot up, and installed minimal X with the following:

Code: Select all

apt-get install --no-install-recommends xserver-xorg-core xserver-xorg-video-fbdev xserver-xorg-input-evdev xserver-xorg-legacy xinit dwm
However, when I put retroarch in xinitrc along with dwm, it throws error like:

Code: Select all

RetroArch [INFO] :: This is RetroArch version 1.4.1 (Git d8855ca)
RetroArch [INFO] :: === Build =======================================
RetroArch [INFO] :: Version: 1.4.1
RetroArch [INFO] :: Git: d8855ca
RetroArch [INFO] :: =================================================
RetroArch [INFO] :: Loading default config.
RetroArch [INFO] :: Looking for config in: "/home/tony/.config/retroarch/retroarch.cfg".
RetroArch [WARN] :: screenshot_directory is not an existing directory, ignoring ...
RetroArch [INFO] :: Environ SET_PIXEL_FORMAT: RGB565.
RetroArch [INFO] :: Version of libretro API: 1
RetroArch [INFO] :: Compiled against API: 1
RetroArch [INFO] :: Set audio input rate to: 29970.03 Hz.
RetroArch [INFO] :: Video @ 960x720
RetroArch [ERROR] :: Failed to connect to Wayland server.
RetroArch [INFO] :: [DBus]: Failed to get DBus connection. Screensaver will not be suspended via DBus.
RetroArch [ERROR] :: [EGL]: Couldn't get EGL display.
RetroArch [ERROR] :: [EGL]: #0x3000, EGL_SUCCESS
RetroArch [ERROR] :: [KMS]: Couldn't find a suitable DRM device.
RetroArch [INFO] :: [SDL_GL] SDL 2.0.5 gfx context driver initialized.
RetroArch [INFO] :: Found GL context: sdl_gl
RetroArch [INFO] :: Detecting screen resolution 1920x1080.
RetroArch [WARN] :: [SDL_GL]: Failed to set video mode: Could not get EGL display
RetroArch [ERROR] :: Cannot open video driver ... Exiting ...
RetroArch [ERROR] :: Fatal error received in: "init_video()"
RetroArch [ERROR] :: This core requires a content file.
Any help is much appreciated.

User avatar
odroid
Site Admin
Posts: 32690
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 212 times
Been thanked: 364 times
Contact:

Re: retroarch on minimal X?

Unread post by odroid » Tue Sep 17, 2019 9:43 am

Unfortunately, ARM does not support any X11/EGL drivers for their recent Mali Bifrost GPUs.
Sorry about that.

raidenii
Posts: 12
Joined: Tue Sep 17, 2019 9:04 am
languages_spoken: english
ODROIDs: N2
Has thanked: 2 times
Been thanked: 0
Contact:

Re: retroarch on minimal X?

Unread post by raidenii » Tue Sep 17, 2019 9:45 am

odroid wrote:
Tue Sep 17, 2019 9:43 am
Unfortunately, ARM does not support any X11/EGL drivers for their recent Mali Bifrost GPUs.
Sorry about that.
Indeed Arm will not offer X11 driver for Bifrost, but is there any way to force Retroarch to use fbdev?

User avatar
odroid
Site Admin
Posts: 32690
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 212 times
Been thanked: 364 times
Contact:

Re: retroarch on minimal X?

Unread post by odroid » Tue Sep 17, 2019 9:55 am

You had to build RetroArch source code with a proper configuration something like this.

Code: Select all

./configure --enable-opengles --disable-kms --disable-x11 --enable-mali_fbdev
It is worth to try RetroArena OS image(which runs on the minimal Ubuntu image) and look into how they built it.
These users thanked the author odroid for the post:
raidenii (Wed Sep 18, 2019 8:45 am)

raidenii
Posts: 12
Joined: Tue Sep 17, 2019 9:04 am
languages_spoken: english
ODROIDs: N2
Has thanked: 2 times
Been thanked: 0
Contact:

Re: retroarch on minimal X?

Unread post by raidenii » Tue Sep 17, 2019 10:00 am

Thanks! Will give a try.

raidenii
Posts: 12
Joined: Tue Sep 17, 2019 9:04 am
languages_spoken: english
ODROIDs: N2
Has thanked: 2 times
Been thanked: 0
Contact:

Re: retroarch on minimal X?

Unread post by raidenii » Tue Sep 17, 2019 11:03 am

BTW, libsdl2 is held back due to Hardkernel's own patch to it. Where can I get corresponding libsdl2-dev?

User avatar
odroid
Site Admin
Posts: 32690
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 212 times
Been thanked: 364 times
Contact:

Re: retroarch on minimal X?

Unread post by odroid » Tue Sep 17, 2019 11:34 am

The pre-installed libsdl2 package has a patch to use the Mali GPU driver.
We will update it soon to sync with the latest Canonical's update.

BTW, what happens if you run "apt install libsdl2-dev"?

raidenii
Posts: 12
Joined: Tue Sep 17, 2019 9:04 am
languages_spoken: english
ODROIDs: N2
Has thanked: 2 times
Been thanked: 0
Contact:

Re: retroarch on minimal X?

Unread post by raidenii » Tue Sep 17, 2019 10:07 pm

Here's what I got:

Code: Select all

tony@odroid:~$ sudo apt-get install libsdl2-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libsdl2-dev : Depends: libegl1-mesa-dev but it is not going to be installed
               Depends: libgl1-mesa-dev but it is not going to be installed
               Depends: libgles2-mesa-dev but it is not going to be installed
               Depends: libglu1-mesa-dev but it is not going to be installed
               Depends: libsdl2-2.0-0 (= 2.0.8+dfsg1-1ubuntu1.18.04.3) but 2.0.8 is to be installed
E: Unable to correct problems, you have held broken packages.
tony@odroid:~$

mdrjr
Site Admin
Posts: 11726
Joined: Fri Feb 22, 2013 11:34 pm
languages_spoken: english, portuguese
ODROIDs: -
Location: Brazil
Has thanked: 1 time
Been thanked: 13 times
Contact:

Re: retroarch on minimal X?

Unread post by mdrjr » Wed Sep 18, 2019 8:07 am

Hello,

Its safe now to unhold libsdl2 package, the updated one will be a fixed one with libsdl2-dev on our repos.
These users thanked the author mdrjr for the post:
raidenii (Wed Sep 18, 2019 8:44 am)

raidenii
Posts: 12
Joined: Tue Sep 17, 2019 9:04 am
languages_spoken: english
ODROIDs: N2
Has thanked: 2 times
Been thanked: 0
Contact:

Re: retroarch on minimal X?

Unread post by raidenii » Wed Sep 18, 2019 8:34 am

mdrjr wrote:
Wed Sep 18, 2019 8:07 am
Hello,

Its safe now to unhold libsdl2 package, the updated one will be a fixed one with libsdl2-dev on our repos.
Thanks! Seems indeed the case:

Code: Select all

tony@odroid:~$ sudo apt-cache policy libsdl2-2.0
libsdl2-2.0-0:
  Installed: 2.0.8
  Candidate: 2:2.0.8+dfsg1-1ubuntu1.18.04.3-hk1
  Version table:
     2:2.0.8+dfsg1-1ubuntu1.18.04.3-hk1 500
        500 http://deb.odroid.in/n2 bionic/main arm64 Packages
Should have checked eariler. Although seems there are other dependencies broken:

Code: Select all

tony@odroid:~$ sudo apt-get install libsdl2-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libsdl2-dev : Depends: libegl1-mesa-dev but it is not going to be installed
               Depends: libgl1-mesa-dev but it is not going to be installed
               Depends: libgles2-mesa-dev but it is not going to be installed
               Depends: libglu1-mesa-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
tony@odroid:~$
Looks like they're conflicting with mali-fbdev, but that's probably something I should not remove if I plan to compile against?

User avatar
odroid
Site Admin
Posts: 32690
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 212 times
Been thanked: 364 times
Contact:

Re: retroarch on minimal X?

Unread post by odroid » Wed Sep 18, 2019 8:42 am

I hope you can build the Retroarch for the Mali-fbdev soon.

mdrjr
Site Admin
Posts: 11726
Joined: Fri Feb 22, 2013 11:34 pm
languages_spoken: english, portuguese
ODROIDs: -
Location: Brazil
Has thanked: 1 time
Been thanked: 13 times
Contact:

Re: retroarch on minimal X?

Unread post by mdrjr » Wed Sep 18, 2019 11:59 am

Can you try manually installing libegl1-mesa-dev ?

let me know on what it conflicts

raidenii
Posts: 12
Joined: Tue Sep 17, 2019 9:04 am
languages_spoken: english
ODROIDs: N2
Has thanked: 2 times
Been thanked: 0
Contact:

Re: retroarch on minimal X?

Unread post by raidenii » Wed Sep 18, 2019 7:35 pm

mdrjr wrote:
Wed Sep 18, 2019 11:59 am
Can you try manually installing libegl1-mesa-dev ?

let me know on what it conflicts
It starts from:

Code: Select all

tony@odroid:~$ sudo apt-get install libegl1-mesa-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libegl1-mesa-dev : Depends: libglvnd-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
And trace all the way down, which says libglvnd-dev depends on libegl1, libgles1 and libgles2, I got:

Code: Select all

tony@odroid:~$ sudo apt-get install libsdl2-dev libegl1-mesa-dev libglvnd-dev libegl1 libgles1 libgles2
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  libboost-filesystem1.65.1 libboost-system1.65.1 libcapnp-0.6.1 libdrm-dev libdrm-freedreno1 libdrm-tegra0
  libegl-mesa0 libgl1-mesa-dev libgles2-mesa-dev libglu1-mesa libglu1-mesa-dev libglvnd-core-dev libice-dev
  libmirclient-dev libmirclient9 libmircommon-dev libmircommon7 libmircookie-dev libmircookie2 libmircore-dev
  libmircore1 libmirprotobuf3 libopengl0 libprotobuf-dev libprotobuf-lite10 libprotobuf10 libpulse-dev
  libpulse-mainloop-glib0 libsm-dev libsndio-dev libwayland-bin libwayland-dev libx11-xcb-dev libxcb-dri2-0-dev
  libxcb-dri3-dev libxcb-glx0-dev libxcb-present-dev libxcb-randr0-dev libxcb-render0-dev libxcb-shape0-dev
  libxcb-sync-dev libxcb-xfixes0-dev libxdamage-dev libxkbcommon-dev libxshmfence-dev libxt-dev libxv-dev
  mesa-common-dev x11proto-damage-dev
Suggested packages:
  libice-doc libsm-doc libwayland-doc libxt-doc
The following packages will be REMOVED:
  mali-fbdev
The following NEW packages will be installed:
  libboost-filesystem1.65.1 libboost-system1.65.1 libcapnp-0.6.1 libdrm-dev libdrm-freedreno1 libdrm-tegra0
  libegl-mesa0 libegl1 libegl1-mesa-dev libgl1-mesa-dev libgles1 libgles2 libgles2-mesa-dev libglu1-mesa
  libglu1-mesa-dev libglvnd-core-dev libglvnd-dev libice-dev libmirclient-dev libmirclient9 libmircommon-dev
  libmircommon7 libmircookie-dev libmircookie2 libmircore-dev libmircore1 libmirprotobuf3 libopengl0 libprotobuf-dev
  libprotobuf-lite10 libprotobuf10 libpulse-dev libpulse-mainloop-glib0 libsdl2-dev libsm-dev libsndio-dev
  libwayland-bin libwayland-dev libx11-xcb-dev libxcb-dri2-0-dev libxcb-dri3-dev libxcb-glx0-dev libxcb-present-dev
  libxcb-randr0-dev libxcb-render0-dev libxcb-shape0-dev libxcb-sync-dev libxcb-xfixes0-dev libxdamage-dev
  libxkbcommon-dev libxshmfence-dev libxt-dev libxv-dev mesa-common-dev x11proto-damage-dev
0 upgraded, 55 newly installed, 1 to remove and 0 not upgraded.
Need to get 5903 kB of archives.
After this operation, 2043 kB disk space will be freed.

gerulrich
Posts: 9
Joined: Tue Jun 18, 2019 10:00 pm
languages_spoken: english,spanish
ODROIDs: N2
Has thanked: 0
Been thanked: 5 times
Contact:

Re: retroarch on minimal X?

Unread post by gerulrich » Fri Sep 27, 2019 1:52 am

I made some packages:
fbdev-dev and libsdl2-dev to install headers without conflicts and retroarch compiled for mali-fbdev.

They are not fully tested, but you can give it a try

https://drive.google.com/drive/folders/ ... sp=sharing

raidenii
Posts: 12
Joined: Tue Sep 17, 2019 9:04 am
languages_spoken: english
ODROIDs: N2
Has thanked: 2 times
Been thanked: 0
Contact:

Re: retroarch on minimal X?

Unread post by raidenii » Sun Sep 29, 2019 2:30 am

gerulrich wrote:
Fri Sep 27, 2019 1:52 am
I made some packages:
fbdev-dev and libsdl2-dev to install headers without conflicts and retroarch compiled for mali-fbdev.

They are not fully tested, but you can give it a try

https://drive.google.com/drive/folders/ ... sp=sharing
Thanks. Mind sharing how you made those packages?

vayd3r
Posts: 5
Joined: Tue Nov 26, 2019 1:13 am
languages_spoken: english
ODROIDs: N2, HC2
Has thanked: 0
Been thanked: 0
Contact:

Re: retroarch on minimal X?

Unread post by vayd3r » Wed Dec 04, 2019 12:47 am

I'm also trying to build retroarch on the ubuntu minimal image. I am getting the same dependency issues that the OP was getting. Is there a suggested procedure for getting the dev packages installed? I see gerulrch created some packages which is great but I'd like to know the manual procedure for resolving this as well.

gerulrich
Posts: 9
Joined: Tue Jun 18, 2019 10:00 pm
languages_spoken: english,spanish
ODROIDs: N2
Has thanked: 0
Been thanked: 5 times
Contact:

Re: retroarch on minimal X?

Unread post by gerulrich » Wed Dec 04, 2019 12:43 pm

vayd3r wrote:
Wed Dec 04, 2019 12:47 am
I'm also trying to build retroarch on the ubuntu minimal image. I am getting the same dependency issues that the OP was getting. Is there a suggested procedure for getting the dev packages installed? I see gerulrch created some packages which is great but I'd like to know the manual procedure for resolving this as well.
Since the problem is a conflict between the packages with the development headers and the mali-fbdev package, the solution is to install the headers manually.

I have downloaded opengl headers from here

Code: Select all

https://www.khronos.org/registry/EGL/api/EGL/egl.h
https://www.khronos.org/registry/EGL/api/EGL/eglext.h
https://www.khronos.org/registry/EGL/api/EGL/eglplatform.h

https://www.khronos.org/registry/OpenGL/api/GLES3/gl3.h
https://www.khronos.org/registry/OpenGL/api/GLES3/gl31.h
https://www.khronos.org/registry/OpenGL/api/GLES3/gl32.h
https://www.khronos.org/registry/OpenGL/api/GLES3/gl3platform.h

https://www.khronos.org/registry/OpenGL/api/GLES2/gl2ext.h
https://www.khronos.org/registry/OpenGL/api/GLES2/gl2.h
https://www.khronos.org/registry/OpenGL/api/GLES2/gl2ext.h
https://www.khronos.org/registry/OpenGL/api/GLES2/gl2platform.h

https://www.khronos.org/registry/EGL/api/KHR/khrplatform.h
and put the files in /usr/include/EGL, /usr/include/GLES3 and /usr/include/GLES2 respectively

You also have to apply this patch:

Code: Select all

--- a/EGL/eglplatform.h
+++ b/EGL/eglplatform.h
@@ -35,6 +35,7 @@
  */

 #include <KHR/khrplatform.h>
+#include <EGL/fbdev_window.h>

 /* Macros used in EGL function prototype declarations.
  *
for sdl2 headers, download

Code: Select all

https://github.com/spurious/SDL-mirror/archive/ef5bf55e83c9d0ccf7a02bc2b08b0d6e46e1b6ef.tar.gz
extract and copy the files inside include folder to /usr/include/SDL2 directory.

Ejecute

Code: Select all

./configure --prefix=/usr
and copy the file sdl2-config to /usr/bin.

You have to create some simlinks

Code: Select all

ln -s /usr/lib/aarch64-linux-gnu/libSDL2-2.0.so.0 /usr/lib/aarch64-linux-gnu/libSDL2-2.0.so
ln -s /usr/lib/aarch64-linux-gnu/libSDL2-2.0.so.0 /usr/lib/aarch64-linux-gnu/libSDL2.so
I have followed these steps to create the fbdev-dev and libsdl2-dev packages that I shared previously

vayd3r
Posts: 5
Joined: Tue Nov 26, 2019 1:13 am
languages_spoken: english
ODROIDs: N2, HC2
Has thanked: 0
Been thanked: 0
Contact:

Re: retroarch on minimal X?

Unread post by vayd3r » Thu Dec 05, 2019 7:11 am

Thanks for the follow up information gerulrich, this is very helpful!

Post Reply

Return to “Ubuntu”

Who is online

Users browsing this forum: No registered users and 2 guests