Mir on raspberry pi 2 + web browser technologies

Asked by Javier Melero

Hi everyone,

First of all sorry if this is not the place for the question I'm going to ask, but I've searched over the internet (stackoverflow, launchpad, etc.) and can't find a clue about this subject.

I'm developing some kind of very basic media center that runs on a raspberry pi 2. This is part of a bigger project for a hotel, the idea is to give room's tvs some "smart" capabilities and at same time allow guests to access data from its account (status, room services, etc.).

This project consists of 3 main parts:
1.- A mobile app (ios/android/window phone) that guests will install in order to control the room media centre directly from its phone, like a remote control, but using it as touchpad, keyboard, etc. (no problem with this part).
2.- A central server where mobile apps and media centers will identify against it, and authenticate in order to sync a remote control (mobile app) with a screen (media center). (no problem here either).
3.- The media center itself, implemented with the raspberry (raspbian os). Here's the problem.

For this last component, we (my team and I), started working with web technologies, nwjs (node webkit). The media center app consists of a full screen node webkit app running directly over X.org (without a desktop environment), the remote control part was made with xdotool, communication with websocket/nodejs directly between raspberry and mobile app (everything happens over the same wifi network). Everything was ok on testing environment (not the pi) but when we test it on a real raspberry the performance is incredibly poor. When I research a little on this matter I found that X.org on the pi runs on the cpu without gpu hardware acceleration, which took us to search for other options for the graphic stack.

So here are my questions:
1. ¿Is it possible to run mir display server on a raspberry pi 2 (raspbian os)?
2. If yes, ¿is it possible to run a single app over mir, without the need of a window manager, desktop shell, etc.?
3. ¿does mir support hardware acceleration over the raspberry pi 2 (GPU Broadcom VideoCore IV)?
4. ¿Is it possible to run webkit, blink or any other modern web rendering engine over mir?
5. And finally ¿Does exist an xdotool equivalent for mir? if not ¿Does mir exposes some API to make it possible to write a program like xdotool?

We've been doing some tests with wayland/weston/maynard on the raspberry, and the answer to the most of those questions is yes, it has a good performance and smooth animations but, as far as I know there is not replacement for xdotool and worst is that wayland doesn't expose an API at all to make it possible. So, I want to know the status of mir display server related to those questions to see if it is a viable option.

Once again, sorry if this isn't the write place to ask, but I'm kinda desperate and I don't know where else to search. Thank you very much!

Question information

English Edit question
Mir Edit question
Andreas Pokorny Edit question
Solved by:
Andreas Pokorny
Last query:
Last reply:
Revision history for this message
Best Andreas Pokorny (andreas-pokorny) said :

Sorry that we missed your question here. You could also use the mir-devel list

This sounds like the perfect candidate for ubuntu snappy with a mir snappy part on top.

Or maybe a qtmir based shell. Take a look at unity8 as an example.. But lets first go through the specific questions.

1. Raspberry pi2 uses a broadcom gpu, that initially did not provide a kernel mode setting (kms) API to setup modes and allocate buffers for rendering. But this has recently changed. Eric Anhalt is working on such a kms driver and a Mesa based GLESv2 capable graphics driver. If that is in place mir would normally run directly with it. With Mir you also can also use the android drivers.

So for the non-android path you would use:
The raspberry pi2 kernel tree from eric anholt with the new kms driver can be found here

The mesa driver is here:

So yes here you do not get an out of the box solution - yet. Out of the box snappy with mir support for Pi2 is on the roadmap for 2016 - and also Kiosk-like applications with snappy/mir in general

2. Mir is a framework for writing shells. You could launch a mir based system-compositor ( see inside the mir examples or unity-system-compositor) - the only part that needs higher privileges to directly access the graphics hardware and input devices. Then either launch a client i.e using the standard qt or gtk or SDL2 client backends to get your UI done. Or launch another mirserver that runs fullscreen inside the system-compositor. Examples for that can be found in qtmir/unity8 or in mir examples again. Then you could have both GLESv2 rendering and the ability to integrate further applications.

3. It should work if the KMS drivers are working, or via the android drivers. But it is hard to tell without trying since each android driver had its characteristics that required some adaptation in mir. Since weston runs it should be possible to write a mir graphics backend that uses the same VC4 specific APIs.

4. There was an attempt to port chromium directly to mir. I believe it was not integrated upstream. But there is now also: https://launchpad.net/oxide

5. Mir provides an API for that. Implementing the input driver interface is one way. A starting point would be this here: http://bazaar.launchpad.net/~mir-team/mir/development-branch/view/head:/include/platform/mir/input/platform.h
Alternatively as a mir shell you can also just add another input device through the InputDeviceRegistry API:

Revision history for this message
Javier Melero (ricmelero) said :

Thank you so much!! This is the kind of info what I was looking for. I'll further investigate on this subject, but I had so many questions that I didn't know where to start, this is so helpful for me as an starting point, knowing the current state of all these "things". Once again thank you!

Revision history for this message
Javier Melero (ricmelero) said :

Thanks Andreas Pokorny, that solved my question.

Revision history for this message
Andreas Pokorny (andreas-pokorny) said :

Btw you can also just go to the IRC #ubuntu-mir and ask whatever you like. There might still be people online.. I mean we have crowd from various time zones. And we really like to have 3rd party feature requests, because it really helps us shape the design of the software. As in : the intention of mir is to be helpful.