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 80 forks source link

Serverside decipher #103

Closed 3PO closed 8 years ago

3PO commented 9 years ago

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

catalinii commented 9 years ago

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

CReimer commented 9 years ago

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

9000h commented 9 years ago

may the better reference is mumudvb

3PO commented 9 years ago

or maybe this?

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

catalinii commented 9 years ago

thanks I will look into those as well...

perexg commented 9 years ago

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

https://github.com/tvheadend/tvheadend/pull/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 commented 9 years ago

Hi,

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

Thanks

perexg commented 9 years ago

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 commented 9 years ago

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 commented 9 years ago

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

3PO commented 9 years ago

@vdrtuxnet,

How do you start minisatip (Parameters) ?

vdrtuxnet commented 9 years ago

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 commented 9 years ago

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

vdrtuxnet commented 9 years ago

Sounds great catalinii!

My setup mentioned above is not a productive solution.

3PO commented 9 years ago

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

Any News?

3PO commented 9 years ago

Reopend.

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

catalinii commented 9 years ago

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

catalinii commented 9 years ago

I have just added the support for this.

perexg commented 9 years ago

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

catalinii commented 9 years ago

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

Pitty01 commented 9 years ago

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 commented 9 years ago

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

(also in Makefile)

catalinii commented 9 years ago

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

perexg commented 9 years ago

See https://github.com/catalinii/minisatip/pull/111

Pitty01 commented 9 years ago

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 commented 9 years ago

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 commented 9 years ago

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 commented 9 years ago

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 commented 9 years ago

Sorry, I did not double check for encrypted channels...

Pitty01 commented 9 years ago

there are but no german or austrian providers

Did the code work for u meanwhile, or did the code work for anyone? The enhancement seems very interesting, really curious how it works. the snapshot comes very quick so i expect a good performance on my xeon server...

catalinii commented 9 years ago

Please fill free to post logs (better to pastebin.com) to keep this post clean. As I said this is far from perfect and my dish is mostly offline and as I saw different channels are sending data in a different way.

Pitty01 commented 9 years ago

what kind of log do u need especially: ocam/minisatip/satip and what log level? Maybe i can provide something tomorrow.

From my pov the following works fine:

Not working here is only the ecm request afterwards, at least for the three providers i tested. Maybe it is related with srvid, which looks sometimes strange in the log. If the ecm request is there (i mentioned earlier that sometimes a single request comes up after channelchange), the encryption is ok and i get some few seconds a picture.

Pitty01 commented 9 years ago

"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."

can u implement something like a workaround to replace caid always to 1a, mybe via command line option or via default when using "-o" parameter. Think that this makes it more comfortable.

[Edit] sorry, this must be in implemented in satip plugin, otherwise its not possible to switch the channel on vdr, will create an issue there instead [/Edit]

Pitty01 commented 9 years ago

here an simple log switching to an encrypted channel on CAID 1843

as i wrote something with the requested service id is strange, the first digit is always zero for some reason: 1843:0F10 instead EF10 on RTL HD 1843:0F74 instead EF74 on SAT.1 HD 1843:0F75 instead EF75 on ProSieben HD 1843:0E9B instead 2E9B on Super RTL HD and so on

provider 1702/1833 and 0648 don't have this problem but it doesn't work anyway - so it might be a second problem?

http://paste.ubuntu.com/10803211/

Pitty

Pitty01 commented 9 years ago

Breaking News: it works now for all three providers using vlc, streams are starting immediately after request, systemload of minisat around 10%:

RTL HD rtsp://server-ip/?src=1&freq=10832&sr=22000&pol=h&msys=dvbs2&pids=0,48,255,259

ORF2W HD rtsp://server-ip/?src=1&freq=11302&sr=22000&pol=h&msys=dvbs2&pids=0,2920,2921,2922,2925

Sky Cinema HD rtsp://server-ip/?src=1&freq=11914&sr=27500&pol=h&msys=dvbs2&pids=0,1279,1283,1284

and also a free to air to check the general system:

Das Erste HD rtsp://server-ip/?src=1&freq=11493&sr=22000&pol=h&msys=dvbs2&pids=0,5101,5102,5103,5104,5105,5106

so it must be related to vdr/satip plugin and how it deals with minisatip

Pitty

[Edit] using vlc it feels very stable streaming HD channels to my laptop [/Edit]

3PO commented 9 years ago

[...] so it must be related to vdr/satip plugin and how it deals with minisatip ...

Maybe it works, if you use the Parameter "CI Extension = yes" with the satip- Plugin?

Readme satip Plugin:

[...] Use CI extension = no If you want to use the CI extension found in some SAT>IP hardware (e.g. Digital Devices OctopusNet), set this option to "yes". ...

Pitty01 commented 9 years ago

think i tried all combinations with satip.CICAM, satip.EnableCIExtension and also vanilla vs. 1A hacked channels.conf: got nothing working exept of a single snapshot picture.

Maybe someone could test with me to confirm my study, maybe its something small i'm doing wrong. Would also be fine if someone could conform the wrong requested caid in 1843.

Pitty

3PO commented 9 years ago

[...] got nothing working exept of a single snapshot picture. ...

same behavior here.

[...] Would also be fine if someone could conform the wron requested caid in 1843. ...

I can confirm this, but with CAID 1830 (HD01 Card).

Pitty01 commented 9 years ago

and vlc works fine as well, i guess?

3PO commented 9 years ago

No, with vlc and dvbviewer i get a Blackscreen.

Pitty01 commented 9 years ago

here it's fine with vlc, even if the 1843 srvid is wrong in the first digit http://paste.ubuntu.com/10808013/

catalinii commented 9 years ago

I will fix the serviceid in the next commit...

rofafor commented 9 years ago

If you're decrypting the streams in the server, you should remove their CA ids too.

nfedera commented 9 years ago

@Pitty01 I can confirm success with ORF2W HD. However, ORF 1HD stays dark. Does it work for you ? I'm using this: rtsp://server-ip/?src=1&freq=11302&sr=22000&pol=h&msys=dvbs2&pids=0,1920,1921,1922,1923,1925

Pitty01 commented 9 years ago

same here, but sometimes i get a snapshot when zapping to with vdr so i guess something is wrong with the rtsp. it's a mess that there is no script extracting rtsp from channels.conf...

nfedera commented 9 years ago

Hmm not sure it is rtsp. I'm experiencing the identical behaviour with http.

nfedera commented 9 years ago

@Pitty01 I could create a simple channels.conf converter. Should be doable in a few lines of python ...

Pitty01 commented 9 years ago

that would be great to test some few channels more and on the other hand to create a m3u playlist

nfedera commented 9 years ago

@Pitty01 here it is: https://gist.github.com/nfedera/5d32e157eb4fe5ef2369

nfedera commented 9 years ago

I've tested the conversion using the current astra channels.list from: http://channelpedia.yavdr.com/gen/DVB-S/S19.2E/S19.2E_complete.channels.conf Since I've written the cc2m3u.py converter right now I was not able to test it with minisatip yet ... will do this tonight when I have access to my equipment at home ...