manio / vdr-plugin-dvbapi

VDR dvbapi plugin for use with OSCam
http://www.streamboard.tv/wbb2/thread.php?threadid=40060
GNU General Public License v2.0
58 stars 25 forks source link

service API seems to fail sometimes #100

Closed mat130780 closed 8 years ago

mat130780 commented 8 years ago

Hi,

the VDR skindesigner plugin uses the plugin's service API in order to display some crypt info (reader, ECM time, CAID etc.) However this does not always work reliably, sometimes the data are missing. I tested this with dvbapi log level = 3. Here is a log when the data are shown correctly: Sep 13 13:37:12 htpc vdr: [12544] DVBAPI: UpdateEcmInfo: PMTO update, adapter=0, SID=EF75 Sep 13 13:37:12 htpc vdr: [12435] connect from 127.0.0.1, port 49895 - accepted Sep 13 13:37:19 htpc vdr: [14628] DVBAPI: Analyze: all data in one TS packet, immediate send Sep 13 13:37:19 htpc vdr: [14628] DVBAPI: Write, sock=17 Sep 13 13:37:19 htpc vdr: [14628] DVBAPI: socket_fd=17 len=152 wrote=152 Sep 13 13:37:19 htpc vdr: [12544] DVBAPI: Action: Got DMX_SET_FILTER request, adapter_index=0, pid=1CEC, demux_idx=0, filter_num=0 Sep 13 13:37:19 htpc vdr: [12544] DVBAPI: SetFilter: adapter=0 set FILTER pid=1CEC start=1, demux=0, filter=0 Sep 13 13:37:19 htpc vdr: [12544] DVBAPI: --> FILTER: 81 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Sep 13 13:37:19 htpc vdr: [12544] DVBAPI: --> MASK: FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Sep 13 13:37:19 htpc vdr: [12544] DVBAPI: SetFilter: filter update, demux=0, filter_num=0 Sep 13 13:37:19 htpc vdr: [12544] DVBAPI: Action: Got CA_SET_DESCR request, adapter_index=0 Sep 13 13:37:19 htpc vdr: [12544] DVBAPI: SetDescr Sep 13 13:37:19 htpc vdr: [12544] DVBAPI: 0.0: odd key set Sep 13 13:37:19 htpc vdr: [12544] DVBAPI: Action: Got ECM_INFO: adapter_index=0, SID = EF75, CAID = 1830 (nagra), PID = 1CEC, ProvID = 000000, ECM time = 95 ms, reader = oscam_cccam, from = blablabla.net, protocol = cccam_ext, hops = 1

Here is a log when no data are shown: Sep 13 17:50:31 htpc vdr: [3186] DVBAPI: Action: Got DMX_SET_FILTER request, adapter_index=1, pid=1CCE, demux_idx=0, filter_num=0 Sep 13 17:50:31 htpc vdr: [3186] DVBAPI: SetFilter: adapter=1 set FILTER pid=1CCE start=1, demux=0, filter=0 Sep 13 17:50:31 htpc vdr: [3186] DVBAPI: --> FILTER: 81 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Sep 13 17:50:31 htpc vdr: [3186] DVBAPI: --> MASK: FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Sep 13 17:50:31 htpc vdr: [3186] DVBAPI: SetFilter: filter update, demux=0, filter_num=0 Sep 13 17:50:32 htpc vdr: [3063] DVBAPI: FillEcmInfo: PMTO match - fill, adapter=0, SID=EF75 Sep 13 17:50:32 htpc vdr: [3186] DVBAPI: Action: Got CA_SET_DESCR request, adapter_index=1 Sep 13 17:50:32 htpc vdr: [3186] DVBAPI: SetDescr Sep 13 17:50:32 htpc vdr: [3186] DVBAPI: 0.0: odd key set Sep 13 17:50:32 htpc vdr: [4195] DVBAPI: Analyze: all data in one TS packet, immediate send Sep 13 17:50:32 htpc vdr: [4195] DVBAPI: Write, sock=99 Sep 13 17:50:32 htpc vdr: [4195] DVBAPI: socket_fd=99 len=152 wrote=152

You can see the line with Action: "Got ECM_INFO: ..." is missing here, thus no information is available although I had switch to an encrypted channel. Could it be that that the API gets "confused" in case oscam is started after VDR has been started, or if oscam crashes and is restarted while VDR is running?

Thanks.

manio commented 8 years ago

Hello Generally if vdr is able to decrypt, then it is connected and the ECM_INFO is sending over the same TCP socket, so it should be not "confused" in cases you mentioned.

Please try this patch in the oscam: http://pastebin.com/ZUfYXnY9 This will drop you a line in the log when the ECM_INFO is sent from the oscam to the plugin. If you will be able to reproduce the problem, please note if the line is still showing in the oscam log.

mat130780 commented 8 years ago

Hi! I have patched and compiled the current scam version and followed your request. Please have a look at these logs: http://pastebin.com/download.php?i=vm5KUCmk <- This is an extract from oscam.log. Please compare the log messages before and after 13:30h. After 13:30h there seems to be no proper connection from oscam to dvbapi, however decryption of the channels was working OK, only the info was missing. http://pastebin.com/download.php?i=N280Xd23 <- This log was created with command "tail -f /var/log/syslog | grep DVBAPI" and covers the same time period. Again, the time after 13:30h is the interesting period where the data were not forwarded properly.

MegaV0lt commented 8 years ago

Links not working... Try that ones: http://pastebin.com/raw.php?i=vm5KUCmk http://pastebin.com/raw.php?i=N280Xd23

manio commented 8 years ago

Yes, i discovered that links myself. I can see that there is something wrong in the oscam after it's restart. Maybe some flag is cleared and it leads to problems after crash/restart. I'll try to look at it when i have some time.

mat130780 commented 8 years ago

Thanks a lot in advance!

manio commented 8 years ago

I think that the problem is in the current code for the discovering if oscam is new or old (if oscam is not up when VDR is starting, it will fallback to "legacy" oscam mode). It will be dropped some day, so instead of fixing it (creating another workaround) i prepared a quick patch for you to test: http://pastebin.com/AadkNqWw

You may use it currently if it works ok. Please try if the problem is gone.

mat130780 commented 8 years ago

Thanks, I have installed dvbapi with the patch included and will test for the next days if I the issue will occur again.

mat130780 commented 8 years ago

I have tested for several days with different scenarios (start of oscam before and after VDR, crashed VDR etc.), and the issue did not occur again. The patch seems to work :-)

MegaV0lt commented 8 years ago

Can you reupload the patch? The page was removed

manio commented 8 years ago

@mat130780, you still have it? Please paste it via pastebin, I created it temporarily and even don't remember exact content.

mat130780 commented 8 years ago

Couldn't find it quickly, I will have a look at the backups next weekend. Please remind ne on Sunday if I have not replied till then.

Am 09.12.2015 um 13:44 schrieb Mariusz Białończyk notifications@github.com:

@mat130780, you still have it? Please paste it via pastebin, I created it temporarily and even don't remember exact content.

— Reply to this email directly or view it on GitHub.

mat130780 commented 8 years ago

Hi,

I found it on my 2nd VDR machine: http://pastebin.com/u9vp89NL

Am 09.12.2015 um 13:44 schrieb Mariusz Białończyk notifications@github.com:

@mat130780 https://github.com/mat130780, you still have it? Please paste it via pastebin, I created it temporarily and even don't remember exact content.

— Reply to this email directly or view it on GitHub https://github.com/manio/vdr-plugin-dvbapi/issues/100#issuecomment-163215521.

manio commented 8 years ago

I think the problem should be now solved with my recent fix (rev 11209). Closing.