Canonical Voices

What Qt, linux and everything thoughts from a developer talks about


Movin' on...

A year has gone by since I started work with Canonical. As it turns out, I must be on my way. Where to? Not real sure at this moment, there seems plenty of companies using Qt & QML these days. \0/

But saying that, I am open to suggestions. LinkedIn
Plenty of IoT and devices using sensors around. Heck, even Moto Z phone has some great uses for sensor gestures similar to what I wrote for QtSensors while I was at Nokia.

But a lack of companies that allow freelance or remote work. The last few years I have worked remotely doing work for Jolla and Canonical. Both fantastic companies to work for, which really have it together for working remotely.

I am still surprised that only a handful of companies regularly allow remote work. I do not miss the stuffy non window opening offices and the long daily commute, which sometimes means riding a motorcycle through hail! (I do not suggest this for anyone)

Of course, I am still maintainer for QtSensors, QtSystemInfo for the Qt Project, and Sensor Framework for Mer, and always dreaming up new ways to use sensors. Still keeping tabs on QtNetwork bearer classes.

Although I had to send back the Canonical devices, I still have Ubuntu on my Nexus 4. I still have my Jolla phones and tablet.

That said, I still have this blog here, and besides spending my time looking for a new programming gig, I am (always) preparing to release a new album.
and always willing to work with anyone needing music/audio/soundtrack work.

Read more

Like it says on the Intel IoT developer site, "Without sensors, there's no IoT".

Because I am the maintainer of QtSensors, I like to inquire about  people's use of sensors and if they use QtSensors. Over the years, I have heard quite often something like, 'Qt is thought of as a UI framework'. *sigh*
But Qt is more than just a UI framework and it's use is not dependent on widgets or declarative wizardry. It is used in quite a few middleware components without UI elements. One of those middleware frameworks is Sensor Framework.

Sensor framework is a daemon that uses a plugin system written using Qt for reading various sensors such as accelerometer or light sensors. It was originally developed by Nokia for Harmattan and ran on the N9. It was also used in MeeGo and later included in the Mer Project and on Jolla phones and the ill fated tablet. So it has been released onto a few commercial products.

We looked at it when I was working at Nokia on the project that I still cannot name, but we had decided we would come up with our own solution. Looking back, this was the wrong decision, we should have taken the already proven sensor framework and ran with that. Why? Because it existed and works.

I started maintaining it when I was a privateer (contractor) developer for Jolla. No one else had touched it for some time so I grabbed the few not yet merged bug fixes and added support for libhybris/android libhardware adaptors.

Sensor Framework has support for multiple clients with down sampling for different data rates. It uses dbus for control lines (to start and stop, etc) but sends data through a socket. It also has a working backend in QtSensors.

I noticed that Ubuntu's Unity does nothing to respond when I put this into "tablet mode". I have to manually open the virtual keyboard among other things.

So I thought I could use sensorfw on my Dell 2 in 1. It's one of those converged laptop/tablet devices. It has a few sensors - accelerometer, gyroscope, magnetometer, and lid sensors. One problem... sensorfw does not support lid sensors, or a few other sensors that are around today in IoT (which I will add a bit later). Lid "sensor" might be a bit of a misnomer, as they could be switches but I'd like to think it is more like a hal effect sensor that uses magnets. In any case there are event nodes to use.

First one I chose is to add the lid sensor - to detect when this machine is put into tablet mode, so the UI can better deal with it.

I also noticed that this kernel has support for iio sensor interface for the accel and gyro. Sensorfw only supports sysfs, evdev and hybris interfaces, so I also wanted to add support for that.

I worked on adding iio support first. Well... really just wrote a sensor adaptor plugin. My plugin supports accelerometer, gyroscope and magnetometer, which this device seems to have. I will expand this to support other sensors later, as well as clean it up a bit.

Thanks to QtSensors sensor framework backend, I can make a UI app change with the orientation and lid changes. Better yet, I can create a game that uses accelerometer data like a marble maze game. Or I can upload the data to one of those Node.js data visualization web apps.

And since sensor framework is opensource, others can as well.

Read more

Sensors are an important part of IoT. Phones, robots and drones all have a slurry of sensors. Sensor chips are everywhere, doing all kinds of jobs to help and entertain us. Modern games and game consoles can thank sensors for some wonderfully active games.

Since I became involved with sensors and wrote QtSensorGestures as part of the QtSensors team at Nokia, sensors have only gotten cheaper and more prolific.

I used Ubuntu Server, snappy, a raspberry pi 3, and the senseHAT sensor board to create a senseHAT sensors snap. Of course, this currently only runs in devmode on raspberry pi3 (and pi2 as well) .

To future proof this, I wanted to get sensor data all the way up to QtSensors, for future QML access.

I now work at Canonical. Snappy is new and still in heavy development so I did run into a few issues. First up was QFactoryLoader which finds and loads plugins, was not looking in the correct spot. For some reason, it uses $SNAP/usr/bin as it's QT_PLUGIN_PATH. I got around this for now by using a wrapper script and setting QT_PLUGIN_PATH to $SNAP/usr/lib/arm-linux-gnueabihf/qt5/plugins

Second issue was that QSensorManager could not see it's configuration file in /etc/xdg/QtProject which is not accessible to a snap. So I used the wrapper script to set up  XDG_CONFIG_DIRS as $SNAP/etc/xdg

[NOTE] I just discovered there is a part named "qt5conf" that can be used to setup Qt's env vars by using the included command qt5-launch  to run your snap's commands.

Since there is no libhybris in Ubuntu Core, I had to decide what QtSensor backend to use. I could have used sensorfw, or maybe iio-sensor-proxy but RTIMULib already worked for senseHAT. It was easier to write a QtSensors plugin that used RTIMULib, as opposed to adding it into sensorfw. iio-sensor-proxy is more for laptop like machines and lacks many sensors.
RTIMULib uses a configuration file that needs to be in a writable area, to hold additional device specific calibration data. Luckily, one of it's functions takes a directory path to look in. Since I was creating the plugin, I made it use a new variable SENSEHAT_CONFIG_DIR so I could then set that up in the wrapper script.

This also runs in confinement without devmode, but involves a simple sensors snapd interface.
One of the issues I can already see with this is that there are a myriad ways of accessing the sensors. Different kernel interfaces - iio,  sysfs, evdev, different middleware - android SensorManager/hybris, libhardware/hybris, sensorfw and others either I cannot speak of or do not know about.

Once the snap goes through a review, it will live here, but for now, there is working code is at my sensehat repo.

Next up to snapify, the Matrix Creator sensor array! Perhaps I can use my sensorfw snap or iio-sensor-proxy snap for that.

Read more

They say there are two sides to every coin, and that holds true for the story of the history leading up to Jolla and it's Sailfish OS. The Jolla story usually starts out with Nokia, but it's really a convergence with Nokia as the center point.

This side of the story starts in Norway, not Finland. Oslo, in fact. Not with Nokia, but with a small company named Trolltech.

I won't start at the very beginning but skip to the part where I join in and include a bit about myself. It was 2001, I was writing a Qt based app called Gutenbrowser. I got an email from A. Kozak at Trolltech, makers of Qt. Saying that Sharp was planning to release a new PDA based on Qt, and wouldn't it be cool if Gutenbrowser would be ported to it? I replied, yes, but as I have no device it might be difficult. He replied back with a name/email of a guy that might be able to help. Sharp was putting on a Developer Symposium where they were going to announce the Zaurus and hand out devices to developers. I jumped at the chance.

It was in California. At that time I was in Colorado. Jason Perlow was working for Sharp at that time, and said he had an extra invite to the Developer symposium. WooHoo! The Zaurus was going to run a Qt based interface originally named QPE, later named Qtopia (and even later renamed Qt Extended). The sdk was released, so I downloaded it and started porting even before I had a device to test it on.

Qtopia was open source, and it was available for developers to tinker with, and put on other devices. There was a community project based on the open source Qtopia called Opie that I became involved with. That turned into me getting a job with Trolltech in Australia, where Qtopia was being developed, as the Qtopia Community Liaison, which luckily later somehow turned into a developer job.

Around the time that Nokia came out with the Maemo tablets, I was putting Qtopia on them. N770, N800, N810, and N900 all got the Qt/Qtopia treatment. (Not to mention the OpenMoko phones I did as well).

Then I was told to flash a Qtopia on an N810 because some Trolls were meeting with Nokia. That became two or three images I had to flash over the coarse of a few weeks. I knew something was up.

Around this time, one of the Brisbane developers (A. Kennedy, I'm looking at you!) had a Creative Friday project to make a dynamic user interface framework using xml. (Creative Friday was something Trolltech did that allowed developers to spend every Friday (unless impending doom of bug fixes/release) of their time on research projects) It was really quite fluid and there was a "prototype" interface running on that N810 as well. It only took a few lines of non c++ code to get dynamic UI's. This would have turned into what the next generation of Qtopia's interface would be made with. It was (and still is) quite amazing.

Then came the news that Nokia was buying Trolltech! Holy cow! A HUGE company that makes zillions of phones wanted to buy little ol' Trolltech. But they already had a Linux based interface - Maemo that was based on Gtk toolkit, and not Qt. WTH!?

Everyone speculated they wanted Trolltech for Qtopia. Wrong. Nokia wanted Qt, and decided to ditch Qtopia. We had a wake for the Qtopia event loop to say our good riddance. All of us in Brissie worried about our jobs.

So our little Trolltech got assimilated into this huge behemoth phone company from Finland. Or was it that Trolltech took over Nokia...? Nokia had plans for Qt that would provide a common toolkit for their massively popular Symbian and new Linux based phones.

The Brisbane office started working on creating the QtMobility API's. Yes, there are parts of Qtopia in QtMobility.

Meanwhile, that creative friday xml interface was still being worked on. It got canceled a few times and also revived a few. That eventually evolved into QML, and QtQuick.
Then came N9 and MeeGo, which was going to use this new fangled dynamic UI. MeeGo was also open source, and it's community version was called Mer and Nemo. Yes, there are parts of Qtopia in MeeGo.

The rest of the story is famous, or rather, infamous now. Nokia made redundant the people working on MeeGo. Later on, all of us Brisbane developers, QA and others were also made redundant. The rest of what I call the Trolltech entity got sold to Digia. The QA server room was packed up and shipped to Digia, who is doing a fantastic job of getting Qt Everywhere!

A few of those guys that were working on MeeGo got together and created a company called Jolla, and created a Linux based mobile OS based on Mer named Sailfish. Yes, there are a few Trolltech Trolls working for Jolla. and yes, there are parts of Qtopia in Sailfish.

Read more

state of QSensor and Qt's sensor gestures

I wanted my next post to include some videos demonstrating QSensors and QSensorGestures. I got sidelined by learning BlackBerry Cascades development.

I am happy to report that Qt5's QSensor and QSensorGestures work very well on BB10.

The qt-project, in cooperation with Qt copyright holders Digia, have recently opened up Qt Mobility project and included that code in the Open Governance model that Qt is currently developed under.

This means that I can contribute to qt-mobility again since Nokia closed the Brisbane office.

There are a number of high profile projects that use Qt 4 and Qt Mobility, namely Jolla Mobile and BlackBerry 10.

One of the first community committed patches was me backporting QSensorGesture to Qt Mobility.
You can get the code here:

There is one change in the signals being generated. I decided to remove the runtime generated signals such as 'shake()' and 'whip()' that use QMetaObjectBuilder. So now there is only 'detected(QString)' signal. The QML API remains the same, with an additional 1.3 version.

On top of that, I added a freefall gesture, as well as moving the irProximity sensor to it's proper place with all the other QSensors.

As for Qt 5...

QSensors unfortunately will not be part of the Qt 5 release package. On top of that, you wont be able to currently find the documentation at nor build QSensors using the normal 'make module-qtsensors'. So, it's a bit like it fell off the face of the Earth.

But fear not, it's still there in git. Still being worked on and improved.

Read more

motion sensor gestures

It's been quite a bit of time since I blogged about anything. No longer able to post to the official Qt Labs blog, so I will post here, and maybe it will get picked up to a wider audience.

It's been about 60 days since my last day at the Nokia office In Brisbane, Australia. My days are now full of house duties, kids, recording music, and looking for appropriate workage.

Blatant self promotion

I have been trying to keep my chops up, taking a short contract doing some desktopy work with Qt. But also keeping up with the Mer and Nemo projects.

We have been working on refactoring the Qt 5 QSensor qml API, removing the old qt-mobility stuff and merging the two imports.

As well, I will, in the near future be adding a QFreeFall sensor that detects when a device is freefalling, and a Wii controller sensor plugin to drive the normal motion QSensors and well as some of the QSensorGestures.

I have done the easily possible, and back ported QSensorGesture and friends to Qt 4, so projects such as Mer/Nemo/Jolla, as well as the Blackberry 10 projects could use some cool sensor gestures API.

When most people think of gesture recognition, they think of the touch sensor. Within Qt, this would be the QGesture classes. They also think about using the image sensor to decipher gestures through a computer vision API such as openCV.
and although I would like to extend QSensorGesture to include the openCV and touch sensors techniques, this is really about existing device motion gestures.

Things such as the obvious gesture of 'shake' - when you shake your phone/tablet, your audio playlist gets randomized. But it can be extended to other gestures as well.

QSensors include the qtsensors gesture recognition plugin, that includes such gestures as whip, shake, pickup, twist, cover, hover, turnover and slam.

The above url shows about how to perform these gestures.

These are simple ad-hock gesture recognizers, and do not verge into the more robust and technically challenging HMM realm of recognizers.

Nor is it currently possible for a user to create their own gestures and use them. I'd planned on doing this at my day job, but someone thought it better I needed to take my own time doing them. These are still on my todo list.

Of course, the backport isn't in the official Qt Mobility repo until becomes a part of the qt-project, but I believe that is only a matter of time and resources.

In my next blog, I will demonstrate the use of motion sensor gestures and the advantages that they might bring to a mobile UX.

Read more

hello world mk II

been a long time.. where ya been?

sensors now.

Read more

hey apple!

N900 has video calling, right now. Nokia phones have had video calling for yonks. FaceTime is not the first.
There, I said. I feel better.

Read more


ok, I'm a c++ Qt kinda guy. I have developed using perl, php, and a touch of python.

What I don't understand, is the current fascination for python.

Please, someone try and enlighten me.

Read more


It has been 7 years since I started the Gutenbrowser project on Sourceforge. I had developed it for at least a year or so before that.
I have started hacking on it again, to fix a few things up. It is still far from what I entirely imagine when I think about what it should be.

In 7 years, the Project Gutenberg when from a few hundred books, maybe even a few thousand, to 10's of thousands. All free.
Now there are devices like the Kindle where you can buy ebooks and read them.
You don't have to buy any books from Gutenberg project. That are all free. Everyone of them.

I will create a new release in the coming weeks, with Linux, Windows and Mac OS X binaries.
You can always get Gutenbrowser in Debian. I am not entirely sure which version it is, but they usually keep it up to date, and occasionally pester me for updates or bug fixes.

I am pretty sure I started working on gutenbrowser 9 years ago. My how things have changed in the last 9 years... blah blah blah....

Read more

long time now...

Haven't written anything for a time now, so maybe I should.

It's been a cold winter this year. Lot of days that are below 20 and nights getting down to below 10.

I have become a cold weather ninny.

Read more

Nokia and open source

Nokia makes some  big news announcement

Ok, so they made an announcement they are buying a controlling percent of Symbian, and will be putting it under an open source license. Specifically the Eclipse Public License (EPL).

What remains to be seen is just how much source will be released as open. The EPL  is very generous to proprietary interests. Allowing contributors to relicense their derived works. Which means, "it" won't stay open source. If it is anything like their Maemo offering, it won't be much. Just enough that PR can call it open source. 

Unfortunely, the EPL is not compatible with all the GPL and LGPL works out there, so not very many of the thousands of really great applications for Linux will be available for this. Unless, of course, an application can be relicensed and uses Qt, which will surely be licensed to allow development on this new EPL Symbian.

As with Nokia news lately, I feel it is generally good and it is great to see such a huge company try and be a better 'citizen'.

Read more

There are certain open source rules businesses need to obey. 

Most of them I learned in kindergarden, "Share everything. Play fair. Don't hit people. Put things back where you found them. Clean up your own mess. Don't take things that aren't yours. Say you are sorry when you hurt somebody."

Open Source and the GPL put power and more rights into the hands of users than proprietary software. Such things as DRM, and IPR take rights away from the people, the users.  Richard Stallman sought to empower users and take power back from the establishment that so often abuses it's power and doesn't play fair like a good citizen. This is what open source is about.

To Big Businesses that use open source, you cannot be part of the solution, if you are part of the problem. You cannot move beyond old business models if you are standing still. 

I dare you to take not small steps, but giant leaps forward to bring back power to the users of your software,  hardware and services. 

Read more

moving day

Well, today was the first day of moving to the new house. Made two runs and doesn't look like we even made a dent in anything. My new truck needs a new stereo, as the commute to work is longer.

Can not wait to get the swim pool cleaned up and take a dip. and I have a larger area for all my computers. Even have room to break out music stuff! Now if I could just find the time to do things...

Read more

long weekends

Long weekends aren't what they used to be. Since having two small kids, I no longer have any real time to sit down and concentrate and really get into hacking on stuff. I have to do that at work.

At any rate. I do find some time in the mornings to do this kind of thing.

Read more


just opened the nokia n810. These are my first impressions.

I have used quite a few different handheld devices. The keyboard is not as tactile and easy to type with as the zaurus keyboards. But hopefully it is just a matter of getting use to.

All I wanted to do is test the gps. I eagerly opened the box and started the process of getting a gps fix. It took quite sometime to fix 3 satellites. Longer than half an hour! Maybe it is just the satellites here in the southern hemisphere and Australia. Could have been the mall and the car as well.

a few days with this now. Battery life is good. The keyboard sucks, and I keep making spelling errors because the keys are too close tgogether and fedel tghe samed.

I like tghe zaurfus keyb oard better.

GPS is gbood if you go somewhere tghat you dont know. otghedfrwise itgs just looking at big brother wathinbg where you go.

Read more

new qtopia images

I have some cool new photos of qtopia 4.3

Read more

oh ya!

Andrew Morton (kernel hacker) during his keynote address at 2005 said when asked what desktop he uses, "I won't use a desktop that developers are so stupid that they try to write gui code in C"

Read more

qtopia and openmoko

I finally got openmoko built on my work machine. Using Suse 10.2 and getting it building was a bit 'not just working'. Suse 10.2 not have a gcc3 compat, so I had to use one from Fedora 6. Plus, I had to patch usbdevice_fs.h so it would compile.

I also got Qtopia building in openembedded. Not only that, it gets installed! woot!

So, now I just have to add Qtopia to the openmoko build, which will be a piece of cake.

Then, the real fun stuff begins and what's left is to create an fic-gta device configration.

Read more

so tired

up most the night with a sick 2 year old. tired. thank goodness for caffeine.

Read more