XBMC on Karmic with VDPAU and VDR

If I read the title “XBMC on Karmic with VDPAU and VDR“, then I think not many people out there, beside the experts, understand what this is all about. It’s about a good looking Media Center for Linux, which can handle HD content from your camcorder or HDTV streams from cable or satellite. Read here about the available PPA repositories, the differences between them and how to set this whole thing up, without loosing the overview.

First I like to give a short introduction of the terms in the headline.

VDRVideo Disk Recorder. This application turns your PC into a extreme versatile satellite receiver, and you can watch TV.

Term Explanation
XBMC A very good looking Open Source Media Center for Windows, MacOS and Linux. It’s free software, everybody is allowed to use it, without any charge
Karmic Karmic Koala alias Ubuntu 9.10, is the new Linux Ubuntu version coming at the end of October 2009. It’s also completely free Operating System based on Debian/Linux.
VDPAU As of September 2008, a hardware acceleration support for playback of H.264 content (HDTV) is available for Linux, called VDPAU. You need a Nvidia graphics card >= GeForce 8200. Without such a card, playback of HD content is only possible with extreme fast hardware (Intel i7 or similar).

Why do I explain this?

Well – my colleague at the office ask me once in a while stuff about Linux, and in the recent past, I’ve been asked about XBMC a few times. Most of the guys at the office aren’t that much into Linux or Media Centers actually, but the awesome look of XBMC caught their attention, and they begin to ask questions. They want to know, if they are smart enough to install and run this application. And I answer always (what else should I answer), that they surely are. The only thing, that is a bit difficult at the beginning is the confusion regarding the different sources and versions.

So we first have to sort out thing a bit. At first place it’s important to know what do you exactly expect from a Media Center, beside a good look. My definition of a state of the art Media Center is told quickly. It should handle all my media, even if it is HD content from my AVCHD camcorder (H.264/1080p) and display my satellite’s HDTV channels, too. And does XBMC, and the components mentioned above do this for me? Yes – they do, although most of them aren’t stable yet, but this is only a matter of time.

If you like to use XBMC without HD support, than you are in a lucky position, because these XBMC versions are stable (bold statement). All you need, is one of these Ubuntu versions:

Stable XBMC versions (without h/w HD support)

 

 

 

They all do have in common, that they’ve been built without HD support (“–enable-vdpau”). There is no stable Karmic Koala version right now (the time you read this, it’s likely already there, just check out the link). Subversion (SVN) development versions with HD support are available here for:

Experimental XBMC versions (with VDPAU)

 

 

 

Ok, we’ve covered the topics XBMC stable and experimental versions, respectively with and without HD support. But even with the experimental SVN versions you aren’t able to watch HDTV with your XBMC installation, because you won’t see any “TV” button or something.

XBMC and HDTV
Here, it’s going to be completely hairy. Either you read here [1] and here [2] on over together more than 100 pages of forum posts, or you just use also two or three PPA repositories. The idea is to install an experimental VDR, which can handle H.264 mpeg transport streams from your cable or satellite card, what is usually know as HDTV, and an also experimental XBMC, which punch through the HDTV live signal – in other words – acts as your TV front-end.
The heros, who made this available in a PPA repository, are Hotzenplotz5 (VDR) and Henning Pingel (XBMC). The latter mentioned has a very nice and useful site [3], where the repositories in question are monitored. These PPA repositories are:

Experimental VDR with VDPAU

Which of both to use, as I can see, is a matter of the xine-lib version. The VDR Team uses the original Reinhard Nissl libxine patches for libxine2 whereas the Hotzenplotz5 repo uses the old libxine with backported patches.
And if I recall it correctly, xinelib 1.2 provides multithreading support for playing back H.264 content on decent hardware without VDPAU (Nvidia’s hardware acceleration). Try this, if you don’t have the possibility to use a Nvidia graphics adapter, or Nvidia card lower than 8200. Of course it makes only sense if you do have a multi-core CPU.

For VDPAU support use the Hotzenplotz5 repos.

What you definitely need, is the

VDR configuration

  • vdr-plugin-streamdev-server

on the machine where your VDR is running. Be sure to allow remote access to your VDR by editing these two config files:

  • /var/lib/vdr/plugins/streamdev/streamdevhosts.conf
  • /var/lib/vdr/svdrphosts.conf

For the experimental XBMC repository is actually one source available, so we do not have much of a choice.

Experimental XBMC for VDR as a PVR backend

The VDR VDPAU installation is described here [4]. The installation of the XBMC-PVR version isn’t very though. Just add the above mentioned PPA into your Karmic package manager, or add it manually into your /etc/apt/sources.list. And perform on the command line:

aptitude update
aptitude install xbmc

The Nvidia driver should be already installed in the step where you do your VDR-VDPAU installation. If you messed around with other PPA repos as well, than watch out, and pay attention to the correct path to your xbmc binary on your hard disk. Some repos install XBMC into /usr/bin some into /usr/local/bin. I ran into this trap, and it took me an hour to realize, that not my XBMC-PVR installation war buggy, but I was permanently invoking the wrong (old) binary lying in /usr/local/bin/xbmc.
If your VDR is up and running, you can turn on the TV support in XBMC now. Go to

XBMC configuration

  • Enabling the TV function
    • Settings -> Network ->TV -> Manage clients
    • select the VDR plugin and hit OK, now
    • Hit Enable

    After this action, you should see in your main menu a TV menu at the very top.

  • Remote control setup
    If you are using Lirc, then you may try to control XBMC with your remote also. The remote control setup isn’t straight forward, but not difficult either.
    Setting up Lirc isn’t part of this article. I’m targeting here at the connection between Lirc and XBMC. There are three config files you have to work with.

    • /etc/lirc/lircd.conf (1)
    • ~/.xbmc/userdata/Lircmap.xml (2)
    • ~/.xbmc/userdata/Keymap.xml (3)

    The dependencies between these three files are explained best by an diagram:
    xbmc-lirc-remote-action-mapping
    You have to create/adjust the Lircmap.xml and Keymap.xml in ~/.xbmc/userdata accordingly. Look up here [4] for Lircmap.xml all available buttons under Remote Buttons and for Keymap.xml look under Available Actions.

  • If something’s not right, turn on debugging. You can do this by going into Settings -> System -> Debug. Not only you’ll get an overlay display in the upper region of your screen, a log file is also written into your ~.xbmc folder. Look out there for xbmc.log.
  • In my case I had to select for Render Method the item VDPAU. The Auto detect mechanism seems not to detect my VDPAU driver and my power consumption on my Athlon AMD 5050e (with two Skystar HD DVB-S2 cards) went up to 98 Watt, with VDPAU enabled my systems consumes while playback of an H.264 stream 76 Watt. Turning off playback does not reflect a change of a single Watt. After closing XBMC my system needs still 66 Watt. Shutting down VDR my system needs 60 Watt and unloading the DVB-S2 drivers (budget_ci, bugget_core) it only consumes 55 Watt. Here the result in a list:
    Consumption in Watt System Condition
    ~98 – 105 VDR + XBMC running. Playing back an H.264 recording. Auto detect as the default preselection is set
    ~76 VDR + XBMC running. Playing back an H.264 recording. VDPAU was set manually
    ~76 VDR + XBMC running. Idle
    ~66 VDR is running, XBMC was turned off
    ~60 VDR turned off
    ~55 with unloaded DVB-S2 drivers (budget_ci, budget_core)

    The mainboard is a K10N78FullHD-hSL R3.0 with six SATA hard disk drives. In sum approx. with 7.5 TB, all sleeping, except the 2.5″ root partition disk ( /dev/sda ) – ( hdparm -y /dev/sd[b-g] was invoked before the tests ). The system is acting as a server also, and is equipped with 8 GB memory, running two VMware machines, also while these tests were performed.

    Conclusions
    It takes a while to see through the jungle of all these PPA’s, even if it is accumulated on one site like this one. And even when you manage to make it all work, it’s not a guarantee it’s going to work all flawlessly. In my case, XBMC refused a few time to start at all. I had to delete the ~/.xbmc folder completely.

    Almost all PPA packages mentioned in this article, are experimental, and therefore once in a while they also like to crash. Especially the half baked punched through TV functionality in the XBMC-PVR version is very nice to look at, but hard to handle. The time for a channel switch hardly gets a ‘fair enough’.
    I haven’t seen any jump mark management. So if your VDR’s channels.conf is properly divided into logical units, like Music, News, Sports, Pay TV, etc, then you won’t be able to use them. It’s due to VDR’s streamdev-server plugin, which XBMC connects against, and its limited service it provides (usually over http://localhost:3000). [UPDATE]It’s been told here (German), that it’s possible to group and use jump marks. Did not tried it yet myself, but will do and report on that.[/UPDATE]

    I didn’t manage to provide channel logos in a appropriate time either, and quit after a few minutes of trying [UPDATE]provide .png files with the same name like the channel. And set it up in TV module under Settings[/UPDATE].

    My conclusion is: It look all very very eye-candy, and me, as the theme designer of the My Media System project really admire the work, these guys accomplished, regarding the theming and look. But – as mentioned before – it’s not stable, and will take a while to mature. It’s not ready to be used in the living-room. No – it’s not ready for productive use – not yet.

    Alternatives
    Using the TV functionality form inside XBMC, looks good on the one hand, on the other it hardly usable. You can workaround it by using either

      • vdr-plugin-xine with xine

    or

    • vdr-plugin-xineliboutput with vdr-sxfe

    .

    But this isn’t a straight forward solution, since you need to switch between these two applications, and you should be experienced to accomplish this task. Search the Internet for such a solution.
    Or if you like a rock stable Media Center for Linux, which uses default components like mplayer, xine and VDR, which are already capable to handle HD content via hardware acceleration – try

    I do it for years now, and guess will stick to it a bit longer.

7 thoughts on “XBMC on Karmic with VDPAU and VDR

  1. When you say, “…using VDR from within XBMC is hardly usable” what did u mean? Is it unstable? missing features? etc?

    The reason i’m asking, is coz i’m wanting to do a similar setup, but i don’t need VDPAU or HDTV, my stuff is basicly SD and my box has a decent CPU, my main desire is for my wife & kids to watch TV and use the rest of XBMC for other media too.. I like myth but its just not easy for my family to simply plugin external media (usb sticks, cameras, memory cards..) and view the content easily. Thus i’m rather excited about this! i take it xbmc-vdr branched has been merged into trunck.

    Exciting times indeed!

  2. @Sam
    it’s a bit difficult to explain, regarding the “hardly usable”. In the first place I’m talking about HDTV and VDR. If you are used to use VDR, then the punched through VDR isn’t the real deal, but it’s rather a matter of feeling, than any hard facts. In general, the channel switch time using HDTV is much longer, in both systems.
    Maybe it’s the usability aspect, because the navigation is different, and your channel groups work differently, too.
    I’ve been told, some people switch between these two application, by some self made scripts, in order not being forced to use the VDR feature from inside XBMC. This sounds like a reasonable solution, because a similar, although a bit more sophisticated, but more or less the same approach we do use in MyMediaSystem, too.

    Actually I can’t say, whether you can expect your family to accept the XBMC solution. I’ve tried it with my fam for two days, and they didn’t like it.

    Guess it’s also a matter of taste.

  3. Excellent how-to — you’ve summarized everything I needed to get XBMC+VDR running on Ubuntu Karmic. Good job — thanks a bunch.

  4. currently in trunk keymap.xnl is depreceated
    need to use keyboard.xml (according wiki)

Comments are closed.