What's Inside the Black Box of Ubuntu Touch?
-
If running a GUI in a Libertine-Container, does it use Xmir or Xwayland or is there something else that has to be enabled on the host, after setting the DISPLAY environment variable? This is one of those Ubuntu specific things that just make it different and a little bit frustrating for those who don't know.
I've tried searching all over to understand this but there is so little documentation on this. And all I'm trying to do is demonstrate that I can make my own app only load it on my own phone.
-
@rob said in What's Inside the Black Box of Ubuntu Touch?:
ValueError: Namespace Gtk not available
Yes, this means that the package which provides the GObject Introspection code for GTK+ (
gir1.2-gtk-3.0
) is not installed. Eachgir1.2-foo
package must be installed for the libraries you want to use in your app, if using python and gtk libraries. -
@rob said in What's Inside the Black Box of Ubuntu Touch?:
If running a GUI in a Libertine-Container, does it use Xmir or Xwayland or is there something else that has to be enabled on the host, after setting the DISPLAY environment variable? This is one of those Ubuntu specific things that just make it different and a little bit frustrating for those who don't know.
Currently, Xmir is used, however, you cannot simply run GUI apps from the command line, such as just typing
firefox
as Unity 8 authenticates apps in a certain way. Xwayland will eventually replace Xmir, when Wayland replaces MirClient as the protocol used, and the work to make Xwayland work properly in Unity 8 is done. You will need a.desktop
file and icon, for any GUI app, and it will need to be started from the Unity 8 app drawer (or the legacy apps scope if using earlier versions), or withubuntu-app-launch
on the command line. -
Thank you @dobey. Everything I learn will be shared with others in a simplified way so please consider me a time investment for UT.
Is there further documentation on ubuntu-app-launch? I've been searching for this since early today and haven't found much.
Yes, I understand about handling .desktop which I can see is stored in the container in the regular /usr/share/applications.
Is this launch command handling the display server? Is the handling of Xmir/Xwayland (future) done automatically? Or do I have to do something else either on the host or in the container?
I'm seeing prompts for setting the DISPLAY env variable and I see a -E parameter. But the sparse documentation doesn't make it clear what I have to do.
-
On the Gobject installation, why did the apt install not automatically handle those dependencies?
-
@rob said in What's Inside the Black Box of Ubuntu Touch?:
Is there further documentation on ubuntu-app-launch? I've been searching for this since early today and haven't found much.
There is some API documentation for developers working on the system, but the
ubuntu-app-launch
tool itself is quite trivial. It only takes one argument, the appid that is being launched.ubuntu-app-launch-appids
will list the installed appids available to launch.@rob said in What's Inside the Black Box of Ubuntu Touch?:
Is this launch command handling the display server? Is the handling of Xmir/Xwayland (future) done automatically? Or do I have to do something else either on the host or in the container?
Xmir does not work in the same way that Xwayland does. A server is started for each X11 app that is being run (so that X11 apps cannot pry into the
$DISPLAY
and steal data from other X11 apps) with Xmir, while Xwayland has a single display server. Therefore, starting of Xmir for each app is handled by theubuntu-app-launch
code, hence why you need to launch GUI apps with it.@rob said in What's Inside the Black Box of Ubuntu Touch?:
On the Gobject installation, why did the apt install not automatically handle those dependencies?
Why should it, if you did not install anything which doesn't need them? As you are the developer in this case, you need to install the dependencies you need when developing an application. The libertine container doesn't know what you need in it, for your own code.
-
@dobey said in What's Inside the Black Box of Ubuntu Touch?:
Why should it, if you did not install anything which doesn't need them? As you are the developer in this case, you need to install the dependencies you need when developing an application. The libertine container doesn't know what you need in it, for your own code.
It's only a comment related to consistency between UT/Libertine-Container vs let's say an Ubuntu 18.04 desktop which is what I'm using. I documented the dependencies needed to install it on Ubuntu 18.04 and am discovering that it is differently packaged for UT. Maybe this is a 16.04 thing..
-
And the ubuntu-app-launch worked on something I installed from apt! Thanks! Slowly making sense.
My python app is still failing on some other aspect of gtk so I'll research that some more. But glad to have made some progress.
-
I moved now to a different approach which is to try to make a Python QT app. So I get the error:
This application failed to start because it could not find or load the Qt platform plugin "ubuntumirclient".Then I see that this is now deprecated and that this will replaced by Xwayland. But this is just a basic Qt app.
I can't even get a simple python Hello World in QT to work in a Libertine Container. That''s all I'm doing.
-
You are writing your own app, to run specifically in Libertine? To what effect?
-
@arubislander hi there! This is more than a simple attempt at making an app. This is a deeper attempt at uncovering how things work on UT. Given that the host system is locked down, the place to do anything else is in a Libertine-Container if that is doable.
This is part of an education series that I'm doing to get more people to appreciate UT (see this video https://youtu.be/rMmWmNyDKG8 )
Yes, I did write a cybersecurity GTK app that I'm sure can be made to run on PureOS on a Librem5 (I don't have one yet so I'm unable to try it). But it runs fine on any Gnome distro. Happy to convert it to QT as well though I have not used QT before.
I can tell you that people will migrate to PostmarketOS on a Pinephone if they can't figure out how UT works. So that is the bigger picture here.
Now for a personal use case, I can easily write things that I can find a purpose for without necessarily wanting to make some Openstore click package. As example, something for a cybersecurity purpose. So doing simple programs is something I expect I can do on any Linux device, for example, a Raspberry PI.
I realize that UT is a different animal but I'm just looking for a predictable behavior so I can push it in a positive way..
-
The other problem that makes it necessary to use the Libertine-Container is that even if I force a read-write on the main system, there's not enough space on /var/cache/apt/archives so you can't really even do much.
And I'm only testing...
Even doing a compile of one of the existing system apps like address-book-app will not work since there's no space to download a build system (perhaps this will not be a limitation on the pinephone since it won't have these specific android partitions)
I realize that many things don't run on Libertine but if I know what the limitations are then it can be put to use. Yes it is pointless running GUI apps like Wireshark, Gimp, Libreoffice and such on it since it's not usable anyway.
I know for example, that non-GUI apps made with Python run fine. Bash stuff runs fine. And that has value, particularly for cybersecurity.
-
Hi @rob, So you want to see how far you can get using UT as a 'regular' Linux distro in Libertine?
In my experience GTK apps work better in Libertine than QT apps. So maybe give the GTK version another go. Only this time Get it compiling and running in a 16.04 LXC container first on your main machine. That should give you a better idea of the dependencies required for your app to run in Libertine.
-
@arubislander thank you. Yes that's been my experience so far. GTK gets me further in Libertine. Which is funny. According to the docs, the host system has a lot of the Qtquick/QML libraries loaded already, so I'm thinking that on a Pinephone, there might be more room to play with it without Libertine and if so I'll try QML on it.
But still as of today, my particular app gets a segmentation fault when I run it using Gtk and started with ubuntu-app-launch. I can simplify the app to figure out where the fault is but this could be one of the many issues with Libertine itself.
This is my plan of action so far. I think that doing any kind of major development on Libertine is not the most productive, other than for an educational exercise. Which I will do for a video.
However, I imagine that the Pinephone will open up more possibilities since it would be no big deal to modify the main UT install. Just have a back UT SD card ready and you're back in business for daily driver use!
From what I understand now of the architecture, some of the limitations I'm finding now may disappear. I'll know for sure on a real Pinephone soon.
-
@rob said in What's Inside the Black Box of Ubuntu Touch?:
GTK gets me further in Libertine. Which is funny. According to the docs, the host system has a lot of the Qtquick/QML libraries loaded already, so I'm thinking that on a Pinephone, there might be more room to play with it without Libertine and if so I'll try QML on it.
It's a long time since I tried developing on the phone, but one thing to bear in mind is the different backends/platforms that toolkits can be configured to use.
The "native" Ubuntu Touch environment uses mirclient, and the corresponding environment variables for Qt, GTK and SDL2 are:
QT_QPA_PLATFORM=ubuntumirclient GDK_BACKEND=mir SDL_VIDEODRIVER=mir
However, for using Xmir (or in the future Xwayland) from Libertine these ought to be:
QT_QPA_PLATFORM=xcb GDK_BACKEND=x11 SDL_VIDEODRIVER=x11
Hope that clarifies some of the issues you're seeing.
PS At some point there will be a migration to Wayland:
QT_QPA_PLATFORM=wayland GDK_BACKEND=wayland SDL_VIDEODRIVER=wayland
-
@rob
The real goal is to not need either Libertine or Anbox... but have apps running natively in UT. -
@3arn0wl lets say the "real ultimate final godlike world domination" goal...
-
@alan_g that is really helpful. Now just to help in my understanding, where, as example does one configure a QT or a GTK so use these settings?
-
@3arn0wl I hope the real objective is freely do whatever we want. Sometimes we use shared public apps. Sometimes we may want to make private apps. Sometimes we just want to play
-
@rob said in What's Inside the Black Box of Ubuntu Touch?:
@alan_g that is really helpful. Now just to help in my understanding, where, as example does one configure a QT or a GTK so use these settings?
These want to be set for the process using the toolkit. Hopefully setting them for the launch command is enough:
QT_QPA_PLATFORM=xcb ubuntu-app-launch ...
There may be further details, it's been a long time since I did any of this.