catalinii / minisatip

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

operator_tune_status APDU incorrect #1046

Open Delitants opened 1 year ago

Delitants commented 1 year ago

CAM does not get automatically renewed when there is time, have to move it to external tuner every 3 months Also last version of minisatip no longer creates BIN file for the cam. Why? Or path got changed?

[25/01 08:13:26.412 AD2]: CA 2 ======= MMI menu ======= [25/01 08:13:26.412 AD2]: [UI 0] CAM 4K tivusat [25/01 08:13:26.412 AD2]: [UI 1] [25/01 08:13:26.412 AD2]: [UI 2] [25/01 08:13:26.412 AD2]: [UI 3] The tivusat smartcard is not active or [25/01 08:13:26.412 AD2]: [UI 4] it has to be reactivated. [25/01 08:13:26.412 AD2]: [UI 5] Please visit the website www.tivusat.tv, [25/01 08:13:26.412 AD2]: [UI 6] contact the callcenter or follow the [25/01 08:13:26.412 AD2]: [UI 7] procedure described in the instructions. [25/01 08:13:26.412 AD2]: [UI 8] (20)

Jalle19 commented 1 year ago

The path is /var/cache/minisatip by default now

Jalle19 commented 1 year ago

@Delitants is this still an issue?

Delitants commented 1 year ago

Yes, but cam reactivates if I switch channel to another and then back to original.

Jalle19 commented 1 year ago

Interesting. @catalinii does that tell you anything? Could some PID be unsubscribed after some time (leading to missing CAM updates in the long run), and then after a channel change it's again subscribed? I've remember seeing commits regarding PIDs 17 and 18 at least.

Jalle19 commented 1 year ago

Could potentially be related to https://github.com/catalinii/minisatip/issues/1077

Delitants commented 1 year ago

It’s hard to catch what it says, because it falls off once or twice a month. This is not a DDCI adapter but TBS PCIE tuner with CI slot.

Jalle19 commented 1 year ago

Please try https://github.com/catalinii/minisatip/pull/1084 if you have the time

Delitants commented 1 year ago

Please try #1084 if you have the time

Thanks but for some reason cam stopped initializing with this version, it seems stuck in loop.

Jalle19 commented 1 year ago

Strange. What's the last working version for you?

Delitants commented 1 year ago

Strange. What's the last working version for you?

1.1.92, but have to manually renew cam every month. Anything newer seems wont make cam start.

Jalle19 commented 1 year ago

It is probably not directly caused by the SDT change then, but something else.

Jalle19 commented 1 year ago

@Delitants can you make a log using the next branch?

Delitants commented 1 year ago

After some testing this update issue might be related to the provider itself, as they want me to tune a specific channel to get ECM renewal packet. Because this procedure needs to be done once a month, I'm unable to collect a log at the event of CAM losing it's activation =\ Regarding initialization issue with recent versions of minisatip, I will open a new ticket as it's not related.

Delitants commented 1 year ago

Please try #1084 if you have the time

Thanks but for some reason cam stopped initializing with this version, it seems stuck in loop. minisatip.log

This is another cam, affected by v. 1.2.102. Works only with 1.1.92 or lower.

Jalle19 commented 1 year ago

What is the issue here now? That some CAM doesn't work in v1.2.x or that some CAM needs tuning to a specific channel every now and then?

Jalle19 commented 3 weeks ago

Closing due to inactivity

Delitants commented 3 weeks ago

Closing due to inactivity

Inactivity, really? You are the one who is inactive in responses, taking a whole year.

What is the issue here now? That some CAM doesn't work in v1.2.x or that some CAM needs tuning to a specific channel every now and then?

Same thing, same issue. Yes "that" CAM needs to be tuned to a specific channel every month and minisatip needs to be restarted 5 times to get it work. Tivusat Digiquest CI+ with a black card.

Jalle19 commented 3 weeks ago

I asked a question last year and got no response, that's why I closed this.

Jalle19 commented 3 weeks ago

You're describing multiple issues here and have provided only a single partial log so it's hard to tell what needs to be fixed. I suspect the issue is that the CAM instructs the host to tune to a specific frequency:

[29/03 23:00:01.581 AD1]: ca_write_apdu: CA 1, session 4, name CIPLUS_APP_OPRF_RESOURCEID, write tag 9F9C0A, data length 18
[29/03 23:00:01.611 AD1]: socket 8, handle 8, master 8, errno 75, read_ok 0, clearing buffer with len 58280
[29/03 23:00:01.611 AD1]: select_and_execute[8]: EOVERFLOW on socket 8 (sid:1) from :0 - type dvr (5) errno 75

For some reason, the log doesn't show CAM_OPRF_operator_tune_receive nor Please TUNE to transponder. Please check if you can find those strings in any of your logs. The actual tuning is not implemented by minisatip, but it should at least log something.

Jalle19 commented 3 weeks ago

Found the reason why your log is missing those messages:

sleep_msec(3 * 1000); // wait 3 secs

and since you seem to absolutely love posting partial incomplete logs, this is what happens. Issues get closed because no one can make any sense of the issue.

Please, post a complete log.

Jalle19 commented 3 weeks ago

There seems to be a bug in CIPLUS_APP_OPRF_handler, the length of the response sent to the CAM is hard-coded while the actual length is dynamic. Only a log with -v ca can shed some light on this since we need the hexdump("CIPLUS_APP_OPRF_handler", data, data_length); section.

@Delitants can you provide the necessary logs?

Delitants commented 3 weeks ago

Found the reason why your log is missing those messages:

sleep_msec(3 * 1000); // wait 3 secs

and since you seem to absolutely love posting partial incomplete logs, this is what happens. Issues get closed because no one can make any sense of the issue.

Please, post a complete log.

I have posted logs earlier, from the start of the program and end, when it fails to decode.

There is actually two separate problems. First one is the most annoying is that I have to restart minisatip several times in a row to make CAM steadily decode, otherwise it fails within 5-10 minutes. Second problem is when I overcome first problem, it can decode for weeks non-stop and then fails unrecoverably via just restarts until I tune a different channel and then back to the original channel. Here is a log again, from start to the end for the problem 1):

minisatip2.log

Jalle19 commented 3 weeks ago

The first issue seems to be the same as the one you've already opened an issue for: https://github.com/catalinii/minisatip/issues/1029

Jalle19 commented 3 weeks ago

Once again, a complete log whenever the "operator tune" operations happen would good.

Delitants commented 3 weeks ago

Once again, a complete log whenever the "operator tune" operations happen would good.

What operator tune means? I mean month long log to store? I don't have so much HDD space.

Jalle19 commented 3 weeks ago

The log from 29/03 would have been good if you hadn't cut out the important bits. I don't know how long you had it running for but I doubt you'd need to run more than 24 hours for the messages to appear.

Jalle19 commented 3 weeks ago

Turns out that one of your partial logs happened to include the relevant parts:

[29/03 23:00:22.775 AD1]: ca_read_apdu: CA 1, session 4, name CIPLUS_APP_OPRF_RESOURCEID, read tag 9F9C07, data length 6
[29/03 23:00:22.775 AD1]: CAM_OPRF_operator_search_status_receive
[29/03 23:00:22.775 AD1]: ca_write_apdu: CA 1, session 4, name CIPLUS_APP_OPRF_RESOURCEID, write tag 9F9C06, data length 9
[29/03 23:00:23.779 signal]: BW 2081 KB/s, DMX 2081 KB/s, Buffered 0.0 MB, Dropped: 0.0 MB, ns/read 107, r: 24, w: 24 fw: 0, tt: 2 ms
[29/03 23:00:24.044 AD1]: ca_read_apdu: CA 1, session 4, name CIPLUS_APP_OPRF_RESOURCEID, read tag 9F9C09, data length 41
[29/03 23:00:24.045 AD1]: CAM_OPRF_operator_tune_receive
[29/03 23:00:24.045 AD1]: CI+ CA1:  F0 27 43 0B 01 22 26 00 03 60 C1 02 75 00 03 43 0B 01 22 26 00 05 60 C1 02 75 00 03 43 0B 01 21 88 00 14 00 C2 03 00 00 04 
[29/03 23:00:24.045 AD1]: Please TUNE to transponder 43b1 V
[29/03 23:00:24.793 signal]: BW 512 KB/s, DMX 512 KB/s, Buffered 0.0 MB, Dropped: 0.0 MB, ns/read 100, r: 6, w: 6 fw: 0, tt: 0 ms
[29/03 23:00:27.045 AD1]: ca_write_apdu: CA 1, session 4, name CIPLUS_APP_OPRF_RESOURCEID, write tag 9F9C0A, data length 18
[29/03 23:00:27.075 AD1]: socket 8, handle 8, master 8, errno 75, read_ok 0, clearing buffer with len 55836
[29/03 23:00:27.075 AD1]: select_and_execute[8]: EOVERFLOW on socket 8 (sid:1) from :0 - type dvr (5) errno 75
Jalle19 commented 3 weeks ago

There are so many things wrong with how we handled operator profile messages, I don't even know where to begin. In an incredible stroke of luck, the contents of the operator_tune APDU have been logged at normal log levels though, so the hardest part (decoding the delivery system descriptors) can be done blindly:

F0 27 43 0B 01 22 26 00 03 60 C1 02 75 00 03 43 0B 01 22 26 00 05 60 C1 02 75 00 03 43 0B 01 21 88 00 14 00 C2 03 00 00 04

Delitants commented 3 weeks ago

How do I check out a non-master branches containing these changes? I only know how to check out master or edit files manually on the localhost.

Jalle19 commented 3 weeks ago

In this particular case, you need to clone my fork:

git clone https://github.com/Jalle19/minisatip.git

Then inside the folder you run git checkout $branch to switch to that branch instead.

Google for some git basics if you need more help, you'll figure it out.

Jalle19 commented 1 week ago

Please try #1084 if you have the time

Thanks but for some reason cam stopped initializing with this version, it seems stuck in loop. minisatip.log

This is another cam, affected by v. 1.2.102. Works only with 1.1.92 or lower.

@Delitants do you still have the CAM used in that log?

Delitants commented 1 week ago

Please try #1084 if you have the time

Thanks but for some reason cam stopped initializing with this version, it seems stuck in loop. minisatip.log

This is another cam, affected by v. 1.2.102. Works only with 1.1.92 or lower.

@Delitants do you still have the CAM used in that log?

I can't remember which one was that, but I have them all, yes. Either DreCrypt or Viaccess one.

Jalle19 commented 1 week ago

Okay, thanks. Would be great if you could test this branch with those and get me some logs so I can see if this new operator profile stuff works correctly or if e.g. minisatip crashes.

Delitants commented 1 week ago

Okay, thanks. Would be great if you could test this branch with those and get me some logs so I can see if this new operator profile stuff works correctly or if e.g. minisatip crashes.

Those cams I have are no longer paid and inactive, nor I can get a direct sat signal for them, except to daisy chain another remote minisatip and tune that sat.

Jalle19 commented 1 week ago

I think a log with -v ca even without signal and subscription would suffice

Delitants commented 15 hours ago

I think a log with -v ca even without signal and subscription would suffice

minisatip.log This is Viaccess cam

Jalle19 commented 7 hours ago

Unfortunately that CAM doesn't seem to use "operator profile" at all, plus you didn't try with the new branch I was referring to (https://github.com/catalinii/minisatip/pull/1153/commits/edc0afa40e2dfcda01a8195fa2b22fb0bba71aac)

Delitants commented 4 hours ago

Unfortunately that CAM doesn't seem to use "operator profile" at all, plus you didn't try with the new branch I was referring to (edc0afa)

Ok, this is DreCrypt module with version you referring to. It just sits like this in this state. minisatip.log

Delitants commented 4 hours ago

Tivusat HD CI+ with the same branch. minisatip.log