What's Inside the Black Box of Ubuntu Touch?
-
@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.
-
This is tangential, but I feel it relevant to the discussion of apps.
I feel this is what @3arn0wl was getting at:
I think the current app that best represents what the community at large is in need of is Pure Maps. It is well designed, runs natively, and has been portable to multiple OS's. If there is a gold standard, it involves these criteria. I know there are others, I just don't know them off-hand.If the Linux mobile ecosystem had enough apps like that we wouldn't need Libertine and Anbox. At least in a philisophical way, to avoid derailing the discussion.
-
@rob You shouldn't need to "configure" any apps in any way for these things. You need a
.desktop
file for your app in libertine, and you need to launch the app withubuntu-app-launch
from the host. It runs the app with a clean environment, and sets variables that need to be set. Asxcb
is the default QPA, and the app is run under Xmir (and thus has$DISPLAY
set), it should try to use that. If not, perhaps there is a bug somewhere, but libertine is also an experimental feature to allow using legacy apps (which are mostly only usable on larger screens with a mouse and keyboard attached).If you want to develop mobile native apps, really, libertine is not the way to do it.
-
@dobey thank you. the question on the setting was for me to understand how the graphics framework knows to use which display client to use. That's all. Most of my questions here are for discovery and education (for my Youtube videos on UT) and not for anything I'm specifically doing.. One of the videos will discuss Mir specifically.
And it actually came to me as I ran libertine launch and the message about the mirclient came up. I was just curious where that was set.
This is a great community and I hope to be saying many positive things about it and all of you.
-
@3arn0wl,
@rob's goal, as I understand it, is not to create an app at all, but to explore the limits of what is possible with the system, preferably while still remaining within support (i.e. not breaking OTA updates)
-
I fully understand that, @arubislander.
-
My apologies, @3arn0wl. Your comment threw me off.
-
@arubislander indeed! at least for now.
I have a couple of apps I could port over too to the openstore. And there are some changes I'd suggest to the system apps. But that's not connected to this thread.
-
@rob said in What's Inside the Black Box of Ubuntu Touch?:
@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
To be fair, you can do whatever you want, as the device is yours and all the code is open source (save of course for the binary blobs in Android side for drivers/firmware). However, it doesn't mean doing what you want is necessarily supported by the software, or that it necessarily should be.
Strictly speaking, Libertine is an experimental feature designed for the purpose of running legacy (X11 and non-converged) apps within the confined environment of Unity 8, either on a PC or when using a phone/tablet with an external display, mouse, and keyboard. There are a few additional things you can use the Libertine container system for, such as a way to install and run terminal apps from the Ubuntu archive, compiling things natively on a phone, etcβ¦
Despite GTK+ being installed in the rootfs (it's really only there because the keyboard indicator, which is used for external keyboards, uses GDK to draw the [EN] "icon" you see in the panel), it is not a directly supported toolkit target of the system. You can build/install something in a Libertine container, and use it with GTK+, but as I mentioned before, you will need to develop the app nearly to the point of something you would ship, with a
myapp.desktop
file, and you will need to install all the dependencies you need, so that the app can run. You also cannot run./myapp
directly in the container, nor runlibertine-launch ./myapp
and need to run it such asubuntu-app-launch containerid_myapp_0.0
from the host (wherecontainerid_myapp_0.0
is the appid, which should appear in the output ofubuntu-app-launch-appids
after you've created the app andmyapp.desktop
file inside the container). -
@dobey here's why I started playing with Libertine.
in theory, on a standard phone like the Nexus 5 I'm using, there are many space limitations doing even testing inside the host. While there are not the same space limitations inside Libertine.
So let's just say I'm testing an app that I could load in the host. I run apt-get install and it says out of space in /cache which apparently is where apt puts it's stuff.
Given the lack of resources available, it's not even possible to do much playing at the host side and then one is stuck with libertine, and its limitations and 'experimental' bugs.
Now I expect this would be different on a pinephone since UT is not stuck with the pre-made partitions on Android.
I also understand that there are differences in pre-loaded libraries in the Host vs what's in Libertine (desktop 16.04) which brings it's own different set of issues.
The point of this exercise is to see if I can do normal Linux things on a UT device vs. let's say using PostmarketOS. This is a valid comparison and an often made one between the OS options.
I understand the upcoming changes (wayland, pinephone) will change the comparison.
One might say that this kind of playing is not normal and would break OTA updates. But that will really be a non issue on the Pinephone since one could just have a clean UT install always available on an extra SD card.
Partly this ability to play with this stuff is why we're on Linux. Partly it's also because of privacy advantages.
In any case, I've concluded that Libertine isn't the answer but need more space on the host to do more experimentation. Hopefully the Pinephone will give that space.
-
@rob if you want to experiment with your phone, you don't need to wait for the pinephone. You can resize your root partition today (most likely), the android stuff doesn't hinder you. Maybe you want to have a look at: https://github.com/timsueberkrueb/plasma-phone-dev-setup/blob/master/usr/bin/resize-root-partition
-
@rob said in What's Inside the Black Box of Ubuntu Touch?:
The point of this exercise is to see if I can do normal Linux things on a UT device vs. let's say using PostmarketOS. This is a valid comparison and an often made one between the OS options.
I think this is a poor distinction to make. Ubuntu Touch is not a traditional Linux distribution, so no, you cannot treat it like one. It is an OS designed with phone/tablet use in mind, and with security restraints to that effect. It's only a valid comparison for people who do not want a phone or tablet, but instead want something they can treat like a traditional Linux distro, in their pocket. And those are two very different things, for which making the comparison in such a manner, doesn't promote the benefits of such a system, and treats the traditional and less secure way as something inherently better.
@rob said in What's Inside the Black Box of Ubuntu Touch?:
Partly this ability to play with this stuff is why we're on Linux. Partly it's also because of privacy advantages.
Android is still Linux. So far, the things you've talked about in terms of building and running an app directly on the phone, have absolutely nothing to do with whether there is a Linux kernel running on the device though. Linux is running on billions of devices in the wild. Simply because you can't ssh into those devices arbitrarily and do some traditional things you might be used to on Debian or Ubuntu on your PC, doesn't make those devices not be Linux. Android is the same.
@rob said in What's Inside the Black Box of Ubuntu Touch?:
In any case, I've concluded that Libertine isn't the answer but need more space on the host to do more experimentation. Hopefully the Pinephone will give that space.
Libertine is the answer, as it is what provides a container for installing and running legacy apps. However, it doesn't magically make those apps responsive or usable on phones, nor does it enable a full traditional Linux distribution experience. Likewise, Pinephone is not an answer here, as it is not the only device that UT will be supporting. The rootfs contents (in terms of what is supported by UT) must remain consistent across devices, regardless of whether they use libhybris or not, and whether or not they are stuck with Android style partitioning. Doing anything different in this area across different devices will only make it harder to support, harder to build apps for UT, and harder for users to use UT. Those are all things we clearly do not want.