The Mer Wiki now uses your Mer user account and password (create account on

Community Workspace/RaspberryPi

From Mer Wiki
Jump to: navigation, search


Mer on Raspberry Pi

This page details the steps required to bring up a development environment which can be used to create a basic Mer image.

The hardware adaptation is maintained in the project [1]


  • Boot with 128M/128M memory split (128M for the ARM, 128M for the GPU)
  • Wired networking
  • Gstreamer HW accelerated decode using gst-omx
  • Audio output through HDMI/audio jack(at least after manual modprobe snd-bcm2835)
  • OpenGL ES 2 (not X.Org integrated)
  • Accelerated Qt 5.0
  • OpenMax IL decode/render (not X.Org integrated)

Not working

  • HW accelerated Gstreamer video render
  • HW accelerated GStreamer video encode
  • HW accelerated Gstreamer audio decode/encode
  • Accelerated X.Org
  • Qt 4.8

Install Mer SDK

Using the instructions at install Mer SDK on your host Linux system. The SDK has been designed to not rely on the host system so you can use your favourite distro.

Get a account and then ping lbt on #mer freenode IRC channel to enable it on the community OBS server,

edit .oscrc to set server to and set user and password

To test the installation follow the instructions for building the SDK image.

Building a Mer Core Image

Here we use the SDK to build an image which can be written to an sdcard which will include bootloader, kernel and a base filesystem which boots X and starts qmlviewer.

Get kickstart file

curl -k -O

To work around a mic issue zypper in the following package to the SDK

sudo zypper in syslinux-extlinux

Use the mic tool to create the image using the kickstart file

export PATH=/sbin:$PATH # Else you'll get "Error <creator>: Command 'modprobe' is not available."
sudo mic create raw mer-rpi.ks -o . --pkgmgr=yum --arch=armv6l

Once the image has been produced write to your sdcard (you may need to use sudo below if groups are not properly set):

dd of=/dev/sdX if=mer-rpi-mmcblk0p.raw bs=4M

Place in RaspberryPi and boot.

Host SDK Development using SB2

Cross-compiling on the host SDK (as opposed to compiling natively on device) is possible by creating a target (an unpacked rootfs) and using sb2 to "emulate" the ARM device.

Step-by-step Setup

Step one is to create the target rootfs. This can be done with mic using the same kickstart file used to create the image:

sudo mic create fs mer-rpi.ks -o /path/to/target --arch=armv6l

This will create a /path/to/target/mer-rpi directory with a rootfs that contains all the default packages from that ks.

Step two is changing the permissions so we can write anywhere on the rootfs:

sudo chown -R $USER.mer mer-rpi

Step three is initializing the sb2 target (yes, a lot of options there):

cd mer-rpi
sb2-init -A armv6l -M armv6l -d -L --sysroot=/ -C --sysroot=/ -c /usr/bin/qemu-arm-dynamic -m sdk-build -n -N -t / mer-rpi /opt/cross/bin/armv6l-meego-linux-gnueabi-gcc

There will be errors from sb2-init (concerning ld and host-gcc), but it should be safe to ignore them.

Step four is to fix a quirk about /var/run in the target being a symlink, sb2 doesn't like this:

rm var/run
mkdir var/run

Step five is to rebuild and refresh the packaging system so we can install devel packages:

sb2 -m sdk-install -R rpm --rebuilddb
sb2 -t mer-rpi -m sdk-install -R zypper ref

Building RPi Examples

As an example of how to use sb2 to build, we shall build the RPi examples. (TBD: sane way to get them)

First off, we know beforehand that we will need the rpi graphics and freetype devel packages installed to compile the examples. Usually the exact dependencies are either in the README or INSTALL of the project or (sadly often) found out by building and failing. We also need make and gcc in the target to compile.

To install, we will use sb2 in sdk-install mode and also request to fake that we are root user (as we did in setup too). This will enable us to write to the rootfs, normally it is considered read-only, and trick the tools to think we have super powers:

sb2 -m sdk-install -R zypper install gcc make gfx-rpi-devel gfx-rpi-libEGL-devel gfx-rpi-libGLESv2-devel gfx-rpi-libOMXIL-devel freetype-devel 

NOTE: sometimes it's necessary to be on the top directory of the target to successfully run commands in the sdk-install mode. If a command fails mysteriously, try that first.

Next we create a symbolic link from /usr (where the libs should be) to mer-pi/opt/vc (where the libs are in RPi "official" images). This way we avoid changing the include paths in the project (which would be a valid fix as well):

ln -s /usr opt/vc

Then we simply go to the hello_pi directory and invoke the build script (which just goes through the example directories calling make in them) through sb2:

sb2 ./

If everything is set up right, you should in a moment have cross-compiled binaries to copy to your device.

NOTE: couple of examples (hello_audio & hello_video) need -lpthread to be added to their LDFLAGS to link succesfully, due to the ilclient helper lib requiring it.

The same principle works for most other projects as well, just install the dependencies and run the build commands through sb2.

(TBD: how to install non-packaged dependencies?)


For questions, suggestions and contributions you can ping the following persons in #mer @ Freenode

  • cristi
  • kulve
  • vgrade
  • zuh

For maintainers

Qt5 Platform Plugin

I've spent sometime this weekend setting up a package to hopefully build a Qt Platform Plugin which will mean we don't need to rebuild the whole of Qt5 with the RPi mkspec.

With lots of help from Stskeeps I've done the following :-

I linkpac'd qtbase to a new project at

and created a new spec file based on the qtwaylandplugin with the aim of just doing a qmake/make in the src/plugins/platforms directory utilising qeglfshooks_pi.cpp. Added the rpi-gfx package to provide EGL/GLES and bcm/vcos bits.

I used the package-config files from rpi-gfx package (thanks kulve) and added qeglfshooks_pi.cpp to the .pro file

Current status is looking good.

Image here

ctrl alt F2 login root/rootme

init 3 to stop uxlaunch trying to spawn X

in particle, minimer, qt-cinematic dirs

qmlscene -platform eglfsrpi *.qml

Catch me (vgrade) on #mer if you want to get involved.

qt5 qml-compositor and qtwayland-rpi


See packages at


Install eglfs-rpi plugin
[16:23] <@Stskeeps> vgrade:
[16:23] <@Stskeeps> add that repo
[16:23] <@Stskeeps> and install:
[16:24] <@Stskeeps> qt5-qtwayland-rpi , qt5-qtwayland-rpi-examples
[16:26] <@Stskeeps> and go for /usr/lib/qt5/examples/qtwayland/qml-compositor/
[16:26] <@Stskeeps> and ./qml-compositor -platform eglfsrpi &
[16:26] <@Stskeeps> do this over ssh, btw
[16:26] <@Stskeeps> and then try qmlscene -platform wayland

maze compositor

cd makecompositor
./mazecompositor -platform eglfsrpi

cd minimer
qmlscene -platform wayland main.qml

Wiki page TODO

  • Add: QtCreator Instructions

Updating packages


git clone
rm firmware/boot/kernel*
tar zcf firmware-boot-<git sha>.tgz firmware/boot


git clone
tar zcf firmware-opt-<git sha>.tgz firmware/hardfp/opt/vc/ firmware/opt/vc/


git clone git://
cd gst-omx
git checkout -b raspberry remotes/origin/raspberry
./ && make dist
mv gst-omx- gst-omx-raspberry-<git sha>.tar.gz

gst-plugins-bad-free, gst-plugins-base

  • Branched from Mer Core
  • gst-plugins-base upgraded to 0.10.36
  • Added --with-audioresample-format=float for ARMv6 in gst-plugins-base.spec



git clone
tar zcf tools-mkimage-<git sha>.tar.gz tools/mkimage
Personal tools