Attract-Mode Support Forum

Attract-Mode Support => General => Topic started by: rwebb616 on October 27, 2021, 04:12:03 PM

Title: ODROID XU4 - gui environment installed but Failed to open X11 display error
Post by: rwebb616 on October 27, 2021, 04:12:03 PM
So how does one set up attract to run at startup without starting an entire desktop environment.  I have it installed but basically I want attract mode to come up at boot and not have to launch it from the desktop.

Right now I have changed my default systemctl target to multi-user so it boots to a shell login with no display manager. 

I manually compiled attract mode using the USE_GLES=1 flag and have not done the make install yet. I was just trying to get the executable to run and it's giving me this error:
Failed to open X11 display: make sure the DISPLAY environment variable is set correctly.
Aborted

It would be really good if there were some documentation on this.  It seems like a basic thing that most people would like to know how to accomplish.

Thanks
Rich
Title: Re: ODROID XU4 - gui environment installed but Failed to open X11 display error
Post by: kent79 on October 27, 2021, 04:56:03 PM
First of all, I have no experience to do that. But I have idea, you may try.

Following as below guide to install Retropie in ODROID XU4 and then install Attract Mode. It should be OK.

https://retropie.org.uk/docs/Odroid-XU3-XU4/
Title: Re: ODROID XU4 - gui environment installed but Failed to open X11 display error
Post by: rwebb616 on October 27, 2021, 05:12:44 PM
Yes, I thought of doing that too - was just getting started on it.  In the RetroPie setup script though under experimental Attract mode is listed as not available.  I'm not sure if I install manually if it will put everything in the place it should be for Retropie.

Rich
Title: Re: ODROID XU4 - gui environment installed but Failed to open X11 display error
Post by: rwebb616 on October 27, 2021, 06:52:02 PM
Ok - installed RetroPie now and Attract mode will not run even in X now.  It gives me an error in the terminal window saying something about can't display texture or something.  At first I got a shared library error so I recompiled attract mode.  It compiled successfully but it just won't run under X11

Any help? Please? :)

Rich
Title: Re: ODROID XU4 - gui environment installed but Failed to open X11 display error
Post by: kent79 on October 27, 2021, 07:16:09 PM
http://forum.attractmode.org/index.php?topic=2275.msg15386#msg15386
Please try to follow #8 Retropie Setup & Install Attract Mode
Title: Re: ODROID XU4 - gui environment installed but Failed to open X11 display error
Post by: Calvin on October 28, 2021, 12:34:27 AM
Hi, I was trying to achieve the same thing (running outside X11) the last few days and I finally got it working. There really is a lack of documentation on that topic.

The issue you are having is probably due to the sfml installation you are using. The steps I took to have it run outside X11 were basically:

1) Compile and install sfml-pi (DRM version) Instructions: https://github.com/mickelson/sfml-pi (https://github.com/mickelson/sfml-pi)
2) sudo make install to install your newly compiled sfml-pi
3) Compile and install attract as you did with flag USE_DRM=1

This should be enough to run attract straight from the console. I have tested this on Ubuntu Server.

If you are experiencing any issues feel free to ask as I went through this procedure recently I might be able to help. (Although I am a newbie with Linux)

EDIT: I think all your emulators have to also support KMS/DRM. I am using Retroarch for this. Instructions: https://docs.libretro.com/guides/kms-mode/ (https://docs.libretro.com/guides/kms-mode/)
Title: Re: ODROID XU4 - gui environment installed but Failed to open X11 display error
Post by: rwebb616 on October 28, 2021, 08:52:33 AM
http://forum.attractmode.org/index.php?topic=2275.msg15386#msg15386
Please try to follow #8 Retropie Setup & Install Attract Mode

Thanks for that - but on the Odroid this does not work - Attract is listed as unavailable in the retropie experimental packages.  Works fine on the Pi though.

Rich
Title: Re: ODROID XU4 - gui environment installed but Failed to open X11 display error
Post by: rwebb616 on October 28, 2021, 08:55:56 AM
Hi, I was trying to achieve the same thing (running outside X11) the last few days and I finally got it working. There really is a lack of documentation on that topic.

Is this for the odroid?  I'm guessing sfml-pi really doesn't mean only for Rpi ?

Rich
Title: Re: ODROID XU4 - gui environment installed but Failed to open X11 display error
Post by: Calvin on October 28, 2021, 09:32:38 AM
I don't know about odroid. As long as you can compile you should be fine. My Ubuntu Server runs on a regular desktop PC not a Raspberry.
Quote
Is this for the odroid?  I'm guessing sfml-pi really doesn't mean only for Rpi
Exactly it is not only for Rpi. This had me confused as well.
Title: Re: ODROID XU4 - gui environment installed but Failed to open X11 display error
Post by: rwebb616 on October 28, 2021, 01:13:27 PM
Ok well I just wrote a fresh sd card with 18.04 and ran all the updates.  I'm not sure if I should install RetroPie first or work on getting Attract Mode running under the console first.  My 18.04 is a minimal install so no GUI installed at all. 

It would be really cool if there were someone that had an Odroid-XU4 that wanted to work with me to get a stable attract mode image.. or at least a guide on how to set one up using Attract Mode and RetroPie. 

Calvin - feel like investing in an Odroid?  about $71 on Amazon. :)
Rich
Title: Re: ODROID XU4 - gui environment installed but Failed to open X11 display error
Post by: rwebb616 on October 28, 2021, 02:27:10 PM
Ok got it all compiled - will not run - getting errors about failing to set mode:

Failed to set mode: Unknown error 524
Aborted

Title: Re: ODROID XU4 - gui environment installed but Failed to open X11 display error
Post by: rwebb616 on October 28, 2021, 02:36:19 PM
Tried to run again and got another error about the pixel format modifier :

Code: [Select]
Attract-Mode v2.6.1 (Linux, SFML 2.5.1 +FontConfig +SWF)
avcodec 57.107.100 / avformat 57.83.100 / swscale 4.8.100 / avutil 55.78.100 / swresample 2.9.100

Config file not found: /home/arcade/.attract/attract.cfg
 - Constructed 1 filters in 0 ms (1 comparisons)
[ 3311.078905] [drm:exymos_plane_atomic_check] *ERROR* unsupported pixel format modifier
Failed to set mode: Unknown error 524
Aborted
arcade@odroid:~$
Title: Re: ODROID XU4 - gui environment installed but Failed to open X11 display error
Post by: Calvin on October 28, 2021, 02:48:12 PM
Bummer, but hey, some progress at least :). Sadly I do not know much about Odroid. Honestly, your thread was the first time I heard about it. It is an arm board, isn't it? And you are running Ubuntu.

Maybe it would help if I tried to get it running on my Pi4 running Ubuntu server or smth?

The config file not found error you can ignore. After you get it starting correctly it will create a config file. I did not experience this pixel modifier error however, things that I would try:

1) sudo attract (if there even is something like sudo on your os)
2) If you didn't already, compile smfl-pi and attractmode with the openGLes flags in addition to DRM. I think ES is for embedded systems, which your odroid should be.

Edit: you also have to use the USE_GLES=1 option when running sudo make install.

Title: Re: ODROID XU4 - gui environment installed but Failed to open X11 display error
Post by: rwebb616 on October 28, 2021, 03:56:54 PM
Yes I did see that as an option - I'll go back and try that.  I wondered.. didn't know what ES stood for but that makes sense. I'll give that a try a little later and post back my results.. I think the last time I did it, I used that option.

Rich
Title: Re: ODROID XU4 - gui environment installed but Failed to open X11 display error
Post by: rwebb616 on October 28, 2021, 04:42:04 PM
Tried that and it couldn't find something - I am pretty sure I have the GLES libraries installed:

Looks kind of like a path thing but I don't know if there are any GLES includes... didn't see anything under the include directory.

I tried posting the output but I get an internal server error when I try to post it on the forum.  Basically it says

CMake Error at /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find GLES (missing: GLES_INCLUDE_DIR)

Looks kind of like a path thing but I don't know if there are any GLES includes... didn't see anything under the include directory.

Rich
Title: Re: ODROID XU4 - gui environment installed but Failed to open X11 display error
Post by: Calvin on October 29, 2021, 01:03:49 AM
I am running the setup on my pi and got the same error.
Code: [Select]
sudo apt install libgles-devfixed it for me
Title: Re: ODROID XU4 - gui environment installed but Failed to open X11 display error
Post by: rwebb616 on October 29, 2021, 09:43:13 AM
Apparently I don't have it:

Code: [Select]
arcade@odroid:~$ sudo apt install libgles-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package libgles-dev
arcade@odroid:~$
Title: Re: ODROID XU4 - gui environment installed but Failed to open X11 display error
Post by: Calvin on October 29, 2021, 09:46:18 AM
oof. Maybe to
Code: [Select]
sudo apt search libgles to find a suitable package.

BTW. I went through with the compile on a Pi4 but I get some errors when building attract that I can't find a solution for.
Title: Re: ODROID XU4 - gui environment installed but Failed to open X11 display error
Post by: rwebb616 on October 29, 2021, 10:33:06 AM
I'm currently installing a Mate desktop version... I was reading elsewhere that some of these libraries are included with the odroid full mate desktop - I'm testing that theory.  Right now running all the udpates.  going to try to compile the SFML-Pi here soon.

I have a prebuilt image for the Pi 3b+ but I have not tried to get anything running on the Pi4.  My 3b+ image runs without X11 and uses Attract so I'm pretty sure it can be done.

Rich
Title: Re: ODROID XU4 - gui environment installed but Failed to open X11 display error
Post by: rwebb616 on October 29, 2021, 06:21:52 PM
Ok SFML-Pi built correctly with GLES but Attract is failing with this:

Code: [Select]
collect2: error: ld returned 1 exit status
Makefile:493: recipe for target 'attract' failed
make: *** [attract] Error 1
arcade@odroid:~/attract$

We're close now though!  If I can get attract to build I think it might just work!

Rich
Title: Re: ODROID XU4 - gui environment installed but Failed to open X11 display error
Post by: rwebb616 on October 29, 2021, 07:18:50 PM
I think these are the important bits:

Code: [Select]
//usr/local/lib/libsfml-window.so: undefined reference to `gbm_bo_get_stride'
//usr/local/lib/libsfml-window.so: undefined reference to `gbm_bo_get_handle'
//usr/local/lib/libsfml-window.so: undefined reference to `gbm_bo_set_user_data'
//usr/local/lib/libsfml-window.so: undefined reference to `gbm_bo_get_height'
//usr/local/lib/libsfml-window.so: undefined reference to `gbm_device_destroy'
//usr/local/lib/libsfml-window.so: undefined reference to `gbm_surface_release_buffer'
//usr/local/lib/libsfml-window.so: undefined reference to `gbm_create_device'
//usr/local/lib/libsfml-window.so: undefined reference to `gbm_bo_get_user_data'
//usr/local/lib/libsfml-window.so: undefined reference to `gbm_surface_destroy'
//usr/local/lib/libsfml-window.so: undefined reference to `gbm_bo_get_modifier'
//usr/local/lib/libsfml-window.so: undefined reference to `gbm_surface_create'
//usr/local/lib/libsfml-window.so: undefined reference to `gbm_bo_get_stride_for_plane'
//usr/local/lib/libsfml-window.so: undefined reference to `gbm_surface_lock_front_buffer'
//usr/local/lib/libsfml-window.so: undefined reference to `gbm_bo_get_device'
//usr/local/lib/libsfml-window.so: undefined reference to `gbm_bo_get_format'
//usr/local/lib/libsfml-window.so: undefined reference to `gbm_device_get_fd'
//usr/local/lib/libsfml-window.so: undefined reference to `gbm_bo_get_plane_count'
//usr/local/lib/libsfml-window.so: undefined reference to `gbm_bo_get_offset'
//usr/local/lib/libsfml-window.so: undefined reference to `gbm_bo_get_width'

I do have the libgbm-dev installed...
Rich
Title: Re: ODROID XU4 - gui environment installed but Failed to open X11 display error
Post by: rwebb616 on October 30, 2021, 07:49:03 AM
BTW. I went through with the compile on a Pi4 but I get some errors when building attract that I can't find a solution for.

Is yours failing on the same undefined references mine is?

Rich
Title: Re: ODROID XU4 - gui environment installed but Failed to open X11 display error
Post by: rwebb616 on October 30, 2021, 09:24:01 AM
Ok my problem was that I forgot the USE_DRM=1 ... once I did that it compiled but it is giving an error on running:

Code: [Select]
Couldn't find required EGL extension: EGL_MESA_platform_gbm or EGL_KHR_platform_gbm
Aborted

Any ideas?
Title: Re: ODROID XU4 - gui environment installed but Failed to open X11 display error
Post by: Calvin on October 30, 2021, 01:40:25 PM
Not really, sorry. I think I saw a dependency somewhere for Mesa. Not sure if this was attract tho. You could try installing mesa (maybe libmesa-dev. idk) At this point I am taking shots in the dark. 

EDIT: Did you run
Code: [Select]
sudo make install USE_GLES=1 ?