• Tutorial: stream GTK applications and use them in your browser (with GTK+ and Broadway)

    A few days ago I’ve (finally) received my first C.H.I.P.. This is the first 9 dollars microcomputer with a 1Gzh R8 ARM CPU, 512Mb of RAM, 4Gb of on-board space and it includes Wireless B/G/N and Bluetooth 4.0.

    All in all for that price, I have to admit that it’s a good, all purpose machine that you can easily use for your experiments and to learn new possibilities in computing.


    So the first thing I wanted to test is how this little machine would be able to stream GTK applications over the network using the Broadway back-end available in GTK+.

    After flashing Debian Jessie on it (that comes without and window manager), I had to compile GTK+ with the Broadway backend enabled (this is now standard in most i386 and amd64 distribution, but not in ARM ones), following the compiling instructions on the GTK+ page.

    So after logging into your C.H.I.P. you need to install the dependencies – some of them are already packaged in the right version, while you will have to compile others:

    sudo apt-get install pkg-config make autoconf2.13 libtool zlib1g-dev libffi-dev gettext libfam-dev libpackagekit-glib2-dev libgtk2.0-dev python2.7-dev gtk-doc-tools libglib2.0-dev gir1.2-glib-2.0 libtiff5-dev flex bison python-dev libcairo2-dev libepoxy-dev libatk-bridge2.0-dev vim libgirepository1.0-dev unzip

    then you will need to install GLIB:

    cd ~

    wget http://ftp.gnome.org/pub/gnome/sources/glib/2.46/glib-2.46.2.tar.xz

    tar xvfJ glib-2.46.2.tar.xz

    cd glib-2.46.2



    Now you need to find the path for giving the CFLAGS to make:

    pkg-config --cflags glib-2.0

    the path that will be shown will have to be used as the example below:

    make CFLAGS='-I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include'

    make install

    export LD_LIBRARY_PATH="/usr/local/lib/:/usr/local/lib/pkgconfig"

    Now it’s time to compile pango, gobject-introspection, gdk-pixbuf, atk and finally GTK+

    cd ~

    wget http://ftp.gnome.org/pub/gnome/sources/pango/1.38/pango-1.38.1.tar.xz

    tar xvfJ pango-1.38.1.tar.xz

    cd pango-1.38.1




    make install

    cd ~

    wget http://ftp.gnome.org/pub/gnome/sources/gobject-introspection/1.46/gobject-introspection-1.46.0.tar.xz

    tar xvfJ gobject-introspection-1.46.0.tar.xz

    cd gobject-introspection-1.46.0



    make install

    cd ~

    wget http://ftp.gnome.org/pub/gnome/sources/gdk-pixbuf/2.32/gdk-pixbuf-2.32.3.tar.xz

    tar xvfJ gdk-pixbuf-2.32.3.tar.xz

    cd gdk-pixbuf-2.32.3



    make install

    cd ~

    wget http://ftp.gnome.org/pub/gnome/sources/atk/2.18/atk-2.18.0.tar.xz

    tar xvfJ atk-2.18.0.tar.xz

    cd atk-2.18.0



    make install

    cd ~

    wget http://ftp.gnome.org/pub/gnome/sources/gtk+/3.18/gtk+-3.18.6.tar.xz

    tar xvfJ gtk+-3.18.6.tar.xz

    cd gtk+-3.18.6

    ./autogen.sh --enable-broadway-backend --enable-x11-backend

    ./configure --enable-broadway-backend --enable-x11-backend

    makeGEdit working in Chromium

    make install

    The time to test the result of our creature has come:

    first of all enable the broadwayd deamon server and choose the port and screen to use:

    broadwayd -p 8080 :2 &

    export GDK_BACKEND=broadway

    export BROADWAY_DISPLAY=:2

    Finally, install a GTK application like shotwell, gedit or galculator

    sudo apt-get install gedit galculator shotwell

    and launch one of them…


    From another machine, now you can fire your browser and point to the address http://ipofyourc.h.i.p:8080

    and use your application running remotely from your browser.


  • Ubuntu: unable to play DVD

    If your Ubuntu installation is not able to play DVDs, here you can see all the steps to enable this feature:

    from a command line, make sure you install the main libraries:

    sudo apt-get purge libdvdread4 libdvdcss2 libdvdnav4 ubuntu-restricted-extras
    sudo apt-get install libdvdnav4 libdvdread4 ubuntu-restricted-extras

    Finally, in order to be able to read crypted content (that is most of the DVD you would find in stores), you need to install the css libraries by running (still from the terminal):

    sudo /usr/share/doc/libdvdread4/install-css.sh

    And now… enjoy your DVDs!


  • Tutorial: boot Parallella from USB external hard drive (using standard SD image)

    I’ve been using my Parallella for a few months now and I’ve already burnt a couple of SD Cards…

    Therefore I thought that it would be better to load the OS from an USB attached Hard Disk, using the SD Card for the boot process only.

    Parallella Board

    In general Linux allows to easily change the root partition by passing the appropriate parameters to the Kernel (or through a bootloader). However in the standard image used by Parallella, a Device Tree is used. This means that you cannot pass directly the desired parameters to the Kernel, but you need modify the standard Device Tree. This is located in the Kernel package available at: http://www.parallella.org/create-sdcard/. See the point #2 (Parallella Linux Kernel – with ot without HDMI support, as you prefer) to download it.

    Once you have decompressed the content (as explained in the instructions), you will see that one of the files is called “devicetree.dtb”. The file is compiled so we’ll need to decompile it. On the Parallella, make a copy of the file in another folder and launch the command:

    dtc -I dtb -o dev.dts -O dts devicetree.dtb

    if the command cannot be found, just install it using:

    sudo apt-get install device-tree-compiler


    Now the file dev.dts is in text again and can be customized.

    Open the file with your favourite text editor and look for the line that begins with “bootargs”. In there you can specify any kernel boot options as described here.

    In our case, we want to boot from a USB attached drive. In order to do so, we need to use the instructions we saw before at Parallella site to copy the official image to an Hard Disk (CAUTION, YOU WILL DELETE YOUR HARD DISK CONTENT – YOU’VE BEEN WARNED!!!). It’s quite simple as you just need to adapt the command to create the partitions by using the appropriate /dev/sdxx device that is related to your external hard disk.


    Therefore the bootargs line will have to look like:

    bootargs = "rootwait root=/dev/sda2 rw rootfstype=ext4";


    Finally, re-compile the new Device Tree:

    dtc -I dts -O dtb -o devicetree.dtb dev.dts

    And now overwrite the old Device Tree with the new one. Happy OS loading from USB!