Latest Entries »

I know, I have written about this before, but, here it is again. Installing ArchLinuxARM on the BeagleBoard, this time, taking a fresh SD card, and now it works like a sunshine. Yesterday, on the 8 GB card, I’d done exactly the same, without any result.

So, let’s see how to install the January 2013 ArchLinux OMAP3 rootfs to an SD card for use with a BeagleBoard.

Download the bootloader http://archlinuxarm.org/os/omap/BeagleBoard-bootloader.tar.gz
Download the rootfs http://archlinuxarm.org/os/ArchLinuxARM-omap-smp-latest.tar.gz

This says the latest rootfs, which would usually be the right thing to do. But to ensure you’re using the same rootfs as I do, you can use http://os.archlinuxarm.org/os/omap/ArchLinuxARM-2013.01-omap-smp-rootfs.tar.gz in stead.

extract the bootloader tarball. This tarball contains a mkcard.sh script which will partition the card for you. As I’ve had problems with the instructions on the ArchLinuxARM site last time, I will use this script instead, as it worked perfectly.


[root@hplaptop bootloader]# ./mkcard.sh /dev/mmcblk0
1024+0 records in
1024+0 records out
1048576 bytes (1.0 MB) copied, 1.13529 s, 924 kB/s
DISK SIZE - 16130244608 bytes
CYLINDERS - 1961
Checking that no-one is using this disk right now ...
OK

Disk /dev/mmcblk0: 1961 cylinders, 255 heads, 63 sectors/track
sfdisk: /dev/mmcblk0: unrecognized partition table type

Please note it also says

./mkcard.sh: line 37: kpartx: command not found

But this ain’t a fatal error. It seems this is a tool to re-read the partition table and create device maps. However, it seems it works without on my system. Anyhow, let’s continue. The said script only partitions the SD card and creates file systems, but nothing else. (unlike the script for the CubieBoard, which I will discuss later)


[root@hplaptop bootloader]# mount /dev/mmcblk0p1 /mnt/a
[root@hplaptop bootloader]# cp MLO /mnt/a
[root@hplaptop bootloader]# cp u-boot.bin /mnt/a
[root@hplaptop bootloader]# cp uEnv.txt /mnt/a
[root@hplaptop bootloader]# mount /dev/mmcblk0p2 /mnt/b
[root@hplaptop bootloader]# cd /mnt/b
[root@hplaptop b]# tar -xvf /run/media/andre/DataBlaat/arm/beagleboard/archlinux/ArchLinuxARM-omap-smp-20130118.tar.gz

It is important for the BeagleBoard that you copy the MLO file first to the FAT parition. This is a pre-boot-loader, “X-loader”, which will load the bootloader “U-Boot”. Then copy the other files to the FAT partition, “u-boot.bin”, the bootloader, and “uEnv.txt”, a configuration file.

Next extract the root file system to the ext3 parition. I usually include the v to the tar arguments to see what’s going on. When this is done, copy the kernel over to the FAT partition

[root@hplaptop b]# cp boot/uImage /mnt/a

This can take longer then expected. When this is done, create a boot script. This boot script will be like the one on the ArchLinuxARM site, but the mmc init line needs to be ommited. It was needed for ancient versions of U-Boot, but has been obsolete for quite a while. So, the boot script will look like


setenv bootargs 'console=ttyO2,115200n8 root=/dev/mmcblk0p2 rw rootfstype=ext3 rootwait'
fatload mmc 0 0x80300000 uImage
bootm 0x80300000
boot

write this bootscript to bootscr, and run mkimage to convert it to an U-boot script. Even though the current version supports the uEnv.txt file, I didn’t manage to get it to boot using the uEnv.txt only. I kept attemption to boot from NAND, but I want to boot from the SD card. I probably only have to set a certain variable to tell it to boot from SD in stead. However, with the boot.scr file present, it boots fine from the SD card.


[root@hplaptop b]# cd /mnt/a
[root@hplaptop a]# vim bootcmd
[root@hplaptop a]# mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n "Beagleboard boot script" -d bootcmd boot.scr
Image Name: Beagleboard boot script
Created: Fri Jan 25 11:05:47 2013
Image Type: ARM Linux Script (uncompressed)
Data Size: 151 Bytes = 0.15 kB = 0.00 MB
Load Address: 00000000
Entry Point: 00000000
Contents:
Image 0: 143 Bytes = 0.14 kB = 0.00 MB
[root@hplaptop mnt]# cd ..
[root@hplaptop mnt]# umount a
[root@hplaptop mnt]# umount b
[root@hplaptop mnt]# sync

Please note: If you’re missing mkimage is available in the AUR repository as package “uboot-mkimage”. Last time when I made an BeagleBoard SD card, I compiled it from source. After this is all done, unmount the file systems, flush the caches, and just put the card into the BeagleBoard, connect to the serial console, and plug in the power. It boots up fine.

P.S. In the rootfs there are some boot.scr files, but they won’t work. First of all, they appear to be for the TrimSlice. But that’s not the problem. They appear to be configured to load the kernel from the rootfs. In the directory /boot there is uImage, so, perfectly fine. However, U-Boot only supports ext2 and not ext3, therefore these files won’t work.

We might need to adjust the kernel parameters later if we want to set something like hdmi or svideo to work. As stated before, when specifying 1280×1024@60Hz, the BeagleBoard is only capable to deliver 57Hz, which my Compaq 1720 monitor refuses to accept. As I have found out with some CubieBoard tests, which I will write about later, the monitor might be a little more tolerant when the input is analogue. Therefore I tried the mentioned HDMI->VGA adaptor also on the BeagleBoard.

When I had my old BeagleBoard installation running, I experienced lots of USB problems, mostly related to the USB Ethernet adaptor. Lots of errors in the pegasus driver. So, I wonder, are the problems really hardware or are they caused by a crappy driver. Anyhow, I’ve bought an SPI Ethernet adaptor for testing purposes.

The BeagleBoard, the Raspberry Pi. They both use an SD card. The CubieBoard uses a µSD card. Basically the same card in a different form factor. Flash memory to store your operating system. As these ARM Boards commonly run a regular Linux distro compiled for ARM, usually logs are written to the file system, updates are installed frequently, and often you see an ext3 file system, which is a journalling file system. This all means there will be frequently written to an SD card in an ARM board, and knowing the write cycles of such a card are limited, makes you wonder, how long will it last. I believe I have hit the end of such an SD card yesterday night.

Kingston SD4/8GB

I bought this card, back in 2009 when I bought my BeagleBoard. When I first tried to use my BeagleBoard, I was stopped by the unstable USB bus, therefore it hasn’t been used much. The SD card has probably been used in cameras in the mean time. When I read the USB problems where probably hardware related and a capacitor might fix them, I’ve started using the BeagleBoard again, yet, experiencing various instability issues.

BeagleBoard Rev. C3

Regular crashes and rebooting, not good for the condition of a file system, and such fsck running on the file system, what are the results for write cycles? Anyhow, when I got my Raspberry Pi, I bought some 16 GB SD cards it. However, wanting to test RISCOS, I didn’t want to use such a 16 GB card for it. So I took this 8 GB card and wrote that image to it. RISCOS booted fine on the Raspberry Pi. However, now I think about it. I once had some boot problems, which disappeared as spontaneous as they came.

Now, I wanted to play around with my BeagleBoard again. I took the 8 GB SD card, I made an image of its contents (the RISCOS image), ran the BeagleBoard SD card script, to correctly partition it for use with a BeagleBoard, which also makes a FAT and ext3 file system. I wanted to try geexbox, an XBMC distro, which also has a version for OMAP3, which includes the BeagleBoard, IGEPv2, and others.

So, I copied the bootloader files to the FAT partition, the rootfs to the ext3 parition, put the card in the BeagleBoard and booted it up. This distro uses systemd, which is also in use by ArchLinux. Anyhow, I was conducting some experiments with the hdmi and svideo outputs of the BeagleBoard.

The HDMI to VGA converter worked fine with my Raspberry Pi and CubieBoard, so I was like, let’s give it a try on the BeagleBoard. Even though it would probably not work without modification to the BeagleBoard, as it shows here, it has overcurrent protection on the HDMI output. Such an HDMI to VGA adaptor without own power supply violates the HDMI/DVI specs and draws much more current from the HDMI port that officially allowed. Actually, the BeagleBoard is the only board (known to me) that restricts HDMI devices to the standards.

In general, specifications about maximal current drawn are violated everywhere, especially on USB busses. And then those cables with an extra USB plug to allow more current in case one port is restricted. Or USB fans, lights and even warming plates for a cup of coffee….. all just drawing current without any USB logic, no identification to the host. Well… enough ranting about that. What was I talking about?

Anyhow, after a few seconds the screen would go off, due the HDMI to VGA adaptor drawing too much current. I went to try the svideo output. Where the video output goes is a kernel parameter, so chaging the files in the boot partition and rebooting. Also note, the manual of the BeagleBoard states I should only (un)plug the cable from the HDMI port when the device is unpowered. Anyhow. When I plugged in the power supply again, nothing happened. Of course I was like, “WTF?!?!?!”. After measuring the power adaptor, it turned out this one just decided to die.

Dead power adaptor

This power adaptor belonged to an USB HUB I’ve decided to retire, as it was causing trouble on the USB bus. Please note this was a 4 port USB hub, and the adaptor is rated 2.5 Amps, as it should. Nowadays you see only 1 Amp for a 4 port USB hub. So, in these days, USB devices draw more power then they should, and USB hubs provide less power then they should. Can someone please explain how on earth this is supposed to work???

Anyhow, the fact the power adaptor just died may make me re-evaluate that USB hub, as its misbehaviour might be related to unstable power. Nevertheless, it’s an old hub, perhaps it even belongs to the first generation of USB 2.0 hubs?

IMG_0985

Anyhow, recently I had some more USB hub issues. I have announced a couple of time again I should write about them. And I should just do it otherwise it will never happen, as I have said I am supposed to write about a certain subject before, but never done in the end. But there are more things to write about so.

I almost forgot, I should still get to the point of this story. So, I had a booting geexbox distro, but I wasn’t able to get anything xbmc on the tv out for some reason. I decided to install ArchLinuxARM in stead. So, I formatted the ext3 partition again and copied the ArchLinuxARM OMAP3 root fs over, I copies the uImage over to the FAT partition, and….. it doesn’t boot. Kernel Panic! Cannot find init! and such. I’ve been testing all night, re-creating the file system, boot loader and everything. I couldn’t find anything wrong. But missing init? it’s right there! I’ve copied a statically linked “hello world” binary (compiled on the Raspberry Pi. ARMv6 Hard Float binaries run fine on ARMv7 Hard Float) over there to test, which ran perfectly fine.

In the end, I noticed the umount command was hanging, when unmounting the card on my laptop. Now, I believe this is related to the SD card malfunctioning. I’ve noticed this before, but I assumed this was some kind of bug instead.

While the umount command was hanging, in another terminal, we see data is being written to the card at a very slow rate:

[andre@hplaptop ~]$ iostat
Linux 3.6.11-1-ARCH (hplaptop) 25-01-13 _x86_64_ (2 CPU)

avg-cpu: %user %nice %system %iowait %steal %idle
9,95 0,00 4,02 21,73 0,00 64,30

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
sda 4,41 51,38 57,41 547377 611549
mmcblk0 0,61 0,35 28,54 3745 30402

When we look at dmesg, it doesn’t complain about anything to do with the sd card, but it noticed the umount being blocked for over two minutes.


[10680.535700] INFO: task umount:3089 blocked for more than 120 seconds.
[10680.535709] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[10680.535714] umount D ffff880127dd58b0 0 3089 2881 0x00000000
[10680.535724] ffff88011e23dc08 0000000000000086 ffff880127dd58b0 ffff88011e23dfd8
[10680.535733] ffff88011e23dfd8 ffff88011e23dfd8 ffffffff81814420 ffff880127dd58b0
[10680.535741] ffff880127f330a8 ffff88013fc13e70 ffff88011e23db98 ffffffff810145b3
[10680.535749] Call Trace:
[10680.535765] [] ? __switch_to+0x163/0x410
[10680.535776] [] ? finish_task_switch+0x49/0xe0
[10680.535787] [] schedule+0x29/0x70
[10680.535794] [] schedule_timeout+0x204/0x260
[10680.535802] [] ? check_preempt_curr+0x75/0xa0
[10680.535809] [] ? ttwu_stat+0xaa/0x120
[10680.535816] [] wait_for_common+0xcd/0x160
[10680.535824] [] ? try_to_wake_up+0x2f0/0x2f0
[10680.535831] [] wait_for_completion+0x1d/0x20
[10680.535841] [] writeback_inodes_sb_nr+0x85/0xb0
[10680.535849] [] ? sys_mknod+0x1/0x20
[10680.535886] [] writeback_inodes_sb+0x2e/0x40
[10680.535893] [] sync_filesystem+0x3d/0xb0
[10680.535902] [] generic_shutdown_super+0x3b/0xf0
[10680.535910] [] kill_block_super+0x30/0x80
[10680.535920] [] deactivate_locked_super+0x3c/0xa0
[10680.535927] [] deactivate_super+0x4e/0x70
[10680.535936] [] mntput_no_expire+0x101/0x160
[10680.535944] [] sys_umount+0x76/0x3a0
[10680.535953] [] system_call_fastpath+0x1a/0x1f

Anyhow, I declare this 8GB SD card deceased. Just another thought. As this “dying sd card” causes weird symptoms.

Edit: I believe the cause of the problems were rather different. During an update, the governor was set to ondemand again, in stead of powersave which I had configured. The issues were probably caused by overheating. I have experienced SD problems before related due overheating. I wonder why my laptop has to run at 800 MHz nowadays, while when it was new it ran at 2800 MHz without problems, but suddenly, overheating issues arrised.

A few days ago, I was logged in to my dedicated server, my connection died. At first I was worried something happened to my server, but it turned out to be my own internet connection that dropped. Looking at the logs, I notice


15.01.13 14:07:04 Internet connection established successfully. IP address: 83.160.145.152, DNS server: 194.109.6.66 and 194.109.9.99, Gateway: 194.109.5.203
15.01.13 14:07:02 Login to the FRITZ!Box user interface from the IP address 192.168.178.30.
15.01.13 14:07:00 DSL is available (DSL synchronization exists with 15005/1011 Kbit/s).
15.01.13 14:06:48 DSL synchronization starting (training).
15.01.13 14:06:25 DSL synchronization starting (training).
15.01.13 14:06:06 DSL synchronization starting (training).
15.01.13 14:04:40 Internet connection cleared.
15.01.13 14:04:40 DSL not responding (no DSL synchronization).

I’m like what’s going on? Why? Usually my internet connection is like


21.12.12 16:22:10 Internet connection established successfully. IP address: 83.160.145.152, DNS server: 194.109.6.66
and 194.109.9.99, Gateway: 194.109.5.203
21.12.12 16:21:41 DSL is available (DSL synchronization exists with 4097/1031 Kbit/s).
21.12.12 16:21:38 DSL synchronization starting (training).

I have complained about this, as I am supposed to have 8 Mbit, but the line was too bad to support 8 Mbit. So, it seems they’ve set up a new DSL Exchange. I’ve noticed some more messages about resynchronisation of the like. I believe they’re fine tuning their new DSL exchange.


18.01.13 01:45:08 Internet connection established successfully. IP address: 83.160.145.152, DNS server: 194.109.6.66
and 194.109.9.99, Gateway: 194.109.5.203
18.01.13 01:45:04 DSL is available (DSL synchronization exists with 17505/967 Kbit/s).
18.01.13 01:44:53 DSL synchronization starting (training).
18.01.13 01:44:30 DSL synchronization starting (training).
18.01.13 01:44:11 DSL synchronization starting (training).
18.01.13 01:44:01 Internet connection cleared.
18.01.13 01:44:01 DSL not responding (no DSL synchronization).
17.01.13 10:50:41 Login to the FRITZ!Box user interface from the IP address 192.168.178.30.
17.01.13 01:45:35 Internet connection established successfully. IP address: 83.160.145.152, DNS server: 194.109.6.66
and 194.109.9.99, Gateway: 194.109.5.203
17.01.13 01:45:31 DSL is available (DSL synchronization exists with 17021/995 Kbit/s).
17.01.13 01:45:20 DSL synchronization starting (training).
17.01.13 01:44:56 DSL synchronization starting (training).
17.01.13 01:44:37 DSL synchronization starting (training).
17.01.13 01:44:28 Internet connection cleared.
17.01.13 01:44:28 DSL not responding (no DSL synchronization).

A few days later, 18 January, I got a letter from XS4ALL, saying they now have VDSL available on my location. Well, that explains the new DSL Exchange. I have accepted the upgrade, which will give me a new modem. In the end, I believe I didn’t have to, as I still did have a Fritz!Box 7270, which on the old connection only gave me 1,6 Mbit. Back then I bought that modem because of the Native IPv6 trials. Now, Native IPv6 is standard at XS4ALL. That modem gets good speeds now as well, but gives me Native IPv6 access. I no longer have to my IPv6 tunnel. (Which had a little problem I haven’t written about yet…)


21.01.13 01:31:33 The system time was updated successfully by time server 89.104.194.134.
21.01.13 01:31:22 IPv6 prefix obtained successfully. New prefix: 2001:980:55e0::/48
21.01.13 01:31:22 IPv6 Internet connection established successfully. IP address: 2001:980:55e0::224:feff:fed7:e4d2
21.01.13 01:31:18 Internet connection established successfully. IP address: 83.160.145.152, DNS server: 194.109.6.66 and 194.109.9.99, Gateway: 194.109.5.203
21.01.13 01:31:16 Login to the FRITZ!Box user interface from the IP address 192.168.178.20.
21.01.13 01:31:14 DSL is available (DSL synchronization exists with 18934/1028 kbit/s).
21.01.13 01:30:59 DSL synchronization starting (training).
21.01.13 01:30:34 DSL synchronization starting (training).

Anyhow, looking back, perhaps it was a bad deal to get the VDSL with the new modem. The new modem only has one analogue phone line, while I have 2 phones. Both Fritz!Box 7170 and 7270 support Pulse dialing just fine. My new box will be a Fritz!Box 7360, where looking at this picture, it turns out to have only one phone connector. Besides I’ve heard rumours newer models of the Fritz!Box might not support Pulse dialing…. but I like my retro phones! And to be honest, such a pulse to tone converter, I don’t like the idea…

Well… I still have a Fritz!Box FON ata somewhere. (But is it reliable? This device was the culprit when my internet in Sweden broke down…. but that was when it was acting as a NAT router as well, which it won’t be doing here)

Besides, there is a chance my district might get glass fiber soon. If 30% of my district signs up, we will get it, and the deadline for signing up is this weekend I believe. I signed up ages ago. Yet…. how long will that take? Will I even be still living here? Anyhow, I have decided to keep my 8 Mbit for now, I could have chosen the 40 Mbit now. Still, that’s the downstream. The upstream will be 4 Mbit in stead of the 1 Mbit I have now. That’s why I am looking forwards to glass, a symmetric connection. Then it becomes interesting to have a “real” server at home.

The past week, I’ve been struggling with tvheadend and oscam. The solution of a working configuration I will present in part 3, but first, I will provide some background information, in part 2 I will discuss the problems I’ve encountered, and finally in part 3 I will provide how to get it working

In my previous post, I have mentioned configuring my USB Satellite receiver, so you guess I have satellite TV. In my country, the Netherlands, the provider is CanalDigitaal. Their channels are encrypted and they use the SECA MediaGuard encryption system. It’s CAID is 0100. CanalDigitaal has Provider ID 0006A.

Canal Digitaal Smart Card  (Mediaguard v10.0)

In order to watch TV on a computer (or raspberry pi), I need to decrypt the TV signals. A regular DVB-S receiver uses a CAM (Common Access Module) which reads the smart card. An example of such a CAM is the MatrixCAM. In the picture two revisions of the MatrixCAM: Reloaded and Revolutions.

MatrixCAM

When Canal Digitaal introduced their SECA Mediaguard v7.3 cards, I bought such a MatrixCAM. Even though my DreamBox had a built-in card reader, back then the store where I bought my DreamBox said it couldn’t read the card. Nowadays I use the card reader to read the card, but back then I wasn’t that much this kind of stuff. It could be true that the softcams back then didn’t support Meduaguard v7.3 cards yet, or simple, the salesman wasn’t aware of it. I mean, he sold me a DreamBox with an emu-enables distro and a couple of funcards, so I suppose if he knew he would have told me, right?

Old Canal Digitaal Smart Card (Mediaguard v7.3)

Before I didn’t need a card or a cam to decrypt their signals. The encryption system they used before was broken and I could watch using a so-called emu, which emulates the whole cam and card by software. Back in the days there were distros for my DreamBox DM-7000S available which had this built-in. I believe the hacked system was Irdeto, but I am not sure about this. In those days there were also programmable cards, like the funcard5, which enabled owners of certain receivers to decrypt the dutch channels, but could also be used as data storage to upgrade firmware I believe.

FUN5 Programmable Card

Anyways, when Canal Digitaal yet again replaced their smart cards with MediaGuard v10.0 cards, like the orange one shown above, the MatrixCAMs didn’t work as they should anymore. With the MediaGuard v10.0 cards, the MatrixCAM started to crash frequently and needed to be powercycled. Even though the software in those CAMs is supposed to be upgradable, I haven’t been able to locate a newer firmware to resolve those problems. One solution to this problem is to buy a CAM from Canal Digitaal themselves, which is an official MediaGuard CAM.

MediaGuard CI CAM

Or, since my DreamBox has an integrated smart card reader, soft an softcam, a CAM in software. For this purpose I have been using CCcam. For my media center project, I have bought an USB smart card reader, A smargo smartreader+, which can be used in combination with such a softcam. CCcam is however closed source software, which I would like to avoid. There is also an open source softcam, oscam, which I will be using, and I will discuss the problems I have encountered with it in part 2.

Smargo SmartReader+

As I mentioned, there have been problems with certain hardware after Canal Digitaal gave out new smart cards. The salesman recommended the MatrixCAM since it supports multiple card systems, as opposed to the official CAM, which only supports one system. Also, the MatrixCAM is software upgradable, so, in theory, new software could be flashed to resolve the incompatibilities with the MediaGuard v10.0 cards… however I once searched but haven’t found.

The day before yesterday, the USB Satellite Receiver I’ve ordered arrived. A few days earlier, the smartcard reader arrived. So, I guess I have all required components now.

Plugging the receiver into the USB port, nothing happens. Ok, dmesg shows a new device has been attached, but no module is being loaded. I guess I’m a bit spoiled, expecting everything to just work, all driver support just to be in the kernel. However, this time this was not the case. The device identifies itself as ID 0572:6831 Conexant Systems (Rockwell), Inc.

Downloading the sources from http://dvbsky.net/Support.html and compiling them. It gives me a packed version of the dvb_usb_dw2102 module, which actually was in my current version. Please note I’ve used the “media_build_bst_121102” version, and not the patches for 3.6, for now.
On the Raspberry Pi, this went without issues. On my laptop there are little issues, as this source package includes the whole media subsystem, and there are conflicting versions with existing kernel modules. I suppose I should investigate their patches too. But… as their patches are for 3.6.6 and I am already beyond…
Nevertheless, I got the device working, both on pi and laptop.

So, next is tvheadend. This is a TV streaming server, which will stream the received TV signals to my XBMC Pi, or, at least, what was the plan. It is configures through a web interface, which is rather heavy when having all channels from a satellite loaded. Firefox regularly freezes and pops up the script not responding dialog. Opera can handle it better then Firefox. Anyhow, using the web interface, setting up username, password, ip range etc. Setting up and scanning the satellite.

On the other Raspberry Pi, running OpenELEC XBMC, connecting to it. Well…. it doesn’t work as well as expected. Really having to convince it to change channels etc.
So, what’s the problem. At first, check if the satellite is aligned correctly. The DreamBox DM7000S has fine reception, so I don’t think that’s the problem. Is there a bottleneck is computing power or bandwidth somewhere in the chain. Note that the Raspberry Pi has it’s ethernet as USB device, which might be the issue. I don’t know if there is a hardware demuxer present in this receiver, but if this is not the case, it will have to stream the signal from the entire transponder over USB, which means a number of channels is sent. This might take up a huge part of the USB bandwidth, which might not leave enough to sent the channel we’re interested in over USB to the Ethernet. If this is the problem, a possible solution might be to hoop up an Ethernet adaptor on a different interface. I’ve read about SPI Ethernet adaptors, such as the ENC624J600 (100 Mbit) and ENC28J60 (10 Mbit). However, I have no idea of the performance of the SPI bus, on the Raspberry Pi, or even in general.

So… let’s compile a xbmc on the laptop, do some cross reference tests. Installing the package xbmc-git from aur. Editing the PKGBUILD is required, remove all the inclusion of libcec, otherwise it will not compile. It will go like, this is not a Raspberry Pi, I will not compile. LOL. Also install the PVR addons. Starting tvheadend and xbmc on the laptop, it works perfectly. So, at least we know now the receiver works fine. Now, connect it to the Pi. The laptop as client, this gives issues as well. So, it seems the Pi as server is the problem.

So, the next test is running XBMC on the Pi and tvheadend on the laptop. This still doesn’t work as desired. This makes me start to believe the Raspberry Pi is not (yet) suitable as a full media center. It worked fine for playing music and videos from files, but on streaming it still has issues. First of all, I have to switch the audio to MPEG2. It will default to AC3 encoded audio, and when this is selected, the channel will not show anything. I have to select MPEG2 audio, switch to a different channel, switch back, and I might get to see something. But in general, it feels unstable. XBMC might just decide to crash and restart when using the PVR client.

Perhaps I should let it rest for a while, because I am spending too much time on this. There is one other thing to try. Installing XBMC on the desktop machine as well, to see how it performs on streaming in general. (And everything on Pi as well, but I really think CPU power will be a problem then) Also… if cpu power is the issue, I still have this CubieBoard, which may come to the rescue. Otherwise I might have to look for a more powerful board.

Anyhow, this is it for now, I still have some more topics to talk about, but that will have to wait till later. But I still have to discuss oscam, usb issues and real time clocks.

Just a few things left do configure on my server Pi. One of them is setting up the scanner server. This is quite straight forwards, and it just takes a couple of minutes to set it up. (See ArchLinux wiki) The first step is to install sane and xinetd on the server:

[andre@rpi-server ~]$ yaourt -S sane xinetd

The next step is setting the allowed clients in /etc/sane.d/saned.conf


# required
localhost
# allow local subnet
192.168.178.0/24

And configuring xinetd. The file /etc/xinetd.d/sane already exists, and all that needs to be changed is setting disable to no. On the clients, add the ip address of the server to /etc/sane.d/net.conf and it just works! Awesome!

Another thing still on the TODO list is the IPv6 tunnel. Unfortunately, the ArchLinux wiki still only lists a configuration for the classical initscripts, and not for systemd. Twice, even: IPv6 – Tunnel Broker Setup and IPv6 – 6in4 Tunnel are describing the same thing.

So.. I guess let’s have a closer look at systemd, how to add custom services to it, right? So… there is a link to Systemd/Services which actually provides what I am looking for. No need to write a custom script. Just adjust it to the settings for the XS4ALL tunnel.

/etc/systemd/system/xs4all-ipv6.service


[Unit]
Description=XS4ALL IPv6 tunnel
After=network.target

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/sbin/ip tunnel add xs4all-ipv6 mode sit remote 194.109.5.241 local 83.160.145.152 ttl 255
ExecStart=/sbin/ip link set xs4all-ipv6 up mtu 1472
ExecStart=/sbin/ip addr add 2001:888:10:590::2/64 dev xs4all-ipv6
ExecStart=/sbin/ip -6 route add ::/0 dev xs4all-ipv6
ExecStop=/sbin/ip -6 route del ::/0 dev xs4all-ipv6
ExecStop=/sbin/ip link set xs4all-ipv6 down
ExecStop=/sbin/ip tunnel del xs4all-ipv6

[Install]
WantedBy=multi-user.target

So… let’s try it:


[root@rpi-server system]# systemctl start xs4all-ipv6
Job for xs4all-ipv6.service failed. See 'systemctl status xs4all-ipv6.service' and 'journalctl -xn' for details.
[root@rpi-server system]# systemctl status xs4all-ipv6.service
xs4all-ipv6.service - XS4ALL IPv6 tunnel
Loaded: loaded (/usr/lib/systemd/system/xs4all-ipv6.service; disabled)
Active: failed (Result: exit-code) since Thu, 2013-01-03 14:50:02 GMT; 8s ago
Process: 15926 ExecStart=/sbin/ip tunnel add xs4all-ipv6 mode sit remote 194.109.5.241 local 83.160.145.152 ttl 255 (code=exited, status=1/FAILURE)
CGroup: name=systemd:/system/xs4all-ipv6.service

[root@rpi-server system]# /sbin/ip tunnel add xs4all-ipv6 mode sit remote 194.109.5.241 local 83.160.145.152 ttl 255
add tunnel sit0 failed: No such device

No worky yet… there is no sit0 device. Sounds like a missing kernel module to me, which makes sense, as I did a full system upgrade ( pacman -Syu) yesterday, which included a new firmware and kernel, but I didn’t reboot yet. So… I think that’s the problem. And indeed it was, after reboot it doesn’t display the error message anymore. However, it doesn’t work yet.

[root@rpi-server andre]# systemctl start xs4all-ipv6
[root@rpi-server andre]# ifconfig
eth0: flags=4163 mtu 1500
inet 192.168.178.49 netmask 255.255.255.0 broadcast 192.168.178.255
inet6 fe80::ba27:ebff:fe89:f248 prefixlen 64 scopeid 0x20 ether b8:27:eb:89:f2:48 txqueuelen 1000 (Ethernet)
RX packets 1614 bytes 167190 (163.2 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1464 bytes 217606 (212.5 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73 mtu 16436
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10
loop txqueuelen 0 (Local Loopback)
RX packets 8 bytes 560 (560.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 8 bytes 560 (560.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

xs4all-ipv6: flags=209 mtu 1472
inet6 fe80::53a0:9198 prefixlen 128 scopeid 0x20 inet6 2001:888:10:590::2 prefixlen 64 scopeid 0x0
sit txqueuelen 0 (IPv6-in-IPv4)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

[root@rpi-server andre]# ping6 google.com
PING google.com(wi-in-x64.1e100.net) 56 data bytes
From tunnel1424.ipv6.xs4all.nl icmp_seq=1 Destination unreachable: Address unreachable
From tunnel1424.ipv6.xs4all.nl icmp_seq=2 Destination unreachable: Address unreachable
From tunnel1424.ipv6.xs4all.nl icmp_seq=3 Destination unreachable: Address unreachable
From tunnel1424.ipv6.xs4all.nl icmp_seq=4 Destination unreachable: Address unreachable
From tunnel1424.ipv6.xs4all.nl icmp_seq=5 Destination unreachable: Address unreachable
^C
--- google.com ping statistics ---
5 packets transmitted, 0 received, +5 errors, 100% packet loss, time 4005ms

So.. what’s wrong here? The Sever is set as the exposed host, therefore it should receive the tunnel packets. So that can’t be the problem. Also, using the old initscripts script it works. So… I guess I’ll have to look at the the differences. At first glance they look the same, so the difference got to be in the details. (note: the error messages are due the fact my system is no longer having support scripts for the old style initscripts)

[root@rpi-server andre]# /etc/rc.d/6in4-tunnel start
/etc/rc.d/6in4-tunnel: line 13: /etc/rc.conf: No such file or directory
/etc/rc.d/6in4-tunnel: line 14: /etc/rc.d/functions: No such file or directory
/etc/rc.d/6in4-tunnel: line 18: stat_busy: command not found
/etc/rc.d/6in4-tunnel: line 36: add_daemon: command not found
/etc/rc.d/6in4-tunnel: line 37: stat_done: command not found
[root@rpi-server andre]# ping6 google.com
PING google.com(wi-in-x65.1e100.net) 56 data bytes
64 bytes from wi-in-x65.1e100.net: icmp_seq=1 ttl=56 time=23.8 ms
64 bytes from wi-in-x65.1e100.net: icmp_seq=2 ttl=56 time=23.0 ms
64 bytes from wi-in-x65.1e100.net: icmp_seq=3 ttl=56 time=23.4 ms
64 bytes from wi-in-x65.1e100.net: icmp_seq=4 ttl=56 time=26.4 ms
^C
--- google.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3004ms
rtt min/avg/max/mdev = 23.044/24.208/26.488/1.355 ms

The problem was rather stupid. A mistake I was struggling with last time I had to set this up. The “local” IP is supposed to LAN (internal) ip not my WAN (external) ip.

[root@rpi-server andre]# systemctl start xs4all-ipv6
[root@rpi-server andre]# ifconfig
eth0: flags=4163 mtu 1500
inet 192.168.178.49 netmask 255.255.255.0 broadcast 192.168.178.255
inet6 fe80::ba27:ebff:fe89:f248 prefixlen 64 scopeid 0x20 ether b8:27:eb:89:f2:48 txqueuelen 1000 (Ethernet)
RX packets 834 bytes 81976 (80.0 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 790 bytes 118486 (115.7 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73 mtu 16436
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10
loop txqueuelen 0 (Local Loopback)
RX packets 8 bytes 560 (560.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 8 bytes 560 (560.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

xs4all-ipv6: flags=209 mtu 1472
inet6 fe80::c0a8:b231 prefixlen 128 scopeid 0x20 inet6 2001:888:10:590::2 prefixlen 64 scopeid 0x0
sit txqueuelen 0 (IPv6-in-IPv4)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

[root@rpi-server andre]# ping6 google.com
PING google.com(wi-in-x71.1e100.net) 56 data bytes
64 bytes from wi-in-x71.1e100.net: icmp_seq=1 ttl=56 time=23.4 ms
64 bytes from wi-in-x71.1e100.net: icmp_seq=2 ttl=56 time=22.8 ms
^C
--- google.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 22.897/23.150/23.403/0.253 ms

Now we got that working, the routing part. To configure the system as a IPv6 router, we add net.ipv6.conf.all.forwarding = 1 to /etc/sysctl.conf. Next we enable radvd. It appears I’ve already installed radvd, otherwise install it with pacman -S radvd.

The /etc/radvd.conf file contains tons of examples. So, we’ll have to a new file for this. We can use the XS4ALL auto create config file for this, as this is not distro specific. (ArchLinux isn’t on their list, they offer Debian, Redhat, FreeBSD, and some commercial Operating Systems like Mac OSX, Windows XP and Windows Vista)


interface eth0 {
AdvSendAdvert on;
AdvHomeAgentFlag off;

prefix 2001:888:1590::/64 {
AdvOnLink on;
AdvAutonomous on;
AdvRouterAddr off;
};
};

Looking at their config file, they’ve disabled Mobile IPv6 support (AdvHomeAgentFlag off;), which is an interesting feature of IPv6. I attended a presentation about this when I was in Sweden, back in 2008. I wish features like this would be widely implemented by now. I mean… if the mobile phone networks supported this…. Think about it. Just keeping your TCP connections open while switching networks. The technology is out there… and has been for years, but no dog uses it.

Anyhow…. back to the configuration. On the other machines, IPv6 connectivity is not yet working. It seems, the system is not acting as a router yet. It appears the /etc/sysctl.conf is not parsed, as when I run sysctl -p it starts working. Some more things that have changed since the old initscripts days. Looking at the ArchLinux Wiki, we’re supposed to create a config file in /etc/sysctl.d/, and if we click the link on there, we see the file needs extension .conf, so, let’s create this file, reboot, and see if it just works.

[root@rpi-server sysctl.d]# echo net.ipv6.conf.all.forwarding = 1 > ipv6_router.conf

Unfortunately, after reboot, it’s still not working…

[andre@rpi-server sysctl.d]$ sysctl net.ipv6.conf.all.forwarding
net.ipv6.conf.all.forwarding = 0

Getting this to work is always a pain in the ass. And why isn’t it parsing the damn config files…. grrr, they are where they should be. Sysctl seem to be started, so it should parse the damn config file.

andre@rpi-server ~]$ systemctl status systemd-sysctl
systemd-sysctl.service - Apply Kernel Variables
Loaded: loaded (/usr/lib/systemd/system/systemd-sysctl.service; static)
Active: active (exited) since Thu, 1970-01-01 01:00:02 BST; 43 years and 0 months ago
Docs: man:systemd-sysctl.service(8)
man:sysctl.d(5)
Process: 49 ExecStart=/usr/lib/systemd/systemd-sysctl (code=exited, status=0/SUCCESS)
CGroup: name=systemd:/system/systemd-sysctl.service

Please note it says 1970 as the Raspberry Pi doesn’t have a RTC, and this is executing early in the boot process (btw. I’ve ordered a I²C RTC to solve this problem)

Some more searching on the internet gave me some french blog. My french is very rusty, and when I had french class in high school, I totally sucked at is, so I won’t even try to read it, and just to the command to restart. After this the config file seems to be parsed. (Does it cache it or what?)

[root@rpi-server sysctl.d]# systemctl restart systemd-sysctl.service
[root@rpi-server sysctl.d]# sysctl net.ipv6.conf.all.forwarding
net.ipv6.conf.all.forwarding = 1

Let’s reboot. After reboot it is not set. So, even though systemctl says it got an active status, somehow, it is not. I’m tired of this, I will just hack it in. Adding systemctl restart systemd-sysctl.service to my tunnel script…. no change. trying sysctl net.ipv6.conf.all.forwarding=1 No change either. Ok. it seems systemctl config files require full paths. Now the hack works. So, the /usr/lib/systemd/system/xs4all-ipv6.service ended up looking like:


[Unit]
Description=XS4ALL IPv6 tunnel
After=network.target

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/sbin/ip tunnel add xs4all-ipv6 mode sit remote 194.109.5.241 local 192.168.178.49 ttl 255
ExecStart=/sbin/ip link set xs4all-ipv6 up mtu 1472
ExecStart=/sbin/ip addr add 2001:888:10:590::2/64 dev xs4all-ipv6
ExecStart=/sbin/ip -6 route add ::/0 dev xs4all-ipv6
ExecStart=/sbin/sysctl net.ipv6.conf.all.forwarding=1
ExecStop=/sbin/ip -6 route del ::/0 dev xs4all-ipv6
ExecStop=/sbin/ip link set xs4all-ipv6 down
ExecStop=/sbin/ip tunnel del xs4all-ipv6

[Install]
WantedBy=multi-user.target

Still, I would prefer to see the sysctl files parsed as it should. This is just a hack. So, I am not happy about this yet… however, the basic configuration is done now. I will have an image of the current content of the SD card (first 2 GB only) and then grow the file system to occupy the complete SD card.

Making the image of the card:

[root@hplaptop raspberrypi]# dd if=/dev/mmcblk0 of=rpi-server.img bs=1M count=1886
1886+0 records gelezen
1886+0 records geschreven
1977614336 bytes (2,0 GB) gekopieerd, 207,126 s, 9,5 MB/s

The original image was 1977614336 bytes, which is 1886 MiB. So, that’s the size of used part, before resizing. Please note, even though dd says MB and GB, it actually means MiB and GiB. I am creating this image in its original size, so I can write it to a different (size) SD card later if necessary.

Growing the file system I’ve already explained when I was discussing my other Pi.

At this stage, other stuff can be added to the installation. (And I should also take another look at qmeu userspace emulation) But also some server software meant for exposure to the internet, such as http, irc, and more. Thinking about my Media Center Project, perhaps the server Pi should run the tvheadend, and connect to the XBMC Pi over the network. It’s just… I am not that comfortable with running soft real time applications on a machine which can receive unknown load from the internet (and also my local network, but I have control over that)

Gelukkig 2013! Het nieuw jaar is weer begonnen, en traditioneel schrijf ik altijd een terugblik op het afgelopen jaar op mijn blog. Ik zat nog te twijfelen of ik deze in het Nederlands of het Engels zou schrijven, maar heb besloten het dit jaar in het Nederlands te doen.

Een jaar geleden begon 2012, een veelbesproken jaar, een jaar waarin alles zou veranderen of de wereld zou eindigen… een jaar dat beloofde een bijzonder jaar te worden. Maar nu, een jaar later, wat is er van uit gekomen? In ieder geval niet het einde van de wereld, anders zou ik dit stukje immers niet schrijven, nietwaar?

Afin, een jaar geleden… hoe begon het jaar. Occupy Eindhoven stond aan de stationsweg langs de Dommel. Toen Occupy tegen het einde van 2011 begon leek dit in lijn met de voorspellingen dat in 2012 alles zou veranderen… maar wat is daarvan terecht gekomen? Niet veel. De stationsweg was de doodsteek voor Occupy Eindhoven, en al spoedig werd Occupy Eindhoven ontruimd.

Alhoewel dit het einde voor het kamp van Occupy Eindhoven was, was dit niet het einde voor Occupy en gerelateerde zaken. Al voor de ontruiming van Occupy Eindhoven was er een artikel op de site van Omroep Brabant dat Occupy Eindhoven een ecodrop wilde. Dit idee is verder ontwikkeld, en hieruit is Beginhoven ontstaan, bestaande uit (een deel van) de harde kern van Occupy Eindhoven, en mensen die via andere wegen, zoals Transition Town Eindhoven, zich hebben aangesloten. Een aantal maanden later is een vereniging opgericht waarvan ik de secretaris ben.

Het idee van Beginhoven is ergens in Eindhoven een braakliggend terrein in te richten voor stadslandbouw en workshops. (Voor meer informatie zie de site van beginhoven) Echter, onderhandelingen met de gemeente verlopen traag, en na maanden hebben we nog steeds geen terrein.

Naast dit alles ben ik natuurlijk ook nog met mijn studie bezig, maar om hier nu veel over op mijn blog te zetten? En over het eerste deel van 2012 weet ik het al niet meer wat ik daar over kan vertellen… Vakken die ik het huidige semester volg, ja, dat is leuker. Ik volg onder andere het vak “The Hacker’s Hut”, een cursusje hacken als college. Eerste deel over websites (SQL injectie, XSS, etc.), tweede deel het echte werk (buffer overflow). Elementair niveau, maar wel leuk.

Een ander interessant vak was Cultuurfilosofie 2. Een vak over het culturele aspect van voedsel. Van voedselindustrie tot eten. Een college waarin ook de nodige maatschappelijke en ethische kwesties gekeken. Dit is echt een vak wat ik kan aanbevelen.

Mijn studie, hoe nu verder? Ik ben van plan om na de zomer aan mijn afstuderen te beginnen. Ik moet nog een vakje “Algebra” afronden. Zo’n homologievak, eigenlijk een backelor vak, maar verplicht voor mijn master aangezien ik mijn bachelor op het HBO heb gedaan. Als ik dat niet afgevinkt heb mag ik niet aan mijn afstuderen beginnen. Een openstaand mastervak zou wel nog tijdens mijn afstuderen mogen, maar zo’n homologatievak, nee dat kan niet. En het blijkt dat het niet hebben gehaald van dat Algebra vak geen gevolgen heeft gehad voor het kunnen volgen van een van mijn mastervakken. Dus de stof echt nodig hebben? Nee, het is alleen een vinkje nodig hebben, dus ik zie het meer als een bureaucratische verplichting dan wat anders.

Maar goed, verder, de afgelopen weken… zijn er misschien ook een paar interessante dingen gebeurd. Cindy kwam met plannen om de Ark op te gaan knappen en hier weer sociale activiteiten plaats te laten vinden. Daar kunnen misschien ook nog interessante dingen uit ontstaan.

Als ik even verder terug kijk, vanaf november zit er weer wat leven in Occupy Eindhoven. We hebben namelijk besloten elke maand op de 5e een actie te voeren in de stad. (Alleen slaan we 5 januari over, we zijn met kerstreces) Daarnaast wordt er elke week een stelling van de week op de site geplaatst.

2012…. tsja… een jaar waarin er veel gebeurd is. Beginhoven, Occupy Eindhoven, en recentelijk de Ark… dat wel, maar de grote revolutie is uitgebleven. Niet dat ik die had verwacht, verandering gaat traag, zo traag dat je het nauwelijks merkt. En dat is het gevaar, dat mensen teleurgesteld raken, omdat ze de verandering niet merken.

Maar goed, genoeg revolutionair geblaat nu, even geen stadslandbouw, tentjes en kraakpanden, laten we het over iets heel anders hebben. 2012 was natuurlijk ook het jaar van de Raspberry Pi. Een ARM computertje van zo’n $35. Toen dat ding uit kwam, het liep storm, die dingen verkochten beter als zoete broodjes. Ze konden de vraag gewoon niet aan. Mijn bloglezers zal het ongetwijfeld niet zijn ontgaan dat ik twee van zulke dingen bezit. Best geinige gingen. Ik ben van plan er eentje om te bouwen tot media center ding met satelliet ontvangst. Ik heb namelijk een Dreambox DM-7000S satelliet ontvanger. Aangezien een aantal zenders naar MPEG4 over is gestapt, kan ik deze zenders niet meer ontvangen. Vandaar dat ik een USB DVB-S2 ontvanger heb aangeschaft, die ik aan de Raspberry Pi wil hangen, en een kaartlezer voor mijn smartcard. Ik ben benieuwd wat dit gaat opleveren, al ben ik bang dat ik tegen de limieten van mijn eerste generatie Raspberry Pi ga aanlopen. Deze heeft slechts 256 MB RAM, waarvan de GPU, of beter gezegd, hardwarematige video decoder, 128 MB wil hebben. (Misschien dat een paar MB minder ook werkt, moet ik nog testen) Daarnaast wil ik hier ook een LCD schermpje aan hangen zodat de tv niet aan hoeft om muziek te luisteren.

En zo zijn er nog meer speelgoedjes, zo heb ik ook een CubieBoard aangeschaft, maar daar moet ik nog eens wat tijd voor maken. Dit is niet een “out-of-the-box-experience” zoals de Raspberry Pi. Hier moet nog wat meer voor gebeuren, en waarschijnlijk moet ik de VGA interface vanaf de pin header plukken. Hier moet ik nog eens een kabel voor verzinnen, aangezien een standaard kabeltje voor op pinheaders niet past. Hij is smaller en heeft kortere pinnetjes.

Naast mijn “ARMy” dat ik bouw, is er op deze server het afgelopen jaar ook een en ander gebeurd. Ik host tegenwoordig toch een aantal sites, en om die reden ga ik binnenkort de boel migreren naar een andere (opnieuw dedicated) server, om de boel eens wat overzichtelijker te regelen, en bovendien een einde te maken aan de overbelastingsproblemen die af en toe de kop op steken, maar die ik niet precies kan lokaliseren.

Weet je, ik ben met vanalles bezig, maar ik moet niet vergeten te studeren. Al is het maar voor dat domme vak Algebra… en ik moet ook nog iets aan Real Time Systems doen.. al heb ik het vak in principe al gehaald, ik moet nog (met een groep) een stukkie inleveren over een paar papers. Al krijg ik er 0 punten voor heb ik het vak nog gehaald, dus eigenlijk boeit dat niet echt. Het moet gewoon gebeuren, maar het heeft verder weinig gevolgen. Het is gewoon een vinkje.

Afin, genoeg geblaat, tijd om hier een einde aan te breien en jullie allemaal een gelukkig 2013 toe te wensen!
Iedereen een dikke *knuf*

OpenELEC XMBC

Today, I’ve returned to Eindhoven, where my Pi was waiting for me. Some more testing to do with my Raspberry. In the meantime, I’ve ordered licenses for hardware decoding of MPEG2 and VC-1. I need at least MPEG2 for DVD decoding and for my planned DVB experiments. VC-1 might be used on some BluRay discs… I don’t even have a drive or anything, but whatever, when I am ordering, let’s just order both, why not?

Well… let’s see… MPEG2 license installed. Let’s play a dvd!… or not… The DVD shows up just fine in XBMC, but when I want to play it, it prompts to insert a disc. What? I mean…. you see the damn disc, so why are you asking to insert a disc?!? Also, when I right click it and select play, it just freezes and I have to kill the task over ssh. No luck there…

XBMC has been indexing my movies and series just before I left to my family. So… let’s see how it performs on those. The results are mixed. Some files play perfectly, others have synchronisation issues, and others won’t play at all. Remember we’re hardware decoding. A wrong codec and it won’t play. Keep in mind, my collection of videos has been around on my hard disks for years, and may already have been old when I downloaded them. The problem is, some files are encoded using the DivX ;) 3.11 codec, which was a popular codec about a decade ago. It was a hacked version of the Microsoft MPEG-4 codec. The original Microsoft codec had a limitation so that it only could be used within an asf container. The hacked version removed this limitation. So far so good, but the problem is, Microsoft MPEG-4 is not compatible with ISO MPEG-4. Microsoft tends to invent their own standards, but, in my best “denglish”, that’s an old cow.

Well… the codec is not supported by the hardware. But… back in the days I bought this KISS DP-508 DVD/DivX player. It has hardware MPEG2/MPEG4 decoding, just like my Raspberry Pi does now, yet it supported playback of DivX 3, so Microsoft MPEG-4 content, which suggests it’s possible to patch Microsoft MPEG4 bitstream to ISO MPEG4 on the fly. I have been searching the internet for clues how to do this, but I haven’t been successful yet. So, I was like, it’s a linux based player, so some sources should be available, right? It appears Cisco owns KISS now, and the sources for the DP-508 don’t appear on their GPL page. Bummer! I haven’t been able to locate the source codes elsewhere yet. It might contain the code that performs this streampatching on the fly. Just a wild guess, it doesn’t have to be in there… And even if I find it, I must find a way to integrate it into XBMC.

Speaking about XBMC. I’m going to give OpenELEC a try. At first I was considering Raspbmc, but I’ve decided for OpenELEC, since it should support DVD playback and have the PVR stuff, so it should be more suitable for my needs. My ArchLinuxARM installation will be be used for the original purpose as a thin desktop. So, I needed another SDCARD. The 8 GB card which I had lying around already contained a RISCOS installation. I really should get some more cards, and perhaps another pi? Oh well… I should have another look at RISCOS. Anyhow… going to use that SDCARD. One thing I’ve noticed. RISCOS hangs on boot when the USB hard disk is connected. Apparently it doesn’t like Linux ext4 and swap partitions… or is it the PC-style partition table that’s causing the confusion. But the SD card also has a PC-style partition table, so I doubt that’s the problem. Anyhow, unplugging the disk and the system continues to boot. Backupping that sdcard and writing the OpenELEC image to it. Let’s see how it performs.

OpenELEC takes quite some time to boot, but well, it’s the first boot. Having to set the language to Dutch, and have a sensible 24 hours clock. AM/PM is just ugly as hell IMHO. Another thing, it actually shows the temperature. I suppose, on ArchLinuxARM I am supposed to install some kernel module to support it. But that’s just a minor detail I haven’t bothered to look after yet. Something more interesting, this build supports changing resolution on the fly, which XBMC on ArchLinuxARM did not.

Now, before I can test if it actually plays DVDs I still have to install the licenses to this image. I will also have to get it mount my NFS shares.

There is also an OpenELEC part in the XMBC configuration now. Nicely integrated. Per default, it appears to offer a SAMBA share. As none of my computers speaks SMB, I will disable it, and enable the SSH deamon. (Using different installations, thus different host keys, on the same machine… hmm… ) More interesting is the keyboard options. Does it mean on this XBMC I can actually type on the keyboard in stead of the on screen keyboard with alphabetic order layout. This appears indeed to be the case. The On Screen Keyboard is still in a silly alphabetical order layout.

But… once can notice this is a one-purpose distro. Just a media center. I mean… I don’t see an easy way to get a shell, except for over the ssh, for which it’s not even clear what login to use. I suppose it’s easier to use an my laptop to enter the license codes into the config.txt file. Looking at that config file, there are also licenses for DTS and DDP. (I’ve never heard of DDP anyways)

Anyways. Booting the Pi again, it seems to be able to play DVDs, even though it first appears to just mount the disc. I have to right click and select play dvd to make it work. Anyways it works… and I’ve already seen some DVB stuff in the interface…. so as soon as my DVB-T receiver arrives I can do some initial testing. If I am pleased with the DVB-T receiver, I will order a the real stuff, a DVB-S receiver and a cardreader. Anyhow…. mounting my other Pi over NFS, and scanning media again.

I have noticed I might need to make little changes to my files as some series/movies aren’t recognised correctly, at least so I’ve noticed on the Arch XBMC installation. Now I am scanning without the directory is movie name option, perhaps this gives better results.

Het is weer Kerstmis, mijn beste bloglezers, Kerstmis 2012. Ik wens iedereen veel geluk en liefde toe.

Veel geluk en liefde, in het bijzonder aan hun die het (en misschien vooral deze dagen) moeilijk hebben.

Ik heb al eerder mijn zorgen over onze samenleving. Onze individualistische samenleving. Een paar weken geleden, het was een donderdag, even na half twee, fietste ik over de kruisstraat. Ik had net wat boodschappen gedaan bij de EkoPlaza en was op weg naar de universiteit, want ik had die namiddag colleges. Toen zag ik een meisje op de stoep met een bord “Eenzaam, u ook?”. Het winkelend volk liep gewoon langs haar heen. Ik besloot haar aan te spreken, ondanks het feit dat ik weinig tijd had.

Eenzaamheid… hoeveel mensen zijn eenzaam? Misschien toch wel meer dan je zou denken. Eenzaam hoeft lang niet altijd te betekenen alleen te zijn. Wat ook in ons gesprek naar boven kwam, en iets wat ik zelf in het verleden ook ervaren heb, je kan in een zaal vol mensen zijn en toch eenzaam zijn.

Ik wens deze kerst, dat zij die eenzaam zijn een warm thuis mogen vinden, dat ze mensen mogen vinden die hun eenzaamheid wegneemt. Dat zij die in een duistere periode in hun leven verkeren een lichtpuntje mogen zien. Kerst is immers het feest van de terugkeer van het licht.

Let’s continue where I’ve stopped yesterday, with writing at least, as there is still some stuff I’ve done which I haven’t written down yet.
Well… let’s see, where was I… so I wrote about installing xfce4 and qmmp and so. Well, we’ve got qmmp, we’ve got the nfs on the server Pi mounted. So let’s play some music, shall we? Well…. no…. no audio device found. The reason for this is that the audio driver was not loaded. So adding snd-bcm2835 to the modules to be loaded solved that problem.

The audio driver is loaded, but still no sound. I am using the HDMI->VGA adaptor. The only HDMI->DVI cable I’ve got is 5 meters long and rather this, so this is a clumsy cable. Therefore I am using a short thing VGA cable with that adaptor. It’s rather inefficient to connect a digital (flat) monitor over an analogue interface, but whatever. The problem is, this HMDI to VGA adaptor does pass through the EDID information from the monitor, however, it falsely claims to support audio, therefore the Raspberry Pi attempts to send the audio over the HDMI interface. So we have to force the analogue output.

This can be done using the following command

amixer cset numid=3 1

Well.. I have sound, but, it’s only mono.

Simple mixer control 'PCM',0
Capabilities: pvolume pvolume-joined pswitch pswitch-joined
Playback channels: Mono
Limits: Playback -10239 - 400
Mono: Playback -1500 [82%] [-15.00dB] [on]

Speaker test gives

[andre@rpi ~]$ speaker-test

speaker-test 1.0.26

Playback device is default
Stream parameters are 48000Hz, S16_LE, 1 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 512 to 16384
Period size range from 512 to 16384
Using max buffer size 16384
Periods = 4
was set period_size = 4096
was set buffer_size = 16384
0 - Front Left
Time per period = 2,326930
0 - Front Left

On some forum. I’ve read a comment this may be caused by a bad cable, causing the Pi to detect only one of the speakers. I have tried headphones and my stereo tower, but still it says Mono. I cannot find where I’ve read this right now, but when searching I’ve found different answers to this problem. It seems this only means the mixer doesn’t support per channel volume control. Running speaker test telling it to use two speakers shows everything works as it should.


[andre@rpi ~]$ speaker-test -c 2

speaker-test 1.0.26

Playback device is default
Stream parameters are 48000Hz, S16_LE, 2 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 256 to 8192
Period size range from 256 to 8192
Using max buffer size 8192
Periods = 4
was set period_size = 2048
was set buffer_size = 8192
0 - Front Left
1 - Front Right
Time per period = 5,663562
0 - Front Left
1 - Front Right

Another thing I’ve tried is to connect a CRT monitor to my HDMI->VGA adaptor. After all, VGA is an analogue interface, and makes much more sense for a real analogue monitor. The system boots up correctly immediately. It doesn’t have the first boot out of sync problem with my flat monitor. The CRT monitor is a 17″ Philips 107G5. One thing to notice is it comes up at 1280×720 with a refresh rate of 60 Hz. This is the “HD 720p60” resolution, right? The reason for this is that the resolution/refresh rate is within the supported range, and as it is an analogue monitor, it doesn’t have a “preferred” resolution.

Using the method for resolution setting as discussed before, the correct resolution can be set

tvservice -e="DMT 19"
fbset -xres 1024 -yres 768 -a

or through the /boot/config.txt file

# Philips 107G5
disable_overscan=1
hdmi_group=2
hdmi_mode=19
hdmi_drive=1

But, this brings me to my CubieBoard. As I mentioned, my Compaq 1720 flat monitor doesn’t accept the output from my CubieBoard. As I’ve understood from forums, it outputs 720p60. So I’ve connected the HDMI->VGA adaptor to the CubieBoard again, and booted it without µSD card. Android boots, and indeed shows output on the screen. So, I’ve verified it’s graphical output is working. However booting on the µSD card gave no graphical output yet. As mentioned before, it’s a possibility the kernel I’m using doesn’t have the framebuffer enabled. Anyhow, the hardware is fine, it’s a software problem.

Another problem that arised is the CubieBoard to fall out halfway during boot. I am using my Phone’s charger (850 mA) to power the Raspberry Pi, but it seems it’s not strong enough to power the CubieBoard with the HDMI output enabled. The CubieBoard ran fine without graphical output enabled. As I am using a powered USB hub. (Even though its power supply is 1 A for 4 USB ports, which should be 500 mA per port, so at least 2 A + power needs for the hub itself). So, I wonder if this is even allowed according to the USB specs. However, I plugged in the CubieBoard’s power cable into that hub, which is also against the USB specifications, to draw power from the bus without any USB logic reporting the amount of energy being drained, and getting approved by the USB host. Besides missing the USB logic it is also drawing over 500 mA, another violation of the USB specifications. So… this is blatantly violating the USB specifications, it seems to work.

Another thing that’s blatantly violating specifications is the OpenMAX implementation on the Raspberry Pi. This is the cause an OpenMAX enabled VLC build doesn’t work on the Raspberry Pi. But it’s not only the Raspberry Pi’s library fault. Even though the problem on the VLC part is rather small, being the filename of the library, being hard-coded for various implementations of OpenMAX, not including the Raspberry Pi’s filename.

Well… as I’ve builded VLC anyways, from the source tarball, I’ll write about doing that as well. Usually software is built through a PKGBUILD patching all problems away. So we call the configure script with the “–enable-omxil” parameter. As it complains about missing gl package, I’m also adding “–disable-glx”, as I’m interested in the OpenMAX plugin.

[andre@rpi vlc-2.0.5]$ ./configure --enable-omxil --disable-glx

VLC depends on LUA version 5.1, and won’t compile with 5.2. Since the filenames for LUA 5.1 are postfixes with their filenames, making a synlink to the un-postfixed is required to make the ./configure script find lua.

Anyhow… this explains why the Raspberry Pi version of XBMC doesn’t use OpenMAX but some custom integrated component on the Raspberry Pi. Anyhow I’ve installed omxplayer, but as it just writes the movie to the framebuffer, but doesn’t erase the borders, it’s not really an option for watching movies on the Pi, at least, not without some additional tools. So, I’m currently building the mentioned XBMC.

Trying to build XBMC (from AUR) showed some other problems. Namely, the /tmp is by default a tmpfs. This is like a RAMdisk in the old DOS days, a part of memory used as a file system. But it’s way too small to build XBMC. Therefore I’m using the hard disk as /tmp.

/home/tmp /tmp none bind 0 0

And now…. I am just waiting for it to finish compiling….. which can take ages… so perhaps one of my next projects is setting up distcc to perform the compiling on a faster machine. NOTE TO SELF: Finish configuring the Raspberry Pi Server first!!! It still needs a sane server, IPv6 configuration, git server, web server!!!

Anyhow speaking about this Media Center software, I also have this DreamBox DM-7000S. It was still running PLi 2009-06-27. Even though nothing new shows up in the opdates, it seems they’ve changed to OpenPLI. So I’ve flashed a new image into my DreamBox. So…. my software is again up to date. Apart from that I’ve swapped the SCART cable with the DVD player, now the snow I was getting is gone. But on the DVD player there is no slow either. I suppose it was just a bad contact.

I have been looking around for a new DreamBox, even though I don’t have a HD-TV, and I am not planning to get one either. But the regional channels are MPEG-4 encoded and so won’t work with the DM-7000S. Well… my dish isn’t aligned correctly for 23.5E anyways so I won’t receive the regional channels anyways. So, a DM-8000 is interesting, I’ve been looking at this for years, but the price is keeping me back. € 875 is a little too much for just a satellite receiver. Ok, there are cheaper stores, but € 819 is still rather high. Ok, there are cheaper DreamBoxes, but I want one that can decode MPEG-4 and offers recording to hard disk. The DM 8000 offers the possibility to install tuner modules so we can receive, apart from DVB-S/DVB-S2 also DVB-T or DVB-C.

Well… since I was looking at this XBMC stuff…. what about turning a Raspberry Pi into a complete Media Center including DVB. Cheap DVB-T receivers are available at DX.com. They seem to offer only one USB DVB-S receiver, but at it mentions only DVB-S and not DVB-S2, it’s not capable to receive HD channels as they use a different modulation. Looking around on the internet found me this receiver.

When thinking about tuning a Raspberry Pi into a satellite receiver, we need to think about the fact all Dutch TV Channels are encrypted. *sigh* Why do they have to do this? Most German channels are FTA for example. Anyhow, on my DreamBox I am using the integrated card reader, as the MatrixCAM Reloaded and MatrixCAM Revolutions, which I used to use in the past, on this and other receivers, show incompatibility issues with the new Smart Cards supplied by CanalDigitaal and freezes regulary, requiring the CA to be powercycled. Using the integrated Smart Card reader and a softcam CCcam the Smart Card works without problems.

Well… CCcam… it’s a proprietary piece of software… so it’s not ideal. There is OScam, which is open source, but it appears not to be available in the OpenPLi DM7000 repository, and since CCcam works, I keep using it. Well… the point is. CCcam can be used as a Softcam for my Smart Card. So adding USB Smart Card Readerto the list of required components for turning the Pi into a satellite receiver. It seems there also exist a multi card version.

If it would be required in the future to use an official CanalDigitaal CAM, USB CASes (1) (2) are also available. Also note it’s possible to program the MatrixCAMs with this devices, however I haven’t been able to locate an update for this. (I’ve looked for this back then when CanalDigitaal shipped those new Smart Cards having the compatibility issues, looking for a bugfix for the freezing problem)

So… it seems all pieces required to do this are available. Will they work together on a Raspberry Pi. And if I obtain a MPEG2 license for the Pi. MPEG is a rather nasty codec due all this license shit, but that’s what all this DVB stuff uses, unfortunately. And Broadcom also has to pay license fees for offering hardware decoding. I don’t agree with all this having to buy a license to unlock a hardware feature, I can understand the reason behind it.

Anyhow, it should be possible, from hardware point of view. From software point of view, the DVB-S2 receiver mentions Linux support. I have no clue about the DVB-T receiver. Also, I don’t know how CCcam or OScam would integrate with XBMC. Well I don’t know anything about XBMC. Hmmm…. I am forgetting something about XBMC. It would also need a remote control, right? DX.com offers remote controls for PCs but are they compatible with XBMC? Well… do I have everything now I need? (Speaking about remote control…. I still can’t find my DVD players remote.)

I’m just wondering, what’s the status of BlueRay on Linux? Is plugging in a BlueRay drive to a Pi an option with XBMC. Well… my USB DVD drive will work given I have the MPEG2 license.