display not working without x11 mode in odroid xu4

Moderators: mdrjr, odroid

display not working without x11 mode in odroid xu4

Unread postby Indranil Sarkar » Thu Jul 05, 2018 8:27 pm

Even though the chunk of code compiles & runs perfectly in my ubuntu 18.04v GUI mode in odroid XU4 but when I try to run the same code in TERMINAL mode( alt + ctrl + F2) it is showing this
XDG_RUNTIME_DIR NOT SET IN THE ENVIRONMENT

“Failed to initialize SDLSDL: No available video device”

Any suggestions ??
Last edited by Indranil Sarkar on Thu Jul 12, 2018 5:35 am, edited 2 times in total.
Indranil Sarkar
 
Posts: 35
Joined: Tue Apr 24, 2018 1:14 pm
languages_spoken: english
ODROIDs: ODROID-XU4

Re: display not working without x11 mode in odroid xuv4

Unread postby odroid » Thu Jul 05, 2018 9:17 pm

The built-in SDL package in our Ubuntu 18.04 image was configured with x11-mali GPU driver option.
You might need to build the SDL library with enabling fbdev-mali option probably.
User avatar
odroid
Site Admin
 
Posts: 28257
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: display not working without x11 mode in odroid xuv4

Unread postby Indranil Sarkar » Fri Jul 06, 2018 4:44 pm

the option is not present only, even if --enable-video-directfb is present
Attachments
Screenshot at 2018-07-06 13-00-43.png
the x11-mali option is not there only in sdl2 cmake files
Screenshot at 2018-07-06 13-00-43.png (223.79 KiB) Viewed 405 times
Last edited by Indranil Sarkar on Thu Jul 12, 2018 5:36 am, edited 1 time in total.
Indranil Sarkar
 
Posts: 35
Joined: Tue Apr 24, 2018 1:14 pm
languages_spoken: english
ODROIDs: ODROID-XU4

Re: display not working without x11 mode in odroid xuv4

Unread postby AreaScout » Fri Jul 06, 2018 6:53 pm

hi

first of all, which application are you trying to compile, only applications with non x11 dependency can be viewed ?

you can build SDL2 with:

Code: Select all
./configure --disable-video-opengl --enable-video-kmsdrm


  1. but X11 has to be completely disabled systemctl set-default multi-user.target
  2. that mali userspace library has to be used http://deb.odroid.in/bigmali.tar
  3. symlinc from libgbm.so -> libgbm.so.9 -> libgbm.so.9.0 -> libmali.so
  4. header file from here http://paste.ubuntu.com/p/dJBVVZjqj4/ to /usr/includes/gbm.h

RG
User avatar
AreaScout
 
Posts: 563
Joined: Sun Jul 07, 2013 3:05 am
languages_spoken: english, german
ODROIDs: X2, U3, XU3, C2, XU4Q

Re: display not working without x11 mode in odroid xuv4

Unread postby Indranil Sarkar » Fri Jul 06, 2018 9:50 pm

i am using directFB for displaying... is it not the right way to do ??
Attachments
Screenshot at 2018-07-06 18-18-20.png
Screenshot at 2018-07-06 18-18-20.png (1.26 MiB) Viewed 390 times
Indranil Sarkar
 
Posts: 35
Joined: Tue Apr 24, 2018 1:14 pm
languages_spoken: english
ODROIDs: ODROID-XU4

Re: display not working without x11 mode in odroid xuv4

Unread postby AreaScout » Fri Jul 06, 2018 11:02 pm

Indranil Sarkar wrote:i am using directFB for displaying... is it not the right way to do ??


no, we have SDL2 with fbdev support from unique repositories or you compile SDL2 with KMSDRM support, i would prefer the second method if you want to use an SDL2 application, what application is it ?

RG
User avatar
AreaScout
 
Posts: 563
Joined: Sun Jul 07, 2013 3:05 am
languages_spoken: english, german
ODROIDs: X2, U3, XU3, C2, XU4Q

Re: display not working without x11 mode in odroid xuv4

Unread postby Indranil Sarkar » Sat Jul 07, 2018 1:36 pm

the application is for simply take images from camera , applying some filters and then to display it on screen. with the GUi mod eit was doing fine but as my application is exposed to GPU , I thought it would be better if I do it in the terminal mode, then I would get max GPU free , plus later on I can go for the minimal ubuntu mate 18.04, but now I am almost losing my hope, as of nowhere I am able to make SDL2 work in the terminal mode.
Indranil Sarkar
 
Posts: 35
Joined: Tue Apr 24, 2018 1:14 pm
languages_spoken: english
ODROIDs: ODROID-XU4

Re: display not working without x11 mode in odroid xuv4

Unread postby Indranil Sarkar » Sat Jul 07, 2018 3:48 pm

AreaScout wrote:hi

first of all, which application are you trying to compile, only applications with non x11 dependency can be viewed ?

you can build SDL2 with:

Code: Select all
./configure --disable-video-opengl --enable-video-kmsdrm


  1. but X11 has to be completely disabled systemctl set-default multi-user.target
  2. that mali userspace library has to be used http://deb.odroid.in/bigmali.tar
  3. symlinc from libgbm.so -> libgbm.so.9 -> libgbm.so.9.0 -> libmali.so
  4. header file from here http://paste.ubuntu.com/p/dJBVVZjqj4/ to /usr/includes/gbm.h

RG


I did as you said, I used kmsdrm

0. reconfigured sdl2 with ./configure --disable-video-opengl --enable-video-kmsdrm
1. disabled x11
2. the library files were there only , like
/usr/lib/arm-linux-gnueabihf/mali-egl/libmali.so
/usr/lib/arm-linux-gnueabihf/libOpenCL.so
** more in the given screenshots
3. did not got that point clearly, but what i noticed there was no libgbm.so.9 in the directories, but other links were there
4. added the header file to /usr/includes/gbm.h

still I am getting failed to initialize SDL : no video device , Can you help to make me understand which step of yours i didn't followed aptly !!
below are some relevant screenshots.
Attachments
Screenshot at 2018-07-07 11-03-16.png
reconfigured
Screenshot at 2018-07-07 11-03-16.png (240.92 KiB) Viewed 369 times
Screenshot at 2018-07-07 11-03-55.png
build complete
Screenshot at 2018-07-07 11-03-55.png (222.68 KiB) Viewed 369 times
Screenshot at 2018-07-07 11-28-33.png
files were already there
Screenshot at 2018-07-07 11-28-33.png (186.65 KiB) Viewed 369 times
Screenshot at 2018-07-07 11-40-55.png
libmaili.so
Screenshot at 2018-07-07 11-40-55.png (98.67 KiB) Viewed 369 times
Screenshot at 2018-07-07 11-38-42.png
Screenshot at 2018-07-07 11-38-42.png (100.1 KiB) Viewed 369 times
Last edited by Indranil Sarkar on Sat Jul 07, 2018 7:51 pm, edited 1 time in total.
Indranil Sarkar
 
Posts: 35
Joined: Tue Apr 24, 2018 1:14 pm
languages_spoken: english
ODROIDs: ODROID-XU4

Re: display not working without x11 mode in odroid xuv4

Unread postby Indranil Sarkar » Sat Jul 07, 2018 3:51 pm

and the output in terminal mode in odroid
Attachments
Screenshot at 2018-07-07 11-47-33.png
output
Screenshot at 2018-07-07 11-47-33.png (1.78 MiB) Viewed 369 times
Indranil Sarkar
 
Posts: 35
Joined: Tue Apr 24, 2018 1:14 pm
languages_spoken: english
ODROIDs: ODROID-XU4

Re: display not working without x11 mode in odroid xu4

Unread postby AreaScout » Sun Jul 08, 2018 12:25 am

Indranil Sarkar wrote:
I did as you said, I used kmsdrm

0. reconfigured sdl2 with ./configure --disable-video-opengl --enable-video-kmsdrm
1. disabled x11
2. the library files were there only , like
/usr/lib/arm-linux-gnueabihf/mali-egl/libmali.so
/usr/lib/arm-linux-gnueabihf/libOpenCL.so
** more in the given screenshots
3. did not got that point clearly, but what i noticed there was no libgbm.so.9 in the directories, but other links were there
4. added the header file to /usr/includes/gbm.h

still I am getting failed to initialize SDL : no video device , Can you help to make me understand which step of yours i didn't followed aptly !!
below are some relevant screenshots.


That's because you didn't do that libgbm.so part, ok:

Code: Select all
cd /usr/lib
sudo ln -s /usr/lib/arm-linux-gnueabihf/mali-egl/libmali.so libgbm.so
sudo ln -s libgbm.so libgbm.so.9
sudo ln -s libgbm.so.9 libgbm.so.9.0.0
sudo ldconfig


the libmali.so in /usr/lib/arm-linux-gnueabihf/mali-egl/libmali.so has to be exchanged with the one from that bigmali.tar archive, did you do that ?

If yes, that should do the trick, just reconfigure SDL2 with ./configure --disable-video-opengl --enable-video-kmsdrm and rebuild it, then copy the new libraries to system lib folder

Code: Select all
cd  to_your_sdl2_dir/
sudo cp build/.libs/libSDL2-2.0.so.0.8.0 /usr/lib/arm-linux-gnueabihf/.
sudo cp build/.libs/libSDL2.a /usr/lib/arm-linux-gnueabihf/.
sudo cp build/.libs/libSDL2main.a /usr/lib/arm-linux-gnueabihf/.


RG
Last edited by AreaScout on Thu Jul 12, 2018 5:17 am, edited 1 time in total.
User avatar
AreaScout
 
Posts: 563
Joined: Sun Jul 07, 2013 3:05 am
languages_spoken: english, german
ODROIDs: X2, U3, XU3, C2, XU4Q

Re: display not working without x11 mode in odroid xu4

Unread postby Indranil Sarkar » Tue Jul 10, 2018 4:16 pm

thank you very very much... I will definitely go with this...
Indranil Sarkar
 
Posts: 35
Joined: Tue Apr 24, 2018 1:14 pm
languages_spoken: english
ODROIDs: ODROID-XU4

Re: display not working without x11 mode in odroid xu4

Unread postby Indranil Sarkar » Tue Jul 10, 2018 5:18 pm

MESA-LOADER: failed to retrieve device information
gbm: failed to open any driver (search paths /usr/lib/arm-linux-gnueabihf/dri:${ORIGIN}/dri:/usr/lib/dri)
gbm: Last dlopen error: /usr/lib/dri/exynos_dri.so: cannot open shared object file: No such file or directory
failed to load driver: exynos
Segmentation fault


but i do have both of them in my system.
Attachments
Screenshot at 2018-07-10 13-46-16.png
Screenshot at 2018-07-10 13-46-16.png (1.55 MiB) Viewed 299 times
Indranil Sarkar
 
Posts: 35
Joined: Tue Apr 24, 2018 1:14 pm
languages_spoken: english
ODROIDs: ODROID-XU4

Re: display not working without x11 mode in odroid xu4

Unread postby Indranil Sarkar » Tue Jul 10, 2018 5:22 pm

/usr/lib/arm-linux-gnueabihf/dri
Attachments
Screenshot at 2018-07-10 13-51-27.png
Screenshot at 2018-07-10 13-51-27.png (97.09 KiB) Viewed 299 times
Indranil Sarkar
 
Posts: 35
Joined: Tue Apr 24, 2018 1:14 pm
languages_spoken: english
ODROIDs: ODROID-XU4

Re: display not working without x11 mode in odroid xu4

Unread postby AreaScout » Tue Jul 10, 2018 6:20 pm

Indranil Sarkar wrote:MESA-LOADER: failed to retrieve device information
gbm: failed to open any driver (search paths /usr/lib/arm-linux-gnueabihf/dri:${ORIGIN}/dri:/usr/lib/dri)
gbm: Last dlopen error: /usr/lib/dri/exynos_dri.so: cannot open shared object file: No such file or directory
failed to load driver: exynos
Segmentation fault


but i do have both of them in my system.


Ok this is a different problem, a recent update from canonical broke the Mali-X11 package, please follow the instructions
from this thread viewtopic.php?f=95&t=31478#p228061

be careful, because your new libmali.so from the bigmali.tar will be overwritten, after you install the mali-x11 package you have to copy it to the system library folder again

reinstall the Mali driver could also be done this way

Code: Select all
sudo apt-get install mali-x11 --reinstall


RG
User avatar
AreaScout
 
Posts: 563
Joined: Sun Jul 07, 2013 3:05 am
languages_spoken: english, german
ODROIDs: X2, U3, XU3, C2, XU4Q

Re: display not working without x11 mode in odroid xu4

Unread postby Indranil Sarkar » Tue Jul 10, 2018 9:51 pm

you have to copy it to the system library folder again


by this you mean

the libmali.so in /usr/lib/arm-linux-gnueabihf/mali-egl/libmali.so has to be exchanged with the one from that bigmali.tar archive
Indranil Sarkar
 
Posts: 35
Joined: Tue Apr 24, 2018 1:14 pm
languages_spoken: english
ODROIDs: ODROID-XU4

Re: display not working without x11 mode in odroid xu4

Unread postby AreaScout » Tue Jul 10, 2018 10:16 pm

Indranil Sarkar wrote:
you have to copy it to the system library folder again


by this you mean

the libmali.so in /usr/lib/arm-linux-gnueabihf/mali-egl/libmali.so has to be exchanged with the one from that bigmali.tar archive


Yes :)
User avatar
AreaScout
 
Posts: 563
Joined: Sun Jul 07, 2013 3:05 am
languages_spoken: english, german
ODROIDs: X2, U3, XU3, C2, XU4Q

Re: display not working without x11 mode in odroid xu4

Unread postby odroid » Tue Jul 10, 2018 10:43 pm

Very interesting information.
I also want to learn how the GBM works better than the traditional fbdev.
I've just read this three years old article to know the basic concept of GBM.
https://community.arm.com/graphics/b/bl ... s-on-fbdev
User avatar
odroid
Site Admin
 
Posts: 28257
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: display not working without x11 mode in odroid xu4

Unread postby AreaScout » Wed Jul 11, 2018 3:32 am

odroid wrote:Very interesting information.
I also want to learn how the GBM works better than the traditional fbdev.
I've just read this three years old article to know the basic concept of GBM.
https://community.arm.com/graphics/b/bl ... s-on-fbdev


Indeed, very good article, I enjoyed it a lot :)
User avatar
AreaScout
 
Posts: 563
Joined: Sun Jul 07, 2013 3:05 am
languages_spoken: english, german
ODROIDs: X2, U3, XU3, C2, XU4Q

Re: display not working without x11 mode in odroid xu4

Unread postby Indranil Sarkar » Wed Jul 11, 2018 4:09 pm

after reinstalling, copying system files what do i get
->back to square one , failed... sdl InitNo available video device !!!
Attachments
Screenshot at 2018-07-11 07-09-07.png
Screenshot at 2018-07-11 07-09-07.png (1.81 MiB) Viewed 224 times
Indranil Sarkar
 
Posts: 35
Joined: Tue Apr 24, 2018 1:14 pm
languages_spoken: english
ODROIDs: ODROID-XU4

Re: display not working without x11 mode in odroid xu4

Unread postby Indranil Sarkar » Wed Jul 11, 2018 4:10 pm

my workflow
Attachments
Screenshot at 2018-07-11 06-03-04.png
Screenshot at 2018-07-11 06-03-04.png (245.22 KiB) Viewed 224 times
Indranil Sarkar
 
Posts: 35
Joined: Tue Apr 24, 2018 1:14 pm
languages_spoken: english
ODROIDs: ODROID-XU4

Re: display not working without x11 mode in odroid xu4

Unread postby Indranil Sarkar » Wed Jul 11, 2018 4:25 pm

but what i have noticed just now is that b4 reinstalling mali-x11 , i did get the kmsdrm as videodriver
but now
even i am enabling it the , after reconfig it is not present in video drivers
Attachments
Screenshot at 2018-07-11 07-19-36.png
after and before reinstalling mali-x11
Screenshot at 2018-07-11 07-19-36.png (616.38 KiB) Viewed 225 times
Last edited by Indranil Sarkar on Thu Jul 12, 2018 5:41 am, edited 2 times in total.
Indranil Sarkar
 
Posts: 35
Joined: Tue Apr 24, 2018 1:14 pm
languages_spoken: english
ODROIDs: ODROID-XU4

Re: display not working without x11 mode in odroid xu4

Unread postby AreaScout » Wed Jul 11, 2018 4:35 pm

Please post your config.log i.e to https://pastebin.com, it should be in the root of your sdl2 source code folder

edit:

And be sure that you have that gbm.h file in /usr/include from my first post
User avatar
AreaScout
 
Posts: 563
Joined: Sun Jul 07, 2013 3:05 am
languages_spoken: english, german
ODROIDs: X2, U3, XU3, C2, XU4Q

Re: display not working without x11 mode in odroid xu4

Unread postby Indranil Sarkar » Wed Jul 11, 2018 5:00 pm

ok, so after going through the config file of sdl2 , i noticed some dependencies for kmsdrm, so after building it, kmsdrm did got enabled, but but but the same
MESA-LOADER: failed to retrieve device information
gbm: failed to open any driver (search paths /usr/lib/arm-linux-gnueabihf/dri:${ORIGIN}/dri:/usr/lib/dri)
gbm: Last dlopen error: /usr/lib/dri/exynos_dri.so: cannot open shared object file: No such file or directory
failed to load driver: exynos
Segmentation fault

persists,
and also after executing the sdl programs in virtual terminal mode, my keyboard doesn't works, so i again have to reboot it, to work with my system.
Indranil Sarkar
 
Posts: 35
Joined: Tue Apr 24, 2018 1:14 pm
languages_spoken: english
ODROIDs: ODROID-XU4

Re: display not working without x11 mode in odroid xu4

Unread postby Indranil Sarkar » Wed Jul 11, 2018 5:02 pm

sorry , i missed your reply , I am posting it in a minute.
Indranil Sarkar
 
Posts: 35
Joined: Tue Apr 24, 2018 1:14 pm
languages_spoken: english
ODROIDs: ODROID-XU4

Re: display not working without x11 mode in odroid xu4

Unread postby Indranil Sarkar » Wed Jul 11, 2018 5:17 pm

AreaScout wrote:Please post your config.log i.e to https://pastebin.com, it should be in the root of your sdl2 source code folder

edit:

And be sure that you have that gbm.h file in /usr/include from my first post
Attachments
Screenshot at 2018-07-11 08-17-18.png
Screenshot at 2018-07-11 08-17-18.png (216.65 KiB) Viewed 217 times
Indranil Sarkar
 
Posts: 35
Joined: Tue Apr 24, 2018 1:14 pm
languages_spoken: english
ODROIDs: ODROID-XU4

Re: display not working without x11 mode in odroid xu4

Unread postby AreaScout » Wed Jul 11, 2018 5:36 pm

please post the contains of the config.log to that empty window on http://pastebin.com and click 'create new paste' after that copy that link from the browser adress line and post it here, it will look somithing like this -> https://pastebin.com/MruJGEb5

also please show me the output of:

Code: Select all
ldconfig -p


RG
User avatar
AreaScout
 
Posts: 563
Joined: Sun Jul 07, 2013 3:05 am
languages_spoken: english, german
ODROIDs: X2, U3, XU3, C2, XU4Q

Re: display not working without x11 mode in odroid xu4

Unread postby AreaScout » Wed Jul 11, 2018 6:32 pm

Ok no need to post, i have tested it now on my XU4, it seems that some of the ld cache config files are no longer exist, and threfore the mali libs are not found, before this is fixed please add manual symbolic links like so:


Code: Select all
sudo ln -s /usr/lib/arm-linux-gnueabihf/mali-egl/libmali.so /usr/lib/arm-linux-gnueabihf/libEGL.so.1
sudo ln -s /usr/lib/arm-linux-gnueabihf/mali-egl/libmali.so /usr/lib/arm-linux-gnueabihf/libEGL.so
sudo ln -s /usr/lib/arm-linux-gnueabihf/mali-egl/libmali.so /usr/lib/arm-linux-gnueabihf/libGLESv2.so
sudo ln -s /usr/lib/arm-linux-gnueabihf/mali-egl/libmali.so /usr/lib/arm-linux-gnueabihf/libGLESv1_CM.so
sudo ln -s /usr/lib/arm-linux-gnueabihf/mali-egl/libmali.so /usr/lib/arm-linux-gnueabihf/libGLESv2.so.2
sudo ln -s /usr/lib/arm-linux-gnueabihf/mali-egl/libmali.so /usr/lib/arm-linux-gnueabihf/libGLESv1_CM.so.1
sudo ldconfig


that should be the only thing what's missed, it should work after this
User avatar
AreaScout
 
Posts: 563
Joined: Sun Jul 07, 2013 3:05 am
languages_spoken: english, german
ODROIDs: X2, U3, XU3, C2, XU4Q

Re: display not working without x11 mode in odroid xu4

Unread postby Indranil Sarkar » Wed Jul 11, 2018 8:39 pm

done, but its still giving the same error
MESA-LOADER: failed to retrieve device information
gbm: failed to open any driver (search paths /usr/lib/arm-linux-gnueabihf/dri:${ORIGIN}/dri:/usr/lib/dri)
gbm: Last dlopen error: /usr/lib/dri/exynos_dri.so: cannot open shared object file: No such file or directory
failed to load driver: exynos
Segmentation fault
Indranil Sarkar
 
Posts: 35
Joined: Tue Apr 24, 2018 1:14 pm
languages_spoken: english
ODROIDs: ODROID-XU4

Re: display not working without x11 mode in odroid xu4

Unread postby AreaScout » Wed Jul 11, 2018 8:52 pm

That's indicating that SDL2 still uses MESA drivers instead of Mali ....

Please show me output of

Code: Select all
ldconfig -p
User avatar
AreaScout
 
Posts: 563
Joined: Sun Jul 07, 2013 3:05 am
languages_spoken: english, german
ODROIDs: X2, U3, XU3, C2, XU4Q

Re: display not working without x11 mode in odroid xu4

Unread postby Indranil Sarkar » Wed Jul 11, 2018 9:03 pm

output of ldconfig -p with config.log

https://pastebin.com/u/Indr026
Indranil Sarkar
 
Posts: 35
Joined: Tue Apr 24, 2018 1:14 pm
languages_spoken: english
ODROIDs: ODROID-XU4

Re: display not working without x11 mode in odroid xu4

Unread postby AreaScout » Wed Jul 11, 2018 9:14 pm

Indranil Sarkar wrote:
output of ldconfig -p with config.log

https://pastebin.com/u/Indr026


Code: Select all
#define SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC_GBM "libgbm.so.1"


libgbm.so.1 is the one that points to the MESA libraries i think, it should use the libgbm.so.9

tell me where this library is pointing to, by doing this and paste it to pastebin

Code: Select all
ls -la /usr/lib/arm-linux-gnueabihf/libgbm*
User avatar
AreaScout
 
Posts: 563
Joined: Sun Jul 07, 2013 3:05 am
languages_spoken: english, german
ODROIDs: X2, U3, XU3, C2, XU4Q

Re: display not working without x11 mode in odroid xu4

Unread postby Indranil Sarkar » Wed Jul 11, 2018 9:22 pm

done
Indranil Sarkar
 
Posts: 35
Joined: Tue Apr 24, 2018 1:14 pm
languages_spoken: english
ODROIDs: ODROID-XU4

Re: display not working without x11 mode in odroid xu4

Unread postby AreaScout » Wed Jul 11, 2018 9:29 pm

Indranil Sarkar wrote:done


i was waiting that you post the output of that command, but anyway i have found another way

Code: Select all
sudo rm /usr/lib/arm-linux-gnueabihf/libgbm.so*
sudo ln -s /usr/lib/arm-linux-gnueabihf/mali-egl/libmali.so /usr/lib/arm-linux-gnueabihf/libgbm.so.1
User avatar
AreaScout
 
Posts: 563
Joined: Sun Jul 07, 2013 3:05 am
languages_spoken: english, german
ODROIDs: X2, U3, XU3, C2, XU4Q

Re: display not working without x11 mode in odroid xu4

Unread postby Indranil Sarkar » Wed Jul 11, 2018 9:31 pm

but that is what i have pasted in pastebin ..
Indranil Sarkar
 
Posts: 35
Joined: Tue Apr 24, 2018 1:14 pm
languages_spoken: english
ODROIDs: ODROID-XU4

Re: display not working without x11 mode in odroid xu4

Unread postby Indranil Sarkar » Wed Jul 11, 2018 9:32 pm

AreaScout wrote:
Indranil Sarkar wrote:done


i was waiting that you post the output of that command, but anyway i have found another way

Code: Select all
sudo rm /usr/lib/arm-linux-gnueabihf/libgbm.so*
sudo ln -s /usr/lib/arm-linux-gnueabihf/mali-egl/libmali.so /usr/lib/arm-linux-gnueabihf/libgbm.so.1

are you saying something like this ??/
Attachments
Screenshot at 2018-07-11 11-09-19.png
Screenshot at 2018-07-11 11-09-19.png (295.61 KiB) Viewed 192 times
Indranil Sarkar
 
Posts: 35
Joined: Tue Apr 24, 2018 1:14 pm
languages_spoken: english
ODROIDs: ODROID-XU4

Re: display not working without x11 mode in odroid xu4

Unread postby AreaScout » Wed Jul 11, 2018 9:37 pm

that looks good now but you have to delete the libgbm.so.1 which still points to the mesa implementation of libgbm

so please make this also:

Code: Select all
sudo rm /usr/lib/arm-linux-gnueabihf/libgbm.so*
sudo ln -s /usr/lib/arm-linux-gnueabihf/mali-egl/libmali.so /usr/lib/arm-linux-gnueabihf/libgbm.so.1
sudo ldconfig


RG
User avatar
AreaScout
 
Posts: 563
Joined: Sun Jul 07, 2013 3:05 am
languages_spoken: english, german
ODROIDs: X2, U3, XU3, C2, XU4Q

Re: display not working without x11 mode in odroid xu4

Unread postby Indranil Sarkar » Wed Jul 11, 2018 9:44 pm

so now its giving only SEGMENTATION ERROR
Indranil Sarkar
 
Posts: 35
Joined: Tue Apr 24, 2018 1:14 pm
languages_spoken: english
ODROIDs: ODROID-XU4

Re: display not working without x11 mode in odroid xu4

Unread postby Indranil Sarkar » Wed Jul 11, 2018 9:47 pm

AND I am just using this code as the test case scenario


Code: Select all
//#include <SDL/SDL.h>
#include <SDL2/SDL.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <iostream>

using namespace std;
using std::cout;
using std::endl;


SDL_Window* window;
SDL_Surface* surface;

int init ()
{
    window = NULL;
    surface = NULL;
   
    if (SDL_Init(SDL_INIT_VIDEO) < 0)
        {
            cout<<"failed... sdl Init"<< SDL_GetError()<<endl;
            return -1;
        }
    window = SDL_CreateWindow("window title", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 320, 240, SDL_WINDOW_SHOWN |SDL_WINDOW_BORDERLESS);
   
    if (window == NULL)
        {
            cout<<"failed... window"<< SDL_GetError()<<endl;
            return -1;
        }
    surface = SDL_GetWindowSurface(window);
    return 0;
}

void cleanup()
{
    SDL_DestroyWindow(window);
    SDL_Quit();
}

int main (int argc, char* argv[])
{
    init();
    SDL_FillRect(surface, NULL, SDL_MapRGB(surface->format,23, 26, 49));
    SDL_UpdateWindowSurface(window);
    SDL_Delay(3000);
    SDL_FillRect(surface, NULL, SDL_MapRGB(surface->format,107, 108, 117));
    SDL_UpdateWindowSurface(window);
    SDL_Delay(1000);
    SDL_FillRect(surface, NULL, SDL_MapRGB(surface->format,50, 100, 150));
    SDL_UpdateWindowSurface(window);
    SDL_Delay(1000);
    cleanup();
    return 0;
}
   
Indranil Sarkar
 
Posts: 35
Joined: Tue Apr 24, 2018 1:14 pm
languages_spoken: english
ODROIDs: ODROID-XU4

Re: display not working without x11 mode in odroid xu4

Unread postby AreaScout » Wed Jul 11, 2018 10:04 pm

for that sample code you can just cd into your SDL2 source dir, inside there is a test folder

to run a test just do this

Code: Select all
cd your_sdl2_source_dir\test
./configure
make -j7
./testgles2


you should see a very fast spinning fullscreen cube
User avatar
AreaScout
 
Posts: 563
Joined: Sun Jul 07, 2013 3:05 am
languages_spoken: english, german
ODROIDs: X2, U3, XU3, C2, XU4Q

Re: display not working without x11 mode in odroid xu4

Unread postby Indranil Sarkar » Wed Jul 11, 2018 10:20 pm

its the same in virtual terminal
segmentation fault
Attachments
Screenshot at 2018-07-11 13-15-56.png
x11 <-------------->vertial Terminal
Screenshot at 2018-07-11 13-15-56.png (1.07 MiB) Viewed 187 times
Indranil Sarkar
 
Posts: 35
Joined: Tue Apr 24, 2018 1:14 pm
languages_spoken: english
ODROIDs: ODROID-XU4

Re: display not working without x11 mode in odroid xu4

Unread postby AreaScout » Wed Jul 11, 2018 10:23 pm

does the vendor say Mali or MESA ?

Code: Select all
INFO: Vendor     : ARM
INFO: Renderer   : Mali-T628
INFO: Version    : OpenGL ES 3.1 v1.r17p0-01rel0.d17cf84c10daf186c21e3efcfae21a65
User avatar
AreaScout
 
Posts: 563
Joined: Sun Jul 07, 2013 3:05 am
languages_spoken: english, german
ODROIDs: X2, U3, XU3, C2, XU4Q

Re: display not working without x11 mode in odroid xu4

Unread postby Indranil Sarkar » Wed Jul 11, 2018 10:25 pm

yes, it does but only in the x11 display.
Indranil Sarkar
 
Posts: 35
Joined: Tue Apr 24, 2018 1:14 pm
languages_spoken: english
ODROIDs: ODROID-XU4

Re: display not working without x11 mode in odroid xu4

Unread postby AreaScout » Wed Jul 11, 2018 10:29 pm

there should also be the same output in the plain terminal window

hmmm what else could be wrong, still looks as if you have a libmali.so problem, you are using the binary from the bigmali.tar archive ?
User avatar
AreaScout
 
Posts: 563
Joined: Sun Jul 07, 2013 3:05 am
languages_spoken: english, german
ODROIDs: X2, U3, XU3, C2, XU4Q

Re: display not working without x11 mode in odroid xu4

Unread postby Indranil Sarkar » Wed Jul 11, 2018 10:31 pm

yes, only the libmali.so , not others like libgbm.so
in bigmail.tar there other .so files also but only libmali.so was copied to my system
Indranil Sarkar
 
Posts: 35
Joined: Tue Apr 24, 2018 1:14 pm
languages_spoken: english
ODROIDs: ODROID-XU4

Re: display not working without x11 mode in odroid xu4

Unread postby AreaScout » Wed Jul 11, 2018 10:40 pm

Indranil Sarkar wrote:yes, only the libmali.so , not others like libgbm.so.1
in bigmail.tar there other .so files also but only libmali.so was copied to my system


that's ok, and you are not trying to run this under X11? you have to disable X11 completely, X11 uses xf86-armsoc driver and this driver also uses DRM, and DRM allows only one DRM Master

because if you would run this under X11 you would have to set a environment variable to use the SDL2 x11 route SDL_VIDEODRIVER=x11 or for DRM it's SDL_VIDEODRIVER=kmsdrm but if x11 is disabled it will automaticaly choose drm

you can also prefix DISPLAY=:0.0 ./testgles2 to get X11 output and not DRM ( if X11 is running of course )
Last edited by AreaScout on Wed Jul 11, 2018 10:56 pm, edited 1 time in total.
User avatar
AreaScout
 
Posts: 563
Joined: Sun Jul 07, 2013 3:05 am
languages_spoken: english, german
ODROIDs: X2, U3, XU3, C2, XU4Q

Re: display not working without x11 mode in odroid xu4

Unread postby Indranil Sarkar » Wed Jul 11, 2018 10:48 pm

AreaScout wrote:
Indranil Sarkar wrote:yes, only the libmali.so , not others like libgbm.so.1
in bigmail.tar there other .so files also but only libmali.so was copied to my system


that's ok, and you are not trying to run this under X11, you have to disable X11 completely, X11 uses xf86-armsoc driver and this driver also uses DRM, and DRM allows only the use of one DRM Master

because if you would run this under X11 you would have to set a environment variable to use the SDL2 x11 route SDL_VIDEODRIVER=x11 or for DRM it's SDL_VIDEODRIVER=kmsdrm but if x11 is diabled it will automaticaly choose drm

you can also prefix DISPLAY=:0.0 ./testgles2 to get X11 output and not DRM ( X11 running of course )



systemctl set-default multi-user.target , this will do right ??
Last edited by Indranil Sarkar on Wed Jul 11, 2018 10:54 pm, edited 1 time in total.
Indranil Sarkar
 
Posts: 35
Joined: Tue Apr 24, 2018 1:14 pm
languages_spoken: english
ODROIDs: ODROID-XU4

Re: display not working without x11 mode in odroid xu4

Unread postby AreaScout » Wed Jul 11, 2018 10:54 pm

yes, and it's still crashing ?
User avatar
AreaScout
 
Posts: 563
Joined: Sun Jul 07, 2013 3:05 am
languages_spoken: english, german
ODROIDs: X2, U3, XU3, C2, XU4Q

Re: display not working without x11 mode in odroid xu4

Unread postby AreaScout » Wed Jul 11, 2018 11:05 pm

btw. with systemctl set-default graphical.target you can get back to x11 environment

i will post an updated tutorial in some days on how to use SDL2 with the new mali GBM enabled user space library, without deleting files ;)
User avatar
AreaScout
 
Posts: 563
Joined: Sun Jul 07, 2013 3:05 am
languages_spoken: english, german
ODROIDs: X2, U3, XU3, C2, XU4Q

Re: display not working without x11 mode in odroid xu4

Unread postby Indranil Sarkar » Wed Jul 11, 2018 11:11 pm

AreaScout wrote:yes, and it's still crashing ?



no now its magic ... like the real one....
its fully functional , and thanks for all the guidance ... it could nvr would have been possible without you... :)
Indranil Sarkar
 
Posts: 35
Joined: Tue Apr 24, 2018 1:14 pm
languages_spoken: english
ODROIDs: ODROID-XU4

Re: display not working without x11 mode in odroid xu4

Unread postby AreaScout » Wed Jul 11, 2018 11:40 pm

Indranil Sarkar wrote:
AreaScout wrote:yes, and it's still crashing ?



no now its magic ... like the real one....
its fully functional , and thanks for all the guidance ... it could nvr would have been possible without you... :)


ha ! i am happy to hear this :)
User avatar
AreaScout
 
Posts: 563
Joined: Sun Jul 07, 2013 3:05 am
languages_spoken: english, german
ODROIDs: X2, U3, XU3, C2, XU4Q

Next

Return to Ubuntu

Who is online

Users browsing this forum: chocho, mad_ady and 3 guests