All pastes #12825 Raw Edit

Mine

public text v1 · immutable
#12825 ·published 2005-05-28 05:41 UTC
rendered paste body
VDR for Budget Cards On Gentoo SC 0.4.4, Xine and, VDR 1.3.24.

Author: Stile for the http://www.curious-contraptions.com forum.

Now that Gentoo is in good shape, the next step is to get the DVB card working. For those with a budget card, I am using a SS 2,  we're going to demonstrate that here. I'm going to attempt to add in the VP1020 also. Since I don't have one, hopefully you guys will tell me if I'm right or wrong so we can make sure it works for that card also. The only real difference will be in the kernel drivers.

This is going to be a bit more involved than the Nexus how-to since we need to add software support for all the missing hardware the Nexus has.

Start by opening a terminal window in KDE. That's K-> System-> Terminal Program (Konsole) for those that haven't found it yet. To do the first of this we need root privledges. So:

	su root
	Enter your root password
	
The first thing you should do is make sure your system is up to date. This is kind of like going to the Windows Update website. Unfortunately Linux has security problems just like Windows. Unlike Windows Update this will also update installed applications also. It's a good idea to do this occasionally. It's a simple process and and it won't require a reboot if you don't recompile the kernel. That's the only time you need to reboot a Linux machine.

Anyway, to do this we need to get the latest portage snapshot first so,

	emerge --sync
	
This will get the updated list of applications and sytem files. Next,

	emerge -vuDp world
	
The options go like this v=verbose, u=updates, D=deep dependency scan, p=pretend and, world=the entire system. The upper case D does make a difference. That will give you a list of what has been updated for your system. Look it over to make sure everything looks right. Then really do it.

	emerge -vuD world

If by chance you get a kernel update as part of the process, you will need to update the linux link in /usr/src. To do that do this:

	cd /usr/src
	ls -l

Look at the current link. If it's not pointing to the latest version of your kernel sources do this:

	rm linux
	ln -s <new kernel directory> linux

That will make the latest sources the current sources for rebuilding the kernel which we will be doing in a couple minutes.

My past guides have used the CVS version of the drivers. I'm going to be a bit more conservative in this one and stick with the kernel drivers. We should be at kernel version 2.6.11 or better and the drivers are pretty good. 

We need to make a change to the kernel drivers for NA users (BEV and DN). To prevent the dvb_frontend from going to sleep. This may already be done but let's be sure.

	nano -w /usr/src/linux/drivers/media/dvb/dvb-core/dvb_frontend.c
   
	look for the line that says:
   
	static int dvb_shutdown_timeout = 5;
   
	change it to:
   
	static int dvb_shutdown_timeout = 0;
	
	Save and close.

For those that don't understand what you just did, you just modified the drivers that will be used. You just changed the C code and in a minute we will compile it into a working driver. It's actually pretty cool that we can do this in Linux. If it doesn't work quite like you would like, you can change it. 

We are now ready to build our kernel. I suggest you use genkernel, but either way, we must ensure that a few things are enabled in the kernel before it is compiled, don't forget the gentoo specific options too. 

	genkernel --menuconfig --udev all

	Code maturity level options  ---> 
	 [*] Prompt for development and/or incomplete code/drivers                        
         [ ]   Select only drivers expected to compile cleanly                            

	--- snip ---
	
	Device Drivers  --->
	Generic Driver Options  --->
	[ ] Select only drivers that don't need compile-time external firmware
	[ ] Prevent firmware from being built                                
	<M> Hotplug firmware loading support                                 
	
	--- snip ---
	
	Device Drivers  --->
	Input device support  ---> 
	--- Mouse interface
	[*] Provide legacy /dev/psaux device
	(1024) Horizontal screen resolution
	(768) Vertical screen resolution
	< > Joystick interface
	< > Touchscreen interface
	<M> Event interface
	< > Event debugging

	--- snip ---

	Device Drivers  --->
	I2C support  ---> 
	<*> I2C support
	<*> I2C device interface
	I2C Algorithms --->
		<*> I2C bit-banging interfaces
		< > I2C PCF 8584 interfaces
		
	--- snip ---

	Device Drivers  --->
	Multimedia devices  ---> 
	  <M> Video For Linux    
	  Video For Linux  --->                                    
	  Radio Adapters  --->                        
	Digital Video Broadcasting Devices  --->      

	--- snip ---          

This is the setup for a Skystar 2 card. If you have a VP1020 ignore this and move to the next --snip--. 
	
	Device Drivers  --->
	Multimedia devices  ---> 
	Digital Video Broadcasting Devices  --->      
	[*] DVB For Linux                                                    
	<M>   DVB Core Support                                               
	---     Supported SAA7146 based PCI Adapters                         
	< >     AV7110 cards (NEW)                                           
	< >     Budget cards (NEW)                                          
	< >     Budget cards with onboard CI connector (NEW)                
	< >     Budget cards with analog video inputs (NEW)                  
	---     Supported USB Adapters                                       
	< >     Technotrend/Hauppauge Nova-USB devices (NEW)
	< >     Technotrend/Hauppauge USB DEC devices (NEW)
	< >     DiBcom USB DVB-T devices (see help for device list) (NEW)
	< >     Terratec CinergyT2/qanu	Device Drivers  --->
	---     Supported FlexCopII (B2C2) Adapters
	<M>     B2C2/Technisat Air/Sky/CableStar 2 PCI
	< >     B2C2/Technisat Air/Sky/Cable2PC USB
	---     Supported BT878 Adapters
	---     Supported DVB Frontends
	Customise DVB Frontends  --->

	--- snip ---

Here's my attempt at a VP1020 setup. It is a bit different than the other cards since it uses a combination of the bttv drivers and the linuxtv drivers. This based off from what information I have been able to find in the driver readmes and on various boards. I don't have one of these to test with so if one of you does and would like to correct me please feel free so this can be made right. If you have a SS2 skip ahead to the second snip.

	Device Drivers  --->
	Multimedia devices  ---> 
	Video For Linux  --->                       
	--- Video Adapters
	<M> BT848 Video For Linux 
	< > Mediavision Pro Movie Studio Video For Linux (NEW)

	--- snip ---

	Device Drivers  --->
	Multimedia devices  ---> 
	Digital Video Broadcasting Devices  --->      
	[*] DVB For Linux
	<M>   DVB Core Support
	---     Supported SAA7146 based PCI Adapters
	< >     AV7110 cards (NEW)
	< >     Budget cards
	< >     Budget cards with onboard CI connector
	< >     Budget cards with analog video inputs
	---     Supported USB Adapters
	< >     Technotrend/Hauppauge Nova-USB devices (NEW)
	< >     Technotrend/Hauppauge USB DEC devices (NEW)
	< >     DiBcom USB DVB-T devices (see help for device list) (NEW)
	< >     Terratec CinergyT2/qanu USB2 DVB-T receiver (NEW)
	 ---     Supported FlexCopII (B2C2) Adapters
	< >     Technisat Skystar2 PCI
	 ---     Supported BT878 Adapters
	<M>     Nebula/Pinnacle PCTV/Twinhan PCI cards
	---     Supported DVB Frontends
		Customise DVB Frontends  --->
	
Once the kernel has sucessfully compiled, rename you kernel, initrd and, System.map files like we did during the Gentoo install so you know which you're using.For those that missed it, I add a date and version to the end of the files. Something like -MM.DD.VV. That's month (MM), day(DD) and, version(VV). That way the next compile won't overwrite things if you need to back up.
 
Then add a new entry into your grub.conf file. This offers you a menu at boot and allows you to easily drop back to the old kernel if something happens to break. Re-emerge any kernel modules (nvidia-kernel). Reboot and log back in as your user.
	
Now we need to set up a display application since we don't have a TV out on these DVB cards. I'm going to install Xine for this. There is a package in portage but there have been some updates that will help us out so I'm going to install a CVS version to take advantage of that. The first thing we need to do is un merge any already installed Xine-lib package. So do this:

	su root
	emerge unmerge xine-lib
	
That will remove the old package. We then need to tell portage that we are supplying our own version. To do that we need to add an entry into the /etc/portage/profile/package.provided file. to do this:

	mkdir /etc/portage/profile
	nano -w /etc/portage/profile/package.provided

Now add these lines that say:

	media-libs/xine-lib-1_rc8
	media-video/vdr-1.2.0
	media-tv/linuxtv-dvb-1.1.1-r1

The entries are so that portage doesn't try to do something with VDR or xine in the future. It will know that we have installed outside of Portage. Save and close. Portage will now treat VDR and Xine as an installed app. This is how you can install packages that aren't in Portage without having Portage interfere. 

Exit back to your user and let's make a place to put this. Create a new directory in your home directory called VDR.
	
	exit
	mkdir ~/VDR
	cd ~/VDR


Now let's get a copy of  xine-lib and xine-ui so we can watch the TV VDR is going to tune in for us. xine-lib is the underlying support for the mpeg decoding etc. xine-ui is the window that displays it to you. The author of the vdr-xine plugin also keeps a copy of the CVS version he used with the latest version of the xine plugin. They would be a good choice here. So:

	cd ~/VDR
	wget http://home.vrweb.de/~rnissl/xine-lib-cvs-20050508220400.tar.bz2
	wget http://home.vrweb.de/~rnissl/xine-ui-cvs-20050508220400.tar.bz2
	tar -jxf xine-lib-cvs-20050508220400.tar.bz2
	tar -jxf xine-ui-cvs-20050508220400.tar.bz2
	
We will now download and install vdr with sc, softcsa, yaepg and, xine. This is best done as a non-root user. Download the VDR source code.
	
	wget ftp://ftp.cadsoft.de/vdr/Developer/vdr-1.3.24.tar.bz2
	tar -jxf vdr-1.3.24.tar.bz2
	
Download and install vdr-sc. This is the heart of the decryption. Without this all you'll be watching is NASA.
	
	cd ~/VDR/vdr-1.3.24/PLUGINS/src/	
	wget http://207.44.152.197/vdr-sc-0.4.4.tar.gz
	tar -zxf vdr-sc-0.4.4.tar.gz
	ln -s sc-0.4.4 sc
		
The last line creates a symbolic link between sc and sc-0.4.4. That way VDR only needs to know that sc is a valid plugin and you can keep track of which version you have. So when sc-0.4.5 comes out all you need to do is change the link to point to the new directory and recompile the plugins. If the new version doesn't work for you for some reason you can change the link back and be back where you started. 
	
VDR needs a little help to understand how to communicate with sc. So we will use a patch provided with sc to modify the VDR source code.
	
	cd ~/VDR/vdr-1.3.24
	patch -p1 < ./PLUGINS/src/sc/patches/vdr-1.3.20-sc.diff
	
Next we need to add in a decryption program. On the full featured cards there is a chip on the card to do this in hardware. With the budget cards we need to do this in software. This is part of why you can't play with a 500Mhz machine and a budget card. This is the softcsa patch.

	wget http://207.44.152.197/vdr-1.3.1-softcsa-0.0.8.diff.gz
	gunzip vdr-1.3.1-softcsa-0.0.8.diff.gz
	patch -p1 < vdr-1.3.1-softcsa-0.0.8.diff
	
Next we'll patch vdr for North America 48 hour and 9 day EPG. VDR can't understand the DN EPG data as it is. This patch will add that ability.

Download eit_dpid-vdr-1.3.18.diff.gz from the files topic in http://www.curious-contraptions.com Linux HTPC forum to your ~/VDR/vdr-1.3.24 directory.
		
	cd ~/VDR/vdr-1.3.24
	gunzip eit_dpid-vdr-1.3.18.diff.gz
	
Now let's patch VDR for the NA EPG data.

	patch -p1 < eit_dpid-vdr-1.3.18.diff
	
Let's get an EPG while we're at it.Download yaepg-0.0.2-1.3.18-19-patched.tar.bz2 from the files topic in http://www.curious-contraptions.com Linux HTPC forum to your ~/VDR/vdr-1.3.24/PLUGINS/src/ directory.

	cd ~/VDR/vdr-1.3.24/PLUGINS/src
	tar -zxf yaepg-0.0.2-1.3.18-19-patched.tar.gz
	ln -s yaepg-0.0.2 yaepg
	cd ~/VDR/vdr-1.3.24
	
Now let's patch VDR for yaepg

	patch -p1 < ~/VDR/vdr-1.3.24/PLUGINS/src/yaepg/patches/vdr-1.3.19-core-yaepg.diff
	
Finally we need the Xine plugin to be able to pipe the VDR output to Xine to display this on the computer screen. If you have a video card with TV out you can set that up to display the video. 

Let's get the Xine plugin:

	cd ~/VDR/vdr-1.3.24/PLUGINS/src/
	wget http://home.vrweb.de/~rnissl/vdr-xine-0.7.4.tgz
	tar -zxf vdr-xine-0.7.4.tgz
	ln -s xine-0.7.4 xine
	cd ~/VDR/vdr-1.3.24

We need modify the recording portion of VDR to understand NTSC. Without this you can run into A/V sync problems with recordings.

	nano -w recording.h
	
Find the line that reads #define FRAMESPERSEC 25 and change the 25 to 30. Save and close Nano.

Next we will patch xine-lib and xine-ui for the vdr plugin. 

	cd ~/VDR
	patch -d. -p0 < ~/VDR/vdr-1.3.24/PLUGINS/src/xine/patches/xine-lib.patch
	patch -d. -p0 < ~/VDR/vdr-1.3.24/PLUGINS/src/xine/patches/xine-ui.patch
	
I'm also going to add a couple more patches. The first fixes VDR's recording replayer to send proper I-frames to a device. It's from the author of the vdr-xine plugin.

	cd ~/VDR/vdr-1.3.24
	wget http://home.vrweb.de/~rnissl/vdr-1.3.24-dvbplayer.patch
	patch -d. -p0 < vdr-1.3.24-dvbplayer.patch

The second is also from the vdr-xine author. It fixes an issue with DVD menus. Without this patch you wont see a change to menu selection. It will come in handy if you choose to add the DVD plugin to vdr. If you have no intention of doing so you can skip this patch.

	wget http://home.vrweb.de/~rnissl/vdr-1.3.18-dvbspu.patch.gz
	gunzip vdr-1.3.18-dvbspu.patch.gz
	patch -d. -p0 < vdr-1.3.18-dvbspu.patch
	
We will also need to install the unichrome xvmc wrapper to enable xvmc support in xine. This allows xine to make use of the hardware acceleration built into current nvidia or via video cards. If you use an ATI card you can skip this. Hardware acceleration won't work with them. If you have a via video card you will also have to install the unichrome via drivers. I don't have a via card so I will leave that as an execise for you. Both the wrapper and the drivers are available at http://sourceforge.net/project/showfiles.php?group_id=102048. At the bottom of the page is the wrapper package. You'll want the latest version. Download the package libXvMCW-0.9.3.tar.gz to the ~/VDR directory. Now let's install it.

	cd ~/VDR
	tar -zxf libXvMCW-0.9.3.tar.gz
	cd libXvMCW-0.9.3
	./configure --x-libraries=/usr/lib --x-includes=/usr/include
	make
	su root
	make install
	exit

You'll notice I tried to keep the individual plugins etc together. Xine itself couldn't be done that way since we needed both xine-lib and the xine plugin since the patchs were in the plugin source. Now let's build and install them. First off xine-lib.

	cd ~/VDR/xine-lib
	./autogen.sh --with-xxmc-path=/usr/X11R6/lib --with-xvmc-path=/usr/X11R6/lib --x-libraries=/usr/X11R6/lib 
	make
	su root
	make install
	env-update
	exit
	
What we just did there was run a script to configure the install for our environment (./autogen.sh). usually that would be just ./configure but in this case the authors needed to do more so they created a script. Then we compiled it with make and finally installed the program so it can be used by the rest of the system. Then we updated the system to show the newly installed program. That is a pretty much standard manual install in Linux. If you were to read the INSTALL document in the source directory it would explain what needed to be done to install the software. Now let's do the same with xine-ui.

	source /etc/profile
	cd ..
	cd xine-ui
	./autogen.sh --enable-vdr-keys
	make
	su root
	make install
	exit

The --enable-vdr-keys creates some special key bindings that xine can pass to vdr for keyboard control. It's tough when you have the display full screen and you want to change the channel since you need the terminal session in the foreground to do that. This allows us to get around that. The only problem is you have to pick keys that Xine isn't using. It gets real confusing fast. This gives you that option though. A remote works much better. Some installs include special switches like this to enable or disable certain features or abilities. 

Before we compile vdr, we need to patch the DVB drivers to support yaepg

	cd /usr/include/linux/dvb
	su root
	cp /home/mythtv/VDR/vdr-1.3.24/PLUGINS/src/yaepg/patches/osd.h.diff osd.h.diff
	patch -p0 < osd.h.diff
	exit

Now, we can compile vdr and vdr-plugins.First we will compile vdr. Make is the command that compiles the source code.
	
	cd ~/VDR/vdr-1.3.24
	make REMOTE=LIRC
		
The REMOTE=LIRC will add in support for LIRC so we can use a remote control with this. 

Now we can compile the plugins. Before we do that though we need to make a change to the makefile for the xine plugin. This will enable support for the yaepg plugin.

	nano -w ~/VDR/vdr-1.3.24/PLUGINS/src/xine/Makefile

Look for the line that says: #VDR_XINE_SET_VIDEO_WINDOW = 1 and remove the #. Save and close the file. Now we will now compile the vdr-plugins, with sc being compiled for Nagra.
	
	make plugins NAGRA=1

We just added LIRC support to VDR. I'm not going to go into setting up LIRC here though. I think that's a whole other topic. It involves a little more than just setting up the software. You can find more information at http://www.lirc.org if you would like. Feel free to come here and ask questions if you need to.

We now need to add a video user group and change some permissions so that a non-root user can execute vdr. If you followed the build this should already be done but you should check to make sure.
	
	nano -w /etc/group
	
	locate the group video and add root and your username
	
	video:x:27:root,<username>
	
If it does not exist, create it as above.  Save your changes, log out and then log back in to let the above take effect.  If unsure how, just restart your computer.

Now we need to change permissions so that a non-root users belonging to the video group can access the dvb devices.

	su root
	
	chgrp -R video /dev/dvb
	chmod -R ug+rwx /dev/dvb
	exit

What we just did was change the owner to the video group which we are a part of and gave the video group read/write access. 

The next task is to configure vdr.  The default vdr configuration uses /video as its configuration directory. If you followed the build, you should have a separate partition mounted as /video. If not we need to create a /video directory.
	
	mkdir /video
	
Next we need to change the permissions so that a non-root users belonging to the video group can access the /video directory
	
	su root
	chgrp -R video /video
	chmod -R ug+rwx /video
	exit
	
				
Now we need to copy the required .config files to the /video directory. These are just the defaults but they give us a starting point.
	
	cd ~/VDR/vdr-1.3.24
	cp *.conf /video
	cp ~/VDR/vdr-1.3.24/PLUGINS/src/xine-0.7.4/data/noSignal.pes /video/plugins/xine/noSignal.pes

We will now make changes to the .conf files.  With the 1.3.x versions of vdr, no changes need to be made to ca.conf. If you have seen an older how-to it will tell you to change this. No need for us.
	
	cd /video
		
We need to tell vdr what satellites we want to see. Make sure the satellites you are pointed at are in the list. They should be but lets check to make sure.
	
	nano -w sources.conf
		
	# Satellites
	
	S119W   Echostar 7
	S110W   Echostar 6/8
	S91W	Nimiq 1
	S82W	Nimiq 2
	
My configuration uses a DiSEqC switch to recieve 119W on port 0, 110w on port 1, 91w on port 2 and, 82w on port 3. So we will need to modify the diseqc.conf file to reflect that.
	
	nano -w diseqc.conf
		
	# EchoStar 7 - 119W - Port 0
	S119.0W 99999 V 11250 t v W15 [E0 10 38 C0]
	S119.0W 99999 H 11250 t V W15 [E0 10 38 C0]
		
	# EchoStar 6/8 - 110W - Port 1
	S110.0W 99999 V 11250 t v W15 [E0 10 38 C4]
	S110.0W 99999 H 11250 t V W15 [E0 10 38 C4]
		
	# Nimiq 1 - 91W - Port 2
	S91.0W 99999 V 11250 t v W15 [E0 10 38 C8]
	S91.0W 99999 H 11250 t V W15 [E0 10 38 C8]

	# Nimiq 2 - 82W - Port 3
	S82.0W 99999 V 11250 t v W15 [E0 10 38 CC]
	S82.0W 99999 H 11250 t V W15 [E0 10 38 CC]
		
	
If your arrangemnent is different, you will need to modify this accordingly. What you need to change are the numbers in the brackets.

	[E0 10 38 C0] is port 0
	[E0 10 38 C4] is port 1
	[E0 10 38 C8] is port 2
	[E0 10 38 CC] is port 3

You will probably want to comment out any satellites you don't see also. Just place a # at the beginning of the line.

setup.conf is normally created when you first start vdr, you can use this template if you like.  A few things to take note of though are the LnbFrequHi, LnbFrequLo, and LnbSLOF for circular LNBs, and sc.LoggerActive, sc.LoggerTimeout, sc.Nagra.MinEcmTime, sc.ScCaps for the sc plugin.
	
	nano -w setup.conf
	
	ChannelInfoPos = 1
	CurrentChannel = 10101
	CurrentVolume = 255
	DefaultLifetime = 99
	DefaultPriority = 50
	DiSEqC = 1
	EPGBugfixLevel = 2
	EPGLanguages =
	EPGLinger = 0
	EPGScanTimeout = 5
	InstantRecordTime = 180
	LnbFrequHi = 11250
	LnbFrequLo = 11250
	LnbSLOF = 0
	MarginStart = 2
	MarginStop = 2
	MarkInstantRecord = 1
	MaxVideoFileSize = 2000
	MenuScrollPage = 0
	MinEventTimeout = 30
	MinUserInactivity = 120
	MultiSpeedMode = 1
	NameInstantRecord = TITLE EPISODE
	OSDHeight = 410
	OSDLanguage = 0
	OSDLeft = 55
	OSDMessageTime = 1
	OSDSkin = classic
	OSDTheme = default
	OSDTop = 30
	OSDWidth = 608
	PauseLifetime = 1
	PausePriority = 10
	PrimaryDVB = 1
	PrimaryLimit = 0
	RecordDolbyDigital = 1
	RecordingDirs = 1
	ResumeID = 0
	SetSystemTime = 0
	ShowInfoOnChSwitch = 1
	ShowReplayMode = 1
	SortTimers = 1
	SplitEditedFiles = 1
	SVDRPTimeout = 300
	TimeSource = S110.0W
	TimeTransponder = 412632
	UpdateChannels = 3
	UseSmallFont = 0
	UseSubtitle = 1
	UseVps = 0
	VideoFormat = 0
	VpsMargin = 120
	ZapTimeout = 3
	sc.LoggerActive = 1
	sc.LoggerTimeout = 0
	sc.Nagra.MinEcmTime = 400
	sc.ScCaps = 1 2
		
Next we need to generate a channels.conf. This is the weak point of Linux and DVB. A person named Thoraz has modified linux-tv's dvb-apps scan utility. It incorporates fixes necessary for scanning DN satellites. He has a website at http://www.phobos.ca/dvb/ I and other people have had problems with the latest version he has out. I would suggest using the older 1.1.1 version. Feel free to try the newer version if you would like. This will get you going for DN and B*V satellites. A point of interest here, even if you don't get all the channels correct, VDR will auto update your channels as you tune to the different transponders. So as long as you can get one working channel on each transponder you can see in your area, VDR will eventually get a complete list. It's not going to be in any kind of order but they'll all be there. 
	
Let's download and compile Thoraz's modified dvb-apps.
	
	su root
	cd /usr/src
	wget http://www.phobos.ca/dvb/files/linuxtv-dvb-apps-na-1.1.1.tar.bz2
	tar xfj linuxtv-dvb-apps-na-1.1.1.tar.bz2
	cd linuxtv-dvb-apps-na-1.1.1/util/scan
	cp nimiq1-91w nimiq2-82w
		
And now compile the scan utility
	
	make
	
We can now scan for channels.  Each scan takes a LOOONNNGGG time
	
Scan echostar 119W on diseqc port 0
	
	./dvbscan -v -lDBS -o vdr -e 3 -5 -s 0 -x 1800 -p echostar-119w > channels.conf.119w

Scan echostar 110W on diseqc port 1
	
	./dvbscan -v -lDBS -o vdr -e 3 -5 -s 1 -x 1800 -p echostar-110w > channels.conf.110w

Scan nimiq1 91W on dieqc port 2
	
	./dvbscan -v -lDBS -o vdr -e 3 -5 -s 2 -x 1234 -p nimiq1-91w > channels.conf.91w
		
Scan nimiq2  82W on diseqc port3
	
	./dvbscan -v -lDBS -o vdr -e 3 -5 -s 3 -x 1234 -p nimiq2-82w > channels.conf.82w
	
If your dish(es) are set up differently. you will need to change the -s value to match the port your setup uses. 0 is port 1, 1 is port 2 etc.

Combine the scanned channels.conf files
	
	cat channels.conf.119w channels.conf.110w channels.conf.91w channels.conf.82w > channels.conf.merged
		
Convert to vdr 1.3.x channels.conf format
	
	./convert_to_vdr_1.3 channels.conf.merged > channels.conf 
		
And finally, place our channels.conf into our vdr .conf directory
	
	cp channels.conf /video/channels.conf
		
You will probably find channels that don't work. You are probably going to spend a lot of time sorting thru this file trying to make it work.  What I ultimately ended up doing was exporting the information from my MyTheatre database and building the file from scratch. I only used my favorites and I was able to order them as I chose. VDR will then keep them updated and will add in the ones I didn't. From that respect it is rather nice but it is a lot of manual work.  Quite frankly, I don't know a good way of doing this. If anyone has a better idea please speak up. 
	
We are now ready to configure sc. Exit back to your user.

The first and formost issue with sc is having the correct RSA keys for each provider id in your SoftCam.Keys file. Since we are using the latest version of sc, your windows file will not work. To date I have not found a working SoftCam.Keys file for Linux on the web. I'm not sure I want to be the guy that explains the magic trick here if you know what I mean. I will try to point you in the right direction though. In the al7bar.tk PCI-DVB forum is a sticky that explains how to create your own SoftCam.Key file. It works. To illustrate I will start you down the path. 

What I did was gather a few bin or bn3, bn10, etc files and started following the procedure. http://maestra.tv is a good place to look for bin files. I took the generated keys from Nagraedit and added them to a text file like this. 

Dish Rom3

0001
PK0= 9B...BD
PK1= 61...1E
PK2= 10...C4
V=   56...CF
Pub Key 0= 06...45
Pub Key 1= C2...2A

I then took those values an plugged them into EMMstudio and added these entries to the file.

PK0= 9B...BD
P1=  83...FE
P2=  E1...BC
N1=  23...BB
E1=  2B...7C
N2=  33...C3
PUB KEY 00= 06...45
PUB KEY 01= C2...2A
V=   56...CF

PK1= 61...1E
P1=  F7...9E
P2=  81...E0
N1=  77...8B
E1=  AB...5C
N2=  33...C3
PUB KEY 0= 06...45
PUB KEY 1= C2...2A
V=   56...CF

Etc. Repeat for provider 0101. Do the same for B*V if you need to with providers 0801 and 0901.

The first big question I had was are my files valid. If they are, you will generate the same keys with this process that you have in your Windows file for one of the parity keys. There is only one active at a time. The Windows file only supplies the currently active keys. At the time of this writing 0001 PK2, 0101 PK0 0801 PK0 and, 0901 PK0 are the active keys. For this you need all of the keys though. 

If you are looking at Bev, there is no N2 key in the EMMStudio database. That's not a problem though. You have a N2 key available to you. Look at the DN N2 keys as you go thru the process. You'll notice a pattern. The same applies to BEV. Take a close look at the BEV keys in your windows file. It shouldn't be too hard to fill in the blanks.

I will give you a nice outline to start from, but you are on your own for the rest.
	
	cd /video
	mkdir plugins
	cd plugins
	nano -w SoftCam.Key  
(Watch the name of this file. The caps need to be there.)
	
	N 0001 00  
	N 0001 01  
	N 0001 E1 PK0 
	N 0001 N1 PK0 
	N 0001 N2 PK0 
	N 0001 E1 PK1 
	N 0001 N1 PK1 
	N 0001 N2 PK1 
	N 0001 E1 PK2
	N 0001 N1 PK2
	N 0001 N2 PK2
	N 0001 V  
		
	N 0001 00  
	N 0001 01  
	N 0101 E1 PK0 
	N 0101 N1 PK0 
	N 0101 N2 PK0
	.
	.
	. 
	N 0101 V  

Continue on with 0801 and 0901 if you are pointed at B*V.

Now we need to create a nagra directory to contain a couple of other files to allow sc to autoroll the video decryption keys.
	
	mkdir nagra
		
You need to place within this directory two files:
	
	ROM3.bin and eep3_00.bin
		
These files can be located in the Windows Fenrir package. It has the files you need. They are called rom3.bin and EEP3.bin within Fenrir.  Rename and copy them to /video/plugins/nagra/ directory.
	
Now, if I didn't steer you wrong and things went as planned we're ready to start VDR.
  
When vdr starts, it will first create a remote.conf.  By default, a keyboard configuration is always created to allow control of vdr. We have installed support for LIRC to also allow us to use a LIRc compatible remote. If you don't have LIRC set up at this point don't worry you can still control this with the keyboard. You can add the remote configuration later by deleting the /video/remote.conf file and starting VDR. It will run thru the remote setup like it was the first time it was run. 

First off open a second terminal session. You need one for VDR and one for Xine. First start Xine

	xine
	
Now start VDR in the other terminal session.
		
	cd ~/VDR/vdr-1.3.24
	./vdr -Psc -Pyaepg -Pxine
	
Now click on the VDR button in the xine control window. You should now see VDR's remote configuration dialog going. Run thru that. If you don't have a remote yet just setup the keyboard commands. You need to be fairly quick between starting Xine, VDR, and pointing Xine to VDR with the button. The configuration dialog does time out and you will be left with a nifty NO SIGNAL screen and no controls. If that happens, shut VDR down and try again. CTRL+C is what shuts VDR down BTW.

Let's set up an alias so you don't have to type so much to get this going. To do this you need to edit the .bashrc file. You will find this in your home directory. 

	nano -w ~/.bashrc 
	
Add and alias entry to slow the typing down.
	
	alias vdrysx="./vdr -Pyaepg -Psc -Pxine" 

Save and close the file	Log out and back in for this to take effect.

Now do this to start VDR, open a terminal window amd.

	cd ~/vdr-1.3.19
	vdrysx
	
Remember you have to start Xine also.
	
That pretty much concludes this installation. If you find any errors or problems please come back here and let us know so we can make this right.


Author: Stile
v0.0.5 Published on opendreambox.afraid.org
v0.0.6 Updated for VDR 1.3.19
v0.0.6.1 bugfix
v0.0.7 Updated for vdr 1.3.24 and published on Curious Contraptions