catalinii / minisatip

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

CA issue #538

Closed 9000h closed 5 years ago

9000h commented 5 years ago

first test with a USB WinTV CI and a diablo cam

./minisatip -D6  -m 0040caa2c79e  -H5:50  -f -lhttp,adapter,stream,pmt,ca -x 9090   | tee /tmp/mini.log
[29/01 20:03:32.865 main]: minisatip version 0.7.16, compiled with s2api version: 050A
[29/01 20:03:32.865 main]: Built with dvbcsa
[29/01 20:03:32.865 main]: Built with CI
[29/01 20:03:32.865 main]: Built with dvbapi
[29/01 20:03:32.865 main]: Built with AES (OpenSSL)
[29/01 20:03:32.865 main]: Built with tables processing
[29/01 20:03:32.865 main]: Built with pmt processing
[29/01 20:03:32.865 main]: Built with satip client
[29/01 20:03:32.865 main]: Built with linux dvb client
[29/01 20:03:32.865 main]: Built with backtrace
[29/01 20:03:32.865 main]: Built without netceiver
[29/01 20:03:32.865 main]: Built with ddci
[29/01 20:03:32.865 main]: Built without t2mi
[29/01 20:03:32.865 main]: New UDP socket 3 bound to 0.0.0.0:1900 
[29/01 20:03:32.865 main]: setting multicast for 239.255.255.250
[29/01 20:03:32.865 main]: New UDP socket 4 bound to 239.255.255.250:1900 (mcast:239.255.255.250)
[29/01 20:03:32.865 main]: Mutex init 0x55b3e4709a00
[29/01 20:03:32.865 main]: Mutex init 0x55b3e60fd108
[29/01 20:03:32.866 main]: sockets_add: handle 3 (type 0) returning socket sock 0 [0.0.0.0:0] read: 0x55b3e44b4162
[29/01 20:03:32.866 main]: Mutex init 0x55b3e60fd268
[29/01 20:03:32.866 main]: sockets_add: handle 4 (type 0) returning socket sock 1 [0.0.0.0:0] read: 0x55b3e44b4162
[29/01 20:03:32.866 main]: Mutex init 0x55b3e60fd3c8
[29/01 20:03:32.866 main]: sockets_add: handle 5 (type 2) returning socket sock 2 [0.0.0.0:0] read: 0x55b3e44b3f40
[29/01 20:03:32.866 main]: Mutex init 0x55b3e60ff8d8
[29/01 20:03:32.866 main]: sockets_add: handle 6 (type 2) returning socket sock 3 [0.0.0.0:0] read: 0x55b3e44b3f40
[29/01 20:03:32.866 main]: Mutex init 0x55b3e60ffa38
[29/01 20:03:32.866 main]: sockets_add: handle -2 (type 0) returning socket sock 4 [0.0.0.0:0] read: 0x55b3e44b4162
[29/01 20:03:32.866 main]: set_socket_thread: thread a50b2700 for sockets 4
[29/01 20:03:32.866 main]: Mutex init 0x55b3e60ffcc8
[29/01 20:03:32.866 main]: sockets_add: handle -2 (type 0) returning socket sock 5 [0.0.0.0:0] read: 0x55b3e44b4162
[29/01 20:03:32.866 main]: set_socket_thread: thread a50b2700 for sockets 5
[29/01 20:03:32.866 signal]: Starting select_and_execute on thread ID a50b2700, thread_name signal
[29/01 20:03:32.866 main]: Mutex init 0x55b3e470bfc0
[29/01 20:03:32.866 main]: Mutex init 0x55b3e470c020
[29/01 20:03:32.868 main]: Mutex init 0x55b3e4716d60
[29/01 20:03:32.868 main]: Mutex init 0x55b3e611b438
[29/01 20:03:32.868 main]: sockets_add: handle -2 (type 0) returning socket sock 6 [0.0.0.0:0] read: 0x55b3e44b4162
[29/01 20:03:32.868 main]: Mutex init 0x55b3e470aec0
[29/01 20:03:32.868 main]: starting init_all_hw 0
[29/01 20:03:32.868 main]: Mutex init 0x55b3e4709ec0
[29/01 20:03:32.877 main]: Starting find_ddci_adapter with index 0
[29/01 20:03:32.877 main]: find_ddci_adapter: adding 0 0 to the list of devices
[29/01 20:03:32.883 main]: Mutex init 0x55b3e61204c8
[29/01 20:03:32.896 main]: Mutex init 0x55b3e6124da0
[29/01 20:03:32.901 main]: DDCI opening [0] adapter 0 and frontend 0
[29/01 20:03:32.901 main]: opened DDCI adapter 0 fe:7 dvr:8
[29/01 20:03:32.901 main]: deleting pids on adapter 0, sid -1, pids=NULL
[29/01 20:03:32.902 main]: Mutex init 0x55b3e611f088
[29/01 20:03:32.902 main]: sockets_add: handle 8 (type 5) returning socket sock 7 [0.0.0.0:0] read: 0x55b3e44b40b9
[29/01 20:03:32.902 main]: set_socket_thread: thread a48b1700 for sockets 7
[29/01 20:03:32.902 AD0]: Starting select_and_execute on thread ID a48b1700, thread_name AD0
[29/01 20:03:34.994 main]: initializing CA0, fd 9 type 2 flags 0x2, after 2092 ms
[29/01 20:03:34.994 main]: slotid: 0
[29/01 20:03:34.994 main]: tcid: 1
[29/01 20:03:34.994 main]: Adding pid 0 to the list of pids as not explicitly added for adapter 0
[29/01 20:03:34.994 main]: Mutex init 0x55b3e470b5c0
[29/01 20:03:34.994 main]: Mutex init 0x55b3e6144c38
[29/01 20:03:34.994 main]: new filter 0 added for adapter 0, pid 0, flags 20, mask_len 0, master_filter 0
[29/01 20:03:34.994 main]: Mutex init 0x55b3e61456c8
[29/01 20:03:34.994 main]: new filter 1 added for adapter 0, pid 17, flags 20, mask_len 0, master_filter 1
[29/01 20:03:34.995 main]: done opening adapter 0 delivery systems: undefined undefined undefined undefined
[29/01 20:03:34.995 main]: done init_hw 1
[29/01 20:03:34.995 main]: Initializing with 1 devices
[29/01 20:03:34.995 CA0]: stackthread_func: start
[29/01 20:03:34.995 main]: Starting select_and_execute on thread ID a693ef00, thread_name main
[29/01 20:03:35.176 CA0]: ca_session_callback: reason 6 slot_id 0 session_number 1 resource_id 0
[29/01 20:03:35.176 CA0]: 00:Host originated transport connection 0 resource 0x00000001 connected
[29/01 20:03:35.496 CA0]: ca_lookup_callback: slot_id 0 requested_resource_id 10041
[29/01 20:03:35.496 CA0]: ca_session_callback: reason 0 slot_id 0 session_number 1 resource_id 10041
[29/01 20:03:35.496 CA0]: 00:CAM connecting to resource 00010041, session_number 1
[29/01 20:03:35.496 CA0]: ca_session_callback: reason 1 slot_id 0 session_number 1 resource_id 10041
[29/01 20:03:35.496 CA0]: 00:CAM successfully connected to resource 00010041, session_number 1
[29/01 20:03:35.496 CA0]: --------------------S_SCALLBACK_REASON_CAMCONNECTED---------EN50221_APP_RM_RESOURCEID-------------------------
[29/01 20:03:35.976 CA0]: 00:ca_rm_reply_callback
[29/01 20:03:35.976 CA0]:   CAM provided resource id: 00010041
[29/01 20:03:35.976 CA0]:   CAM provided resource id: 00020041
[29/01 20:03:35.976 CA0]:   CAM provided resource id: 00030041
[29/01 20:03:35.976 CA0]:   CAM provided resource id: 00240041
[29/01 20:03:35.976 CA0]:   CAM provided resource id: 00400041
[29/01 20:03:37.480 CA0]: ca_lookup_callback: slot_id 0 requested_resource_id 20041
[29/01 20:03:37.480 CA0]: ca_session_callback: reason 0 slot_id 0 session_number 2 resource_id 20041
[29/01 20:03:37.480 CA0]: 00:CAM connecting to resource 00020041, session_number 2
[29/01 20:03:37.480 CA0]: ca_session_callback: reason 1 slot_id 0 session_number 2 resource_id 20041
[29/01 20:03:37.480 CA0]: 00:CAM successfully connected to resource 00020041, session_number 2
[29/01 20:03:37.480 CA0]: --------------------S_SCALLBACK_REASON_CAMCONNECTED---------EN50221_APP_AI_RESOURCEID-------------------------
[29/01 20:03:37.960 CA0]: 00:ca_ai_callback
[29/01 20:03:37.960 CA0]:   Application type: 01
[29/01 20:03:37.960 CA0]:   Application manufacturer: 0001
[29/01 20:03:37.960 CA0]:   Manufacturer code: 0001
[29/01 20:03:37.960 CA0]:   Menu string: IPNOSYS 0.36
[29/01 20:03:39.496 CA0]: ca_lookup_callback: slot_id 0 requested_resource_id 30041
[29/01 20:03:39.496 CA0]: ca_session_callback: reason 0 slot_id 0 session_number 3 resource_id 30041
[29/01 20:03:39.496 CA0]: 00:CAM connecting to resource 00030041, session_number 3
[29/01 20:03:39.496 CA0]: ca_session_callback: reason 1 slot_id 0 session_number 3 resource_id 30041
[29/01 20:03:39.496 CA0]: 00:CAM successfully connected to resource 00030041, session_number 3
[29/01 20:03:39.496 CA0]: --------------------S_SCALLBACK_REASON_CAMCONNECTED---------EN50221_APP_CA_RESOURCEID-------------------------
[29/01 20:03:40.008 CA0]: 00:ca_ca_info_callback
[29/01 20:03:40.008 CA0]:   Supported CA ID: 0100 for CA 0
[29/01 20:03:40.008 CA0]: CA 1 can handle CAID 0100 mask FFFF on adapter 0 at position 0
[29/01 20:03:40.008 CA0]:   Supported CA ID: 0500 for CA 0
[29/01 20:03:40.008 CA0]: CA 1 can handle CAID 0500 mask FFFF on adapter 0 at position 1
[29/01 20:03:40.008 CA0]:   Supported CA ID: 0b00 for CA 0
[29/01 20:03:40.008 CA0]: CA 1 can handle CAID 0B00 mask FFFF on adapter 0 at position 2
[29/01 20:03:40.008 CA0]:   Supported CA ID: 0604 for CA 0
[29/01 20:03:40.008 CA0]: CA 1 can handle CAID 0604 mask FFFF on adapter 0 at position 3
[29/01 20:03:40.008 CA0]:   Supported CA ID: 0606 for CA 0
[29/01 20:03:40.008 CA0]: CA 1 can handle CAID 0606 mask FFFF on adapter 0 at position 4
[29/01 20:03:40.008 CA0]:   Supported CA ID: 0661 for CA 0
[29/01 20:03:40.008 CA0]: CA 1 can handle CAID 0661 mask FFFF on adapter 0 at position 5
[29/01 20:03:40.008 CA0]:   Supported CA ID: 0662 for CA 0
[29/01 20:03:40.008 CA0]: CA 1 can handle CAID 0662 mask FFFF on adapter 0 at position 6
[29/01 20:03:40.008 CA0]:   Supported CA ID: 1702 for CA 0
[29/01 20:03:40.008 CA0]: CA 1 can handle CAID 1702 mask FFFF on adapter 0 at position 7
[29/01 20:03:40.008 CA0]:   Supported CA ID: 1722 for CA 0
[29/01 20:03:40.008 CA0]: CA 1 can handle CAID 1722 mask FFFF on adapter 0 at position 8
[29/01 20:03:40.008 CA0]:   Supported CA ID: 1762 for CA 0
[29/01 20:03:40.008 CA0]: CA 1 can handle CAID 1762 mask FFFF on adapter 0 at position 9
[29/01 20:03:40.008 CA0]:   Supported CA ID: 1800 for CA 0
[29/01 20:03:40.008 CA0]: CA 1 can handle CAID 1800 mask FFFF on adapter 0 at position 10
[29/01 20:03:40.008 CA0]:   Supported CA ID: 1801 for CA 0
[29/01 20:03:40.008 CA0]: CA 1 can handle CAID 1801 mask FFFF on adapter 0 at position 11
[29/01 20:03:40.008 CA0]:   Supported CA ID: 1833 for CA 0
[29/01 20:03:40.008 CA0]: CA 1 can handle CAID 1833 mask FFFF on adapter 0 at position 12
[29/01 20:03:40.008 CA0]:   Supported CA ID: 09c4 for CA 0
[29/01 20:03:40.008 CA0]: CA 1 can handle CAID 09C4 mask FFFF on adapter 0 at position 13
[29/01 20:03:40.008 CA0]:   Supported CA ID: 0d00 for CA 0
[29/01 20:03:40.008 CA0]: CA 1 can handle CAID 0D00 mask FFFF on adapter 0 at position 14
[29/01 20:03:40.008 CA0]:   Supported CA ID: 0d01 for CA 0
[29/01 20:03:40.009 CA0]: CA 1 can handle CAID 0D01 mask FFFF on adapter 0 at position 15
[29/01 20:03:40.009 CA0]:   Supported CA ID: 0d03 for CA 0
[29/01 20:03:40.009 CA0]: CA 1 can handle CAID 0D03 mask FFFF on adapter 0 at position 16
[29/01 20:03:40.009 CA0]:   Supported CA ID: 0d22 for CA 0
[29/01 20:03:40.009 CA0]: CA 1 can handle CAID 0D22 mask FFFF on adapter 0 at position 17
[29/01 20:03:40.009 CA0]:   Supported CA ID: 0919 for CA 0
[29/01 20:03:40.009 CA0]: CA 1 can handle CAID 0919 mask FFFF on adapter 0 at position 18
[29/01 20:03:40.009 CA0]:   Supported CA ID: 1802 for CA 0
[29/01 20:03:40.009 CA0]: CA 1 can handle CAID 1802 mask FFFF on adapter 0 at position 19
[29/01 20:03:40.009 CA0]:   Supported CA ID: 1803 for CA 0
[29/01 20:03:40.009 CA0]: CA 1 can handle CAID 1803 mask FFFF on adapter 0 at position 20
[29/01 20:03:40.009 CA0]:   Supported CA ID: 183d for CA 0
?? ??:0
?? ??:0
?? ??:0
?? ??:0
?? ??:0
?? ??:0
?? ??:0
?? ??:0
?? ??:0
?? ??:0
RECEIVED SIGNAL 11 - SP=0 IP=0
Obtained 10 stack frames.
0x55b3e44c7e37 : 0x55b3e44c7f2c : 0x7efda6545890 : 0x55b3e44dd819 : 0x55b3e44d3f99 : 0x7efda5ac68fb : 0x7efda5acc3d5 : 0x7efda5ace328 : 0x7efda5acf05f : 0x55b3e44d32d6 : 

I had to change to a bigger value https://github.com/catalinii/minisatip/blob/f0a4b9387a54d9669f1f782a43308cd3dff69b97/src/tables.h#L10

[29/01 21:05:14.653 CA2]: --------------------S_SCALLBACK_REASON_CAMCONNECTED---------EN50221_APP_CA_RESOURCEID-------------------------
[29/01 21:05:15.165 CA2]: 00:ca_ca_info_callback
[29/01 21:05:15.165 CA2]:   Supported CA ID: 0100 for CA 2
[29/01 21:05:15.165 CA2]: CA 1 can handle CAID 0100 mask FFFF on adapter 2 at position 0
[29/01 21:05:15.165 CA2]:   Supported CA ID: 0500 for CA 2
[29/01 21:05:15.165 CA2]: CA 1 can handle CAID 0500 mask FFFF on adapter 2 at position 1
[29/01 21:05:15.165 CA2]:   Supported CA ID: 0b00 for CA 2
[29/01 21:05:15.165 CA2]: CA 1 can handle CAID 0B00 mask FFFF on adapter 2 at position 2
[29/01 21:05:15.166 CA2]:   Supported CA ID: 0604 for CA 2
[29/01 21:05:15.166 CA2]: CA 1 can handle CAID 0604 mask FFFF on adapter 2 at position 3
[29/01 21:05:15.166 CA2]:   Supported CA ID: 0606 for CA 2
[29/01 21:05:15.166 CA2]: CA 1 can handle CAID 0606 mask FFFF on adapter 2 at position 4
[29/01 21:05:15.166 CA2]:   Supported CA ID: 0661 for CA 2
[29/01 21:05:15.166 CA2]: CA 1 can handle CAID 0661 mask FFFF on adapter 2 at position 5
[29/01 21:05:15.166 CA2]:   Supported CA ID: 0662 for CA 2
[29/01 21:05:15.166 CA2]: CA 1 can handle CAID 0662 mask FFFF on adapter 2 at position 6
[29/01 21:05:15.166 CA2]:   Supported CA ID: 1702 for CA 2
[29/01 21:05:15.166 CA2]: CA 1 can handle CAID 1702 mask FFFF on adapter 2 at position 7
[29/01 21:05:15.166 CA2]:   Supported CA ID: 1722 for CA 2
[29/01 21:05:15.166 CA2]: CA 1 can handle CAID 1722 mask FFFF on adapter 2 at position 8
[29/01 21:05:15.167 CA2]:   Supported CA ID: 1762 for CA 2
[29/01 21:05:15.167 CA2]: CA 1 can handle CAID 1762 mask FFFF on adapter 2 at position 9
[29/01 21:05:15.167 CA2]:   Supported CA ID: 1800 for CA 2
[29/01 21:05:15.167 CA2]: CA 1 can handle CAID 1800 mask FFFF on adapter 2 at position 10
[29/01 21:05:15.167 CA2]:   Supported CA ID: 1801 for CA 2
[29/01 21:05:15.167 CA2]: CA 1 can handle CAID 1801 mask FFFF on adapter 2 at position 11
[29/01 21:05:15.167 CA2]:   Supported CA ID: 1833 for CA 2
[29/01 21:05:15.167 CA2]: CA 1 can handle CAID 1833 mask FFFF on adapter 2 at position 12
[29/01 21:05:15.167 CA2]:   Supported CA ID: 09c4 for CA 2
[29/01 21:05:15.167 CA2]: CA 1 can handle CAID 09C4 mask FFFF on adapter 2 at position 13
[29/01 21:05:15.167 CA2]:   Supported CA ID: 0d00 for CA 2
[29/01 21:05:15.167 CA2]: CA 1 can handle CAID 0D00 mask FFFF on adapter 2 at position 14
[29/01 21:05:15.168 CA2]:   Supported CA ID: 0d01 for CA 2
[29/01 21:05:15.168 CA2]: CA 1 can handle CAID 0D01 mask FFFF on adapter 2 at position 15
[29/01 21:05:15.168 CA2]:   Supported CA ID: 0d03 for CA 2
[29/01 21:05:15.168 CA2]: CA 1 can handle CAID 0D03 mask FFFF on adapter 2 at position 16
[29/01 21:05:15.168 CA2]:   Supported CA ID: 0d22 for CA 2
[29/01 21:05:15.168 CA2]: CA 1 can handle CAID 0D22 mask FFFF on adapter 2 at position 17
[29/01 21:05:15.168 CA2]:   Supported CA ID: 0919 for CA 2
[29/01 21:05:15.168 CA2]: CA 1 can handle CAID 0919 mask FFFF on adapter 2 at position 18
[29/01 21:05:15.168 CA2]:   Supported CA ID: 1802 for CA 2
[29/01 21:05:15.168 CA2]: CA 1 can handle CAID 1802 mask FFFF on adapter 2 at position 19
[29/01 21:05:15.169 CA2]:   Supported CA ID: 1803 for CA 2
[29/01 21:05:15.169 CA2]: CA 1 can handle CAID 1803 mask FFFF on adapter 2 at position 20
[29/01 21:05:15.169 CA2]:   Supported CA ID: 183d for CA 2
[29/01 21:05:15.169 CA2]: CA 1 can handle CAID 183D mask FFFF on adapter 2 at position 21
[29/01 21:05:15.169 CA2]:   Supported CA ID: 2600 for CA 2
[29/01 21:05:15.169 CA2]: CA 1 can handle CAID 2600 mask FFFF on adapter 2 at position 22
[29/01 21:05:33.583 AD0]: satipc: Sent keep-alive to the satip server 192.168.178.1:554, adapter 0, socket_id 7, handle 7, timeout 25000
[29/01 21:05:33.583 AD0]: satipc_http_request (ad 0): sending to sock 7: 
OPTIONS rtsp://192.168.178.1:554/ RTSP/1.0
CSeq: 2
User-Agent: minisatip 0.7.16
9000h commented 5 years ago

a speed test of the WinTV CI looks not so bad

./ci_throughput.pl
Writing to '/dev/dvb/adapter0/sec0' in blocks of 3840 TS (721920 bytes) for 20 seconds ...
Bitrate OUT(641280 TS): 47.97 Mbit/s
Bitrate IN (637908 TS): 47.72 Mbit/s

https://www.vdr-portal.de/forum/index.php?thread/130720-wintv-ci-cinergy-usb-ci-und-ddci2/&postID=1308685#post1308685 ci_throughput.pl.zip

9000h commented 5 years ago

PR created