Coding Chase - Projects

My 3D Hub

Thank You For Donating:

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

Wednesday, 3 September 2014

Cubieboard: GStreamer 0.10 + libvdpau-sunxi

It's been a while since I've posted in the blog, but while I'm still to release any new versions of Qt5Box, there's still some exploring to be done with hardware accelerated video on Cubieboard.

Using X11 and libvdpau-sunxi, it's possible to have hardware accelerated video on Cubieboard, and confirm it with mplayer - just check the sunxi wiki steps for that.

But what about GStreamer? Read on...

Step 1: libvdpau-sunxi and mplayer

- based on Cubian images for Cubieboard
- add sunxi_cedar_mod to /etc/modules

sudo apt-get install libvdpau-dev vdpauinfo libvdpau-sunxi

http://linux-sunxi.org/Cedrus

- set permissions in udev rules
- reserve memory for the VPU
- add VDPAU_DRIVER=sunxi to /etc/environment

sudo apt-get install mplayer2

wget sintel mp4 trailers

DISPLAY=:0 mplayer -ao alsa:device=hw=1.0 -vo vdpau -vc ffmpeg12vdpau,ffh264vdpau, sintel_trailer-480p.mp4


(at this point, 480p, 720p, 1080p should work properly with mplayer)

Step 2: libvdpau-sunxi and GStreamer


sudo apt-get install libasound2-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libgstreamer-plugins-bad0.10* gstreamer0.10-plugins-ugly gstreamer0.10-alsa gstreamer0.10-plugins-good gstreamer0.10-tools gtk-doc-tools

DISPLAY=:0 gst-launch-0.10 playbin2 uri=file:///home/cubie/sintel_trailer-480p.mp4 video-sink="autovideosink" audio-sink="faad ! audioconvert ! alsasink device=hw:1,0"

(no vdpau yet - video is distorted, audio is working over HDMI)

sudo apt-get autoremove
sudo apt-get install faad libfaad-dev libfaad2
sudo apt-get clean

wget http://gstreamer.freedesktop.org/src/gst-plugins-bad/gst-plugins-bad-0.10.23.tar.xz

./autogen.sh && make -j 3 && sudo make install

sudo ln -s /usr/local/lib/gstreamer-0.10/libgstvdpau.so /usr/lib/arm-linux-gnueabihf/gstreamer-0.10/
sudo ln -s /usr/local/lib/libgstvdp-0.10.so.23 /usr/lib/libgstvdp-0.10.so.23
sudo ln -s /usr/local/lib/libgstvdp-0.10.so.23.0.0 /usr/lib/libgstvdp-0.10.so.23.0.0

rm -rf ~/.gstreamer-0.10/ && gst-inspect-0.10 | grep vdpau

vdpau:  vdpausink: VDPAU Sink
vdpau:  vdpauvideopostprocess: VdpauVideoPostProcess
vdpau:  vdpaumpeg4dec: VDPAU Mpeg4 Decoder
vdpau:  vdpauh264dec: VDPAU H264 Decoder
vdpau:  vdpaumpegdec: VDPAU Mpeg Decoder

DISPLAY=:0 gst-launch-0.10 playbin2 uri=file:///home/cubie/sintel_trailer-480p.mp4 video-sink="vdpauh264dec ! vdpauvideopostprocess ! vdpausink" audio-sink="faad ! audioconvert ! alsasink device=hw:1,0"

Failed to open VDPAU backend libvdpau_sunxi.so: cannot open shared object file: No such file or directory

sudo ln -s /usr/lib/arm-linux-gnueabihf/vdpau/libvdpau_sunxi.so.1 /usr/lib/libvdpau_sunxi.so

Failed to open VDPAU backend /usr/lib/libvdpau_sunxi.so: undefined symbol: XTranslateCoordinates

(the mplayer line works OK with vdpau video support and alsa audio through HDMI)

sudo apt-get purge libvdpau-sunxi

(leave libvdpau-dev installed)

git clone https://github.com/linux-sunxi/libvdpau-sunxi.git

cd libvdpau-sunxi
make
sudo make install

(mplayer and GStreamer working now)

reboot

- mplayer cmdline working
- gstreamer cmdline working

Wednesday, 30 July 2014

Qt5Box v0.3 in the works

Having Qt5 marry GStreamer along with GStreamer acceleration for embedded is still to be, although from previous posts, both platforms are working decently enough on Cubieboard.

That said, Qt5Box v0.2 is all about Qt5 alone - no QtMultimedia, QtWebkit - and in even though QtMultimedia currently doesn't seem to support video acceleration (and with QML as well), it still manages to get something done if the video is SD.

Maybe there are some applications at present, concerning SD Webcams or SD video playback - that would be accessible.

So Qt5Box v0.3 will at least have (hopefully) GStreamer integration which is pretty straight-forward, and as for Webkit, still considering if that's an advantage as well!

Wednesday, 16 July 2014

Qt5Box v0.2 - Cubieboard A10 Fixes

Ok, so my cubieboard A10 model is severely crippled when it comes to video output, but I went ahead and tried to build Cubie A10 targets in Qt5Box.

Recently though, a member of the community reached out and decided to donate his cubieboard A10 to the project - and a big, big thank you goes out to him for his gesture.

Isaac Chavarria, a.k.a. ikeeki has been doing some outstanding work in the Cubieboard community and you're welcome to follow up on his work with Cubiuntu.

That said, I went on to test Qt5Box with Cubieboard A10. If you own one of these and wish to take Qt5Box v0.2 for a spin, then take these notes with you:

cb1-rootfs a.k.a. Cubieboard A10 Framebuffer:

- /opt needed write permissions for app deployment


after booting your cubieboard from the supplied SD Card image, change permissions to /opt like so:

# chmod -R a+rwx /opt/

that way, Qt Creator will be able to deploy the app files to your cubieboard.



cb1-rootfs-x11 a.k.a. Cubieboard A10 X11:

- /opt needed write permissions for app deployment (same as above)


- updated /etc/slim.conf with the correct user for auto-login
(having the wrong user set up would prevent slim from starting up properly and as a result of that, no Desktop)


Edit /etc/slim.conf and update the following line:

default_user        cubie

... and this is it for Cubieboard A10.


Of course, these fixes should be included in the next version of Qt5Box, once it's out!

Thursday, 19 June 2014

Qt5Box v0.2 is out!

Just finished uploading Qt5Box v0.2 to my Box.com account.

- This new version includes support for all the Cubieboard devices - A10, A20, Cubietruck
- Changed the default Ubuntu environment to gnome-classic without effects, in order to save on resources and usability
- Qt Creator is already included and pre-configured as usual, Qt 5.3.0 is already pre-compiled as well

For access to the files, you can either PM me in the Cubieforums or through here and supply a valid email address, to be granted access on the Box.com account.

The Virtualbox OVA file is about 16GB in size and once imported to Virtualbox, the VM will eat away at least 100GB of HDD.

More details in the README.1st doc, as usual.

Thursday, 5 June 2014

Cubieboard - Qt 5.3.0 [X11]

After building Qt 5.3.0 for Cubieboard A20 on Framebuffer, I went ahead with another build for X11. I wasn't expecting much hassle, but in the end, some "dirty hacks" were required to be able to cross-compile it, using the same steps and configure lines as with Qt 5.2.1.

As far as I could tell and also from what I gathered on IRC, the wows I got aren't so much Qt's responsability, but rather the Mali library headers for EGL, GLES, etc that may need updating.

In any case, getting past those hurdles and getting QtCinematicExperience to work required these modifications:

qtbase/src/gui/kernel/qplatformcursor.h

#include <QtGui/QCursor>

#   ifdef CursorShape
#       define X_CursorShape CursorShape
#       undef CursorShape
#   endif

QT_BEGIN_NAMESPACE


qtbase/src/platformsupport/eglconvenience/qeglplatformcursor.cpp


#include "qeglplatformintegration_p.h"

#   ifdef CursorShape
#       define X_CursorShape CursorShape
#       undef CursorShape
#   endif

QT_BEGIN_NAMESPACE


qtbase/src/platformsupport/eglconvenience/qeglplatformcontext.cpp

#include <QtCore/qtextstream.h>
#include "qeglplatformcontext_p.h"

Thursday, 29 May 2014

Cubieboard, Qt 5 on Framebuffer and VSync

My personal goals with Qt 5 and Cubieboard have always been to try to get the most bang for my buck.

On cubieboard A20/cubietruck, using r3p2-01rel02 Mali libraries and some tweaking in the fex script it's actually possible to make use of all the power in the GPU and see the FPS go up.

On framebuffer though, going on 80+ FPS and above, it becomes noticeable that some animations display a sort of tearing effect: the vertical refresh rate of the screens is unable to keep up with the actual frame rate and the end result isn't that clean.

Following up on that same issue,which was posted on the cubieforums thread a while back, I managed to find the time to test one solution that popped up - a disabled function inside the framebuffer files in the sunxi kernel.

Enabling the function and re-compiling the kernel did the trick and I think it actually solved the issue.

While waiting to hear back from the user who reported the issue, I posted a couple of videos on youtube hoping to be able to demonstrate the issue (the sun orb going around), and the apparent solution: