kevin gunn

more sample client updates

I can’t even remotely take credit for this. Alberto from the Mir team took the mir-client snap and updated to utilize the mir-libs snap through the content interface. This is helpful as a guide for others who want to avoid making useless copies of libraries in a mir-client app snap. He also added some additional example client applications to run on the mir-kiosk, along with using the snap set command to dynamically change those from the command line. I’ve updated the mir-snaps wiki on how to utilize this. enjoy! If you wanna discuss or have issues, find me (kgunn) on freenode #ubuntu-mir

kevin gunn

formalizing the kiosk work a bit more

If you’ve been following along, you’ll know that we’ve put some snap work in to show how you might use Mir as a framework to build a kiosk style product. This post touches on a couple of recent evolutions.

First, there’s been recent work in improving Mir’s API stability at the server level, to be a true toolkit for shells through Miral which you can read about here. And you can read about the latest Miral 0.3 release here. Part of Miral provides 2 default shell implementations. One is miral-shell and the other is miral-kiosk. Miral-kiosk, as the name suggests, is a very minimal shell, keeping the footprint and complexity low. Hence it’s perfect for targeting products requiring simple, single application user interfaces. So we’ve created a snap utilizing this, named “mir-kiosk”.

Eventually Miral will become part of Mir itself, we just need to work through supported trusted prompts in more complex shell use cases (which is happening as I type). But the point of this post, is demonstrating miral-kiosk in a snap. If anyone reading this is considering using Mir snaps for production in a kiosk style product, I would recommend miral-kiosk as the preferred method. The same confinement achieve before still exists and you can run the same example applications.

Second, with the advent of the content interface available in the latest snapd release we are moving out the Mir libraries into their own snap that can be leveraged by the shell and mir-clients. This will make sure the Mir libraries stay in sync with one another and there’s a little deduplication gain so there’s not a lot of snaps with copies of Mir libraries as stage packages. This snap’s name is “mir-libs”.

Both the mir-kiosk & mir-libs snaps are available in the snap store. It can be demonstrated using the same mir-client snap that’s been used before in other posts.

Now, to experience this you need to download the latest ubuntu-core image, which is Release Candidate 2 (RC2). Download the appropriate architecture of the mir-client snap and then copy that over to your running ubuntu-core image. You can then ssh into your device/VM and install in this particular order.

$ snap install mir-libs --channel=edge --devmode
$ snap install mir-kiosk --channel=edge --devmode
$ snap install mir-client_0.24.1_amd64.snap --devmode --dangerous

 

At this point you should witness PhotoViewer running on mir-kiosk using mir-libs via content interface on your device or VM.

One last note, you might notice I’ve added –devmode to the installation steps here, that is due to a small regression in the RC2 image, it’s a bug that’s actively being worked. Confinement is still maintained with the the mir-kiosk snap.

 

kevin gunn

a better kiosk demo

Hey just having more fun snapping on dragonboard. I’ve updated the mir-client snap to use a Qt demo that is probably a bit more like what a kiosk style application might be. It’s the photoviewer on dragonboard as an example. Which improved not only the demo experience but provides developers a better guide since it actually uses the qmake plugin of snapcraft to build the demo from source. I can’t emphasize how easy it was to modify my snapcraft project to add this to the demo. Again, good ‘ol mir-snaps wiki can be used as a guide. And if you don’t want to build, you can grab my personal builds of these snaps for arm64 for mir-server snap and mir-client-snap respectively.

kevin gunn

Mir snaps on Dragonboard with Touch

hey just a very quick update. Had some more time to play around today and touch is working after all (only difference is I left my usb keyboard disconnected today so maybe it was getting confused)

Anyhow, here’s videos of Qt clocks with touch and Qt samegame with touch

kevin gunn

fun with mir snap on Dragonboard!

OK, I’m really overdue on posting something about this as I’ve had _something_ running on the dragonboard 410c for a while. If you don’t know about dragonboard you can check out dragonboard from 96boards .

So dragonboard is targeted to be a supported reference board by our Snappy team and they’re in the process of pushing out beta images to play with in the 16 series. I had been concerned that we I was going to have to go and build the graphics drivers into our Ubuntu core snap. When I started I wasn’t even sure of the state of the freedreno drivers vs closed source vendor drivers. But as luck would have it, someone quite recently had turned on the gallium drivers to be built and package as part of the Ubuntu distro, which means I got the freedreno drivers with no effort! Lots of love to Rob Clark for all the work he’s done on freedreno (if your interested in learning more  check out freedreno on github ).

So getting a devmode mir snap demo up and running was relatively painless. However, I do want to say I found a little difference in my runs amd64 VM vs the native arm64. This resulted in some tweaks to the mir interface in snapd (which had already landed and should be in the next snapd release). Also, never use setterm when developing with Mir, that create all sorts of chaos for me 🙂 I had used setterm for convenience to prevent the screen from blanking, ended up causing failures when I was working on making sure the mir snaps could run confined.

If you follow the good ol’ mir snaps wiki, you can easily duplicate this – running the mir snaps fully confined on dragonboard core snap. Also, I wanted to point out again there are other Qt demos you can try besides the clock app – simply modify the helper file in the client example (client-start) to be something besides “clock”, for example “maroon” or “samegame”. You can do this with an HDMI monitor and mouse attached  like in this  video of various Qt apps as mir-client snaps running on dragonboard . Still need to investigate some mouse oddities that seem to only occur with apps other than clock.

And lastly, I got new toy over the weekend. I ordered a 7″ touch screen from adafruit. Here’s a quick video of the 7″ display attached. I need to tinker with it to see about getting the touch to work, but it was nice to just hook it together and the display come up.

kevin gunn

So first, if you didn’t catch it, series 16 Ubuntu Core beta images are available here http://cdimage.ubuntu.com/ubuntu-snappy/16.04/current/

I just verified the Mir snaps are functioning and made some small updates to match here https://developer.ubuntu.com/en/snappy/build-apps/mir-snaps/

One of which being a command line switch for installing the snaps locally… –dangerous, what a great flag name 🙂

Also, I made some updates to the snaps themselves to check for the architecture from $SNAP_ARCH and then set up all the correct paths. So this means the scripts will work properly on the various archs without having to tinker. I’ve also changed the mir-client snap specifically to pull the demos from the archive, this way you’ll also get the right binary for the right arch as well.

Enjoy!

 

kevin gunn

Confined snaps on classic…unity8 style

Wanted to quickly share some work-in-progress. I’d previously posted about running unconfined snaps on unity8 , this post is about a small but important incremental step in the progress. Since the mir interface is now part of snapd – you can begin confining apps as snaps targeting Unity8. What this means is, those developers who’ve been delivering and maintaining clicks for Unity8 will have a method to test out their snap on the Unity8 desktop. This will help those developers eventually migrate completely to snaps quickly and easily while keeping their confinement.

So if you want to give it a shot….

Here’s the pull request for adding mir to implicit interfaces , which will make the mir interface an available slot on the system. You can use the mod and rebuild snapd using Zyga’s tools  (If you’ve never modified snapd, recommend reading the README  on github  )

And one other hot tip that wasn’t obvious when I started tinkering with this…when rebuilding/running snapd, just use the one-shot method like “$ ./refresh-bits snap snapd setup run-snapd” this will build snap, snapd, stop the running installed snapd and run the newly built snapd all in one go.

Once you’ve got snapd rebuilt and running, you just need to rebuild ubuntu-clock-app from snappy playpen. Again, it’s only a one-line change to add “mir” as a plug to the ubuntu-clock-app’s yaml. Here’s a branch with the change.

Anyhow, I hope you give it a shot and let us know about any struggles you might encounter. You can find me in either #snappy or #unity8 on freenode.

kevin gunn

Mir interface landed!

So the Mir interface has landed in snapd. This means that the mir-server snap can be downloaded and taken into use in a fully confined mode, along with matching mir-client snap. I’ve been keeping updated instructions here on the best way to operate and develop your mir-client snap. The one caveat is there’s still a snappy bug (launchpad bug# 1577897)  with snap auto-connections.  This means that you have to manually make the plug-slot connection of the mir-server and mir-client, and then restart the mir-client service. I’ve just uploaded a new mir-server snap which is on Mir version 0.23.5, it should be reflected in the store soon.

At any rate, I’d love to hear back from folks trying this out. In the coming weeks I’m hoping to spend some time on dragonboard and getting this working there.

kevin gunn

Snap on Unity8 classic

I wanted to provide a quick guide for those who might be tinkering around with snaps. This is a demonstration for developers interested in the ability to create snaps of their applications as well for Unity8, analogous to the experience of snaps on classic Ubuntu on Unity7, as outlined at https://developer.ubuntu.com/en/desktop/get-started/. These instructions assume you’ve already installed and experienced ubuntu-core, the ubuntu-snappy-cli, installing and running snaps on Unity7. You should also be running an up-to-date Ubuntu 16.04 system, since there are updates consistently being made to snapcraft and snapd.

In following this guide you’ll eventually run ubuntu-clock-app as the demonstration. In order to avoid confusion, ensure you do not have the clock application installed on your ubuntu-core from previous experimentation. The reason for this is that ubuntu-clock-app in the store assumes it is running on an X11 based system, but the snap we are going to build and install here assumes it is running on a Mir based system and there is no X11 in the Unity8 session. So before we begin, while logged into your Unity7 session run the following:

 

$ sudo snap remove ubuntu-clock-app

 

If you haven’t already, you need to install the unity8-desktop-session-mir package and add ppa:ci-train-ppa-service/stable-phone-overlay (the addition of the ppa is in order to keep up to date with the latest Unity8, UI toolkit and Mir changes that are being regularly released for the phone).

Note1: we are in the process of SRU’ing a change to Unity8-desktop-session-mir that will automatically add the PPA, but for now this is required as the SRU process will take time.

Note2: you must be using free graphics drivers for the unity8-desktop-session-mir, for instance if you are on an Intel gpu you will have no problems, if you are on an AMD gpu you will need radeon, if you are on Nvidia you will need Nouvea.

Open a terminal and run the following commands:

 

$ sudo apt-add-repository ppa:ci-train-ppa-service/stable-phone-overlay

$ sudo apt-get update

$ sudo apt-get dist-upgrade

$ sudo apt-get install unity8-desktop-session-mir

 

At this point, you should be able to log out of your Unity7 session and toggle the greeter icon to Unity8 and login. Once in your Unity8 session, you can navigate to the Ubuntu Store scope on the Dash via the Apps scope. Search for the terminal app and install it.

NOTE: i’m trying to get the terminal app updated in the store to be a “fat package” which means working for both amd64 and armhf architectures. Until then you can find and install the terminal app from https://launchpad.net/~dpm/+archive/ubuntu/ppa

$ sudo add-apt-repository ppa:dpm/ppa

$ sudo apt update

$ sudo apt install ubuntu-terminal-app

Open up the terminal app to download the ubuntu-clock-app source that has relevant snapcraft files and modifications to support running on the Unity8-Mir system. If you want to see the what modifications I had to add you may compare the branch we’ll be building, lp:~kgunn72/snappy-desktop-exmaples/try-mir-take1 to lp:snappy-desktop-examples . The modifications are mainly that the snap needs to contain the qtmir plugin since Unity8 is running on the Mir stack for graphics and X11 is not running.

 

You’ll notice on the installation step we install with –devmode, as we are just now in the process of creating the interfaces for Unity8 and Mir. Running in –devmode means that the application is not confined. Then enjoy building and running the snap:

 

$ bzr branch lp:~kgunn72/snappy-desktop-examples/try-mir-take1

$ cd ./try-mir-take1/ubuntu-clock-app

$ snapcraft

$ sudo snap install ubuntu-clock-app*.snap –devmode

 

OK congrats, you’ve built a snap for an application that runs on unity8. There is one bug (https://bugs.launchpad.net/ubuntu/+source/unity8-desktop-session/+bug/1590439) that we need to account for to add /snap/bin to our path. But once done, you should be able to launch the app.

 

$ export PATH=$PATH: /snap/bin

$ ubuntu-clock-app.clock

Hope you enjoyed this exercise. In theory this could be applied to any application that might have been created for the Ubuntu phone. We’ll be working to make this process less manual over time.