The State Of DVB-S On Linux

I just wasted a few hours experimenting with DVB applications for Linux as I thought I’d like an alternative to Kaffeine that I currently use.

Guess what? None of them worked despite tuning fine using w_scan, scan or their internal scanners.

Totem and gnome-dvb-control use gnome-dvb-daemon as their backend which just coredumps almost instantly, the frontends just spawn a load of python errors whenever you click something.

The CLI favourite “vdr” just kind of sits there doing nothing instead of displaying a menu.

xawtv is just a joke these days, tvtime is not much better.

Everything seems to be focused on DVB-T (Freeview) rather than DVB-S2 (Freesat/Sky).

So I’m sticking with Kaffeine to drive my WinTV Nova-HD-S2. It works well but I’d like a console interface and a better EPG.

Backup Night

I spent most of last night (bit sad innit?!) backing up my computers – well it started off as I thought I should clone my Mac Mini (in case I decide to buy OSX Lion) which I’ve never done before.

Booted Ubuntu 11.04 from a LiveCD, and dd’ed an 80Gb disk image to the 1Tb NTFS drive over USB. Ubuntu 11.04/Unity is a bit better than Fedora 15/Gnome Shell.

Click for fullsize

Click for fullsize

Did the same with the laptop, 160Gb image that time, but its XP+Fedora, did the 80Gb desktop the other day and the other 64Gb desktop a while back. I’ve got to clone my HTPC too, that’s running Win7+Fedora, think that’s 250Gb.

Then I backed up the images to my fileserver. I decided that over 300Gb of disk images (so far – all the PC’s would come to about 900Gb) was a bit much to keep on my desktop machine or eSATA backup drive, so I’ve just got images on the USB drive and the fileserver, I can’t see both failing. I’ve got a spare 1Tb drive lying around which I might get one of those weird docks for and free up a few hundred gigs on the fileserver!

Thinking about it, I should clone the fileserver’s boot drive too, although that would be a 250Gb image – I could just backup used blocks with Clonezilla or Acronis but I don’t trust either anymore. Maybe I’ll treat the fileserver to a little 64Gb SSD or something, its running Ubuntu 9.10 so could probably do with an upgrade when 11.10 gets released in October.

Halfway through all of this we had a power surge which rebooted my computers, so had to re-rsync the data drives on two of them and the eSATA drive, and check the image on the USB had copied properly to the fileserver (md5sum runs slow over USB2!) left that going this morning, its done now.

Building An Android Kernel

As I’ve been compiling Cyanogenmod for the ZTE Blade, I thought I’d have a look at compiling the kernel instead of applying binary patches. I found this tutorial which kind of helped, here’s my simplified summary:

1. Pull kernel source from Github (currently weighs in at 1.7Gb):

git clone git://github.com/TomGiordano/kernel_zte_blade.git

2. Get the .config file – most tutorials say to get this from your phone which is running the kernel that you want to compile, but actually its already stored in git:

cp ~/kernel_zte_blade/arch/arm/configs/cyanogen_blade_defconfig ~/kernel_zte_blade/.config

3. Build the kernel:

make ARCH=arm CROSS_COMPILE=~/cyanogenmod/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi-

4. Build CM7 as usual, and to make things easier we’re going to copy a few files all into the same directory, including the split_bootimg.pl we downloaded:

mkdir ~/custom_kernel
cd ~/custom_kernel/
 
cp ~/split_bootimg.pl .
cp ~/kernel_zte_blade/arch/arm/boot/zImage .
cp ~/cyanogenmod/out/host/linux-x86/bin/mkbootimg .
cp ~/cyanogenmod/out/target/product/blade/update-cm-7.1.0-RC1-Blade-KANG-signed.zip .
cp ~/cyanogenmod/out/host/linux-x86/framework/signapk.jar .
cp ~/cyanogenmod/build/target/product/security/testkey.* .
 
unzip update-cm-7.1.0-RC1-Blade-KANG-signed.zip

6. Unzipping the KANG has given us the META-INF and system directories and boot.img file, which we must now unpack:

./split_bootimg.pl boot.img

6a. Optionally copy across the .ko files mentioned in modules.order to system/lib/modules/2.6.32.9-perf/ the highlighted ones are probably not neccessary:

grep -v test modules.order | sed 's|^kernel/||g'
 
arch/arm/mach-msm/reset_modem.ko
crypto/ansi_cprng.ko
drivers/scsi/scsi_wait_scan.ko
drivers/net/wireless/libra/librasdioif.kodrivers/input/evbug.koarch/arm/oprofile/oprofile.ko

7. Recreate the boot.img with the new kernel:

./mkbootimg --cmdline 'androidboot.hardware=blade console=ttyMSM2,115200 g_android.product_id=0x1354 g_android.serial_number=Blade-CM7' --base 0x2600000 --kernel zImage --ramdisk boot.img-ramdisk.gz -o boot.img

6. Zip up the new boot.img and old META-INF and system directories:

zip -r rom.zip META-INF boot.img system

7. Sign the zip:

java -jar signapk.jar testkey.x509.pem testkey.pk8 rom.zip rom-signed.zip

8. Generate an md5sum of the signed zip so users can check it downloaded properly:

md5sum rom-signed.zip > rom-signed.zip.md5sum

And here’s the screenshot of the running ROM with my kernel:

Click for fullsize

Click for fullsize

Bluetooth

As part of my frustration with PulseAudio and my Skype headset, I thought I’d try using my little USB Bluetooth dongle and my headset. Well after a couple of hours I managed to get mplayer to play out of my headset but upon reboot I can’t get it to work, and PA didn’t detect it anyway, so no good for Skype – which annoyingly these days only uses PA and not direct ALSA devices.

I paired my BT headset with my Android phone which worked nicely, but the voice dialler is shit – no better than via the phone’s mic.

I also wasted an hour more trying to get PA to route Skype to my wired headsets and everything else via the monitor speakers – with the option to switch easily, but that didn’t work so I’m back to my odd little hack of firing up alsamixer and switching between 2 channel and 6 channel a couple of times and loading Skype then turning off the Surround channel using amixer.

I also updated the blog to WordPress 3.2.1

Attack Of The Clones

I’ve been trying out some cloning solutions as Clonezilla failed to restore a working system when I cloned my Fedora 14 install.

I tried Acronis True Image Home 2011 PlusPack, and that was a bit odd – I can get past grub, but that’s about it – I think its not liking the UUID’s or something with the encrypted partitions. Possibly this is because it wanted to auto-grow the /boot partition from 500Mb to 6Gb!

So now I’ve tried the most basic option – an Ubuntu 11.04 LiveCD and dd – and I successfully restored the disk image into VirtualBox to test it out.

The commands are as follows – note that reading in chunks of 4k is optimised for SSD’s and the 80Gb backup took about 40mins:

Backup:

dd if=/dev/sda of=/var/tmp/ntfs/backup.img bs=4096

Restore:

dd if=/var/tmp/ntfs/backup.img of=/dev/sda bs=4096

I used an unencrypted NTFS USB drive to store the images as it takes out the hassle of device-mapper (encryption) permissions (ext3), network setup (NFS/samba) and file-splitting (FAT32).

Update: upgraded the blog to WordPress 3.2