catalinii / minisatip

minisatip is an SATIP server for linux using local DVB-S2, DVB-C, DVB-T or ATSC cards
https://minisatip.org
328 stars 81 forks source link

EMMs not sent to CAM when using DD CI #960

Closed Jalle19 closed 2 years ago

Jalle19 commented 2 years ago

I've been using a CAM for about two months now, and two times I've had to move the CAM temporarily to my TV in order to get entitlements updated. I suspect there's something wrong with the code, but I'm not really sure how to fix it.

@catalinii AFAICT you added support for this many years ago? Not sure when it stopped working.

Jalle19 commented 2 years ago

I'm also thinking that this could be part of the reason why Kabelio CAMs cannot be initialized fully (https://github.com/catalinii/minisatip/issues/910). Many are saying that some CAMs need to have data passed to them before they "wake up" and initialize the content control resource, and perhaps missing EMMs is why this doesn't seem to have any effect when using minisatip.

Yuri666 commented 2 years ago

To test your assumption, needs to try to initialize the Kabello CAM in dvb card with imbedded CI interface - it pass full transonder stream to the CAM.

catalinii commented 2 years ago

The problem was reported before however was not able to repro. If you tune to a TP i. The beginning and leave it that way for let's say an hour, the CAM will get updated and EMMs are working fine. I think something happens of you keep changing the channels.

If you get a repro I can take a look. This is where the mapping of emm pids happens: https://github.com/catalinii/minisatip/blob/master/src/ddci.c#L1250

Jalle19 commented 2 years ago

My logs look like this when grepping for that particular log line:

$ journalctl -u minisatip --since "2022-03-27 19:00:00" | grep 'CAT pos\|mapped adapter'
Mar 27 19:50:03 vladimir minisatip[22640]: [27/03 19:50:03.372 AD0]: mapped adapter 0 (0) pid 1 (1) to 1, pmt 12
Mar 27 19:50:03 vladimir minisatip[22640]: [27/03 19:50:03.372 AD0]: mapped adapter 0 (0) pid 1464 (1464) to 1464, pmt 12
Mar 27 19:50:03 vladimir minisatip[22640]: [27/03 19:50:03.372 AD0]: mapped adapter 0 (0) pid 2758 (2758) to 2758, pmt 12
Mar 27 19:50:03 vladimir minisatip[22640]: [27/03 19:50:03.372 AD0]: mapped adapter 0 (0) pid 450 (450) to 450, pmt 12
Mar 27 19:50:03 vladimir minisatip[22640]: [27/03 19:50:03.372 AD0]: mapped adapter 0 (0) pid 550 (550) to 550, pmt 12
Mar 27 19:50:03 vladimir minisatip[22640]: [27/03 19:50:03.372 AD0]: mapped adapter 0 (0) pid 552 (552) to 552, pmt 12
Mar 27 19:50:03 vladimir minisatip[22640]: [27/03 19:50:03.373 AD0]: CAT pos 0 caid 0B00, pid 0
Mar 27 19:50:03 vladimir minisatip[22640]: [27/03 19:50:03.373 AD0]: mapped adapter 0 (0) pid 0 (0) to 0, pmt -1
Mar 27 19:51:59 vladimir minisatip[22640]: [27/03 19:51:59.577 AD0]: mapped adapter 0 (0) pid 1 (1) to 1, pmt 12
Mar 27 19:51:59 vladimir minisatip[22640]: [27/03 19:51:59.577 AD0]: mapped adapter 0 (0) pid 1464 (1464) to 1464, pmt 12
Mar 27 19:51:59 vladimir minisatip[22640]: [27/03 19:51:59.577 AD0]: mapped adapter 0 (0) pid 2758 (2758) to 2758, pmt 12
Mar 27 19:51:59 vladimir minisatip[22640]: [27/03 19:51:59.577 AD0]: mapped adapter 0 (0) pid 450 (450) to 450, pmt 12
Mar 27 19:51:59 vladimir minisatip[22640]: [27/03 19:51:59.577 AD0]: mapped adapter 0 (0) pid 550 (550) to 550, pmt 12
Mar 27 19:51:59 vladimir minisatip[22640]: [27/03 19:51:59.577 AD0]: mapped adapter 0 (0) pid 552 (552) to 552, pmt 12
Mar 27 19:51:59 vladimir minisatip[22640]: [27/03 19:51:59.578 AD0]: CAT pos 0 caid 0B00, pid 0
Mar 27 19:51:59 vladimir minisatip[22640]: [27/03 19:51:59.578 AD0]: mapped adapter 0 (0) pid 0 (0) to 0, pmt -1
Mar 27 20:02:38 vladimir minisatip[22640]: [27/03 20:02:38.870 AD0]: mapped adapter 0 (0) pid 1 (1) to 2, pmt 6
Mar 27 20:02:38 vladimir minisatip[22640]: [27/03 20:02:38.870 AD0]: mapped adapter 0 (0) pid 1456 (1456) to 1456, pmt 6
Mar 27 20:02:38 vladimir minisatip[22640]: [27/03 20:02:38.870 AD0]: mapped adapter 0 (0) pid 4117 (4117) to 4117, pmt 6
Mar 27 20:02:38 vladimir minisatip[22640]: [27/03 20:02:38.870 AD0]: mapped adapter 0 (0) pid 1539 (1539) to 1539, pmt 6
Mar 27 20:02:38 vladimir minisatip[22640]: [27/03 20:02:38.870 AD0]: mapped adapter 0 (0) pid 3573 (3573) to 3573, pmt 6
Mar 27 20:02:38 vladimir minisatip[22640]: [27/03 20:02:38.870 AD0]: mapped adapter 0 (0) pid 3574 (3574) to 3574, pmt 6
Mar 27 20:02:38 vladimir minisatip[22640]: [27/03 20:02:38.871 AD0]: CAT pos 0 caid 0B00, pid 0
Mar 27 20:35:17 vladimir minisatip[22640]: [27/03 20:35:17.018 AD0]: mapped adapter 0 (0) pid 1 (1) to 2, pmt 6
Mar 27 20:35:17 vladimir minisatip[22640]: [27/03 20:35:17.018 AD0]: mapped adapter 0 (0) pid 1452 (1452) to 1452, pmt 6
Mar 27 20:35:17 vladimir minisatip[22640]: [27/03 20:35:17.018 AD0]: mapped adapter 0 (0) pid 1397 (1397) to 1397, pmt 6
Mar 27 20:35:17 vladimir minisatip[22640]: [27/03 20:35:17.018 AD0]: mapped adapter 0 (0) pid 451 (451) to 451, pmt 6
Mar 27 20:35:17 vladimir minisatip[22640]: [27/03 20:35:17.018 AD0]: mapped adapter 0 (0) pid 553 (553) to 553, pmt 6
Mar 27 20:35:17 vladimir minisatip[22640]: [27/03 20:35:17.018 AD0]: mapped adapter 0 (0) pid 554 (554) to 554, pmt 6
Mar 27 20:35:17 vladimir minisatip[22640]: [27/03 20:35:17.078 AD0]: CAT pos 0 caid 0B00, pid 0

I'm seeing two potential issues:

  1. https://github.com/catalinii/minisatip/blob/master/src/ddci.c#L1269 here only the first PMT is used, whereas everywhere else we loop through each PMT stored.
  2. The pid is always 0 and it doesn't always show up in the log later in the "mapped adapter" log line from add_pid_mapping_table
Jalle19 commented 2 years ago

Here's some more of the same (journalctl -u minisatip --since today | grep 'CAT pos\|mapped adapter').

minisatip_cat_mapping.txt

Jalle19 commented 2 years ago

This should be fixed now