Tag Archive: xbmc


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.

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

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.