Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serverside decipher #103

Closed
3PO opened this issue Mar 14, 2015 · 184 comments
Closed

Serverside decipher #103

3PO opened this issue Mar 14, 2015 · 184 comments

Comments

@3PO
Copy link

3PO commented Mar 14, 2015

Is it possible to implant Support for Softcams e.g. oscam for serverside decipher?

@catalinii
Copy link
Owner

I see it is a very requested feature...I am looking into this.

@CReimer
Copy link

CReimer commented Mar 14, 2015

@catalinii: You could take a look at this VDR plugin: https://github.com/manio/vdr-plugin-dvbapi
It connects VDR to oscam

@9000h
Copy link
Collaborator

9000h commented Mar 14, 2015

may the better reference is mumudvb

@3PO
Copy link
Author

3PO commented Mar 14, 2015

or maybe this?

--> https://github.com/gfto/tsdecrypt

@catalinii
Copy link
Owner

thanks I will look into those as well...

@perexg
Copy link
Contributor

perexg commented Mar 18, 2015

TVHeadend supports the SAT>IP Server with descrambling now - the fork with the implementation is here:

tvheadend/tvheadend#597

This code will be merged after testing.

@catalinii : Could you implement X-SATIP-RTSP-Port extension to run minisatip completely using the user priviledges (for tvheadend) ?

@catalinii
Copy link
Owner

Hi,

No problem, can you describe what X-SATIP-RTSP-Port?

Thanks

@perexg
Copy link
Contributor

perexg commented Mar 18, 2015

The standard RTSP port 554 requires root priviledges (to bind to) for the server. The X-SATIP-RTSP-Port is one entry in the HTTP header (when serving the XML description file) sent by the SAT>IP server to notify client about the non-standard RTSP TCP port number. It's my idea (only implemented in tvheadend at the moment).

@vdrtuxnet
Copy link

Hi mates,

as I mentioned a while ago, I got server side decryption working, by using
minisatIP, ffdecsawrapper and vdr sat>IP clients.

I's more a test drive than productive environment because fast zapping is not possible, decryption between channel switching tooks's roughly 4-7 seconds.

Some information regarding the setup:
Server side:
Intel Pentium G3258 CPU
8 GB DDR 3 RAM
Intel PRO/1000 MT Server Adapter Dual Port (port bonding)
8 * DD DVB-S2 devices
Ubuntu 14.04 server
media build experimental - HG
minisatIP - git
ffdecsawrapper - git

Client side:
VDR 2.16 to 2.20 on Arch and Ubuntu
some VDR Plugins
vdr-plugin-satip git

Card and key server:
OScam and OSCam-emu
on my Pf-Sense router

The CAID parameter in the vdr channels.conf need to be set to CAID=1A, something in the private space between 0010-00FF should work either and channel list update should be disabled.

This setup is successful working with 8 DVB-S2 devices and 8 vdr sat>IP clients on different channels at the same time.

In between i moved the server hardware to a ASRock Q1900M with 8 GB DDR 3 RAM, and got the same decryption time between channel switching, so the CPU is not the bottle-neck.

kind regards

@9000h
Copy link
Collaborator

9000h commented Mar 26, 2015

I did nearly the same with openelec in a wetek play 2 tuners for my Panasonic Client.

@3PO
Copy link
Author

3PO commented Mar 26, 2015

@vdrtuxnet,

How do you start minisatip (Parameters) ?

@vdrtuxnet
Copy link

You have to start minisatIP by using the -e parameter, each loopback device need to be listed like:

./minisat -e 0,1,2,3,x... other parameters to your needs

It is important not adding the physical devices, but in the case you use the wrong, the system will
tell you.

@catalinii
Copy link
Owner

Hey guys... I am still testing the dvbapi protocol with minisatip... Next commit will have at least minimal support...

@vdrtuxnet
Copy link

Sounds great catalinii!

My setup mentioned above is not a productive solution.

@3PO
Copy link
Author

3PO commented Apr 5, 2015

... Next commit will have at least minimal support...

Any News?

@3PO 3PO closed this as completed Apr 5, 2015
@3PO 3PO reopened this Apr 5, 2015
@3PO
Copy link
Author

3PO commented Apr 5, 2015

Reopend.

Sorry, i closed it, because i pushed the wrong button. ^^

@catalinii
Copy link
Owner

I am still testing it...did not have too much time latelly to complete it.

@catalinii
Copy link
Owner

I have just added the support for this.

@perexg
Copy link
Contributor

perexg commented Apr 10, 2015

@catalinii : please, make this code completely optional... some hw does not have CPU power to do descrambling on the SAT>IP server side...

@catalinii
Copy link
Owner

Yeah, this is the idea...without -o should be no performance penalty.
Anyway DISABLE_DVBCSA removes the code completely.

@Pitty01
Copy link

Pitty01 commented Apr 10, 2015

just tested the latest code with minisatip, vdr-plugin-satip and oscam - seems that the minisatip is connecting as dvbapi user successful. I modified vdr channels.conf to hava caid 1a for all channels.

FTA is fine but for decrypt i get only one single request from vdr. So i get a snapshot of the decrypted picture and then decsrambling stops. I can see same in oscam log: one successfull ecm and then it stops.

Is there anything else i should know to get it working?

Thanks, Pitty

@perexg
Copy link
Contributor

perexg commented Apr 10, 2015

@catalinii : There is no reason to compile code which cannot be used. I would prefer an ifdef solution..

(also in Makefile)

@catalinii
Copy link
Owner

Hi, the solution from Makefile and dvbapi.c/h is not what you are looking for ?
It uses ifdef....

@perexg
Copy link
Contributor

perexg commented Apr 10, 2015

See #111

@Pitty01
Copy link

Pitty01 commented Apr 10, 2015

can u provide one or two encrypted astra rtsp we can use to test with vlc instead. - or is there any script available to convert channels,conf to rtsp?

unfortunately in the readme is only a single one Hotbird 13E and also FTA

@pbriesch
Copy link

You can go to http://www.inverto.tv/products/product.php?section=2&id=242&cat=96 and download from there this file:

IDL400S_DLNA_and_M3U_Channel_Lists
http://www.inverto.tv/downloads/support.php?id=1789

@3PO
Copy link
Author

3PO commented Apr 10, 2015

I have just added the support for this.

Not working here. ;(

BTW: why do you use the dvbapi protocol and not the camd3 protocol??

@Pitty01
Copy link

Pitty01 commented Apr 10, 2015

pbriesch: unfortunately no single hdp, orf or sky channel in that astra list from inverto...

a script would be fine, also for deeper testing pupose

@pbriesch
Copy link

Hi guys,
when I switch HD+ channels on Astra oscam does get informed about the channel switch an things work fine. When I switch to Hotbird oscam does not notice the channel change most of the times. Only sometimes it works an I can see a picture. As soon I switch back to Astra oscam immediately recognizes the channel change and things work fine.

@Pitty01
Copy link

Pitty01 commented Jun 29, 2015

Yeaaaaah, seems fine, thank u catalinii!

Will check concurrent recordings from one and two vdr and with more channel per transponder maybe tonight.

Pitty

@catalinii
Copy link
Owner

Hi Paul,

Can you upload the log mentioning on which channel oscan does not detect the channel change?

Thanks

@9000h
Copy link
Collaborator

9000h commented Jun 29, 2015

just for info, there is a nice sheet with all details in regards to dvb on the net
http://www.cascaderange.org/presentations/DVB_Poster.pdf

@lars18th
Copy link
Contributor

lars18th commented Jul 1, 2015

Hi,

Please, someone can explain with examples, how to use Oscam with minisatip in CLIENT MODE?

Here the my config:

  • 1 minisatip (without CSA) with one DVB-S2 tuner.
  • 1 Oscam server
  • 1 minisatip (with CSA enabled) pointing to the Oscam server.

Then, how to configure the second minisatip and the Oscam server?
I don't know if the DVBAPI implies:
a) Oscam server and minisatip running in the same machine;
b) minisatip driving a physical hardware tuner.

Please, can you explain?
Thank you.

@lars18th
Copy link
Contributor

lars18th commented Jul 1, 2015

Hi,

I respond to me (and anyone that needs this info):

  1. Put this info in your Oscam server (oscam.conf file):
[dvbapi]
enabled     = 1
pmt_mode    = 4
listen_port = 9000
user        = minisatip
boxtype     = pc
  1. Create the user "minisatip" in your Oscam server.

  2. Start minisatip adding these parameters: "-o IP_OSCAM_SERVER:9000 -t"

Then you can run the Oscam server in a remote machine (different than the server where running minisatip); and it also works in client mode (with remote SAT>IP servers).

Great! ;-)

@pbriesch
Copy link

pbriesch commented Jul 1, 2015

@lars18th
You might want to add:

au     =     1

@lars18th
Copy link
Contributor

lars18th commented Jul 1, 2015

@pbriesch
Only if you're using a card reader!
For a "simple" Oscam "proxy" to another Oscam server, you don't need at all!

@lars18th
Copy link
Contributor

lars18th commented Jul 1, 2015

Hi,

Using Oscam with some Astra 19.2 channels, some crash when channel change:

[01/07 19:24:29.5876]: Requested new Item for key 2000000000408, returning 2
[01/07 19:24:29.5876]: utils.c:169 allocation_wrapper malloc allocated 1510 bytes at 0x72cef0
Segmentation fault

@catalinii
Copy link
Owner

Probably this is the same as #133 , can you reproduce it at will or just happened once ?

Thanks

@lars18th
Copy link
Contributor

lars18th commented Jul 2, 2015

Hi Catalin,

Probably this is the same as #133 , can you reproduce it at will or just happened once ?

Yes, after several tests it seems to be the same issue. Haw many times happens? Between 40-50% of times for a channel change when selecting different frequency.

I feel that the problem is related to two troubles:

  1. Delay. I noticed that several crashes comes when the minisatip client don't receive the stream from the tuner.

  2. Garbage data. In some cases the crash is found after a frequency change but initial data is corrupted. My assumption is that you need to check initial packets, or baypass the first outcomes before send them to the Oscam.

In any case the crash occurs only when using Oscam server.

@catalinii
Copy link
Owner

I added some code to force the checksum check for pmt and pat.

Please test the next commit.

Thanks

@lars18th
Copy link
Contributor

lars18th commented Jul 6, 2015

@catalinii

I hope this checksum check will fix the crash. Waiting for test it!

@catalinii
Copy link
Owner

I have added the checksum fix in the latest commit...can you test and let me know ?

Thanks

@catalinii
Copy link
Owner

please reply to #133

@lars18th
Copy link
Contributor

lars18th commented Jul 9, 2015

Hi Catalin,

Also I can reproduce some specific case: When minisatip request a new channel to the Oscam server, but the timeout expires on the server, then the status of the minisatip will be inconsistent and after some commands it crashes.

Log on the Oscam server related to this problem:

2015/07/09 15:03:05  2794760 c      (ecm) minisatip (0000&000000/0000/1111/22:33333333333333333333333333333333): timeout (8000 ms) by **** - Program 1000

I hope this helps!

@lars18th
Copy link
Contributor

lars18th commented Jul 9, 2015

Hi Catalin,

After more testing, my suggestion is: please, include code for process the case of "timeout" in the Oscam server when you start to decode. Perhaps the simple option of re-ask for decoding is the more simple and efective. My conclusion is that this particular case is at time the source of several problems.

Regards.

@catalinii
Copy link
Owner

Hi,

Can you send me some minisatip logs for this issue?

Thanks

@lars18th
Copy link
Contributor

@catalinii

I'll try to provide some log... However, the "use case" is very specific: the Oscam server triggers a "timeout" and then the minisatip continues waiting for the response from the Oscam server. I hope you can complete the code (with a simple "re-ask for key" in case of "timeout").

Regards!

@lars18th
Copy link
Contributor

@catalinii

I have a more interesting solution than a LOG: You can reproduce the issue (and debug it)! :-D

  1. Start your Oscam server, but REMOVE any card inside it (leave the reader as "enabled").
  2. In the Oscam GUI: Config/Global/Client timeout: set your value (for ex. 4000; equal to 4sec.)
  3. Start minisatip connecting to the Oscam server.
  4. With a client (or http request) try to tune ANY encrypted channel...

The result is: minisatip request the key to the Oscam server, the timeour expires on the Oscam server, and the minisatip waits indefinitely.

Try it!

@catalinii
Copy link
Owner

Hi Lars,

for all the issues I am reproducing in house what is going on. However a log helps me understand better where is the problem and understand if I am on the right track on reproducing the issue.

For example in this case, the dvbapi should not block minisatip in any way, it should just not decrypt the stream.
Thanks

@lars18th
Copy link
Contributor

@catalinii

Perhaps the dvbapi not blocks minisatip, but it stops the stream! I think you really need to "re-ask" for decryption when a timeout occurs! If you don't do it, at every minimal error (network fails, oscan error, etc.) the stream stops.

Any idea for improve this?
Regards.

@catalinii
Copy link
Owner

Are you using the satip client ?

Please post a log and I will look into it.

Thanks

@lars18th
Copy link
Contributor

lars18th commented Aug 3, 2015

Hi Catalin,

Will be possible to add one new parameter like this?

-tt clean the PSI from all CA information in all PMT tables.

This is because I like to use it when a client is scanning for "convert" all channels to FTA. It's not for decrypt multiple programs, but for mark all as clear in the channel list.

You agree?

@catalinii
Copy link
Owner

Hi Guys,

please let me know if there are any issues here or I can close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests