Monday, December 31, 2012

Getting started with SDL on BB10 and the Playbook

BlackBerry provides SDL for the available for BlackBerry 10 and the PlayBook, with a nice touch screen helper library to make it easier to create touch screen controls with minimal or even no modification to original apps.

The instructions on how to use SDL after building everything is quite lacking on the web site so, I'll document my findings here for anyone else that is interested and also as a reminder for myself.

Anyway, start with cloning TouchControlOverlay and SDL from the RIM github repo. I won't go into the details here. And remember to source the bbndk evironment first.

Ok, now you should have the sources. Start with building and installing  TouchControlOverlay

cd TouchControlOverlay
make
make install

Next, building SDL. I prefer to use an out-of-source build directory, makes it easier to build for both BB10 and PlayBook from the same source.

$ mkdir sdlbb10
$ cd sdlbb10
$ ../SDL/configure  --prefix=/home/milang/bbndk/target_10_0_9_1673/qnx6/armle-v7 \
--host=arm-unknown-nto-qnx8.0.0eabi \
--without-x --enable-pthreads \
--enable-audio --enable-video-playbook \
LDFLAGS="-lscreen -lasound -lpps -lm -lpng14 -lbps -lxml2 -lEGL -lGLESv2" \
CPPFLAGS="-D__PLAYBOOK__ -D__QNXNTO__"
$ make

Install SDL
$ make install

Ok, now SDL is installed nicely. Next edit the bbndk-env.sh script and add

PKG_CONFIG_PATH=${QNX_TARGET}/armle-v7/lib/pkgconfig
export PKG_CONFIG_PATH

in the end of the file. Re-source it or set the PKG_CONFIG_PATH manually. What this does is enable pkg-config enabled sources to find SDL (and other software that uses pkg-config to get options). For example the SDL libraries that we will add next, SDL_net and SDL_image. But that will come in another post.

Friday, December 07, 2012

A look inside the BDP-150 Frimware, netflix_qt you say?

In my previous post, I showed the basic contents of the Pioneer BDP-150 firmware image.

Looking at the binwalk output listing we can easily find the boot loader, Linux kernel and a squashfs image.

461744     0x70BB0    uImage header, header size: 64 bytes, header CRC: 0x775F4C1C, created: Wed Oct 24 10:43:23 2012, image size: 1573204 bytes, Data Address: 0xDA00000, Entry Point: 0xDA00000, data CRC: 0x782925E7, OS: Linux, CPU: ARM, image type: OS Kernel Image, compression type: none, image name: 
479272     0x75028    gzip compressed data, from Unix, last modified: Wed Oct 24 10:38:55 2012, max compression
2574912    0x274A40   Squashfs filesystem, little endian, version 3.1, size: 59779047 bytes, 471 inodes, blocksize: 131072 bytes, created: Wed Oct 24 10:51:11 2012

Extract the filesystem image with dd, like so:

$ dd if=BDP-150_V01.05.bin of=sqfs.img bs=2574912 skip=1
23+1 records in
23+1 records out
60048084 bytes (60 MB) copied, 1.03521 s, 58.0 MB/s

Now you have a Squashfs image. You can mount it or extract the contents using unsquashfs, like so:

$ unsquashfs sqfs.img 
Parallel unsquashfs: Using 4 processors
726 inodes (1492 blocks) to write

[===================================================================================================================================================================================/] 1492/1492 100%
created 330 files
created 63 directories
created 78 symlinks
created 0 devices
created 0 fifos

Now you have the firmware extracted and you can start looking around. There are some interesting looking bits in there. For example the UI is built on DirectFB and there is a Netflix binary (/usr/local/bin/netflix_qt/netflix ) linked against Qt. Pretty silly of Netflix not to support desktop linux users...

Who knows, with some luck this might run on some other ARM based thingy ? Oh, right.. that is the next thing I'll try :)

Wednesday, December 05, 2012

Pioneer BDP-150 Blu-ray player, Linux Inside

I finally gave in and got myself a Blu-ray player. After much googling and comparing I decided on a Pioneer BDP-150 Player. Luckily I was tired and didn't go to the store directly and so got it even cheaper as they had it on sale, 99€ only.

One of the biggest plus in my book was that the device ARMv6 (mediatek) based, running Linux  2.6.27 kernel with a DirectFB and Qt. Firmware to play with here and available sources here.

binwalk:ing the firmware data file gives:

DECIMAL    HEX        DESCRIPTION
-------------------------------------------------------------------------------------------------------
67512      0x107B8    Mediatek bootloader
67897      0x10939    LZMA compressed data, properties: 0x80, dictionary size: 1073741824 bytes, uncompressed size: 196608 bytes
114580     0x1BF94    Mediatek bootloader
300220     0x494BC    JFFS2 filesystem data little endian, JFFS node length: 8195
417804     0x6600C    LZMA compressed data, properties: 0x90, dictionary size: 738197504 bytes, uncompressed size: 754973620 bytes
430796     0x692CC    JFFS2 filesystem (old) data little endian, JFFS node length: 344
441485     0x6BC8D    LZMA compressed data, properties: 0x5D, dictionary size: 1036255232 bytes, uncompressed size: 327678 bytes
447129     0x6D299    LZMA compressed data, properties: 0x02, dictionary size: 8388608 bytes, uncompressed size: 1073741824 bytes
447153     0x6D2B1    LZMA compressed data, properties: 0x02, dictionary size: 8388608 bytes, uncompressed size: 1073741824 bytes
447177     0x6D2C9    LZMA compressed data, properties: 0x02, dictionary size: 8388608 bytes, uncompressed size: 1073741824 bytes
450404     0x6DF64    LZMA compressed data, properties: 0x80, dictionary size: 1660944384 bytes, uncompressed size: 521134 bytes
461744     0x70BB0    uImage header, header size: 64 bytes, header CRC: 0x775F4C1C, created: Wed Oct 24 10:43:23 2012, image size: 1573204 bytes, Data Address: 0xDA00000, Entry Point: 0xDA00000, data CRC: 0x782925E7, OS: Linux, CPU: ARM, image type: OS Kernel Image, compression type: none, image name: 
479272     0x75028    gzip compressed data, from Unix, last modified: Wed Oct 24 10:38:55 2012, max compression
2574912    0x274A40   Squashfs filesystem, little endian, version 3.1, size: 59779047 bytes, 471 inodes, blocksize: 131072 bytes, created: Wed Oct 24 10:51:11 2012
33020448   0x1F7DA20  JFFS2 filesystem data big endian, JFFS node length: 503796
35336806   0x21B3266  PNG image, 91 x 88, 8-bit/color RGBA, non-interlaced
35439823   0x21CC4CF  PNG image, 97 x 88, 8-bit/color RGBA, non-interlaced
35516856   0x21DF1B8  PNG image, 168 x 161, 8-bit/color RGBA, non-interlaced
52281361   0x31DC011  gzip compressed data, has CRC, was "\031\202\273\253M\021\334\335\276\207\340\356\1771\014@\356\376\013{\023r\367}t\027\271;\005k\026\271\273\027R\034r\367\351\011\202\273\237`\211\221\273\267`\035#w7B\227\220\273\327\025\027\334}\003", last modified: Thu Sep  6 02:46:23 2029
62487104   0x3B97A40  PNG image, 1920 x 1080, 8-bit/color RGB, non-interlaced