duck.

DVBSky S952 v3 (and other DVBSky stuff) on DSM6

Recommended Posts

Hey folks! Been using DSM6 on my trusty Microserver for a few weeks now, but needed to get my S952 v3 (delivered this afternoon) working with it.

 

After several hours trying to figure out why DSM6 uses a woefully old Linux kernel without the support compiled in, and also trying to find the DSM6.0.2 kernel source (which, as it happens, doesn't exist), I finally figured it out (indeed TVHeadend is running through the muxes in the background while I type this!)

 

Considering the ridiculous amount of legwork needed to figure this out, I'll post a quick walkthrough on how I did it, as well as my compiled modules at the end.

 

Credit to this post for figuring out how to put a build environment together (including where to find the damn kernel source)

 

I MAKE NO GUARANTEES REGARDING THE ACCURACY OF THIS. DON'T COME TO ME CRYING IF YOUR NAS SPONTANEOUSLY COMBUSTS, YOUR LOTTERY NUMBERS DON'T COME UP, OR IF YOU'RE A LAWYER ABOUT TO TELL ME THAT THIS IS THE WRONG WAY TO DO IT.

 

First off you'll need a development environment, I personally did it through the debian chroot on the box itself - but you might want to investigate doing it in a VM if you're going to be compiling heavier stuff. You'll need the debian-chroot package from synocommunity for this method.

 

Let the chroot install fully (give it 5-10 minutes, be patient, it's still installing packages in the background) then chroot in:

 

sudo /var/packages/debian-chroot/scripts/start-stop-status chroot

 

and grab some dependencies (n.b: any warnings for locale issues can (probably) be safely ignored, if they're causing issues you can always localegen some more):

 

apt-get update; apt-get install build-essential ncurses-dev bc git

 

We also need to make a fake /dev/shm otherwise compilation is going to go berserk about it not existing. Edit /etc/fstab and insert the following:

none /dev/shm tmpfs rw,nosuid,nodev,noexec 0 0

 

then mount it with the usual mount /dev/shm.

 

Now we need to go grab our synology development environment. Thankfully, Synology provide some super useful scripts to automate this for DSM6 (EnvDeploy provides ample opportunity to grab a cup of tea):

 

mkdir ~/build
cd ~/build
git clone https://github.com/SynologyOpenSource/pkgscripts-ng.git
pkgscripts-ng/EnvDeploy -v 6.0 -p bromolow
cd build_env/ds.bromolow-6.0

 

We can now go grab the kernel source, which is also on github (I'm assuming this is some cobbled together one, but hey, it works) - we also symlink it to make sure the dvb module compilation works properly

 

cd source
git clone https://github.com/quiknick/7274-kernel.git
cd 7274-kernel
cp synoconfigs/bromolow .config
mkdir -p /lib/modules/3.10.77
ln -s /root/build_env/ds.bromolow-6.0/source/7274-kernel /lib/modules/3.10.77/build

 

(Note: At this point, if you just want extra 3.10 tree kernel modules, you're done (in fact, you don't even need that last command)! just go make them with make ARCH="x86_64" oldconfig -> menuconfig -> modules)

 

This is where the fun part starts: compiling the DVB modules. First we grab them...

 

cd /root/build_env/ds.bromolow-6.0/source
wget http://www.dvbsky.net/download/linux/media_build-bst-140128.tar.gz
tar xf media_build-bst-140128.tar.gz
rm media_build-bst-140128.tar.gz

 

and then actually compile them (opportunity to grab your next cup of tea):

 

./v4l/build_x64.sh
make
touch /lib/modules/3.10.77/modules.order
touch /lib/modules/3.10.77/modules.builtin
make install

 

Note the fact that we did make install after touching those modules files. This is just installing them inside the chroot - it won't actually install them to your DSM, so this isn't the end! We mainly do the install step because we want /lib/modules/3.10.77/modules.dep, which lists the dependencies that your particular card is going to need. I'm not going to tell you exactly to do this because the end modules you need are going to vary by card to card, but you basically need to search that file for your module, and copy any dependencies (listed after the colon) to your DSM / load them before that module. (Note: some dependencies may have dependencies of their own, be sure to check!)

 

We can now copy these shiny new modules out of our chroot (do this outside your chroot, use exit to escape!):

 

rm /lib/modules/backports_dvb/*
cp /volume1/\@appstore/debian-chroot/var/chroottarget/root/build_env/ds.bromolow-6.0/source/media_build-bst-13/v4l/*.ko /lib/modules/backports_dvb/
chmod 755 /lib/modules/backports_dvb/*.ko

 

and copy any firmware that your card needs to /lib/firmware (you can usually find this on the linuxtv page for your card, the following should work for all dvbsky cards but do your own research!):

cd /lib/firmware
wget http://www.dvbsky.net/download/linux/dvbsky-firmware.tar.gz
tar zxf dvbsky-firmware.tar.gz
rm dvbsky-firmware.tar.gz

 

Now create a script to load them in when the machine starts. Use the notes you took earlier regarding your module dependencies, and tailor the script below to suit your tastes. (credit to Charles Hallard for the original script). This one is ready to go for S952 v3 folks, read above if you're using something else

 

(this goes in something like nano /usr/local/etc/rc.d/S10loaddvb.sh)

!/bin/sh
MODULES_DIR="/lib/modules/backports_dvb"
SUBMODULES="dvb-core.ko rc-core.ko dvbsky_m88rs6000.ko"
MAINMODULES="smipcie.ko"

start_modules(){
       echo "--- Load modules ---"
       for i in $SUBMODULES $MAINMODULES; do
               echo "Loading $i"
               insmod $MODULES_DIR/$i
       done
}

stop_modules(){
       echo "--- Unload modules ---"
       for i in $MAINMODULES $SUBMODULES; do
               echo "Unloading $i"
               rmmod $MODULES_DIR/$i
       done
}

case "$1" in
start)
       start_modules
       ;;
stop)
       stop_modules
       ;;
*)
       echo "usage: $0 { start | stop }" >&2
       exit 1
       ;;
esac

 

Make it executable with a wave of the magic chmod +x /usr/local/etc/rc.d/S10loaddvb.sh wand, reboot with as many things crossed as possible, and hopefully it'll work!

 

 

 

 

If you're left after reading that thinking "what the hell does half of this mean I can't linux", then don't panic: here's my compiled modules, tested working against DSM6.0.2:

 

dvbsky_modules_dsm6_bromolow_190216.tar.gz (58.3M, md5: 4ee12139a024f3123cab0dfeebc81e4a)

 

Again, I make no guarantee, warranty, or otherwise for the above compiled modules: they are provided as-is. If you don't trust me, then feel free to compile them as above with the instructions.

 

Many thanks to everyone here for providing an excellent information resource, and I hope this solves a few people's nightmares!

 

N.B: I don't have enough posts to respond to PMs yet, so if you have issues, post in this thread or email me (me@duck.me.uk) - preferably the former because it's super useful for people to go back in a thread to see what did / didn't work! - and I'll try my best to help; but like I said, no guarantees.

Share this post


Link to post
Share on other sites

Working my way through this,

 

Any idea's why i'm getting insmod: ERROR

 

root@XXXXXXX:/usr/local/etc/rc.d# /usr/local/etc/rc.d/S10loaddvb.sh start

--- Load modules ---

Loading dvb-core.ko

insmod: ERROR: could not insert module /lib/modules/backports_dvb/dvb-core.ko: File exists

Loading rc-core.ko

insmod: ERROR: could not insert module /lib/modules/backports_dvb/rc-core.ko: File exists

Loading dvbsky_m88rs6000.ko

insmod: ERROR: could not insert module /lib/modules/backports_dvb/dvbsky_m88rs6000.ko: File exists

Loading smipcie.ko

insmod: ERROR: could not insert module /lib/modules/backports_dvb/smipcie.ko: File exists

Edited by Guest

Share this post


Link to post
Share on other sites

those modules are already inserted.

 

try to unload them first.

 

rmmod nameofmodule.ko and then insmod nameofmodule.ko.

Share this post


Link to post
Share on other sites

Tried what you said on one .ko, got error message.

 

 

root@xxxx:~# /usr/local/etc/rc.d/S10loaddvb.sh start

--- Load modules ---

Loading dvb-core.ko

insmod: ERROR: could not insert module /lib/modules/backports_dvb/dvb-core.ko: File exists

Loading rc-core.ko

insmod: ERROR: could not insert module /lib/modules/backports_dvb/rc-core.ko: File exists

Loading dvbsky_m88rs6000.ko

insmod: ERROR: could not insert module /lib/modules/backports_dvb/dvbsky_m88rs6000.ko: File exists

Loading smipcie.ko

insmod: ERROR: could not insert module /lib/modules/backports_dvb/smipcie.ko: File exists

 

root@xxxx:~# rmmod dvb-core.ko

rmmod: ERROR: Module dvb_core is in use by: dvb_usb_ttusb2 dib8000 dib9000 em28xx_dvb dvb_as102 dvb_usb smipcie au082 8 dvb_usb_tbsqbox2ci cxd2820r dvb_usb_pctv452e dvb_usb_tbs5680 dvb_usb_v2 m88ds3103 dvb_usb_dvbsky dib7000p

 

root@xxxx:~# /usr/local/etc/rc.d/S10loaddvb.sh stop

--- Unload modules ---

Unloading smipcie.ko

Unloading dvb-core.ko

rmmod: ERROR: Module dvb_core is in use by: dvb_usb_ttusb2 dib8000 dib9000 em28xx_dvb dvb_as102 dvb_usb au0828 dvb_usb_tbsqbox2ci cxd2820r dvb_usb_pctv452e dvb_usb_tbs5680 dvb_usb_v2 m88ds3103 dvb_usb_dvbsky dib7000p

Unloading rc-core.ko

rmmod: ERROR: Module rc_core is in use by: dvb_usb_ttusb2 dvb_usb dvb_usb_dib0700 dvb_usb_pctv452e dvb_usb_v2 dvb_usb_dw2102 dvb_usb_dvbsky dvb_usb_it913x

Unloading dvbsky_m88rs6000.ko

 

root@xxxx:~# /usr/local/etc/rc.d/S10loaddvb.sh start

--- Load modules ---

Loading dvb-core.ko

insmod: ERROR: could not insert module /lib/modules/backports_dvb/dvb-core.ko: File exists

Loading rc-core.ko

insmod: ERROR: could not insert module /lib/modules/backports_dvb/rc-core.ko: File exists

Loading dvbsky_m88rs6000.ko

Loading smipcie.ko

root@xxxx:~#

Share this post


Link to post
Share on other sites

When you rmmod some module, ig he has depenves, they have to be rmmod first, so look at your inserts as unload them on inverse order.

Share this post


Link to post
Share on other sites

Hi, thank you very much for the tutorial!

 

I also have DVBSky S952, but I have version 2, not version 3, the difference is that i need cx23885 (v2) instead of smipcie (v3).

 

I got stuck on this part:

./v4l/build_x64.sh

make

touch /lib/modules/3.10.77/modules.order

touch /lib/modules/3.10.77/modules.builtin

make install

 

When I try the "make" command it gives me this error:

root@NAS:~/build/build_env/ds.bromolow-6.0/source/media_build-bst# make

make -C /root/build/build_env/ds.bromolow-6.0/source/media_build-bst/v4l

make[1]: Entering directory '/root/build/build_env/ds.bromolow-6.0/source/media_build-bst/v4l'

creating symbolic links...

make -C firmware prep

make[2]: Entering directory '/root/build/build_env/ds.bromolow-6.0/source/media_build-bst/v4l/firmware'

ln: failed to access '../../linux/firmware/dabusb//*': No such file or directory

make[2]: Leaving directory '/root/build/build_env/ds.bromolow-6.0/source/media_build-bst/v4l/firmware'

make -C firmware

make[2]: Entering directory '/root/build/build_env/ds.bromolow-6.0/source/media_build-bst/v4l/firmware'

make[2]: Nothing to be done for 'default'.

make[2]: Leaving directory '/root/build/build_env/ds.bromolow-6.0/source/media_build-bst/v4l/firmware'

Kernel build directory is /lib/modules/3.10.77/build

make -C /lib/modules/3.10.77/build SUBDIRS=/root/build/build_env/ds.bromolow-6.0/source/media_build-bst/v4l modules

make[2]: Entering directory '/root/build/build_env/ds.bromolow-6.0/source/7274-kernel'

 

ERROR: Kernel configuration is invalid.

include/generated/autoconf.h or include/config/auto.conf are missing.

Run 'make oldconfig && make prepare' on kernel src to fix it.

 

 

WARNING: Symbol version dump /root/build/build_env/ds.bromolow-6.0/source/7274-kernel/Module.symvers

is missing; modules will have no dependencies and modversions.

 

CC [M] /root/build/build_env/ds.bromolow-6.0/source/media_build-bst/v4l/altera-lpt.o

In file included from :0:0:

/root/build/build_env/ds.bromolow-6.0/source/7274-kernel/include/linux/kconfig.h:4:32: fatal error: generated/autoconf.h: No such file or directory

#include

^

compilation terminated.

scripts/Makefile.build:308: recipe for target '/root/build/build_env/ds.bromolow-6.0/source/media_build-bst/v4l/altera-lpt.o' failed

make[3]: *** [/root/build/build_env/ds.bromolow-6.0/source/media_build-bst/v4l/altera-lpt.o] Error 1

Makefile:1227: recipe for target '_module_/root/build/build_env/ds.bromolow-6.0/source/media_build-bst/v4l' failed

make[2]: *** [_module_/root/build/build_env/ds.bromolow-6.0/source/media_build-bst/v4l] Error 2

make[2]: Leaving directory '/root/build/build_env/ds.bromolow-6.0/source/7274-kernel'

Makefile:51: recipe for target 'default' failed

make[1]: *** [default] Error 2

make[1]: Leaving directory '/root/build/build_env/ds.bromolow-6.0/source/media_build-bst/v4l'

Makefile:26: recipe for target 'all' failed

make: *** [all] Error 2

root@NAS:~/build/build_env/ds.bromolow-6.0/source/media_build-bst#

 

How did you get duck.? can anybody help me?

 

In LinuxTV (https://www.linuxtv.org/wiki/index.php/DVBSky) I have read that you need to install required build tools (apt-get install kernel-package linux-headers-`uname -r`), but this command returns the following error:

E: Unable to locate package linux-headers-3.10.77

E: Couldn't find any package by regex 'linux-headers-3.10.77'

 

I have seen the dependencies of cx23885 and they are: videobuf-core.ko, videobuf-dma-sg.ko, rc-core.ko, dvb-core.ko, altera-ci.ko, videodev.ko, v4l2-common.ko, cx2341x.ko, snd-pcm.ko, snd.ko, tveeprom.ko, videobuf-dvb.ko, btcx-risc.ko, tda18271.ko

 

In your pack of compiled modules (dvbsky_modules_dsm6_bromolow_190216.tar.gz) are all except these two: snd-pcm.ko and snd.ko (And if they have dependencies they may also be missing in the pack)

If you were so kind, could you upload these two compiled modules?

I would really appreciate it :smile:

 

In principle all modules are loaded well, except this:

insmod cx23885.ko

insmod: ERROR: could not insert module cx23885.ko: Unknown symbol in module

 

dmesg | grep cx23885

[ 4942.283284] cx23885: Unknown symbol snd_pcm_new (err 0)

[ 4942.283317] cx23885: Unknown symbol snd_card_register (err 0)

[ 4942.283333] cx23885: Unknown symbol snd_card_free (err 0)

[ 4942.283368] cx23885: Unknown symbol snd_pcm_format_physical_width (err 0)

[ 4942.283418] cx23885: Unknown symbol snd_pcm_lib_ioctl (err 0)

[ 4942.283458] cx23885: Unknown symbol snd_pcm_hw_constraint_pow2 (err 0)

[ 4942.283476] cx23885: Unknown symbol snd_pcm_set_ops (err 0)

[ 4942.283554] cx23885: Unknown symbol snd_card_create (err 0)

[ 4942.283569] cx23885: Unknown symbol snd_pcm_period_elapsed (err 0)

 

As I said before, I think it's because I'm missing those two dependencies (snd-pcm.ko and snd.ko), but I am unable to "make" my drivers for the problems I explain above, so I am unable to get those two modules that I am missing.

 

Thank you very much and sorry for my bad english.

Regards :wink:

Share this post


Link to post
Share on other sites

manuelin did you get sorted?

 

I've been having a lot of trouble getting y DVBsky card to work.

 

Where you successful in getting your card working?

Did you have any ideas like what i encountered?

 

Regards,

Share this post


Link to post
Share on other sites
manuelin did you get sorted?

 

I've been having a lot of trouble getting y DVBsky card to work.

 

Where you successful in getting your card working?

Did you have any ideas like what i encountered?

 

Regards,

 

No, I continue with the same problem, I have not advanced anything :sad:

 

foster182, did you get the card to work? What problem do you have exactly?

The part that fails me has worked for you? (When I try the "make" command)

 

Regards :wink:

Share this post


Link to post
Share on other sites
manuelin did you get sorted?

 

I've been having a lot of trouble getting y DVBsky card to work.

 

Where you successful in getting your card working?

Did you have any ideas like what i encountered?

 

Regards,

 

No, I continue with the same problem, I have not advanced anything :sad:

 

foster182, did you get the card to work? What problem do you have exactly?

The part that fails me has worked for you? (When I try the "make" command)

 

Regards :wink:

 

That main problems i'm having is getting certain commands to work.

 

Using firsttris method, i get stuck at step 8

 

''8.) Edit Makefile:

ARCH ?= x86_64

CROSS_COMPILE ?= /usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-''

 

but -sh: ARCH: command not found

 

I've tried installing packages to use this command but no luck.

 

I came into the same situation using Duck's method that commands would not work.

 

Did you have to install separate packages for commands to work?

 

I might go back a try Ducks method again.

Share this post


Link to post
Share on other sites

Can anyone shed some light on this, going to take another crack at trying to get my DVB card working on my Gen8 microserver

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now