Feature #3360

Support for extended CW API

Added by B C over 1 year ago. Updated 8 months ago.

Status:NewStart date:2015-11-30
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Descrambling
Target version:4.4

Description

like multiple CWs per channel needed for eg PowerVU support

Keep up the good work

History

#1 Updated by Jaroslav Kysela over 1 year ago

  • Target version set to 4.4

#3 Updated by Joe User 8 months ago

I finally found some free time so I worked on adding extended_cw support to TVheadend. I also add DES decryption. I have it basically working, but only have done limited testing. Quite possibly it will break "normal" CSA decryption, (but at this time I do not have a way to test.) I have tested it with both CSA and DES powervu channels.

Things to do:
Find a way to set when to use the extended_cw (for now it is forced.)
Fix decrypting multiple channels on the same transponder ( now starting second channel stops first from working.)
Add more/better debug/trace messages.

Note: I used the latest oscam (11272) with the latest "offical" oscam-emu patch (they incorporated all my changes recently) But I sometimes had problems with oscam getting the PMT information. It would work the first time after oscam was started, but then not again. I am not sure if the problem is with oscam or tvheadend, but I added a line to oscam which enables it to work (almost) always: (line 3144 after oscam-emu patch is applied)

        if((cfg.dvbapi_boxtype == BOXTYPE_PC || cfg.dvbapi_boxtype == BOXTYPE_PC_NODMX || cfg.dvbapi_boxtype == BOXTYPE_SAMYGO)
                 && buffer[7] == 0x82 && buffer[8] == 0x02)
        {
                *demux_index = buffer[9]; // it is always 0 but you never know
                *adapter_index = buffer[10]; // adapter index can be 0,1,2
                *ca_mask = (1 << *adapter_index); // use adapter_index as ca_mask (used as index for ca_fd[] array)
+                if (buffer[21]==0x84 && buffer[22]==0x02) *pmtpid = b2i(2, buffer+23);
        }

Source code is available on my github account (https://github.com/joeusercz/tvheadend/tree/extended_cw) if anyone wants to try it.

I did not bother with a pull request because much more testing needs to be done!

#4 Updated by Joe User 8 months ago

I finally found some free time so I worked on adding extended_cw support to TVheadend. I also add DES decryption. I have it basically working, but only have done limited testing. Quite possibly it will break "normal" CSA decryption, (but at this time I do not have a way to test.) I have tested it with both CSA and DES powervu channels.

Things to do:
Find a way to set when to use the extended_cw (for now it is forced.)
Fix decrypting multiple channels on the same transponder ( now starting second channel stops first from working.)
Possibly use openssl DES functions. (currently I added cscrypt from oscam-emu.)
Add more/better debug/trace messages.

Note: I used the latest oscam (11272) with the latest "offical" oscam-emu patch (they incorporated all my changes recently) But I sometimes had problems with oscam getting the PMT information. It would work the first time after oscam was started, but then not again. I am not sure if the problem is with oscam or tvheadend, but I added a line to oscam which enables it to work (almost) always: (line 3144 after oscam-emu patch is applied)

        if((cfg.dvbapi_boxtype == BOXTYPE_PC || cfg.dvbapi_boxtype == BOXTYPE_PC_NODMX || cfg.dvbapi_boxtype == BOXTYPE_SAMYGO)
                 && buffer[7] == 0x82 && buffer[8] == 0x02)
        {
                *demux_index = buffer[9]; // it is always 0 but you never know
                *adapter_index = buffer[10]; // adapter index can be 0,1,2
                *ca_mask = (1 << *adapter_index); // use adapter_index as ca_mask (used as index for ca_fd[] array)
+                if (buffer[21]==0x84 && buffer[22]==0x02) *pmtpid = b2i(2, buffer+23);
        }

Source code is available on my github account (https://github.com/joeusercz/tvheadend/tree/extended_cw) if anyone wants to try it.

I did not bother with a pull request because much more testing needs to be done!

#5 Updated by Joe User 8 months ago

I finally found some free time so I worked on adding extended_cw support to TVheadend. I also add DES decryption. I have it basically working, but only have done limited testing. Quite possibly it will break "normal" CSA decryption, (but at this time I do not have a way to test.) I have tested it with both CSA and DES powervu channels.

Things to do:
Find a way to set when to use the extended_cw (for now it is forced.)
Fix decrypting multiple channels on the same transponder ( now starting second channel stops first from working.)
Possibly use openssl DES functions. (currently I added cscrypt from oscam-emu.)
Add extended_cw functionality to LIBDVBCSA. ( currently I only implemented it with ffdecsa.)
Add more/better debug/trace messages.

Note: I used the latest oscam (11272) with the latest "offical" oscam-emu patch (they incorporated all my changes recently) But I sometimes had problems with oscam getting the PMT information. It would work the first time after oscam was started, but then not again. I am not sure if the problem is with oscam or tvheadend, but I added a line to oscam which enables it to work (almost) always: (line 3144 after oscam-emu patch is applied)

        if((cfg.dvbapi_boxtype == BOXTYPE_PC || cfg.dvbapi_boxtype == BOXTYPE_PC_NODMX || cfg.dvbapi_boxtype == BOXTYPE_SAMYGO)
                 && buffer[7] == 0x82 && buffer[8] == 0x02)
        {
                *demux_index = buffer[9]; // it is always 0 but you never know
                *adapter_index = buffer[10]; // adapter index can be 0,1,2
                *ca_mask = (1 << *adapter_index); // use adapter_index as ca_mask (used as index for ca_fd[] array)
+                if (buffer[21]==0x84 && buffer[22]==0x02) *pmtpid = b2i(2, buffer+23);
        }

Source code is available on my github account (https://github.com/joeusercz/tvheadend/tree/extended_cw) if anyone wants to try it.

I did not bother with a pull request because much more testing needs to be done!

Also available in: Atom PDF