Opened 11 years ago

Closed 10 years ago

#3102 closed defect (fixed)

constcw pmt

Reported by: Sedoy Owned by:
Priority: major Component: DVBApi
Severity: medium Keywords:
Cc: Sensitive: no

Description

Revision

All

Issue Description

If 2 Channels have the same caid and sid, oscam use only the first Key in const.cw list. Currently oscam not filter the File if different pmt use to Channel decode.
Example:
CAID:PROVIDER:SID:PMT:PID::XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX
2600:000000:0004:17EE:1FFF::XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX #1 Channel
2600:000000:0004:0C01:1FFF::XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX #2 Channel

Oscam decode only the 1 Channel and try to decode the 2 Channel with the Key from 1 Channel with Blackscreen.

When the issue occurs

Always

How the issue is reproducable

Always

Attachments (5)

const_cw_provid_ecmpid.patch (1.3 KB ) - added by theparasol 10 years ago.
added optional provid and ecmpid
const_cw_provid_ecmpid_vpid.patch (8.3 KB ) - added by theparasol 10 years ago.
added vpid handling
const_cw_provid_ecmpid_vpid_v2.patch (10.8 KB ) - added by theparasol 10 years ago.
vpid v2 + more debug output on unhandled ecm responses
const_cw_provid_ecmpid_vpid_v3.patch (11.4 KB ) - added by theparasol 10 years ago.
v2 + fix for multiecmpid channels
const_cw_provid_ecmpid_vpid_v4.patch (11.9 KB ) - added by theparasol 10 years ago.
v3 + fix for dvbapi adding same ecmpid more than once

Download all attachments as: .zip

Change History (21)

comment:1 by juppdidupp, 10 years ago

Priority: minormajor

The bug seemed to have been fixed a lot of SVNs ago (SVN 6089: http://www.streamboard.tv/oscam/ticket/2084).

However, the problem is still existing: OSCam does not read and compare the PMT PID with the entries in the constcw file. Being able to have this second (or even a third) attribute would really add great value to the BISS functionality and, simultaneously, decrease the attractivity of such dubious spin-offs like ymod.

comment:2 by theparasol, 10 years ago

Added PROVID and ECMPID (both optional!)
So now all attributes are evaluated except PMT PID (WTF is this anyway? TSID / ONID I know PMT PID not)
However that 'PMT PID' isnt considered in oscam DVBAPI module yet.
So implementing is a bit difficult if we even dont know what PMT PID should be
Very strange that BISS, as even the ECMPID is equal amongst channels.
If TSID or ONID should be added this has effect on all other cas systems too

So plz add some real live logs with some channels logged with -d129 and make sure this section is in it:

2013/09/07 21:49:17 1013B580 c New PMT info from server (total size: 52)
2013/09/07 21:49:17 1013B580 9F 80 32 82 00 2E 03 27 14 F9 00 19 01 81 08 FF
2013/09/07 21:49:17 1013B580 FF 00 00 00 0A 03 E8 82 02 01 01 84 02 05 78 09
2013/09/07 21:49:17 1013B580 04 06 04 F3 8C 03 00 37 00 00 02 00 3A 00 00 06
2013/09/07 21:49:17 1013B580 00 AE 00 00
2013/09/07 21:49:17 1013B580 c capmt:
2013/09/07 21:49:17 1013B580 03 27 14 F9 00 19 01 81 08 FF FF 00 00 00 0A 03
2013/09/07 21:49:17 1013B580 E8 82 02 01 01 84 02 05 78 09 04 06 04 F3 8C 03
2013/09/07 21:49:17 1013B580 00 37 00 00 02 00 3A 00 00 06 00 AE 00 00
2013/09/07 21:49:17 1013B580 c [DVBAPI] Receiver sends PMT command 3 for channel 2714
2013/09/07 21:49:17 1013B580 c [pmt] type: 81 length: 8 (assuming enigma private descriptor: namespace ffff0000 tsid 0a onid 3e8)
2013/09/07 21:49:17 1013B580 c [pmt] type: 82 length: 2
2013/09/07 21:49:17 1013B580 c [pmt] type: 84 length: 2
2013/09/07 21:49:17 1013B580 c [pmt] type: 09 length: 4
2013/09/07 21:49:17 1013B580 c [ADD PID 0] CAID: 0604 ECM_PID: 138C PROVID: 000000
2013/09/07 21:49:17 1013B580 c [pmt] stream_type: 03 pid: 0037 length: 0
2013/09/07 21:49:17 1013B580 c [pmt] stream_type: 02 pid: 003a length: 0
2013/09/07 21:49:17 1013B580 c [pmt] stream_type: 06 pid: 00ae length: 0
2013/09/07 21:49:17 1013B580 c Found 1 ECMpids and 3 STREAMpids in PMT
2013/09/07 21:49:17 1013B580 c [DVBAPI] Receiver wants to demux srvid 2714 on adapter 0000 camask 0001 index 0001
2013/09/07 21:49:17 1013B580 c New program number: 2714 (RTL 4) [pmt_list_management 3]

by theparasol, 10 years ago

added optional provid and ecmpid

comment:3 by Sedoy, 10 years ago

This is a Log without your Patch, because all BISS Channels use PROVID 000000 and ECM-PID 1FFF. In this example, the first key is used from the list, although that is wrong, just because the SID are the same. It would be better perhaps as mgcamd make,in addition that uses the video PID.

Log:

2013/09/08 15:04:45 76E03898 c [DVBAPI] new events occurred on 1 of 1 handlers after 15210 ms inactivity
2013/09/08 15:04:45 76E03898 c [DVBAPI] now handling fd 9 that reported event 1
2013/09/08 15:04:45 76E03898 c new socket connection fd: 14
2013/09/08 15:04:45 76E03898 c capmt:
2013/09/08 15:04:45 76E03898    03 00 01 05 00 19 01 81 08 0D E8 2C 7D 00 01 00 
2013/09/08 15:04:45 76E03898    01 82 02 01 00 84 02 01 00 09 04 26 00 FF FF 02 
2013/09/08 15:04:45 76E03898    01 01 00 00 04 01 02 00 00 06 01 0A 00 00 
2013/09/08 15:04:45 76E03898 c [DVBAPI] Receiver sends PMT command 3 for channel 0001
2013/09/08 15:04:45 76E03898 c [pmt] type: 81 length: 8 (assuming enigma private descriptor: namespace de82c7d tsid 01 onid 01)
2013/09/08 15:04:45 76E03898 c [pmt] type: 82 length: 2
2013/09/08 15:04:45 76E03898 c [pmt] type: 84 length: 2
2013/09/08 15:04:45 76E03898 c [pmt] type: 09 length: 4
2013/09/08 15:04:45 76E03898 c [ADD PID 0] CAID: 2600 ECM_PID: 1FFF PROVID: 000000
2013/09/08 15:04:45 76E03898 c [pmt] stream_type: 02 pid: 0101 length: 0
2013/09/08 15:04:45 76E03898 c [pmt] stream_type: 04 pid: 0102 length: 0
2013/09/08 15:04:45 76E03898 c [pmt] stream_type: 06 pid: 010a length: 0
2013/09/08 15:04:45 76E03898 c Found 1 ECMpids and 3 STREAMpids in PMT
2013/09/08 15:04:45 76E03898 c [DVBAPI] Receiver wants to demux srvid 0001 on adapter 0000 camask 0001 index 0000
2013/09/08 15:04:45 76E03898 c New program number: 0001 (2600:0001 unknown) [pmt_list_management 3]
2013/09/08 15:04:45 76E03898 c [DVBAPI] Demuxer #0 demux_index:  0 ca_mask: 01 program_info_length:  25 ca_pmt_list_management 03
2013/09/08 15:04:45 76E03898 c [PRIORITIZE PID 0] 2600:000000:1FFF:0000 (rdr: constcw weight: 2)
2013/09/08 15:04:45 76E03898 c [DVBAPI] Demuxer #0 trying to descramble PID #0 CAID 2600 PROVID 000000 ECMPID 1FFF ANY CHID
2013/09/08 15:04:45 76E03898 c [DVBAPI] Demuxer #0 try to start new filter for caid: 2600, provid: 000000, pid: 1FFF
2013/09/08 15:04:45 76E03898 c DEVICE open (/dev/dvb/adapter0/demux0) fd 15
2013/09/08 15:04:45 76E03898 c [DVBAPI] Demuxer #0 Filter #1 started succesfully (caid 2600 provid 000000 pid 1FFF)
2013/09/08 15:04:45 76E03898 c [DVBAPI] Demuxer #0 Filter #1 set ecmtable to ODD+EVEN (CAID 2600 PROVID 000000 FD 15)
2013/09/08 15:04:45 76E03898 c [DVBAPI] Demuxer #0 Filter #1 set chid to ANY CHID on fd 15
2013/09/08 15:04:46 76E03898 c request_cw stage=3 to reader constcw ecm hash=C2391522B06EB289B06E8AFB73F25CF2
2013/09/08 15:04:46 76E01B00 p ---- ecm_task 0, idx 1, sflag=1
2013/09/08 15:04:46 76E01B00 p Entry found: 2600:000000:0001:0021:1FFF::XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX 
2013/09/08 15:04:46 76E01B00 p notice: changed dcw checksum byte cw[3] from 00 to 11
2013/09/08 15:04:46 76E01B00 p notice: changed dcw checksum byte cw[7] from 00 to 11
2013/09/08 15:04:46 76E01B00 p notice: changed dcw checksum byte cw[11] from 00 to 11
2013/09/08 15:04:46 76E01B00 p notice: changed dcw checksum byte cw[15] from 00 to 11
2013/09/08 15:04:46 76E01B00 p start client thread action 32
2013/09/08 15:04:46 76E01B00 p constcw [constcw] TRACE: ecm answer for ecm hash C2391522B06EB289B06E8AFB73F25CF2 rc=0
2013/09/08 15:04:46 76E03898 c add reader job action 5 queue length 0 constcw
2013/09/08 15:04:46 76E03898 c [DVBAPI] Demuxer #0 request cw for ecm 2600&000000/1FFF/0001/0B:00000000000000000000000000000000
2013/09/08 15:04:46 76E03898 c [DVBAPI] Demuxer #0 has 1 ecmpids, 3 streampids, 1 ecmfilters and 0 emmfilters
2013/09/08 15:04:46 76E03898 c data from add_job action=32 client c vu
2013/09/08 15:04:46 76E03898 c [DVBAPI] Demuxer #0 controlword received for PID #0 CAID 2600 PROVID 000000 ECMPID 1FFF CHID 0000
2013/09/08 15:04:46 76E03898 c [DVBAPI] Demuxer #0 luckyshot new controlword ecm response hash C2391522B06EB289B06E8AFB73F25CF2 (ecm table reset)
2013/09/08 15:04:46 76E03898 c [DVBAPI] Demuxer #0 descrambling PID #0 CAID 2600 PROVID 000000 ECMPID 1FFF CHID 00
2013/09/08 15:04:46 76E03898 c [DVBAPI] added to channel cache: 2600&000000/1FFF/0001/00:(null)
2013/09/08 15:04:46 76E03898 c [DVBAPI] Demuxer #0 PID: #0 CAID: 2600 ECMPID: 1FFF is using index 0
2013/09/08 15:04:46 76E03898 c DEVICE open (/dev/dvb/adapter0/ca0) fd 16
2013/09/08 15:04:46 76E03898 c [DVBAPI] Demuxer #0 stream #1 CA_SET_PID pid=0x0101 index=0
2013/09/08 15:04:46 76E03898 c [DVBAPI] Demuxer #0 stream #2 CA_SET_PID pid=0x0102 index=0
2013/09/08 15:04:46 76E03898 c [DVBAPI] Demuxer #0 stream #3 CA_SET_PID pid=0x010a index=0
2013/09/08 15:04:46 76E03898 c [DVBAPI] Demuxer #0 writing odd part (here_is_the_cw) of controlword, replacing expired (0000000000000000)
2013/09/08 15:04:46 76E03898 c [DVBAPI] Demuxer #0 write cw0 index: 0 (ca0)
2013/09/08 15:04:46 76E03898 c [DVBAPI] Demuxer #0 writing even part (here_is_the_cw) of controlword, replacing expired (0000000000000000)
2013/09/08 15:04:46 76E03898 c [DVBAPI] Demuxer #0 write cw1 index: 0 (ca0)
2013/09/08 15:04:46 76E03898 c vu (2600&000000/1FFF/0001/0B:here_is_the_dcw): found (43 ms) by constcw

Last edited 10 years ago by Sedoy (previous) (diff)

comment:4 by theparasol, 10 years ago

Can you give me the output of these lines from different BISS channels?

2013/09/08 23:53:30 1013BB68 c [pmt] type: 81 length: 8 (assuming enigma private descriptor: namespace ffff0000 tsid 0a onid 3e8)

(you can see it with -d128 loglevel right after channelchange)

comment:5 by Sedoy, 10 years ago

Here:

2013/09/08 23:59:11   4F5508 c [pmt] type: 81 length: 8 (assuming enigma private descriptor: namespace de82c7d tsid 01 onid 01)

2013/09/09 00:02:43   4F5508 c [pmt] type: 81 length: 8 (assuming enigma private descriptor: namespace 820000 tsid 1e14 onid 13e)

2013/09/09 00:04:16   4F5508 c [pmt] type: 81 length: 8 (assuming enigma private descriptor: namespace de80000 tsid 0c onid 55)

2013/09/09 00:05:39   4F5508 c [pmt] type: 81 length: 8 (assuming enigma private descriptor: namespace 320000 tsid 11 onid 55)

2013/09/09 00:08:09   4F5508 c [pmt] type: 81 length: 8 (assuming enigma private descriptor: namespace 320000 tsid 0c onid 55)

comment:6 by theparasol, 10 years ago

darn.. not unique either :(

for videopid the whole dvbapi ecm request and returned controlword matching has to change.

by theparasol, 10 years ago

added vpid handling

comment:7 by gf, 10 years ago

@theparasol: That patch is a very bad idea because you are breaking user visible file format.

comment:8 by theparasol, 10 years ago

Can you give more detail GF since I dont get the essence of your remark.
Can it be done better/different?

comment:9 by gf, 10 years ago

-sscanf(token, "%4x:%6x:%4x:%4x:%4x::%2x %2x %2x %2x %2x %2x %2x %2x %2x %2x %2x %2x %2x %2x %2x %2x", &caid, &provid, &sid, &pmt, &pid, 
+sscanf(token, "%4x:%6x:%4x:%4x:%4x::%2x %2x %2x %2x %2x %2x %2x %2x %2x %2x %2x %2x %2x %2x %2x %2x", &caid, &provid, &sid, &vpid, &ecmpid, 

If I'm reading the patch correctly you are adding another field in file that have already established format. If that is the case this would break the parsing of files not migrated to the new format.

comment:10 by theparasol, 10 years ago

Now I get the point... PMT wasnt even used in oscam before and from the example files I got from Sedoy PMT is for real vpid, so I just gave it the right name.

comment:11 by Sedoy, 10 years ago

With last Patch its completely not working. Say rejecting reader sid.

comment:12 by theparasol, 10 years ago

plz provide a -d129 logfile + constcw file (replace controlwords with something invalid!)

comment:13 by Sedoy, 10 years ago

Log:

-------------------------------------------------------------------------------
>> OSCam <<  cardserver started at Mon Sep  9 22:39:07 2013
-------------------------------------------------------------------------------
2013/09/09 22:39:07        0 s >> OSCam <<  cardserver started, version 1.20-VU+Duo, build r8906 (mipsel-newnigma2-linux-gnu-ssl)
2013/09/09 22:39:07        0 s creating pidfile /tmp/.oscam/oscam.pid with pid 5256
2013/09/09 22:39:07        0 s 1 AES key(s) added on reader oben for 0500:030b00
2013/09/09 22:39:07        0 s userdb reloaded: 1 accounts loaded, 0 expired, 0 disabled
2013/09/09 22:39:07        0 s signal handling initialized
2013/09/09 22:39:07        0 s 177 service-id's loaded in 6ms
2013/09/09 22:39:07        0 s constcw [constcw] creating thread for device /usr/keys/constcw
2013/09/09 22:39:07        0 s anti cascading disabled
2013/09/09 22:39:07 77403C68 p local reader: constcw (file: /usr/keys/constcw) constant cw
2013/09/09 22:39:07 77403C68 p constcw [constcw] proxy initialized, server /usr/keys/constcw:0
2013/09/09 22:39:07 77405900 c plain dvbapi-client granted (vu, au=auto (12 reader))
2013/09/09 22:39:07 77405900 c [DVBAPI] Detected /dev/dvb/adapter0/demux0 Api: 0, userconfig boxtype: 1
2013/09/09 22:39:07   4CD160 h webif: decompressed 53474 bytes back into 153576 bytes
2013/09/09 22:39:07   4CD160 h HTTP Server running. ip=0.0.0.0 port=502
2013/09/09 22:39:12   4CD160 h all debug_level=1
2013/09/09 22:39:12   4CD160 h WebIf: Origin checked. Result: access from 192.168.177.20 => allowed
2013/09/09 22:39:14   4CD160 h all debug_level=129
2013/09/09 22:39:14   4CD160 h WebIf: Origin checked. Result: access from 192.168.177.20 => allowed
2013/09/09 22:39:20 77405900 c [DVBAPI] new events occurred on 1 of 1 handlers after 13492 ms inactivity
2013/09/09 22:39:20 77405900 c [DVBAPI] now handling fd 9 that reported event 1
2013/09/09 22:39:20 77405900 c new socket connection fd: 15
2013/09/09 22:39:20 77405900 c capmt:
2013/09/09 22:39:20 77405900    03 00 0C 05 00 19 01 81 08 0D E8 2C 7D 00 01 00 
2013/09/09 22:39:20 77405900    01 82 02 01 00 84 02 0C 00 09 04 26 00 FF FF 02 
2013/09/09 22:39:20 77405900    0C 01 00 00 04 0C 02 00 00 
2013/09/09 22:39:20 77405900 c [DVBAPI] Receiver sends PMT command 3 for channel 000C
2013/09/09 22:39:20 77405900 c [pmt] type: 81 length: 8 (assuming enigma private descriptor: namespace de82c7d tsid 01 onid 01)
2013/09/09 22:39:20 77405900 c [pmt] type: 82 length: 2
2013/09/09 22:39:20 77405900 c [pmt] type: 84 length: 2
2013/09/09 22:39:20 77405900 c [pmt] type: 09 length: 4
2013/09/09 22:39:20 77405900 c [ADD PID 0] CAID: 2600 ECM_PID: 1FFF PROVID: 000000
2013/09/09 22:39:20 77405900 c [pmt] stream_type: 02 pid: 0c01 length: 0
2013/09/09 22:39:20 77405900 c [pmt] stream_type: 04 pid: 0c02 length: 0
2013/09/09 22:39:20 77405900 c Found 1 ECMpids and 2 STREAMpids in PMT
2013/09/09 22:39:20 77405900 c [DVBAPI] Receiver wants to demux srvid 000C on adapter 0000 camask 0001 index 0000
2013/09/09 22:39:20 77405900 c New program number: 000C (2600:000C unknown) [pmt_list_management 3]
2013/09/09 22:39:20 77405900 c [DVBAPI] Demuxer #0 demux_index:  0 ca_mask: 01 program_info_length:  25 ca_pmt_list_management 03
2013/09/09 22:39:20 77405900 c [PRIORITIZE PID 0] 2600:000000:1FFF:0000 (rdr: constcw weight: 2)
2013/09/09 22:39:20 77405900 c [DVBAPI] Demuxer #0 trying to descramble PID #0 CAID 2600 PROVID 000000 ECMPID 1FFF ANY CHID
2013/09/09 22:39:20 77405900 c [DVBAPI] Demuxer #0 try to start new filter for caid: 2600, provid: 000000, pid: 1FFF
2013/09/09 22:39:20 77405900 c DEVICE open (/dev/dvb/adapter0/demux0) fd 16
2013/09/09 22:39:20 77405900 c [DVBAPI] Demuxer #0 Filter #1 started succesfully (caid 2600 provid 000000 pid 1FFF)
2013/09/09 22:39:20 77405900 c [DVBAPI] Demuxer #0 Filter #1 set ecmtable to ODD+EVEN (CAID 2600 PROVID 000000 FD 16)
2013/09/09 22:39:20 77405900 c [DVBAPI] Demuxer #0 Filter #1 set chid to ANY CHID on fd 16
2013/09/09 22:39:20 77405900 c request_cw stage=3 to reader constcw ecm hash=768A679044D15774A2409D8AF72F0D33
2013/09/09 22:39:20 77403C68 p ---- ecm_task 0, idx 1, sflag=1
2013/09/09 22:39:20 77403C68 p start client thread action 32
2013/09/09 22:39:20 77403C68 p constcw [constcw] TRACE: ecm answer for ecm hash 768A679044D15774A2409D8AF72F0D33 rc=4
2013/09/09 22:39:20 77405900 c add reader job action 5 queue length 0 constcw
2013/09/09 22:39:20 77405900 c [DVBAPI] Demuxer #0 request cw for ecm 2600&000000/1FFF/000C/09:00000000000000000000000000000000
2013/09/09 22:39:20 77405900 c [DVBAPI] Demuxer #0 has 1 ecmpids, 2 streampids, 1 ecmfilters and 0 emmfilters
2013/09/09 22:39:20 77405900 c data from add_job action=32 client c vu
2013/09/09 22:39:20 77405900 c [DVBAPI] This ecm response is unhandled!
2013/09/09 22:39:20 77405900 c vu (2600&000000/1FFF/000C/09:00000000000000000000000000000000): rejected reader sid (53 ms) by constcw
2013/09/09 22:39:24 77405900 c [DVBAPI] new events occurred on 1 of 3 handlers after 3532 ms inactivity
2013/09/09 22:39:24 77405900 c [DVBAPI] now handling fd 15 that reported event 17
2013/09/09 22:39:24 77405900 c [DVBAPI] Demuxer #0 stop descrambling program number 000C (2600:000C unknown)
2013/09/09 22:39:24 77405900 c [DVBAPI] Demuxer #0 stop Filter #1 (fd: 16 api: 0, caid: 2600, provid: 000000, ecmpid: 1FFF)
2013/09/09 22:39:24 77405900 c DEVICE open (/dev/dvb/adapter0/ca0) fd 16
2013/09/09 22:39:24 77405900 c [DVBAPI] Demuxer #0 stream #1 CA_SET_PID pid=0x0c01 index=-1
2013/09/09 22:39:24 77405900 c [DVBAPI] Demuxer #0 stream #2 CA_SET_PID pid=0x0c02 index=-1
2013/09/09 22:39:26        0   start client thread action 31
2013/09/09 22:39:26 77405900 c data from add_job action=31 client c vu
2013/09/09 22:39:27 77405900 c [DVBAPI] new events occurred on 1 of 1 handlers after 3067 ms inactivity
2013/09/09 22:39:27 77405900 c [DVBAPI] now handling fd 9 that reported event 1
2013/09/09 22:39:27 77405900 c new socket connection fd: 15
2013/09/09 22:39:27 77405900 c capmt 3f:
2013/09/09 22:39:27 77405900    9F 80 3F 04 83 02 00 00 

und constcw:

2600:000000:000C:0C01:1FFF::XXXXXXXXXXXXXXXXXXXXXXXXX #RTR Planeta (4.0W)

comment:14 by theparasol, 10 years ago

Yep.. found it, hope no more leftovers ;)

Plz test v2!

by theparasol, 10 years ago

vpid v2 + more debug output on unhandled ecm responses

by theparasol, 10 years ago

v2 + fix for multiecmpid channels

by theparasol, 10 years ago

v3 + fix for dvbapi adding same ecmpid more than once

comment:15 by Sedoy, 10 years ago

svn 8911 working now. Thanks for fix.

comment:16 by theparasol, 10 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.