Project

General

Profile

Actions

Bug #5649

closed

CA PMT descriptor parsing changed in recent oscam

Added by nautilus7 nautilus7 almost 6 years ago. Updated almost 6 years ago.

Status:
Fixed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
2019-06-08
Due date:
% Done:

100%

Estimated time:
Found in version:
latest version - current source code
Affected Versions:

Description

In the ca pmt creation code, the 0x82 descriptor which informs the ca application (softcam) about the used demux device (and adapter) is misused and filled with different information depending on its position in the ca pmt message. This a totally wrong approach and should be avoided.

See
https://github.com/tvheadend/tvheadend/blob/76dd042e0d3bb93e1102eae65c2d23aa31233274/src/descrambler/capmt.c#L2247
https://github.com/tvheadend/tvheadend/blob/76dd042e0d3bb93e1102eae65c2d23aa31233274/src/descrambler/capmt.c#L2267

The purpose of each descriptor is to carry SPECIFIC data, independently of its position in the message.
The exact structure of a descriptor is determined by its tag.
Imagine what would happen if a DVB SI descriptor carried different information depending on its position in a TS section.

The misuse of this descriptor was hidden in softcams like oscam until recently, when a rewrite of the oscam's ca pmt descriptor parsing code exposed this issue.

If there is a need in tvheadend to send different information each time, then you should use different descriptors.
If none of the already supported ones is appropriate, you should create a new one. Currently oscam supports the following private descriptors in the ca pmt:

1. enigma namespace - carries enigma namespace, tsid and onid - descriptor_tag 0x81 descriptor_length 0x08

2. demux and ca_mask - carries ca device (in bit mask form) and demux device - descriptor_tag 0x82 descriptor_length 0x02 (deprecated)

3. adapter - carries adapter index - descriptor_tag 0x83 descriptor_length 0x01

4. pmt pid - carries pmt pid of the service - descriptor_tag 0x84 descriptor_length 0x02

5. service type mask (live tv, recording, etc) - descriptor_tag 0x85 descriptor_length 0x04

6. demux (added recently) - carries demux device - descriptor_tag 0x86 descriptor_length 0x01

Most of them (if not all) come from enigma and are already supported by tvheadend.
The main problem is the 0x82 descriptor as already mentioned, because it is used with two different ways in tvheadend...

I propose the use of the new 0x86 for sending the demux device in use and drop the deprecated 0x82 completely.
The 0x83 can be also used for sending the adapter info.

AFAIK, dvb adapters for pc do not have any hardware ca devices, so I am not sure how this should be handled.
I guess the virtual ca device should be the same as the demux device, e.g. for demux0 -> ca0, demux1 -> ca1, etc.
In this case, the 0x86 descriptor is enough.
Oscam assumes the ca device index is equal to the demux device when it receives the 0x86 descriptor. (This is also the case for modern enigma boxes)


Files

a.patch (1.25 KB) a.patch Jaroslav Kysela, 2019-06-09 17:22
Actions

Also available in: Atom PDF