Feature #4477

Hardware CI Digital Devices DDCI2

Added by Christian Brauwers 4 months ago. Updated 30 minutes ago.

Status:NewStart date:2017-07-07
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Descrambling
Target version:4.6

Description

Hey,
would it be possible to bring the Solution from Jasmin into TVH ?

I mean the DDCI2 Plugin for VDR : https://github.com/jasmin-j/vdr-plugin-ddci2
I think this would be a great option.

I already take a look at it, but my knowledge isn't good enough for this task.

For the beginning i can help while testing with my Setup (DD Max S8, DD Duo CI, AlphaCrypt with Sky V14 Card)

History

#1 Updated by saen acro 4 months ago

How this is better then GNUTV ?

gnutv -cammenu

#2 Updated by Christian Brauwers 4 months ago

1) I can't get TVH working with my Setup. With or without redirect via ddbridge... no result at all
2) DDCI2 enable MTD

#3 Updated by sharky :-) 3 months ago

Yes , we need this feature in tvh ;-)

#4 Updated by Jasmin Jessich 3 months ago

saen acro wrote:

How this is better then GNUTV ?

The DD CI is a dedicated CI interface which can be used by any tuner.
It is the task of the application to send the scrambled TS stream to a new device (the DD driver defined ciX another driver secX) and read out the descrambled one.
This can be done even with a TS stream received by a tuner which is not from DD and this is really very cool ;)

Additionally the CAM can be used to decode several TS streams from different tuners, if someone takes care of the PIDs in the CA-PMTs and the TS stream (recoding those).
Currently there is only one application available in Linux which supports Multi Tuner Decoding AFAIK, namely VDR.
My Plugin for VDR provides the necessary functions to send the TS stream to the DD CI device and read it out from there. VDR take care of the PIDs in case of MTD (the CAM needs to support this also).

I may be able to support the TVH developers with details, but I am running VDR and have only limited time, so I can't extend TVH with this feature.

BR,
Jasmin

#5 Updated by saen acro 3 months ago

There is linux based solution for this but is closed source,
It work only with DD OEM solution example Anevia Flamingo XL
One CI can descramble from up to 4 tuners.

For those who dont have DD bridge configuration
https://www.linuxtv.org/wiki/index.php/Digital_Devices_DuoFlex_C%26T#Adding_CI

@Jasmin Jessich
Is it possible to remove VDR dependency?

#6 Updated by Daniel Scheller 3 months ago

saen acro wrote:

For those who dont have DD bridge configuration
https://www.linuxtv.org/wiki/index.php/Digital_Devices_DuoFlex_C%26T#Adding_CI

The issue is that this doesn't work as it should, at least when using TVHeadend. With the ca activated in the configuration, still whatever you redirect from/to, it just doesn't descramble.

With the DD CI Bridges and addon boards, you gain soooo much flexibility when going the intended approach of the DD drivers and Jasmin's implementation. The driver creates an additional "sec0" (or "ci0" if you're using the vendor provided package). That device node can be opened r/w. An application then only needs to write an encrypted TS stream to that device and read back the eventually decrypted stream if the CAM or card permissions allow decryption.

This is especially not limited to DD hardware. Basically, any TS stream can be sent in this way to the device. Ie. in my test/dev system, I have a "foreign" single tuner DVB-C installed. With the antenna plugged into that card, VDR+DDCI2 happily descrambles scrambled services received via the "foreign" tuner. There's even no setup involved - no adapter_alloc, no redirect, nothing, just boot system (load drivers), start application (VDR with the DDCI plugin), watch scrambled tv, done.

I'm not very much into the tvheadend internals at all, but I think one way to implement this is to derive functionality from the card client, but instead piping things through FFDECSA or libdvbcsa, the stream must be sent through the device nodes, yet, CAM control still must be done on the ca0 device.

#7 Updated by Daniel Scheller 3 months ago

Oh, and ofcourse, if someone starts to work on this, count me in as a tester.

#8 Updated by Jasmin Jessich 3 months ago

saen acro wrote:

@Jasmin Jessich
Is it possible to remove VDR dependency?

Not really, because it is Plugin for VDR and it is C++.
It also depends on the trigger of VDR to get and return TS packets.

Yes, someone can re-use the code but merely as a pattern than literally.
Again, I have no clue about TVH and how the stream is routed and how someone can interact with the core part of TVH.
In principle it might be possible to convert ddci2 to C or make a glue layer in C++ to be called by C (much less work, I guess), but I have currently no time and will to do that. But I can assist and maybe someone can convince me, that is better I do the work ... . But not now!

BR,
Jasmin

#9 Updated by Christian Brauwers 3 months ago

First let me say, thanks Jasmin to join this Ticket. I know you are working with VDR so thanks :-)

Actually i'm using VDR too cause i can't use my SkyV14 Card anymore with TVH.
Jasmins Solution is working very well. No Problems.

So it would be really really good to implement such things in TVH.

#10 Updated by Christian Brauwers 24 days ago

anyone?

at the moment having big trouble with vdr / kodi ... after switch back to tvh as live tv server everythings running very well ... (but without the subscriptions from my local card of course)
catalinii from minisatip is implementing ddci function into his software. sure i can use then minisatip with tvh ... but would be very good if tvh can do this OOTB

#11 Updated by Jaroslav Kysela 24 days ago

  • Target version set to 4.6

Marking as 4.6 - no priority for me, but it should be implemented.

#12 Updated by Jasmin Jessich 24 days ago

If you need any support, don't hesitate to contact me (eMail see README ddci2 plugin).

Please note, that you need a recent Kernel (4.14.) or my DKMS or the vendor driver package
https://launchpad.net/~jasmin-jessich/+archive/ubuntu/media-build-dkms/+packages
https://github.com/jasmin-j/media-build-dkms
https://github.com/DigitalDevices/dddvb

And keep in min, that the caX/secX(ciX) devices are not dedicated to any tuner device. I don't know if TVH supports this currently. If you plan to also implement MTD, you can look to the VDR sources. MTD is done in the VDR code.
Don't be confused by ciX and secX devices. This depends on the used driver. I plan to make a patch to the driver to rename secX to ciX in the Kernel also. So TVH needs to be able to use both, like ddci2.

BR,
Jasmin

#13 Updated by Christian Brauwers 18 days ago

Thanks @Jaroslav Kysela & @Jasmin Jessich

#14 Updated by sharky :-) 17 days ago

Jaroslav Kysela wrote:

Marking as 4.6 - no priority for me, but it should be implemented.

Jaroslav , that is to late :)

#15 Updated by Jose K 11 days ago

@Jaroslav Kysela
Thx for setting this on your todo list.

#16 Updated by Mark Clarkstone 10 days ago

sharky :-) wrote:

Jaroslav Kysela wrote:

Marking as 4.6 - no priority for me, but it should be implemented.

Jaroslav , that is to late :)

Good things come to those who wait. :) If you can't, you could add it if you know how (I wish I did!).

Tvheadend really needs more people, Jaroslav does a fantastic job, but he's only one person.

#17 Updated by Jasmin Jessich 10 days ago

Tvheadend really needs more people, Jaroslav does a fantastic job, but he's only one person.

In my holidays I met Daniel and he asked me to help.
I installed now TVH on a test machine and I already contacted Jaroslav concerning the required changes.

BUT:
TVH is a complicated piece of SW when you start from scratch with really no knowledge.
I got some little hints from Jaroslav, but I need to understand how TVH works internally to add this feature to TVH. And implementing MTD will be not really easy, I guess.
But first the DD CI needs to be used by a tuner all other things is currently out of scope for me. And don't expect that soon! I am also working on Kernel driver and Kernel build system fixes and my time is really limited.

BR,
Jasmin

#18 Updated by Mark Clarkstone 10 days ago

Jasmin Jessich wrote:

Tvheadend really needs more people, Jaroslav does a fantastic job, but he's only one person.

In my holidays I met Daniel and he asked me to help.
I installed now TVH on a test machine and I already contacted Jaroslav concerning the required changes.

BUT:
TVH is a complicated piece of SW when you start from scratch with really no knowledge.

This is VERY true. I'm no C developer, PHP, Python is what I'm used to, it would take me years to get proficient (in C) for me to even feel comfortable writing code for TVH. I've learnt a great deal from Jaroslav already!

I got some little hints from Jaroslav, but I need to understand how TVH works internally to add this feature to TVH. And implementing MTD will be not really easy, I guess.
But first the DD CI needs to be used by a tuner all other things is currently out of scope for me. And don't expect that soon! I am also working on Kernel driver and Kernel build system fixes and my time is really limited.

BR,
Jasmin

This..

Mark Clarkstone wrote:
Tvheadend really needs more people, Jaroslav does a fantastic job, but he's only one person.

Wasn't directed at you personally, sorry if it seemed that way. TVH is an open project, so anyone can contribute (even in the smallest of ways). The more the merrier!

#19 Updated by Christian Brauwers 9 days ago

@Jasmin Jessich : Do you need a DD CI for testing? i would spend one if its help ... feel free to contact me (du kannst dich gern auf deutsch melden)

#20 Updated by Jasmin Jessich 9 days ago

Do you need a DD CI for testing?

No THX, I got all I need already from DD and I also had some cards bought beforehand.
I have an Octopus CI with a DuoFlex S2 and a Cine S2 V6 with a DuoFlex CI (single and also the duo variant).

At the end the HW is very good abstracted by the driver and the application works with any DD CI card.

BR,
Jasmin

#21 Updated by Jan Schreiber 5 days ago

It really would be awesome if this could be implemented in 4.4, i recently had to move to DVBViewer Media Server (It's supporting MTD out of the box) but TVH was so much better, i would love to be able to switch back to TVH.

If there's anything i can help with (i'm no coder unfortunaltey) i would love to do so, also willing to donate money if this would be of any help.

BR

Jan

#22 Updated by Jasmin Jessich 5 days ago

Please STOP writing every week, that it would be nice to have this in TVH!
This is really annoying and doesn't get things quicker done!

Jaroslav refactored yesterday the CAM handling, which makes it easier to implement the DD CI support. I am working on this in my spare time and it is ready when I am finished. And my time is not much, so it will take time. I don't know the release date of TVH 4.4, but it will take
20..30 hours to implement that. This means 2..3 weeks, depending on my spare time and my work load in the company (yes, I have also a real life!).

i recently had to move to DVBViewer Media Server (It's supporting MTD out of the box) but
TVH was so much better, i would love to be able to switch back to TVH.

In the first step I will support using the DD CI for any tuner, but not MTD.
I have currently no clue how to implement MTD, because this needs to rewrite the PIDs of the TS stream und also rewrite the PIDs in the CA-PMTs. The reason is, that PIDs are not unique across different stations, but need to be unique for the CAM.

i would love to do so, also willing to donate money if this would be of any help.

I don't need any donation and I will not implement this quicker, if you donate. I work on this because I was asked by several people to help and I get no single cent for my volunteer work nor do I want something.

But if you like TVH and if you want to support TVH, of course you can donate so that Jaroslav can continue to work on TVH and make this SW better.

BR,
Jasmin

#23 Updated by saen acro 30 minutes ago

Just to be clear in with mode is better to be set ddbridge.conf
in default

tree /dev/dvb
/dev/dvb
├── adapter0
│   ├── ca0
│   └── ci0
├── adapter1
│   ├── demux0
│   ├── dvr0
│   ├── frontend0
│   └── net0
├── adapter10
│   ├── demux0
│   ├── dvr0
│   ├── frontend0
│   └── net0
├── adapter11
│   ├── demux0
│   ├── dvr0
│   ├── frontend0
│   └── net0
├── adapter12
│   ├── demux0
│   ├── dvr0
│   ├── frontend0
│   └── net0
├── adapter13
│   ├── ca0
│   └── ci0
├── adapter14
│   ├── demux0
│   ├── dvr0
│   ├── frontend0
│   └── net0
├── adapter15
│   ├── demux0
│   ├── dvr0
│   ├── frontend0
│   └── net0
├── adapter16
│   ├── ca0
│   └── ci0
├── adapter17
│   ├── demux0
│   ├── dvr0
│   ├── frontend0
│   └── net0
├── adapter18
│   ├── demux0
│   ├── dvr0
│   ├── frontend0
│   └── net0
├── adapter2
│   ├── demux0
│   ├── dvr0
│   ├── frontend0
│   └── net0
├── adapter3
│   ├── ca0
│   └── ci0
├── adapter4
│   ├── demux0
│   ├── dvr0
│   ├── frontend0
│   └── net0
├── adapter5
│   ├── demux0
│   ├── dvr0
│   ├── frontend0
│   └── net0
├── adapter6
│   ├── demux0
│   ├── dvr0
│   ├── frontend0
│   └── net0
├── adapter7
│   ├── demux0
│   ├── dvr0
│   ├── frontend0
│   └── net0
├── adapter8
│   ├── ca0
│   └── ci0
└── adapter9
    ├── demux0
    ├── dvr0
    ├── frontend0
    └── net0

19 directories, 66 files

if set options ddbridge adapter_alloc=3 msi=0

tree /dev/dvb
/dev/dvb
├── adapter0
│   ├── ca0
│   ├── ca1
│   ├── ci0
│   ├── ci1
│   ├── demux0
│   ├── demux1
│   ├── demux2
│   ├── demux3
│   ├── dvr0
│   ├── dvr1
│   ├── dvr2
│   ├── dvr3
│   ├── frontend0
│   ├── frontend1
│   ├── frontend2
│   ├── frontend3
│   ├── net0
│   ├── net1
│   ├── net2
│   └── net3
├── adapter1
│   ├── ca0
│   ├── ci0
│   ├── demux0
│   ├── demux1
│   ├── dvr0
│   ├── dvr1
│   ├── frontend0
│   ├── frontend1
│   ├── net0
│   └── net1
├── adapter2
│   ├── demux0
│   ├── demux1
│   ├── demux2
│   ├── demux3
│   ├── dvr0
│   ├── dvr1
│   ├── dvr2
│   ├── dvr3
│   ├── frontend0
│   ├── frontend1
│   ├── frontend2
│   ├── frontend3
│   ├── net0
│   ├── net1
│   ├── net2
│   └── net3
└── adapter3
    ├── ca0
    ├── ca1
    ├── ci0
    ├── ci1
    ├── demux0
    ├── demux1
    ├── demux2
    ├── demux3
    ├── dvr0
    ├── dvr1
    ├── dvr2
    ├── dvr3
    ├── frontend0
    ├── frontend1
    ├── frontend2
    ├── frontend3
    ├── net0
    ├── net1
    ├── net2
    └── net3

4 directories, 66 files

by the way is any one deal with Anevia they use debian and CI
if anyone want to test image of Anevia can post it led then 256mb

Also available in: Atom PDF