Thread Tools
Posts: 174 | Thanked: 181 times | Joined on Jun 2011 @ Italy
Originally Posted by jaromrax View Post
Very nice, we are waiting for details...
Me too, I hope that It will work also for my PCTV 70e

The Following User Says Thank You to blackjack4it For This Useful Post:
Posts: 468 | Thanked: 610 times | Joined on Jun 2006
First of all a BIG disclaimer!!!!
These instructions flash the N900 with your own compiled kernel! This can brick your N900 if done incorrectly, requiring a reflash in the worst-case scenario!
This sounds really scary, but in reality, if anything goes wrong and the N900 appears bricked, you can almost always just flash the original Nokia kernel (KERNEL ONLY!) and get the N900 working again without any data-loss (but you may need to reinstall kernel-power etc.)

DVB-T modules for Kernel Power v48
I compiled my own kernel-power v48 image and modules in scratchbox and added the v4l dvb modules for DiBcom DiB0700 USB DVB devices (pctv nanoStick uses that chip ) from a more recent version of v4l.

Most instructions are based on this post about compiling kernel-power from source by NiQ, but I updated them for the v48 version from pali.

first I created a fresh target in scratchbox for kernel compilation called "kp48":
scratchbox sb-conf setup "kp48" -c cs2007q3-glibc2.5-arm7 -d qemu:perl:svn:apt-https -t /scratchbox/devkits/qemu/bin/qemu-arm-sb

scratchbox sb-conf select "kp48"

scratchbox sb-conf rs "kp48" /home/$USER/maemo-sdk-rootstrap_5.0_20.2010.36-2_armel.tgz 

scratchbox sb-conf in "kp48" -edFL
then I updated the target and downloaded and unpacked the source package from extras-devel:
DEBLINE="deb fremantle free non-free"

echo $DEBLINE | tee -a "/scratchbox/users/$USER/targets/kp48/etc/apt/sources.list"

DEBLINE="deb-src fremantle free"

echo $DEBLINE | tee -a "/scratchbox/users/$USER/targets/kp48/etc/apt/sources.list"

scratchbox fakeroot apt-get -o APT::Architecture=armel update

scratchbox fakeroot apt-get -o APT::Architecture=armel upgrade -y --force-yes

scratchbox fakeroot apt-get -o APT::Architecture=armel -f install -y --force-yes

scratchbox fakeroot apt-get -o APT::Architecture=armel install ncurses-dev -y --force-yes

scratchbox fakeroot apt-get -o APT::Architecture=armel install kernel-power-source -y --force-yes

scratchbox mkdir "/scratchbox/users/$USER/home/$USER/kp48"

scratchbox bzip2 -d < "/scratchbox/users/$USER/targets/kp48/usr/src/kernel-power-source-" | tar -x -C "/scratchbox/users/$USER/home/$USER/kp48/"
Later on we will run "menuconfig" to select the correct modules. This ncurses menu only works in scratchbox after a small change:


lineOld="for ext in so a dylib ; do"

lineNew="echo -lncurses; exit ; for ext in so a dylib ; do"

sed -i "s/$lineOld/$lineNew/g" "$fileName"
Now compile the normal kernel image and modules for power kernel v48. I use "-j 3" to speed up compilation, by using 3 threads in parallel. But if you have an even faster CPU you can use a higher value ( Intel Core i7 with 4 cores for example, you could use "-j 8")

scratchbox -d /home/$USER/kp48/kernel-power/ make EXTRAVERSION=.10-power48 rx51_defconfig

scratchbox -d /home/$USER/kp48/kernel-power/ make -j 3 EXTRAVERSION=.10-power48 bzImage

scratchbox -d /home/$USER/kp48/kernel-power/ make -j 3 EXTRAVERSION=.10-power48 modules
Normally you could now run menuconfig, select the modules for the dvb adapter and compile the modules again. Sadly the modules produced in this way for the DiBcom 0700 devices do NOT work. The N900 will reset when you attempt to watch a video stream. I don't know why (it is a behavior that also happens when using some other DVB devices, even when I use the updated v4l drivers)

Next step is to copy the zImage and modules to a safe place and strip the debug information:
scratchbox -d /home/$USER/kp48/kernel-power/ cp arch/arm/boot/zImage ../zImage

scratchbox -d /home/$USER/kp48/kernel-power/ mkdir ../modules

cd /scratchbox/users/$USER/home/$USER/kp48/kernel-power/

find . -name "*.ko" -exec cp '{}' ../modules/ \;

cd -

cd /scratchbox/users/$USER/home/$USER/kp48/modules

for f in * 


scratchbox strip --strip-debug /home/$USER/kp48/modules/$f


cd -
All this is just a slightly updated version of the "compile kernel power from source" post from NiQ
Now it is time to download updated v4l drivers.
You need mercurial to download the sources.

cd /scratchbox/users/$USER/home/$USER/kp48/

hg clone

cd -
By default these updated v4l drivers will NOT work on a 2.6.28 kernel! You need to change 1 line of code as is explained here :


lineOld="p = kmalloc_track_caller(len, GFP_KERNEL);"

lineNew="p = kmalloc(len, GFP_KERNEL);"

sed -i "s/$lineOld/$lineNew/g" "$fileName"
Next is linking them to our compiled kernel power and running menuconfig.

scratchbox -d "kp48/v4l-dvb" make release DIR="/home/$USER/kp48/kernel-power/" kernel-links

scratchbox -d "kp48/v4l-dvb" make menuconfig
For the PCTV nanoStick modules select ONLY the following items and deselect the rest.
<M> Multimedia support
<M> DVB for Linux[*] Load and attach frontend and tuner driver modules as needed
(8) maximum number of DVB/ATSC adapters
[*] Dynamic DVB minor allocation
[*] DVB/ATSC adapters --->
<M> Support for various USB DVB devices
<M> DiBcom DiB0700 USB DVB devices (see help for supported devices)
If you have a different USB DVB adapter you can try other modules (but they may not work, I haven't tested other ones yet).
If you do NOT deselect stuff like v4l and other items the camera on you N900 may not function anymore. That is why I recommend to only select modules for the DVB device from this updatedv4l source.

Next step is to compile the updated v4l modules and strip the debug code:

scratchbox -d "kp48/v4l-dvb" make -j 3

mkdir "/scratchbox/users/$USER/home/$USER/kp48/modulesV4l"

cd "/scratchbox/users/$USER/home/$USER/kp48/v4l-dvb"

find . -name "*.ko" -exec cp '{}' ../modulesV4l/ \;

cd -

cd "/scratchbox/users/$USER/home/$USER/kp48/modulesV4l"

for f in * 


scratchbox strip --strip-debug "/home/$USER/kp48/modulesV4l/$f"


cd -
You now have two folders in your "sbhome/kp48" directory named "modules" and "modulesV4l" and a zImage. Copy these two folders to the N900 and ON THE N900 run the following commands to copy the modules to the correct location and set all the properties in the correct way:

mkdir /lib/modules/
cp modules/* /lib/modules/
cp modulesV4l/* /lib/modules/
chown -R root:root /lib/modules/
chmod 644 /lib/modules/*
rm /lib/modules/current
ln -s /lib/modules/ /lib/modules/current
Turn off the N900 and flash the kernel image to the N900:
sudo flasher-3.5 -f -k zImage -R
You now have a kernel-power v48 installed with DVB modules.
The next step is to setup the N900 to actually do something with the DVB device

In the example in my youtube videoI used H-E-N to set the n900 in USB host mode and mplayer to start the DVB device to watch Dutch freeview channels.

I also managed to compile tvheadend for the N900, and am hopeful that that will enable me to view all Digitenne channels on the N900 (even the ones using Conex encryption by using a remote key server using OSCam).
FYI: TVheadend does NOT compile using the default toolchain for Maemo 5 on scratchbox because the gcc compiler is too old, but does compile if you use the newer toolchain intended for Harmattan, and available through the scratchbox repository if you install scratchbox in Ubuntu 11.04 or LinuxMint 11.

But all those other things are for a future post

The Following 14 Users Say Thank You to Bernard For This Useful Post:
Posts: 7 | Thanked: 0 times | Joined on Feb 2012 @ Iran
its very good .
tnx bernard.

Last edited by noorallah; 2012-05-01 at 10:16.
Posts: 438 | Thanked: 190 times | Joined on Oct 2009 @ spain-aragon-zaragoza
Very thanks bernard for it.

Thread Tools

Forum Jump

All times are GMT. The time now is 20:07.