Rigolo

sasc-ng

This MythBuntu with DVB-C Guide is still a work in progress and subject to change at anytime. They main focus is on building opensasc-ng and use it in combination with a cardserver and valid smartcard in combination with a DVB-C PCI card. It will most likely also work with DVB-S and DVB-T cards but they are for now untested. If you find anything wrong or incomplete then 2 have 2 options: Fix it and update this guide or report it on the Linux DVB-Sat-TV forum on dvbn.happysat.org or on the "PC gebaseerde DVB ontvangers (HTPC)" forum on sat4all.com for dutch users.


Install MythBuntu 8.10 as describe in the mythbuntu installation manual but do not run myth-setup yet (suggested in the last step when installing). Reboot the PC and when MythTV is started just hit ESC and terminate mythtv-frontend. Mythbackend is also not running because it it is not setup correctly yet.

Run the update manager to get the latest updates on all the packages. After a new installation there are usually a large amount of packages that needs to be updated. After you have finished updating and a possible reboot (again ESC out of mythtv) you need to download and compile the latest dvb-c kernel drivers as described here: LinuxTV dvb drivers

The packages that are installed during this step are

  • sudo apt-get install mercurial linux-headers-$(uname -r) build-essential

You can just downloaded the drivers to your home directory and compiled from there.

  • hg clone http://linuxtv.org/hg/v4l-dvb
  • cd v4l-dvb
  • make
  • sudo make install

Now reboot the PC to make sure the latest drivers are used. Hit ESC again when mythtv frontend is started to exit it.

Use the standard steps that are mentioned on the linuxtv.org DVB wiki to test if your dvb hardware is working correctly before continuing with sasc-ng. Your DVB hardware needs to work on FTA channels so that you can rule out any driver/module problems.

Next step is to get the opensasc-ng source. opensasc-ng is the continuation of the original sasc-ng source with new code and bug fixes and is updated to the latest version of vdr-sc (0.9.x)

opensasc-ng code is available via subversion so you first need to install subversion

  • sudo apt-get install subversion

then you can download the opensasc-ng to your own home directory

  • cd (to go back to your home directory)
  • svn co -r 49 http://opensvn.csie.org/opensascng/open-sasc-ng

this commands creates a open-sasc-ng directory under your home directory and checks out revision 49. This is the latest revision as of October 19 2008. Because we might need to patch the source code to make it work with this revision and MythBuntu 8.10 all patches will be tested for revision 49 only.

If there are updates to opensasc-ng that need to be incorporated into this how-to than they will included in this How-To

first run the configure command and point this to the v4l-dvb source code

  • ./configure --dvb-dir=/home/<user>/v4l-dvb

This will generate the correct details for the make file and will determine what optimization to use for FFdecsa

Using C++ compiler: g++
Using compile type debug
Processor capabilities: native ( mmx sse )
Trying various FFdecsa optimizations...
PARALLEL_32_INT: 77
PARALLEL_64_2INT: 78
PARALLEL_64_LONG: 74
PARALLEL_64_MMX: 122
PARALLEL_128_2LONG: 66
PARALLEL_128_2MMX: 110
PARALLEL_128_SSE: test failed
PARALLEL_128_SSE2: build failed
Choosing PARALLEL_MODE = PARALLEL_64_MMX
Using DVB_DIR: /home/<user>/v4l-dvb/linux

Now that you have the correct make file let's "make" the module first

  • make module

This will create the module in the dvbloopback/module directory

You can try to insert the module to see if that gives any errors

  • insmod ./dvbloopback/module/dvbloopback.ko
  • dmesg

Check if there where no errors when the module was inserted on your system.

before you can compile sasc-ng you need to install some additional packages: anonymous

  • sudo apt-get install libssl-dev
  • sudo apt-get install gettext

in order to prevent a error while compiling create an empty compiler.h file in the v4l-dvb source code

  • touch /home/<user>/v4l-dvb/linux/include/linux/compiler.h

Before you can compile sasc-ng on MythBuntu 8.10 beta you need to patch the source code in order to prevent some compile errors. This patch is not needed on 8.04.1 Here is the patch script

Index: sc/thread.cpp
===================================================================
--- sc/thread.cpp (revision 49)
+++ sc/thread.cpp (working copy)
@@ -203,7 +203,7 @@
active = running = false;
childTid = 0;
description = NULL;
- SetDescription(Description);
+ SetDescription("%s", Description);
}

cThread::~cThread()
Index: dvblb_plugins/plugin_cam.c
===================================================================
--- dvblb_plugins/plugin_cam.c (revision 49)
+++ dvblb_plugins/plugin_cam.c (working copy)
@@ -628,7 +628,7 @@
}
printf("User Message %s data: %s\n", str, data);
outstr = sc->SVDRPCommand((const char *)str, (const char *)data, res);
- printf(outstr);
+ printf("%s", (const char*)outstr);
printf("User Message %s returned: %d\n", str, res);
}
}

You can copy this code and save it to a file and patch the open-sasc-ng code your self, or you can manually make the changes. anonymous After you have patched the code you can compile sasc-ng

  • make

and than you can run sasc-ng using the following command:

  • sudo ./sasc-ng -j 0:1

With sasc-ng running you can open an other terminal windows and first try to record a dvb broadcast of a FTA channel but using the virtual dvb adapter. You can just the normal c/s/t zap dvb utils to tune to a specifc channel and then in a third terminal window use a simple 'cat /dev/dvb/adapter1/dvr0 > file.mpeg' to record the digital dvb data stream. You can then use any media player that supports mpeg to play back this recording. If this is successfull you can continue with setting up your smartcard interface.

now you can work on setting up the sc_files directory to decrypt the channels you want to watch. I use a NewCS server on my local lan as a cardserver so I need to setup a cardclient.conf file with a newcamd line in there:

  • newcamd:hostname:port:emm/caid/mask:username:password:cfgKey

have a look at the example file you can find at: /home/<user>/open-sasc-ng/sc/PLUGINS/src/sc-src/examples/cardclient.conf.example

Now continue to setup mythtv using the new virtual card.