• 1(current)
  • 2
  • 3
  • 4
  • 5
  • 39
[LINUX] HOW-TO get Live TV with VDR working in XBMC for Linux
#1
Thumbs Up 
I recently discovered that alwinus created a magnificent patch for XBMC which allows watching live TV using the Video Disk Recorder project. While I'm sure the XBMC patch will soon find its way into SVN, here's a HOW-TO setup the whole thing from scratch. See my signature for H/W specs. I've tested the following on fresh installation of Ubuntu 8.10.

1. Get V4L working
First some things we'll during need the setup:
Code:
sudo apt-get install mercurial linux-headers-`uname -r` checkinstall libcap-dev gettext
sudo ln -s /usr/src/linux-headers-`uname -r` /usr/src/linux

Let's create a VDR user and check out and compile the Video4Linux sources. You probably don't need that if your DVB-Card is already working.
Code:
sudo useradd vdr -g video -d /home/vdr -s /bin/bash -m
sudo echo "vdr ALL=(ALL) ALL" >> /etc/sudoers
su - vdr
mkdir src
cd src
hg clone http://linuxtv.org/hg/v4l-dvb
cd v4l-dvb
make
sudo make install
sudo reboot

After rebooting, your DVB card should be visible as /dev/dvb/adapter0. If that's not the case, check dmesg for any messages:
Code:
dmesg | grep -i dvb
[   12.331793] dvb-usb: found a 'Hauppauge Nova-T 500 Dual DVB-T' in warm state.
[   12.331820] dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer.
[   13.147492] DVB: registering new adapter (Hauppauge Nova-T 500 Dual DVB-T)
[   13.153323] DVB: registering adapter 0 frontend 0 (DiBcom 3000MC/P)...
[   13.749432] input: IR-receiver inside an USB DVB receiver as /devices/pci0000:00/0000:00:1e.0/0000:04:01.2/usb11/11-1/input/input8
[   13.770039] dvb-usb: schedule remote query interval to 50 msecs.
[   13.770042] dvb-usb: Hauppauge Nova-T 500 Dual DVB-T successfully initialized and connected.
[   13.770266] usbcore: registered new interface driver dvb_usb_dib0700
Also, check the V4L Wiki for any firmware updates you may need for your DVB card.

2. FFmpeg and Xinelib
VDR was built for so-called full-featured DVB cards, which not only demodulate the TV signal but also decode the transport stream. I'm using a budget card which doesn't do any decoding at all, so we have let the CPU do it. For testing VDR without XBMC already, this is done by a plugin called xineliboutput, which uses the Xine libary and ffmpeg to render the video. So here's how to setup ffmpeg and xine. In order to compile Xine-lib, we need the latest ffmpeg from SVN, the Ubuntu package won't work for some reason.
Code:
sudo apt-get purge ffmpeg libavutil49 libavcodec51 libavdevice52 libavformat52 x264 libx264-dev libavcodec-dev
sudo apt-get install git-core yasm texi2html libtheora-dev libxvidcore4-dev libcdio-dev libvcdinfo-dev libfaad-dev
su - vdr
cd src
git clone git://git.videolan.org/x264.git
cd x264
./configure --enable-shared
make
sudo checkinstall --fstrans=no --install=yes --pkgname=x264 --pkgversion "1:0.svn`date +%Y%m%d`-0.0ubuntu1"
cd ..
sudo apt-get install libfaac-dev libmp3lame-dev libtheora-dev libvorbis-dev libxvidcore4-dev
svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
cd ffmpeg
./configure --enable-shared --enable-gpl --enable-postproc --enable-libmp3lame --enable-libvorbis --enable-pthreads --enable-swscale --enable-libx264 --enable-libtheora --enable-libfaac --enable-libfaad --enable-libxvid
make
sudo checkinstall --fstrans=no --install=yes --pkgname=ffmpeg --pkgversion "3:1.svn`date +%Y%m%d`-12ubuntu3"
sudo ldconfig
Now ffmpeg is the latest version, compile the Xine library:
Code:
sudo apt-get purge libxine-dev
sudo apt-get install libpng12-dev zlib1g-dev libfreetype6-dev libslang2-dev
cd ~/src
wget http://www8.mplayerhq.hu/MPlayer/releases/codecs/essential-20071007.tar.bz2
tar xivf essential-20071007.tar.bz2
sudo mv essential-20071007 /usr/local/lib/win32
sudo ln -s /usr/local/lib/win32 /usr/local/lib/codecs
hg clone http://hg.debian.org/hg/xine-lib/xine-lib-1.2
cd xine-lib-1.2
./autogen.sh --with-external-ffmpeg --disable-dxr3 --enable-w32dll --with-w32-path=/usr/local/lib/win32
make
sudo checkinstall --fstrans=no --install=yes --pkgname=libxine2-dev --pkgversion "1.2.svn`date +%Y%m%d`-12ubuntu3"
sudo ldconfig

3. Install VDR 1.7.4
Now we have a the necessary libraries, let's setup VDR.
Code:
> sudo apt-get install liba52-0.7.4-dev libasound2-dev libfontconfig1-dev
su - vdr
cd ~/src
wget ftp://ftp.cadsoft.de/pub/people/kls/vdr/Developer/vdr-1.7.4.tar.bz2
tar xivf vdr-1.7.4.tar.bz2
ln -s vdr-1.7.4 vdr
wget http://trac.xbmc.org/raw-attachment/ticket/5595/vdr-1.7.4-ext68-streamdev.patch
wget http://www.zulu-entertainment.de/files/patches/VDR-Extensions-Patch-68.tar.bz2
tar xivf VDR-Extensions-Patch-68.tar.bz2
cd vdr
patch -p1 < ../VDR-Extensions-Patch-68/vdr-1.7.4_extensions.diff
patch -p1 < ../vdr-1.7.4-ext68-streamdev.patch
patch -p1 < ../VDR-Extensions-Patch-68/extras/vdr-1.6.0-2-ext_parentalrating-content.diff
sudo cp /usr/src/linux-headers-`uname -r`/include/linux/compiler.h /home/vdr/src/v4l-dvb/linux/include/linux/compiler.h
cp Make.config.template Make.config
Now open Make.config and change these lines:
Code:
DVBDIR   = /home/vdr/src/v4l-dvb/linux
LOCDIR   = /usr/share/locale
PLUGINDIR = ./PLUGINS
PLUGINLIBDIR = /usr/lib/vdr/plugins
VDRSCRIPTDIR = /usr/lib/vdr/scripts
VIDEODIR = /media/video
CONFDIR  = /etc/vdr/

PARENTALRATING = 1
STREAMDEVEXT = 1

Create the folders, and compile VDR:
Code:
sudo mkdir /media/video
sudo mkdir -p /usr/lib/vdr/plugins
sudo mkdir -p /usr/lib/vdr/scripts
sudo mkdir -p /etc/vdr/plugins
make
make plugins
sudo checkinstall --fstrans=no --install=yes --pkgname=vdr --pkgversion "1.7.4-5ubuntu2-0"
sudo cp -a svdrpsend.pl /usr/bin
sudo cp *.conf /etc/vdr/

For testing VDR "standalone", compile the xineliboutput plugin mentioned above:
Code:
sudo apt-get install libextractor-dev
cd /home/vdr/src/vdr/PLUGINS/src
wget http://heanet.dl.sourceforge.net/sourceforge/xineliboutput/vdr-xineliboutput-1.0.3.tar.bz2
tar xivf vdr-xineliboutput-1.0.3.tar.bz2
mv xineliboutput-1.0.3 xineliboutput
cd xineliboutput
make
sudo checkinstall --fstrans=no --install=yes --pkgname=vdr-plugin-xineliboutput --pkgversion "1.0.3-0"
sudo mkdir -p /etc/vdr/plugins/xineliboutput
sudo cp *.mpg /etc/vdr/plugins/xineliboutput/
cd ../../../
make plugins
The streamdev plugin is pretty important if you want to stream to XBMC:
Code:
cd /home/vdr/src/vdr/PLUGINS/src
cvs -d:pserver:[email protected]:/var/cvsroot login
cvs -d:pserver:[email protected]:/var/cvsroot co -D 4/22/09 streamdev
wget http://trac.xbmc.org/raw-attachment/ticket/5595/streamdev-cvs220409_xbmc-v6.patch
patch -p0 < streamdev-cvs220409_xbmc-v6.patch
sudo mkdir -p /etc/vdr/plugins/streamdev
sudo cp streamdev/streamdev/streamdevhosts.conf /etc/vdr/plugins/streamdev
sudo cp streamdev/streamdev/streamdevhosts.conf /etc/vdr/vdrsvdrphosts.conf
cd ../../
make plugins

If everything compiled OK, you can finally reinstall VDR with the plugins:
Code:
sudo apt-get purge vdr
sudo sudo checkinstall --fstrans=no --install=yes --pkgname=vdr --pkgversion "1.7.4-5ubuntu2-1"

4. Find channels on your network
Now you need to create a valid channels.conf file so VDR knows how to tune to your channels. This can be done with (dvb)scan, however you'll need a transponder file first, so we're using w_scan to generate it.
Code:
cd ~/src
wget http://wirbel.htpc-forum.de/w_scan/w_scan-20081106.tar.bz2
tar xivf w_scan-20081106.tar.bz2
cd w_scan-20081106
make
sudo cp w_scan /usr/local/bin
See w_scan -h for options, ie if you're not using a DVB-T card; cable and satellite have other options. We now generate a transponder file and then a channels.conf for VDR:
Code:
sudo apt-get install dvb-utils dvbstream dvbsnoop
mkdir ~/.tzap
w_scan -a 0 -x > ~/.tzap/<your-country-code>-<your-cable-provider>-<your-city>
scan -a 0 ~/.tzap/<your-country-code>-<your-cable-provider>-<your-city> -o vdr > ~/.tzap/vdr-channels.conf
sudo cp ~/.tzap/vdr-channels.conf /etc/vdr/channels.conf

5. Start VDR
Open /usr/local/bin/runvdr and update it to the following:
Code:
VDRPRG="/usr/local/bin/vdr"
VDRCMD="$VDRPRG -c /etc/vdr -E /var/vdr -l 3 \
        -P streamdev-server \
        -P'xineliboutput -l none -r 37890 -p' \
        -u root \
        $*"
and add "return 0" to the LoadDriver() and UnloadDriver() functions. Oh, and change first line to bash instead of sh. Then try running it from the console:
Code:
sudo runvdr
and in another console (not via remote shell but while running X):
Code:
vdr-sxfe --video=xv
Now you should see a TV channel through the Xine library (you may need to update /etc/vdrsvdrphosts.conf with the correct IPs).

6.Compile XBMC
Now to the fun part.
Code:
svn co http://xbmc.svn.sourceforge.net/svnroot/xbmc/branches/pvr-testing/XBMC
cd XBMC
Read README.linux and apt-get the necessary packages. Then, as usual:
Code:
./configure --enable-vdpau
make -j2
sudo checkinstall --fstrans=no --install=yes --pkgname=xbmc --pkgversion "svn<put-revision-in-here>19616-vdr-testing"
xbmc

Select the PVR addon under Settings -> Video -> TV -> Manage Clients. This opens a addon browser where you add the VDR client. You now have an additional "TV" entry in PM3.HD, which lets you watch Live TV and much more. Have fun and thanks again to alwinus for this great patch!
Running XBMC on my HTPC, tablet, phone and pinball machine.
Always read the XBMC online-manual, FAQ and search the forums before posting. Do NOT e-mail Team-XBMC members asking for support. For troubleshooting and bug reporting, make sure you read this first.
Reply
#2
Continueing here due to character limitations per post.

A Update from patched r17591 to patched r17664
If you've had already applied an older patch and like to upgrade to the new one, here are the instructions:
Code:
cd linuxport
wget http://trac.xbmc.org/raw-attachment/ticket/5595/xbmc-svn17794-pvr.patch.gz
gunzip xbmc-svn17794-pvr.patch.gz
cd XBMC
patch -p1 -R < ../xbmc-svn17664-pvr.patch
svn update -r 17794
patch -p1 < ../xbmc-svn17794-pvr.patch
rm ~/.xbmc/userdata/Database/MyTV1.db
Then you're good for the usual ./configure and make. Also make sure you added the last two lines in Make.config of step 4, I just recently added those.

B Update from patched r17664 to patched r18100
Idem for the latest patch to r18100:
Code:
cd linuxport
wget http://www.xbmc.org/trac/raw-attachment/ticket/5595/xbmc-svn18100-pvr.patch.gz
gunzip xbmc-svn18100-pvr.patch.gz
cd XBMC
make clean
patch -p1 -R < ../xbmc-svn17794-pvr.patch
svn update -r 18100
patch -p1 < ../xbmc-svn18100-pvr.patch
rm ~/.xbmc/userdata/Database/MyTV1.db
make -j2

C Update from patched r18100 to patched r19232
I suggest you reapply the patches from scratch. Reverse-patching the old ones got me quite some trouble.
VDR 1.7.4:
Code:
su - vdr
cd ~/src
wget http://trac.xbmc.org/raw-attachment/ticket/5595/vdr-1.7.4-ext68-streamdev.patch
wget http://www.zulu-entertainment.de/page/klick.php?d=VDR+Extensions+Patch
tar xivf VDR-Extensions-Patch-68.tar.bz2
rm vdr-1.7.4 -r
tar xivf vdr-1.7.4.tar.bz2
cd vdr
patch -p1 < ../VDR-Extensions-Patch-68/vdr-1.7.4_extensions.diff
patch -p1 < ../vdr-1.7.4-ext68-streamdev.patch
patch -p1 < ../VDR-Extensions-Patch-68/extras/vdr-1.6.0-2-ext_parentalrating-content.diff
cp Make.config.template Make.config
Open Make.config and change these lines:
Code:
DVBDIR   = /home/vdr/src/v4l-dvb/linux
LOCDIR   = /usr/share/locale
PLUGINDIR = ./PLUGINS
PLUGINLIBDIR = /usr/lib/vdr/plugins
VDRSCRIPTDIR = /usr/lib/vdr/scripts
VIDEODIR = /media/video
CONFDIR  = /etc/vdr/

PARENTALRATING = 1
STREAMDEVEXT = 1
Streamdev:
Code:
cd ~/src/vdr/PLUGINS/src/
cvs -d:pserver:[email protected]:/var/cvsroot co -D 4/4/09 streamdev
wget http://trac.xbmc.org/raw-attachment/ticket/5595/streamdev-cvs040409_xbmc-v5.patch
patch -p0 < streamdev-cvs040409_xbmc-v5.patch
cd ../../
make
make plugins
sudo apt-get purge vdr
sudo checkinstall --fstrans=no --install=yes --pkgname=vdr --pkgversion "1.7.4-5ubuntu2-2"

XBMC:
Code:
cd linuxport
wget http://trac.xbmc.org/raw-attachment/ticket/5595/xbmc-svn19232-pvr.patch.gz
gunzip xbmc-svn19232-pvr.patch.gz
cd XBMC
make clean
patch -p1 -R < ../xbmc-svn18100-pvr.patch
svn update -r 19232
patch -p1 < ../xbmc-svn19232-pvr.patch
rm ~/.xbmc/userdata/Database/MyTV1.db
./configure --enable-vdpau
make -j2

D Update from patched r19232 to patched 19616
Streamdev:
Code:
su - vdr
cd ~/src/vdr/PLUGINS/src/
rm -rf streamdev
cvs -d:pserver:[email protected]:/var/cvsroot co -D 4/22/09 streamdev
wget http://xbmc.org/raw-attachment/ticket/5595/streamdev-cvs220409_xbmc-v6.patch
patch -p0 < streamdev-cvs220409_xbmc-v6.patch
cd ~/src/vdr
make plugins
sudo apt-get purge vdr
sudo checkinstall --fstrans=no --install=yes --pkgname=vdr --pkgversion "1.7.4-5ubuntu2-3"
XBMC:
Code:
cd linuxport
wget http://xbmc.org/raw-attachment/ticket/5595/xbmc-svn19616-pvr.patch.gz
gunzip xbmc-svn19616-pvr.patch.gz
cd XBMC
make clean
patch -p1 -R < ../xbmc-svn19232-pvr.patch
svn update -r 19616
patch -p1 < ../xbmc-svn19616-pvr.patch
rm ~/.xbmc/userdata/Database/MyTV1.db
./configure --enable-vdpau
make -j2

E 2000-06-10: Use the new pvr-testing branch
XBMC changes have gone upstream to a new branch. You don't have you patch XBMC each time but use directly the branch:
Code:
svn checkout http://xbmc.svn.sourceforge.net/svnroot/xbmc/branches/pvr-testing/XBMC
No changes concerning streamdev and VDR, both still need to be patched, see above.

Oh, and here are the screenshots (kudos to alwin):

Image Image Image Image Image
Running XBMC on my HTPC, tablet, phone and pinball machine.
Always read the XBMC online-manual, FAQ and search the forums before posting. Do NOT e-mail Team-XBMC members asking for support. For troubleshooting and bug reporting, make sure you read this first.
Reply
#3
wonderful!

(please delete my post if it is deemed unacceptable)

any idea if this will work for DVB-s (FTA satellite)?
Reply
#4
I'm by all means no VDR expert, but I suppose as soon as VDR works with your DVB-S card, you're set with XBMC as well. VDR-Wiki and VDR-Portal are great resources.
Running XBMC on my HTPC, tablet, phone and pinball machine.
Always read the XBMC online-manual, FAQ and search the forums before posting. Do NOT e-mail Team-XBMC members asking for support. For troubleshooting and bug reporting, make sure you read this first.
Reply
#5
There is work being done to integrate VDPAU into XBMC:

http://www.xbmc.org/forum/showthread.php...62&page=22

Any idea how this interacts with the XBMC+VDR project discussed in this thread? VDR already utilizes vdpau with a xine plugin...I'm a little confused as to the flow of data and what app+hardware decodes what.

VDR is the ultimate 'live tv' application, and XBMC is the ultimate media center...getting them to work together with both using a cheap video solution & vdpau is the holy grail imo.
Reply
#6
Sorry, but what if im not using V4L ... as far as i understand, my Nexus-S card does not require those to work.

I guess my question is, what are the steps to compile this without V4L?

thanks.. i really want to try this, since for the last 5 days now (and over 10 reformats) i finally got myth to work and i dont like how it looks.
Reply
#7
@philter:
VDR uses xine for vdapu decoding - the xbmc implementation uses streamdev-server and probably just passes on the undecoded stream to XBMC, so any hd decoding has to be done xbmc side I would say.

@megacrypto:
Your Nexus should work out of the box with a not even so recent kernel but you might need a newer version if you want to use the VDR 1.7 developer releases (although I don't know why you would - it's under heavy development and primarily intended for HDTV). As long as the needed plugins (should actually only be streamdev with the xbmc patch) work with an older vdr version there shouldn't be that much work involved.

At anybody who knows: what does the streamdev patch exactly do ? Is it needed for playback of recordings ? If not, is it essential ? I have a pretty old vdr version running on a settop box and don't really want to do any patching on that machine and recompiling - and I don't need direct access to recordings.
Reply
#8
sorry, but what if my vdr is running on a different machine? what port do i use? 3000?
Reply
#9
Streamdev-server is designed for that so that probably shouldn't be a problem. Haven't had a look at xbmc's implementation, but I would guess it is not limited to localhost.
Reply
#10
i got the XBMC part compiled ok.. and now i have the TV section, a few questions i have:
1. in the setup of it under settings / video .. i can select between vdr or myth.. so can i use either of them?
2. in the guide above, the way that sasc is compiled it somehow recompiles the kernel? now i can not find my dbvloopback that was running with myth? (sorry .. this does not belong here.. i compiled vdr from another post)


im still testing, but im no expert and i keep trying things from here and there and this is not a very wise idea to achieve any stable results .. but this is a very nice step forward for xbmc
Reply
#11
Hi, to all! This is my first post, but had to register and congratulate the author of the guide and specially the author of the xbmc + vdr integration.

That said, let's comment some things.

@chene
Yes, it works with DVB-S/S2. It all depends on your hardware.

@megacrypto
You're already using V4L-DVB. The Only difference is that it's already upstream (V4L-DVB API 3) and the newest as of 2.6.28 is V4L-DVB API 5 (S2API) that supports DVB-S2 and others. Think of it - the new API, that is - as an extension to the old API, allowing for more devices to be recognised and working out-of-the-box. The same happened with your Nexus-S. 2.6.29 already was support for most S2 capable devices.

@philter
vdr works with xine-vdpau + vdr-xine 0.9.0 or xineliboutput 1.0.3 or xineliboutput cvs.

I've been following that topic on xbmc vdpau integration and it rocks. After vdr integration, it's the second best news this year about xbmc. Finally a perfect media-center.

@hotzenpl0tz
streamdev stands for streaming device. It's a vdr plugin for streaming over a network (or locally). It's kind off the same concept as mythTV backend -> frontend.
Reply
#12
when i go into tv, xbmc crashes: there is where the log stops:
Code:
01:22:41 T:3067873072 M:323448832   DEBUG: CGUIMediaWindow::GetDirectory (?)
01:22:41 T:3067873072 M:323448832   DEBUG:   ParentPath = []
01:22:41 T:3067873072 M:323448832   ERROR: GetDirectory - Error getting ?
01:22:41 T:3067873072 M:323448832   ERROR: CGUIMediaWindow::GetDirectory(?) failed
01:22:41 T:3067873072 M:326717440 WARNING: Cleanup: Having to cleanup texture pointer-nofocus.png


ok.. got vdr running on my xbmc box (which is a different box than that running vdr ... i will put the settings i used as soon as the xbmc box unfreezes Smile


on the xbmc machine [ip 192.168.1.4] in TV settings:

Code:
Enabled                                    True
Enable TV Service                       VDR
Username                                  vdr
Password                                  xxxxxx
Server address                          192.168.1.5
Port                                         2004
Connect timeout                        4
Command timeout                      5

in the vdr machine [ip 192.168.1.5] under Menu/Setup/Plugins/streamdev-server:
Code:
--common settings--
Max no of clients                     5
Suspend behaviour                  Offer suspend
Client may suspend                 yes
--VDR-to-VDR Server ---
Start VDR-to-VDR Server         yes
VDR-to-VDR Server Port          2004
Bind to IP                             192.168.1.5
--HTTP Server----
Start HTTP Server                  yes
HTTP Server Port                   3000
HTTP Streamtype                   PES
Bind to IP                             192.168.1.5


now, my vdr is running on a channel, which i can watch on my xbmc box, but when i try to change to a different channel from the xbmc box .. it freezes ? what am i missing?
Reply
#13
I actually didn't have to put anything under user/password in XBMC's TV settings to make it work.
Running XBMC on my HTPC, tablet, phone and pinball machine.
Always read the XBMC online-manual, FAQ and search the forums before posting. Do NOT e-mail Team-XBMC members asking for support. For troubleshooting and bug reporting, make sure you read this first.
Reply
#14
megacrypto Wrote:now, my vdr is running on a channel, which i can watch on my xbmc box, but when i try to change to a different channel from the xbmc box .. it freezes ? what am i missing?


Have you only one DVB Card? If yes it is possible the other channels are blocked, can you try VDR with the dummydevice plugin http://phivdr.dyndns.org/vdr/vdr-dummyde...-1.0.2.tgz and switch inside VDR under Settings->DVB->Frontend to another one.

For the MythTV selection inside settings, it is not programmed now and without function.


Best regards,

Alwin
Reply
#15
Hi,
I am new to the forum and congrats for this jobs (integretion + HowTo)

@megacrypto
for your probleme of freeze, in your VDR streamdev.plugins settings, change:
Suspend behaviour Offer suspend
to Always

it should fix your problem Wink

[EDIT]
else you could only tune to a channel in the same transponder of the one selected in the VDR server if you have enable concurent decoding in your sc config


and good luck
Reply
  • 1(current)
  • 2
  • 3
  • 4
  • 5
  • 39

Logout Mark Read Team Forum Stats Members Help
[LINUX] HOW-TO get Live TV with VDR working in XBMC for Linux14