Sidux VDR DVB-S2
Inhaltsverzeichnis |
Description
This install proces will show you how to install vdr and dvb-s2 drivers from source on sidux (debian sid based distribution). I know that compiling the source under Debian distribution isnt common and some ppl will say Debian isnt for you if you do it that way. Well if you wanna have latest developer version of VDR and DVB-S2 drivers and also ffpmeg and xine player then you need to use sources.
Hardware
For this you can use what you have. This to be Howto is based on DVB-S2 cards, and the software needed to play VDR over VGA cards aka xine-vdr plugin.
Used Hardware
This is my VDR HTPC based system:
Case: Thermaltake Bach black PSU: LC Power 420 Watt - Green Power Mainboard: Gigabyte GA-P35-DS4 rev 1.0 CPU: Intel Core 2 Duo E6420 Boxed RAM: Super Talent DIMM Kit 2GB PC2-6400U HDD: Samsung SpinPoint T166 500GB SATA II (HD501LJ) DVB-S2: Technotrend-budget DVB S2-3200 <-- remote not used --> VGA: nVidia 9500 GT 512MB Remote: Medion USB X10
Getting the distribution and installing it
To obtaint sidux distribution go to http://www.sidux.com/ and download latest version. In time of writing this HowTo it was "sidux-2008-02" and for my VDR HTPC i used 64bit lite version : sidux-2008-02-erebos-kde-lite-amd64-200806252050.iso.
Direct download link for iso (470MB) http://debian.tu-bs.de/project/sidux/release/sidux-2008-02-erebos-kde-lite-amd64-200806252050.iso Some note from sidux.com
THIS IS VERY IMPORTANT: sidux, as a Linux LIVE-CD, is based on high compression technology, and because of that, special care is needed when burning the ISO image. Only use high quality CD-media [or DVD+RW] and burn in DAO-mode (disk-at-once) and not faster than x8.
You my use this boot cheatcode if you get Font to be to Big when you boot live cd and this is my boot cheatcode for installing sidux on 40" LCD TV: Just press Tab before booting live cd and add at end this:
vga=0x37B dpi=75
vga=0x37B is cheatcode for resolution 1280x720x32 dpi=75 is cheatcode for Dot´s Per Inch for your display
More info about Cheatcodes for sidux you can find here: http://manual.sidux.com/en/cheatcodes-en.htm
After installing distribution make shure your sidux distribution is updated to latest version, we will first get latest debian.list and source.list
cd /etc/apt/sources.list.d && wget -O debian.list http://sidux.com/files/misc/sources.list.d/debian.list && wget -O sidux.list http://sidux.com/files/misc/sources.list.d/sidux.list
We will also need extras, for the extras use as root:
wget -qO /usr/local/bin/extras http://extras.741.com/extras && cd /usr/local/bin && chmod +x extras && extras
You dont need to install anything here ist important to have debian-multimedia source list named: multimedia.list in /etc/apt/sources.d/ for installing some -dev library which are not found in other sources list. Dist-upgrade
init 3 apt-get update apt-get dist-upgrade -d (only download files) apt-get dist-upgrade (update files)
If new kernel is installed then reboot and boot in new kernel. After booting in the new Kernel we need also to install graphics driver for our nVidia card, and for that we will use smxi sidux Maintenance script from h2. We will switch to terminal:
Ctrl+Alt+F1
then login with root and your root password switch to init 3 (shoot down X)
init 3
install smxi script
cd /usr/local/bin; wget techpatterns.com/smxi.zip;unzip smxi.zip;smxi
Configure script, but dont do dist upgrade or anything with it, we will use it only for graphics driver:
sgfxi -co 173.14.12
switch to init 5 (start X)
init 5
Setup your resolution with nvidia tool, i am using 1920x1080@60Hz for Full HD resolution on my Samsung LE-40M86BD LCD TV. If you are looged as user in X (and you should) you will not have rights to write nvidia settings to X11 configuration file /etc/X11/xorg.conf but you can copy that code from nvidia settings window and paste in X11 as root user from console.
su mv /etc/X11/xorg.conf /etc/X11/xorg.conf_orig vi /etc/X11/xorg.conf
Press I for insert Paste that settings from nvidia configuration tool, Press Escape and type
:wq
Now you can reboot to see if you will get it working on resolution you just setup (or restart X : init 3 and init 5 from terminal or CTRL+Alt+Backspace) Now we setup everything for building VDR on our system.
Lirc
I will use Medion USB X10 remote control, here is what you need to do to get it working:
apt-get install lirc-modules-source dpkg-reconfigure lirc-modules-source
Check atiusb from the list rest uncheck. Copy lircd.conf from this wiki http://www.vdr-wiki.de/wiki/index.php/Fernbedienung_-_USB_X10 and save to /etc/lirc/lircd.conf Edit hardware.conf file and add that lirc_atiusb modules
vi /etc/lirc/hardware.conf <-- and change settings to match with code belove -->
Code: hardware.conf part of it |
# Run "lircd --driver=help" for a list of supported drivers. DRIVER="default" # If DEVICE is set to /dev/lirc and udev is in use /dev/lirc0 will be # automatically used instead DEVICE="/dev/lirc0" MODULES="lirc_atiusb" |
#Module compile and install apt-get install module-assistant module-assistant -f auto-install lirc-modules-source
Blacklist the atiremote
vi /etc/modprobe.d/blacklist #Hit I for Insert mode, and add to the end of file blacklist ati_remote #Hit Escape and write :wq to save and quite vi editor reboot
And check with "/usr/bin/irw" if remote is working when you press some buttons on it.
DVB-S2 Drivers
We will use Manu´s multiproto tree: Install dvb driver from multiproto, for that we need mercurial for "hg clone etc"
apt-get update apt-get install mercurial cd /usr/local/src hg clone http://jusst.de/hg/multiproto dvb cd /usr/src/dvb/linux/include/linux/ ln -s /usr/src/linux-headers-`uname -r`/include/linux/compiler.h compiler.h cd /usr/local/src/dvb/
We will also use two new patchs for TT-3200 card which should resolv lock on some channels/transponders posted on linux-dvb mailing list multiproto_channellock_fix.patch.diff and multiproto_fastlock_fix_new.patch.diff. Create new file:
vi multiproto_channellock_fix.patch.diff
Code: multiproto_channellock_fix.patch.diff |
--- linux/drivers/media/dvb/frontends/stb0899_algo.c.org 2008-04-24 22:04:10.000000000 +0200 +++ linux/drivers/media/dvb/frontends/stb0899_algo.c 2008-07-16 18:54:25.000000000 +0200 @@ -205,7 +205,7 @@ struct stb0899_internal *internal = &state->internal; struct stb0899_params *params = &state->params; - short int derot_step, derot_freq = 0, derot_limit, next_loop = 3; + short int derot_freq = 0, derot_limit, next_loop = 3; int index = 0; u8 cfr[2]; @@ -213,11 +213,10 @@ /* timing loop computation & symbol rate optimisation */ derot_limit = (internal->sub_range / 2L) / internal->mclk; - derot_step = (params->srate / 2L) / internal->mclk; while ((stb0899_check_tmg(state) != TIMINGOK) && next_loop) { index++; - derot_freq += index * internal->direction * derot_step; /* next derot zig zag position */ + derot_freq += index * internal->direction * internal->derot_step; /* next zig zag position */ if (ABS(derot_freq) > derot_limit) next_loop--; |
vi multiproto_fastlock_fix_new.patch.diff
Code: multiproto_fastlock_fix_new.patch.diff |
--- stb6100.c 2008-09-17 19:54:23.000000000 +0200 +++ stb6100.c.new 2008-09-17 20:21:08.000000000 +0200 @@ -343,11 +343,18 @@ break; } + regs[STB6100_DLB] = 0xDC; + /** Disable LPEN */ + regs[STB6100_LPEN] &= ~STB6100_LPEN_LPEN; /* PLL loop disabled */ + + if ((rc = stb6100_write_regs(state, regs)) < 0) + return rc; + /* Baseband gain. */ if (srate >= 15000000) - g = 9; // +4 dB - else if (srate >= 5000000) - g = 11; // +8 dB + g = 8; + else if (state->srate >= 5000000) + g = 12; else g = 14; // +14 dB @@ -399,9 +406,11 @@ /* Power up. */ regs[STB6100_LPEN] |= STB6100_LPEN_SYNP | STB6100_LPEN_OSCP | STB6100_LPEN_BEN; + msleep(2); if ((rc = stb6100_write_regs(state, regs)) < 0) return rc; + msleep(2); regs[STB6100_LPEN] |= STB6100_LPEN_LPEN; /* PLL loop enabled */ if ((rc = stb6100_write_reg(state, STB6100_LPEN, regs[STB6100_LPEN])) < 0) return rc; @@ -410,13 +419,16 @@ if ((rc = stb6100_write_reg(state, STB6100_VCO, regs[STB6100_VCO])) < 0) return rc; - msleep(10); /* wait for LO to lock */ + msleep(5); /* wait for LO to lock */ regs[STB6100_VCO] &= ~STB6100_VCO_OSCH; /* vco search disabled */ regs[STB6100_VCO] |= STB6100_VCO_OCK; /* search clock off */ if ((rc = stb6100_write_reg(state, STB6100_VCO, regs[STB6100_VCO])) < 0) return rc; regs[STB6100_FCCK] &= ~STB6100_FCCK_FCCK; /* LPF BW clock disabled */ - if ((rc = stb6100_write_reg(state, STB6100_FCCK, regs[STB6100_FCCK])) < 0) +// if ((rc = stb6100_write_reg(state, STB6100_FCCK, regs[STB6100_FCCK])) < 0) + + stb6100_normalise_regs(regs); + if((rc = stb6100_write_reg_range(state, ®s[1], 1, STB6100_NUMREGS - 3)) < 0) return rc; msleep(30); |
Patch the files with:
patch -p0 -i multiproto_channellock_fix.patch.diff patch -p0 -i multiproto_fastlock_fix_new.patch.diff
You should get info that files habe been patched.
make make install reboot
Reboot and check dmesg for log about DVB-S2 device:
saa7146: register extension 'budget_ci dvb'. ACPI: PCI Interrupt 0000:05:00.0[A] -> GSI 20 (level, low) -> IRQ 20 saa7146: found saa7146 @ mem ffffc20000334000 (revision 1, irq 20) (0x13c2,0x1019). saa7146 (0): dma buffer size 192512 DVB: registering new adapter (TT-Budget S2-3200 PCI) adapter has MAC addr = 00:00:00:00:00:00 <- changed input: Budget-CI dvb ir receiver saa7146 (0) as /devices/pci0000:00/0000:00:1e.0/0000:05:00.0/input/input6 stb0899_attach: Attaching STB0899 stb6100_attach: Attaching STB6100 DVB: registering frontend 0 (STB0899 Multistandard)...
Xine ffpmeg
We will use latest snapshoot for xine-lib xine-ui, and as we are building xine-lib with external ffmpeg we will use latest ffmpeg to:
ffmpeg
cd /usr/local/src/ apt-get update apt-get remove libxine1 libxine1-bin libxine1-dbg <--removing xinelib installed with distribution, remove all these: gxine gxineplugin libxine1-xvdr -->
This will remove old xine1 library:
Code: |
root@vdrbox:~# apt-get remove libxine1 libxine1-bin libxine1-dbg Reading package lists... Done Building dependency tree Reading state information... Done Package libxine1-dbg is not installed, so not removed The following packages will be REMOVED: gxine gxineplugin libxine1 libxine1-bin libxine1-console libxine1-ffmpeg libxine1-misc-plugins libxine1-plugins libxine1-x libxine1-xvdr 0 upgraded, 0 newly installed, 10 to remove and 11 not upgraded. After this operation, 8880kB disk space will be freed. Do you want to continue [Y/n]? y |
apt-get install autoconf libtool automake autoconf pkg-config gettext subversion apt-get install liba52-0.7.4-dev libmp3lame-dev libvorbis-dev zlib1g-dev libpng12-dev libx11-dev libxv-dev libasound2-dev libogg-dev apt-get install libxvidcore4-dev libtheora-dev libgsm1-dev libfaac-dev libfaad-dev
Before doing build-dep ffmpeg you need to edit sidux.list and debian.list in /etc/sources.list.d/ and uncomment (remove #) in front of deb-src, and also for multimedia.list where you need to insert line:
deb-src http://www.debian-multimedia.org/ unstable main
1)
apt-get update apt-get build-dep ffmpeg svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg-14-09-2008 cd ffmpeg-14-09-2008 ./configure --prefix=/usr --enable-shared --enable-gpl --enable-postproc --enable-liba52 --enable-libmp3lame --enable-libvorbis --enable-pthreads --enable-swscale --arch=x86_64 --cpu=k8 make make install ldconfig
xine-lib
- download xine-lib from Mercurial Repositories (xine-lib, gxine)
apt-get update apt-get install autogen cvs libXext-dev libcdio-dev libvcdinfo-dev libpostproc-dev libpng12-dev libxt-dev cd /usr/local/src/ hg clone http://hg.debian.org/hg/xine-lib/xine-lib-1.2 xine-lib-1.2-14-09-2008 cd xine-lib-1.2-14-09-2008
- IMPORTANT for latest ffmpeg snapshoot you need to patch xine-lib-1.2 to get it compiled with external ffmpeg, thnx to _ds_ for patch.
Code: patch.diff |
diff --git a/src/combined/ffmpeg/ff_audio_decoder.c b/src/combined/ffmpeg/ff_audio_decoder.c --- a/src/combined/ffmpeg/ff_audio_decoder.c +++ b/src/combined/ffmpeg/ff_audio_decoder.c @@ -321,7 +321,7 @@ static void ff_audio_decode_data (audio_ if (!this->output_open) { if (!this->audio_bits || !this->audio_sample_rate || !this->audio_channels) { - avcodec_decode_audio (this->context, + avcodec_decode_audio2 (this->context, (int16_t *)this->decode_buffer, &decode_buffer_size, &this->buf[0], diff --git a/src/combined/ffmpeg/ffmpeg_decoder.h b/src/combined/ffmpeg/ffmpeg_decoder.h --- a/src/combined/ffmpeg/ffmpeg_decoder.h +++ b/src/combined/ffmpeg/ffmpeg_decoder.h @@ -31,6 +31,10 @@ # include <libavcodec/avcodec.h> #endif +#if LIBAVCODEC_VERSION_MAJOR > 51 +#define bits_per_sample bits_per_coded_sample +#endif + typedef struct ff_codec_s { uint32_t type; enum CodecID id; |
Copy the code above in to the new file:
vi patch.diff <-- Hit I for Insert and Paste that code; Hit escape and write :wq --> patch -p1 -i patch.diff ./autogen.sh --prefix=/usr --with-external-ffmpeg --disable-dxr3 make make install ldconfig
xine-ui
apt-get update apt-get install shared-mime-info cd /usr/local/src/ cvs -d:pserver:anonymous@xine.cvs.sourceforge.net:/cvsroot/xine login cvs -z3 -d:pserver:anonymous@xine.cvs.sourceforge.net:/cvsroot/xine co -P xine-ui mv xine-ui xine-ui-14-09-2008 cd xine-ui-14-09-2008 ./autogen.sh --prefix=/usr --enable-vdr-keys make make install
VDR
- Lets download vdr-1.7.0
apt-get update apt-get install libncurses-dev libncursesw5-dev libxft-dev libjpeg62-dev libcap-dev cd /usr/local/src/ wget ftp://ftp.cadsoft.de/vdr/Developer/vdr-1.7.0.tar.bz2 tar -xjf vdr-1.7.0.tar.bz2 mv vdr-1.7.0 vdr cd vdr
- patch for h264
wget http://www.linuxtv.org/pipermail/vdr/attachments/20080413/1054bcfb/attachment-0001.bin mv attachment-0001.bin vdr-1.7.0-h264-syncearly-framespersec-audioindexer-fielddetection-speedup.diff.bz2 bunzip2 vdr-1.7.0-h264-syncearly-framespersec-audioindexer-fielddetection-speedup.diff.bz2 patch -p1 -i vdr-1.7.0-h264-syncearly-framespersec-audioindexer-fielddetection-speedup.diff
- now xine-vdr.0.8.2 from Reinhard Nißl http://home.vrweb.de/~rnissl/
cd PLUGINS/src/ wget http://home.vrweb.de/~rnissl/vdr-xine-0.8.2.tgz tar -xzvf vdr-xine-0.8.2.tgz mv xine-0.8.2/ xine mv vdr-xine-0.8.2.tgz /usr/local/src/ <-- maybe we will need it later to --> cd ../../
- Use Make.config i posted here
vi Make.config <-- hit i for Insert mode paste the code above and hit escape and type :wq -->
Code: Make.config |
# # User defined Makefile options for the Video Disk Recorder # # Copy this file to 'Make.config' and change the parameters as necessary. # # See the main source file 'vdr.c' for copyright information and # how to reach the author. # # $Id: Make.config.template 2.0 2008/01/13 12:54:09 kls Exp $ ### The C compiler and options: CC = gcc CFLAGS = -g -O2 -Wall CXX = g++ CXXFLAGS = -g -O2 -Wall -Woverloaded-virtual -Wno-parentheses ifdef PLUGIN CFLAGS += -fPIC CXXFLAGS += -fPIC endif ### The directory environment: DVBDIR = /usr/local/src/dvb/linux MANDIR = /usr/man BINDIR = /usr/bin LOCDIR = /usr/share/locale PLUGINDIR= ./PLUGINS PLUGINLIBDIR= /usr/lib/vdr/plugins VDRSCRIPTDIR= /usr/lib/vdr/scripts VIDEODIR = /video CONFDIR = /etc/vdr ### The remote control: LIRC_DEVICE = /dev/lircd RCU_DEVICE = /dev/ttyS1 ## Define if you want vdr to not run as root #VDR_USER = vdr REMOTE= LIRC VFAT= 1 FFMDIR= /usr/local/src/ffmpeg-14-09-2008 #dont forget to change if ffmpeg folder have diferent name FFMPEG_STATIC= 1 FFMPEG_SVN= 1 ### You don't need to touch the following: ifdef DVBDIR INCLUDES += -I$(DVBDIR)/include endif |
make make plugins make install
- copy the .mpg files from xine-vdr plugin to plugins directory
mkdir /etc/vdr/plugins/xine/ cd /etc/vdr/plugins/xine/ cp -a /usr/local/src/vdr/PLUGINS/src/xine/data/* .
- make symlink to xineplayer
cd /usr/local/src/vdr/PLUGINS/src/xine/ ln -s $(pwd)/xineplayer /usr/bin/xineplayer
- config files copy to /etc/vdr
cd /usr/local/src/vdr/ cp -a svdrpsend.pl /usr/bin/ cp *.conf /etc/vdr