Coding Chase - Projects

My 3D Hub

Thank You For Donating:

Ikeeki (linux-sunxi@irc.freenode.net)
Computer Troubleshooters Brasil

Thursday 27 March 2014

Qt5 + GStreamer + Cubieboard [X11/FB]

New Development Sets available at the cubieforums repositories: (see June 2014 announcements)

- Cubieboard A20 only
- Qt 5.2.1 with GStreamer integration
- qt-declarative-camera example was cross-compiled and worked successfully, is present in both FB/X11 images for in the Cubieboard A20 sections

- I tested it with two usb webcam models:

Colour output: Logitech C160 Webcam

Black and White output: Hercules HD Twist Webcam


Only tested the Hercules Webcam on GStreamer and didn't fiddle much with it, will check it out with the declarative-camera example and see how that goes.

Tuesday 25 March 2014

Qt5 on Embedded - USB Webcams

Well, so by now Qt5 graphics on Cubieboard devices are pretty much stable and displaying solid performance - so what now?

Last year I did some research on Qt5, GStreamer and Raspberry Pi. Back then, I was using a Raspberry Pi, an old USB Webcam, an IR Sensor and a bright white LED.

Some coding magic with QZXing and a short while later I had a nifty QRCode Decoding app, running on Raspberry Pi:

- the sensor would be triggered by placing a card against an acrylic plate
- the app would use the webcam to snap a picture
- the app would analyse the picture with QZXing and decode any existing QRCode within
- the decoded string would be passed on from the C++ layer worker thread, to the main event loop and the QML layer - to update a Text element.
- as an added bonus, I included the snapped picture on QML and I also added a LED later on to act as flash to ensure proper lighting when the picture was snapped.

I recently uploaded the code to my bitbucket account, back then I had to modify QXZing to work with Qt 5 since it was 4.7.

While this proof of concept worked, Qt was relying on an external command - streamer - using QProcess - and I always thought of going back and integrating the webcam in Qt, the proper way. Also, the Pi's CPU was getting some load with the whole thing.

Fast forward it to today and with cubieboard's performance, and even a conventional dual core SoC has the potential to improve the experience.

I've managed to produce new development environments for Cubieboard A20 (sd card images and cross-compiled qmake for the dev host) where Qt5, by the means of QtMultimedia, has GStreamer integration, these are being uploaded to the cubieforums hosting solution

While GStreamer on Cubie isn't (yet) hardware accelerated, for this specific case, it works - my old USB webcam works fine either on Framebuffer or X11, and since it supports MJPEG, I get 30 FPS @640x480 with medium/low CPU stress.

Hopefully I'll be able to update the QRDecoder example to include proper USB Webcam handling, rather than rely on streamer.

Later on I'll also try to integrate an NFC shield I never got to use - let's see how that one goes...!

Monday 17 March 2014

Cubieforums Support

The folks at cubieforums.com were outstanding and I'm currently uploading the pre-made images there as well - more updates on this to be made on the community thread!

Check out the link > http://dl.cubieforums.com/ikeeki/IMAGES/ww/cubieboard/


  • the linaro gcc archive can be found at official website
  • the qt 5.2.1 sources archive can be found at the official website

These backups include the sd card images, the related dev host qmake files and the mkspecs/patches.

Box.com Bandwidth Cap

My Box.com monthly limit has been reached - so as an alternative, I've created slimmed down archives on my secondary box.com account:

https://app.box.com/qt5-cubieboard

If you're using a cubieboard 2 or a cubietruck, then by downloading the official cubian image for your device and copying over the binaries from the slimmed archives, you should be able to have the Qt5 Cinematic Experience running at full speed, as well as set things up for developing your own Qt5 apps.

READMEs are included and you can read more about it on the community thread:

Cubietruck Qt 5.2.1 [X11]

And X11 is working too - still using Cubian as described in the previous post. Trying to figure out a lighter way to distribute the work, without depleting box.com resources.

Saturday 15 March 2014

Cubietruck Qt 5.2.1 [Framebuffer]

Currently uploading Cubian images to the box.com images account. I went with Cubian this time because my cubietruck didn't seem to work properly with ssvb's branch, even with usual patches for 2GB RAM, reduced memory clock, etc etc etc...

Cubietruck has the same SoC as Cubieboard 2, so as far as Qt5 cross-compilation is concerned, it is the same. The challenge this time, for me, was the added features on Cubietruck, such as built-in wifi and bluetooth.

Cubian git sources, currently at 3.4.79, only consider mali r3p0 - so I had to do some kernel merging to include the r3p2-01rel2 version in there.

But it worked, so in the end I got mali, ethernet, wifi and bluetooth going!

I had been able to cross-compile Qt5 for Cubietruck a while back, so that wasn't new - but back then I really didn't care much for the remaining hardware, which I ended up looking at this time around.

X11 version still to come, but for now, some rest is in order...!

Friday 14 March 2014

Cubieboard Qt5 Files

The Box.com account got a lot of traffic added lately and the monthly cap was hit in no time. The sd card images are quite big and since most people (hopefully) will rather have the specific mkspecs and patches files, and do the work themselves, I've set up a second account with these essential files for building.

That way, those who wish to build stuff themselves will still have access to the necessary files, without having to wait for traffic cap resets.

Images URL: https://app.box.com/qt5-cubieboard-images

Mkspecs + patches URL: https://app.box.com/qt5-cubieboard

Saturday 8 March 2014

Cubieboard (A20) - X11 Q 5.2.1

New image set currently being uploaded to Box.com:

- The README file contains all the relevant information
- I had to make some adjustments to the linux-cubieboard2-g++ mkpecs files
- The cross-compilation ./configure line for this one is:

./configure -opengl es2 \
-device linux-cubieboard2-g++ \
-device-option CROSS_COMPILE=/opt/qt5.cubieboard2.workbench/gcc-linaro-arm-linux-gnueabihf-4.8-2013.09_linux/bin/arm-linux-gnueabihf- \
-sysroot /opt/qt5.cubieboard2.workbench/cubie-rootfs \
-opensource \
-confirm-license \
-optimized-qmake \
-release \
-make libs \
-prefix /usr/local/qt5cb2x11 \
-no-pch \
-nomake examples \
-nomake tests \
-no-eglfs \
-no-linuxfb \
-qt-xcb \
-v



So Cubieboard 2 seems all set, both framebuffer and X11 cross-compiled environments!

Friday 7 March 2014

Cubieboard CPR

Taking a break from Qt5 on Cubieboard A20, I decided to recover an older A10 cubieboard I had around.

This A10 was one of the first units to come out, has gone to war and back and the HDMI port is broken. At a given time I used a breadboard for cubie A10 with VGA support but couldn't seem to find it anywhere, so I had to go in blind.

I decided to make this unit into a house server unit, it works perfectly connected to the USB port on one of the TP-Link routers and I thought about using it for controlling other network elements around here as well as run some scripts and such.

With the HDMI gone, I decided to make use of the NAND and save myself and SD Card, so I went ahead and started going at it with available NAND images.

My first attempt lead me to Cubian, the official distro - and everything was working fine until I noticed I might have to change some stuff in the kernel.

I decided to get back to the typical linaro rootfs + sunxi kernel approach and get the latest, so this sunxi wiki page had what I needed.

Generating a LiveSuit image was half the work,I used the latest linaro ubuntu saucy server rootfs with sunxi-bsp and in no time, I had the img file needed to flash the NAND.

Flashing the NAND wasn't without incidents though, as my Linux Mint host wouldn't install the awusb driver needed for the PC to detect cubie on OTG USB connect.

The LiveSuit zip file included a Chinese README pdf which didn't help much, as my Chinese isn't that great, but in the end I managed to build, install and load the driver, and flash cubie.

Once flashed, another hurdle: no out-of-the-box SSH access, and no HDMI either. SD Card time with Cubian, chroot into the NAND system and ssh installation - success.

And when all seemed OK, I noticed the available space on the running NAND system was really low - the whole system was running off of the NAND on a 600MB partition.

Resizing/reorganizing the NAND was in order but that did prove difficult, so as a mental note, below are the commands I used, after the system was already installed, to merge partitions and resize things, using Cubian from microSD.

root@Cubian:~# nand-part -f a10 /dev/nand 2048 "bootloader 131072" "env 4096" "rootfs 7841792"
root@Cubian:~# fsck -f /dev/nandc
root@Cubian:~# resize2fs /dev/nandc


Explanation on all of this is available at this blog post although in my case, somehow it didn't go so smoothly, hence the notes above...

In any case, at present the NAND only has two partitions - boot with about 64MB in size and root with the remaining, for a total of 4GB!

Wednesday 5 March 2014

Cubieboard (A20) - FB Qt 5.2.1

Quick Update:

All files have been uploaded and checked for integrity.

https://app.box.com/qt5-cubieboard-images

Qt 5.2.1 on sunxi mali libraries r3p2-01rel1 (framebuffer) files are being uploaded to my Box.com account, there's a readme included to help set everything up.

It is possible that after a while of running the Cinematic Experience, the screen blanks out. Using a usb keyboard and pressing Space will recover it, but since that's not much of a solution, try the following:

- log in on cubie and as root, mount the boot partition
- create a uEnv.txt file and include the following line, only:

extraargs=console=tty0 consoleblank=0

- save the file and reboot. It should be enough to stop the screen from blanking.

Unfortunately this file didn't get included in the image, so for long term app execution, it might come in handy!

Follow up discussion in the community forum thread

Cubieboard Qt5 Resource Files

Ok, so with the help of the Cubieboard community, I've managed to my initial goal of having Qt5 running on Cubieboard (A10/A20) and Cubietruck.

The detailed guide on how to achieve this was posted before, there's the official community thread, so the next step is: generating environments so that everyone can test and code Qt5 apps and mainly, have some fun with it!

On this Box.com url you will (hopefully) find updated image sets which will include all the necessary pre-compiled files for you to start coding with Qt5 and running your apps on your Cubieboard, using the sunxi Mali libraries:

https://app.box.com/qt5-cubieboard-images

There's a README which hopefully will help you set everything up nicely, and right now I only have an older Qt 5.1.1 image set uploaded, but hopefully soon I'll be able to produce more image sets, so stay tuned!