Switching between minimal and desktop versions

Post Reply
wallyz21
Posts: 137
Joined: Thu Apr 04, 2019 11:00 am
languages_spoken: english
ODROIDs: N2
Has thanked: 10 times
Been thanked: 16 times
Contact:

Switching between minimal and desktop versions

Post by wallyz21 » Thu Apr 18, 2019 1:40 pm

With the exception of the obvious (minimal doesn't have MATE installed)

Can the MATE desktop be installed on the minimal image?

Can the MATE desktop be disabled temporarily (on turned off) on the desktop image.

I prefer the desktop image but would like the option of running ppssppsdl as on the minimal image, but don't necessarily want two images.

If I boot the MATE desktop version and switch to a console terminal (ctrl-alt-F1) can I stop the MATE desktop and the X server in order to run ppssppsdl in the same way as the minimal image?

Would this be the same?
Walter Zambotti
N2 - Ubuntu Mate Desktop

User avatar
tobetter
Posts: 5070
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1
Location: Paju, South Korea
Has thanked: 159 times
Been thanked: 483 times
Contact:

Re: Switching between minimal and desktop versions

Post by tobetter » Thu Apr 18, 2019 1:53 pm

I am thinking of how Petitboot can let you select two operating systems on the same memory card (SD or eMMC)...

crashoverride
Posts: 4942
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 285 times
Contact:

Re: Switching between minimal and desktop versions

Post by crashoverride » Thu Apr 18, 2019 2:01 pm

wallyz21 wrote:
Thu Apr 18, 2019 1:40 pm
If I boot the MATE desktop version and switch to a console terminal (ctrl-alt-F1) can I stop the MATE desktop and the X server in order to run ppssppsdl in the same way as the minimal image?
You can temporarily stop the desktop using the following command in a console terminal:

Code: Select all

sudo service lightdm stop
The desktop can be restarted using:

Code: Select all

sudo service lightdm start
The issue with having the desktop is that Mesa drivers are dependency of all desktop environments in Ubuntu. This causes the Mali GPU drivers to be replaced with software emulation. You may need to manually replace the GPU library symlinks (libEGL.so, libGLES.so.2, etc) to point to libmali.so. Also note that VLC will lockup when the Mali fbdev driver is used. This can be worked around by manually configuring the VLC video output.
These users thanked the author crashoverride for the post:
wallyz21 (Thu Apr 18, 2019 4:06 pm)

wallyz21
Posts: 137
Joined: Thu Apr 04, 2019 11:00 am
languages_spoken: english
ODROIDs: N2
Has thanked: 10 times
Been thanked: 16 times
Contact:

Re: Switching between minimal and desktop versions

Post by wallyz21 » Thu Apr 18, 2019 4:16 pm

crashoverride wrote:
Thu Apr 18, 2019 2:01 pm
wallyz21 wrote:
Thu Apr 18, 2019 1:40 pm
If I boot the MATE desktop version and switch to a console terminal (ctrl-alt-F1) can I stop the MATE desktop and the X server in order to run ppssppsdl in the same way as the minimal image?
You can temporarily stop the desktop using the following command in a console terminal:

Code: Select all

sudo service lightdm stop
The desktop can be restarted using:

Code: Select all

sudo service lightdm start
The issue with having the desktop is that Mesa drivers are dependency of all desktop environments in Ubuntu. This causes the Mali GPU drivers to be replaced with software emulation. You may need to manually replace the GPU library symlinks (libEGL.so, libGLES.so.2, etc) to point to libmali.so. Also note that VLC will lockup when the Mali fbdev driver is used. This can be worked around by manually configuring the VLC video output.
Ok so as root (from console with lightdm service stopped) :

$ cd /usr/lib/aarch64-linux-gnu/
$ mv libEGL.so.1.0.0 libEGL.so.1.0.0_old
$ ln -s libMali.so libEGL.so.1.0.0

So all the libEGL* will should now be linked to libMali

$ cd /root/ppsspp
$ PPSSPPSDL

But errors with can't find graphics device
Walter Zambotti
N2 - Ubuntu Mate Desktop

User avatar
odroid
Site Admin
Posts: 34109
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 666 times
Been thanked: 611 times
Contact:

Re: Switching between minimal and desktop versions

Post by odroid » Thu Apr 18, 2019 4:47 pm

Try apt install --resinstall mali-fbdev and run glmark2-es2-fbdev to check the Mali GPU functionality.

crashoverride
Posts: 4942
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 285 times
Contact:

Re: Switching between minimal and desktop versions

Post by crashoverride » Thu Apr 18, 2019 4:50 pm

There is more than one symlink required due to linux shared library versioning:

Code: Select all

libEGL.so
libEGL.so.1
libEGL.so.1.0.0

libGLESv2.so
libGLESv2.so.2
libGLESv2.so.2.0.0
All of the above provided by Mesa need to be a symlink to libMali.so

wallyz21
Posts: 137
Joined: Thu Apr 04, 2019 11:00 am
languages_spoken: english
ODROIDs: N2
Has thanked: 10 times
Been thanked: 16 times
Contact:

Re: Switching between minimal and desktop versions

Post by wallyz21 » Fri Apr 19, 2019 12:48 am

crashoverride wrote:
Thu Apr 18, 2019 4:50 pm
There is more than one symlink required due to linux shared library versioning:

Code: Select all

libEGL.so
libEGL.so.1
libEGL.so.1.0.0

libGLESv2.so
libGLESv2.so.2
libGLESv2.so.2.0.0
All of the above provided by Mesa need to be a symlink to libMali.so
Here are the links:

Code: Select all

lrwxrwxrwx 1 odroid odroid     11 Jul 31  2018 /usr/lib/aarch64-linux-gnu/libEGL.so -> libEGL.so.1
lrwxrwxrwx 1 root   root       15 Mar 21 23:44 /usr/lib/aarch64-linux-gnu/libEGL.so.1 -> libEGL.so.1.0.0
lrwxrwxrwx 1 root   root       10 Apr 18 23:30 /usr/lib/aarch64-linux-gnu/libEGL.so.1.0.0 -> libMali.so

lrwxrwxrwx 1 odroid odroid     14 Jul 31  2018 /usr/lib/aarch64-linux-gnu/libGLESv2.so -> libGLESv2.so.2
lrwxrwxrwx 1 root   root       18 Mar 21 23:44 /usr/lib/aarch64-linux-gnu/libGLESv2.so.2 -> libGLESv2.so.2.0.0
lrwxrwxrwx 1 root   root       10 Apr 18 23:30 /usr/lib/aarch64-linux-gnu/libGLESv2.so.2.0.0 -> libMali.so
Looks okay to me! All the libs are pointing to libMali.so Either directly or indirectly!

Still complains no video device available!
Walter Zambotti
N2 - Ubuntu Mate Desktop

wallyz21
Posts: 137
Joined: Thu Apr 04, 2019 11:00 am
languages_spoken: english
ODROIDs: N2
Has thanked: 10 times
Been thanked: 16 times
Contact:

Re: Switching between minimal and desktop versions

Post by wallyz21 » Fri Apr 19, 2019 1:15 am

odroid wrote:
Thu Apr 18, 2019 4:47 pm
Try apt install --resinstall mali-fbdev and run glmark2-es2-fbdev to check the Mali GPU functionality.
Thanks did that, but didn't help!

Actually don't do this on a full MATE desktop image as this MAY have caused a lot a package dependencies to break for me!

I was unable to fix the held broken dependencies until I purged mali-fbdev which removed many other packages which I am
uncertain I need or not. Anyway I have began the long road of reinstalling all the packages!

It is enough to copy the libMali.so from the minimal image to the MATE desktop image.

The lib can be found in /usr/lib/aarch/aarch64-linux-gnu.
Last edited by wallyz21 on Fri Apr 19, 2019 10:21 pm, edited 2 times in total.
Walter Zambotti
N2 - Ubuntu Mate Desktop

User avatar
odroid
Site Admin
Posts: 34109
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 666 times
Been thanked: 611 times
Contact:

Re: Switching between minimal and desktop versions

Post by odroid » Fri Apr 19, 2019 8:41 am

Was the PPSSPP working before installing Mate Desktop?

wallyz21
Posts: 137
Joined: Thu Apr 04, 2019 11:00 am
languages_spoken: english
ODROIDs: N2
Has thanked: 10 times
Been thanked: 16 times
Contact:

Re: Switching between minimal and desktop versions

Post by wallyz21 » Fri Apr 19, 2019 11:48 am

odroid wrote:
Fri Apr 19, 2019 8:41 am
Was the PPSSPP working before installing Mate Desktop?
In direct answer to your question. Yes but I started with the full MATE desktop version and it only worked via X and was dropping most frames.

I have started with the full Mate Desktop image and not with the minimal image. I'm trying to have a setup where I can switch between the two without having two different boot images. I normally develop in the desktop do some preliminary SDL2 testing under the desktop but then I need to switch over to the minimal image to do my application performance testing. Having two different images would mean constantly copying my application between the two setups which would be tedious.

So at this stage I can develop my SDL2 app and run it under X (poorly) to get an idea my code works but now I need to test it with MALI GPU support.

Maybe I should have started with the minimal image and then added the MATE desktop rather than the other way around by starting with the MATE desktop and disabling the desktop in an attempt to achieve the minimal setup.

I was concerned the minimal and full (MATE Desktop) images had more differences than just the desktop. I was hoping the full version had everything the minimal version had but extra!
Last edited by wallyz21 on Fri Apr 19, 2019 12:20 pm, edited 1 time in total.
Walter Zambotti
N2 - Ubuntu Mate Desktop

User avatar
odroid
Site Admin
Posts: 34109
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 666 times
Been thanked: 611 times
Contact:

Re: Switching between minimal and desktop versions

Post by odroid » Fri Apr 19, 2019 12:09 pm

Since Mate/X11 has no way to use the GPU acceleration, you have to start with the minimal image first.
The minimal image has a modified SDL2 library which is needed for the PPSSPP on the framebuffer.
The modified SDL2 uses the Mali driver only on the framebuffer.
So your SDL2 app also need to run without X11 if your app uses OpenGL-ES API.
Please start from the minimal image.

We have a plan to make a guide to run some GPU using apps(Kodi, PPSSPP, RetroArch and so on) on the virtual terminal (i.e., Ctrl-Alt-F2) with Mate desktop installing on the minimal image.
Here is a concept of proof : viewtopic.php?f=98&t=34149&p=250789#p250780
Kodi on N2 Ubuntu: viewtopic.php?f=177&t=34438
But it may take a few weeks.

wallyz21
Posts: 137
Joined: Thu Apr 04, 2019 11:00 am
languages_spoken: english
ODROIDs: N2
Has thanked: 10 times
Been thanked: 16 times
Contact:

Re: Switching between minimal and desktop versions

Post by wallyz21 » Fri Apr 19, 2019 1:41 pm

I managed to do it!

The missing piece of the puzzle was to have the GPU enabled version of SDL2 library installed.

This requires you have copied libSDL2-2.0.so.0.8.0 from the minimal image to the desktop image /usr/lib/aarch64-linux-gnu/libSDL2-2.0.so.0.8.0_gpufb

So here is my set to mali script (must be run as root (sudo)):

Code: Select all

#!/bin/bash
service lightdm stop
#
cd /usr/lib/aarch64-linux-gnu
#
mv libEGL.so.1.0.0 libEGL.so.1.0.0_old
ln -s libMali.so libEGL.so.1.0.0
#
mv libGLESv2.so.2.0.0 libGLESv2.so.2.0.0_old
ln -s libMali.so libGLESv2.so.2.0.0
#
mv libSDL2-2.0.so.0.8.0 libSDL2-2.0.so.0.8.0_x11
mv libSDL2-2.0.so.0.8.0_gpufb libSDL2-2.0.so.0.8.0
#
ls -l libEGL*
ls -l libGLESv2*
ls -l libSDL2-2.0*
And the script to change it back to X11 (must be run as root (sudo)):

Code: Select all

#!/bin/bash
cd /usr/lib/aarch64-linux-gnu
#
rm libEGL.so.1.0.0
mv libEGL.so.1.0.0_old libEGL.so.1.0.0
#
rm libGLESv2.so.2.0.0
mv libGLESv2.so.2.0.0_old libGLESv2.so.2.0.0
#
mv libSDL2-2.0.so.0.8.0 libSDL2-2.0.so.0.8.0_gpufb
mv libSDL2-2.0.so.0.8.0_x11 libSDL2-2.0.so.0.8.0
#
ls -l libEGL*
ls -l libGLESv2*
ls -l libSDL2-2.0*
#
service lightdm start
To mount the minimal image from the full image use this command:

Code: Select all

sudo mount  -t auto -o loop,offset=$((264192*512)) ./ubuntu-18.04.2-4.9-minimal-odroid-n2-20190329.img /mnt/minroot
Ensure you are in the same directory as the .img or provide the full path to it and you must have made a /mnt/minroot folder/directory first.

I have since discovered that is is not necessary to stop and restart the lightdm service. PPSSPPSDL will happily run side by side with the desktop running.
Last edited by wallyz21 on Fri Apr 19, 2019 10:42 pm, edited 1 time in total.
These users thanked the author wallyz21 for the post:
Kahana82 (Fri Apr 26, 2019 5:21 pm)
Walter Zambotti
N2 - Ubuntu Mate Desktop

User avatar
odroid
Site Admin
Posts: 34109
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 666 times
Been thanked: 611 times
Contact:

Re: Switching between minimal and desktop versions

Post by odroid » Fri Apr 19, 2019 2:34 pm

Great progress. :D
Glad to hear you found the missing piece of the puzzle.

BTW, can I ask you what you want to develop?

wallyz21
Posts: 137
Joined: Thu Apr 04, 2019 11:00 am
languages_spoken: english
ODROIDs: N2
Has thanked: 10 times
Been thanked: 16 times
Contact:

Re: Switching between minimal and desktop versions

Post by wallyz21 » Fri Apr 19, 2019 10:27 pm

odroid wrote:
Fri Apr 19, 2019 2:34 pm
Great progress. :D
Glad to hear you found the missing piece of the puzzle.

BTW, can I ask you what you want to develop?
I'm a member of the CoCo (Tandy Color Computer 6809) user group. I have helped to develop a version of a CoCo emulator that now runs using SDL2 and AGAR GUI.

I have it running natively on Windows 64bit. Linux X86 64. Mac OSX and now Linux Arm 64.

So if anyone needs a port of AGAR 1.5.0 for Linux Arm64 I have one ready.

Image
Screenshot at 2019-04-19 21-30-47.png
Screenshot at 2019-04-19 21-30-47.png (33.65 KiB) Viewed 2314 times
These users thanked the author wallyz21 for the post:
gajam (Mon May 18, 2020 4:48 pm)
Walter Zambotti
N2 - Ubuntu Mate Desktop

Post Reply

Return to “Ubuntu”

Who is online

Users browsing this forum: No registered users and 1 guest