What's Inside the Black Box of Ubuntu Touch?



  • @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.



  • 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 with ubuntu-app-launch from the host. It runs the app with a clean environment, and sets variables that need to be set. As xcb 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 run libertine-launch ./myapp and need to run it such as ubuntu-app-launch containerid_myapp_0.0 from the host (where containerid_myapp_0.0 is the appid, which should appear in the output of ubuntu-app-launch-appids after you've created the app and myapp.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


Log in to reply