Project

General

Profile

Feature #4477

Hardware CI Digital Devices DDCI2

Added by Christian Brauwers over 7 years ago. Updated almost 7 years ago.

Status:
Fixed
Priority:
Normal
Assignee:
-
Category:
Descrambling
Target version:
Start date:
2017-11-29
Due date:
% Done:

0%

Estimated time:
(Total: 0.00 h)

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)


Files

backup-23112015.json (73.6 KB) backup-23112015.json saen acro, 2017-10-22 21:33

Subtasks

Feature #4750: DDCI2 - implement multi-transport-stream-decoding (MTD)AcceptedJaroslav Kysela

Actions

History

#1

Updated by saen acro over 7 years ago

How this is better then GNUTV ?

gnutv -cammenu

#2

Updated by Christian Brauwers over 7 years 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 :-) over 7 years ago

Yes , we need this feature in tvh ;-)

#4

Updated by Jasmin Jessich over 7 years 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 over 7 years 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 over 7 years 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 over 7 years ago

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

#8

Updated by Jasmin Jessich over 7 years 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 over 7 years 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 about 7 years 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 about 7 years ago

  • Target version set to 999

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

#12

Updated by Jasmin Jessich about 7 years 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 about 7 years ago

Thanks @Jaroslav Kysela & @Jasmin Jessich

#14

Updated by sharky :-) about 7 years 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 Anonymous about 7 years ago

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

#16

Updated by Mark Clarkstone about 7 years 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 about 7 years 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 about 7 years 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 about 7 years 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 about 7 years 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 about 7 years 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 about 7 years 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 about 7 years 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

#24

Updated by Jasmin Jessich about 7 years ago

saen acro wrote:

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

Currently TVH can't use a dedicated DDCI. This means you need to use the redirect feature of the DD driver to connect the CI with a tuner. For this you need adapter_alloc=3, because TVH needs to find the caX device in the same adapter directory as the frontend dvr and all the other devices.

But this issue is dealing with the implementation of the dedicated DDCI feature. So please ask your question in the forum.

BR,
Jasmin

#25

Updated by saen acro about 7 years ago

Jasmin is Anevia write some special software because they do not care where is attached CI.

[    1.875742] ddbridge 0000:04:00.0: Port 0: Link 0, Link Port 0 (TAB 1): CI
[    1.877176] ddbridge 0000:04:00.0: Port 1: Link 0, Link Port 1 (TAB 2): DUAL DVB-S2
[    1.878173] ddbridge 0000:04:00.0: Port 2: Link 0, Link Port 2 (TAB 3): CI
[    1.879140] ddbridge 0000:04:00.0: Port 3: Link 0, Link Port 3 (TAB 4): DUAL DVB-S2
[    2.393732] ddbridge 0000:0a:00.0: Port 0: Link 0, Link Port 0 (TAB 1): NO MODULE
[    2.394649] ddbridge 0000:0a:00.0: Port 1: Link 0, Link Port 1 (TAB 2): DUAL DVB-S2
[    2.395654] ddbridge 0000:0a:00.0: Port 2: Link 0, Link Port 2 (TAB 3): CI
[    2.396668] ddbridge 0000:0a:00.0: Port 3: Link 0, Link Port 3 (TAB 4): NO MODULE
[    2.626396] ddbridge 0000:0b:00.0: Port 0: Link 0, Link Port 0 (TAB 1): NO MODULE
[    2.628201] ddbridge 0000:0b:00.0: Port 1: Link 0, Link Port 1 (TAB 2): DUAL DVB-C/T
[    2.630073] ddbridge 0000:0b:00.0: Port 2: Link 0, Link Port 2 (TAB 3): DUAL DVB-C/T
[    2.631061] ddbridge 0000:0b:00.0: Port 3: Link 0, Link Port 3 (TAB 4): NO MODULE
[    4.552900] ddbridge 0000:0d:00.0: Port 0: Link 0, Link Port 0 (TAB 1): CI
[    4.553864] ddbridge 0000:0d:00.0: Port 1: Link 0, Link Port 1 (TAB 2): DUAL DVB-S2
[    4.554887] ddbridge 0000:0d:00.0: Port 2: Link 0, Link Port 2 (TAB 3): CI
[    4.555810] ddbridge 0000:0d:00.0: Port 3: Link 0, Link Port 3 (TAB 4): DUAL DVB-S2
.....

[    1.872624] ddbridge 0000:04:00.0: device name: Digital Devices Octopus OEM
[    1.872642] ddbridge 0000:04:00.0: HW 0001000d REGMAP 00010004
[    2.392108] ddbridge 0000:0a:00.0: device name: Digital Devices Octopus OEM
[    2.392122] ddbridge 0000:0a:00.0: HW 0001000d REGMAP 00010004
[    2.625146] ddbridge 0000:0b:00.0: device name: Digital Devices Octopus OEM
[    2.625163] ddbridge 0000:0b:00.0: HW 0001000d REGMAP 00010004
[    4.551432] ddbridge 0000:0d:00.0: device name: Digital Devices Octopus OEM
[    4.551447] ddbridge 0000:0d:00.0: HW 0001000d REGMAP 00010004

#26

Updated by Jasmin Jessich about 7 years ago

saen acro wrote:

Jasmin is Anevia write some special software because they do not care where is attached CI.

I don't know Anevia, but what you are posting is the Kernel log and not the log of a usermode program!

The Kernel uses the adaper_alloc setting to create the caX/ciX/frontedX/.. devices in the adapterX directories according to the setting.

The usermode programm needs to detect if the caX device belongs to a frontendX device (hard wired) or if it is independent. This detection is currently done by the VDR program this way:
If the caX device is in the same adapter directory as the frontedX program:
--> hard_wired
If the caX device is in a dedicated adapter directory:
--> freely usable by any tuner

I am implementing this feature also in TVH and use the same algorithm. This requires no configuration and is proofed to work with VDR (see GitHub):
https://github.com/jasmin-j/tvheadend/tree/ddci_work

BR,
Jasmin

#27

Updated by saen acro about 7 years ago

This is log from Anevia device with ubuntu 16.04
official image have expired license and is useless as support of anevia

official image use old NGINE driver

#28

Updated by Jasmin Jessich about 7 years ago

Sorry, but I don't know how I can help you and what this has to do with this feature request?
So please stop hijacking this thread and open another one or ask in the forum!

BR,
Jasmin

#31

Updated by Jaroslav Kysela almost 7 years ago

  • Target version changed from 999 to 4.4
#32

Updated by Jaroslav Kysela almost 7 years ago

  • Status changed from New to Fixed

I'm closing this. For MTD, we should have another feature request.

Also available in: Atom PDF