My powervu linux streaming setup II. (TVHeadend)

There are 52 replies in this Thread which was already clicked 16,190 times. The last Post () by dvbxsat.

  • I have been using TVHeadend (instead of MuMuDVB) for two months now. I had to make some patches to oscam-emu/osemu and to tvheadend to get it to work. But, now no patches are needed since now the functionality is implemented in the latest TVHeadend.


    Basic steps to setup:


    Install TVHeadend (latest version from nightly builds...)
    For Debian:

    Code
    echo deb https://dl.bintray.com/tvheadend/ubuntu master main | sudo tee -a /etc/apt/sources.list
    apt-get update
    apt-get install tvheadend



    (You can use this guide for help with setting up TVHeadend: http://linuxsat-support.com/showthread.php?t=78286)


    Create network(s)



    Add network created to adapter

    Code
    Configuration -> DVB Inputs -> TV adapters -> (your adapter) -> Parameters
    	(varies depending on your physical setup, ie motor/diseqc swithces. etc...)
    	Under Basic Settings add your new network



    Define mux for your network

    Code
    Configuration -> DVB Inputs -> Muxes -> add
    	Network: HBO (or whatever you entered above)
    	Delivery system: DVB-S
    	Frequency: 10935000
    	Symbol rate: 13750000
    	Polarization: H
    	Modulation: QPSK
    	FEC: 5/6
    
    	Leave other defaults and press "create"



    Scan new muxes

    Code
    Configuration -> DVB Inputs -> Networks
    	Select HBO (or whatever you entered above) and then press "Force Scan"


    Hopefully if you go now to Services, you should see the channels from the mux...

    Create a PowerVU streaming profile with mpeg-ts pass through and enable PAT and SDT rewrite

    Code
    Configuration -> Stream -> Streaming Profiles -> Add
    	Type: MPEG-TS Pass-thru/built-in
    	Enabled: (check)
    	Profile Name: PowerVU (or any name, but must replaced in further config, scripts, etc...)
    	Rewrite PMT: unchecked
    	Rewrite PAT: checked
    	Rewrite SDT: checked
    	Rewrite EIT: unchecked
    
    	Leave other defaults and press "create"



    Create a pvu user with password pvu with PowerVU as streaming profile (or any name/password, but must replaced in further config, scripts, etc...)



    Install either oscam-emu or osemu
    Build your own, or look here for latest versions: http://linuxsat-support.com/forumdisplay.php?f=1230


    Since oscam-emu/osemu ignores the user:password in the url request, you must setup the user:password for TVHeadend in oscam-emu/osemu.
    For OSEmu, add "-t <stream source user>:<stream source password>" to the command line:

    Code
    ./OSEmu -a user:pass -p1234 -s tvheadendhostip -r 9981:17999 -c /path/to/PowerVU_keyfile -b -t pvu:pvu


    And for oscam-emu, you have to add the user:password to the oscam.conf file in the streamrelay section:

    Code
    [streamrelay]
    stream_source_port            = 9981
    stream_source_auth_user       = pvu
    stream_source_auth_password   = pvu


    To use with TVHeadend, you just need to create a URL something like:

    Code
    http://pvu:pvu@192.168.1.10:17999/stream/service/5207215882cb76f456a5d65ecfba2124?profile=PowerVU&descramble=0&emm=1:0:0:4


    Where the last number is the sid (srvid/service id) of the channel in hex.


    Here are some scripts (original base from B C at TVHeadend forum) modified to create vlc playlists and userbouquets for use with enigma2.


    VLC playlist:


    Enigma2 userbouquet:



    BTW:
    I left the user:password in the URL in the scripts because in the future I would like to change oscam-emu/osemu so it parses the http request and passes on the user:password hash to enigma2/TVHeadend instead of making it an oscam-emu/osemu config option.


    Attached are the binaries I am currently using, the scripts and an example oscam.conf...

  • I have not had much time to play with auto update. But I did stream from TVHeadend to TSReader with powervu plugin and auto update is working. Hopefully this week I will have some time to play. :)


    - - - Updated - - -


    So while debugging a bit, I found one problem. While the url generated by the scripts works for decrypting/playing the stream from TVHeadend, it was not sending emm info. Finally I noticed that alhough TVHeadend wasn't complaining (even in debug logs), it did not parse the "emm=1" properly. To get it to work, you need to add another "&" between "emm=1" and the trailing sid info for oscam. (":0:0:4")


    So to get the emm pids to be sent, the url needs to be changed to something like:

    Code
    http://pvu:pvu@192.168.1.10:17999/stream/service/5207215882cb76f456a5d65ecfba2124?profile=PowerVU&descramble=0&emm=1&:0:0:4


    Here are updated scripts to automatically generate the correct urls.


    VLC Playlist:


    Enigma2 userbouquet:

    Edited 2 times, last by joeuser: Fixed typo in VLC Playlist script ().

  • Hi Joe,


    thank you.


    I see no difference, for me it is not working.


    My AU keys are valid, they update the key file on a Windows box with no issue.


    My major problem is, that the oscam log is no very talkative with the stream relay and TVH, for me it is not easy to debug.


    As I read on the TVH forum, they have plans to add the extended CW api to their DVBAPI implantation, may be this will work.



    Best regards

  • Yes, I looked at the oscam-emu/osemu code and it looks like it only supports AU through the dvbapi interface and not through stream relay only connection. I was thinking to add the functionality to stream relay, but not sure it is worth the time/effort if TVHeadend will be updated. (Of course they also have to add DES decryption for it to fully work and I am not sure where they stand on that...)


    And yes there is not much debug info in oscam-emu/osemu especially in stream relay section. It is on my todo list, but not a priority and I don't have much free time for it now...

  • I finally got around to testing auto update. I made some changes to oscam-emu/osemu to allow for processing the emm pid through the stream relay connection. So it now works with TVHeadend. Attached are x64 binaries for oscam-emu and osemu.


    Note: Sometimes TVHeadend does not send the emm pid. (The "emm=1" option should send it...) If you don't see it, try restarting the connection. I will try to debug why when I get some free time and/or submit a bug report to TVHeadend.


    Also note: I only tested on a few channels. The parsing of the CAT is a bit of a hack, so it may not work on all channels....


    (Source code is available on my osemu git and I have issued a pull request, but not sure if/when it will get merged...)

  • Here are updated files for TVHeadend. The stream emm processing is now enabled/disabled via config. (Default is disabled.)


    For OSEmu, use the "-e" option.


    For oscam-emu add the following line to the oscam.conf file:

    Code
    [streamrelay]
    stream_emm_enabled            = 1

    Or it can be configured via the webif...


    - - - Updated - - -


    BTW - to get debug output, for osemu use the "-v" option and for oscam use the debug option "-d68" (4 = cardreader - prints pids found , 64 = emm - prints UA keys found in stream).
    Warning, for some channels with lots of UA keys in the stream, it will spew a lot of "key not found/missing" messages...


    - - - Updated - - -


    Sorry, I forgot to upload the oscam-emu patch...


    - - - Updated - - -


    Added fix for detection of ac3 tracks on some channels.

  • Hi Joe,


    I do some tests at the moment, I found two tiny bugs:


    1. in the VLC script

    Code


    Code
    echo http://$userpass@$OSEmu/stream/service/$(basename "$services")\?profile=$profile\&descramble=0\&emm=\&1:0:0:$sid


    should be


    Code
    echo http://$userpass@$OSEmu/stream/service/$(basename "$services")\?profile=$profile\&descramble=0\&emm=1\&:0:0:$sid



    2. a typo in the log


    Code
    [Emu] EMM eror: AU key for UA 003EFE02 is missing


    should be


    Code
    [Emu] EMM error: AU key for UA 003EFE02 is missing
  • Thanks, first was a typo, unfortunate I cannot edit the post anymore. I will ask an admin to fix it or let me fix it.
    Second is a typo from the origial oscam-emu/oscam, but I will change it if I make any other changes...


    EDIT:
    Typo in post #3 VLC Playlist fixed..

    Edited once, last by joeuser ().

  • Hi Joe,


    thank you for your patch, AU is working fine now.


    Do you see any possibility to make the key available for all SIDs especially for AFN?

  • I have been thinking about it (and chatted with a few others about it.) Problem is that oscam-emu/osemu needs to work with all different systems, not just powervu. We need to find a way to change it, yet keep it compatible with all other systems. I have not had much time to work on it, but I think in the end, there will have to be a whole new UpdateKeys function just for powervu. Even then it will be a little difficult to deal with multiple channels using the same sid and multiple channels using the same key.

  • it works great, thank you!
    have some questions, i have 10 dvb-s cards installed, 6 of them used by another software by MAC adress, 2 not used now and 2 i use for tvheadend for 2 differet satellites, after systems reboot, all cards changed their numbers (adapter0, adapterX) and now i have a problem, because tvheadend used adapter numbers. Does anybody know, is it possibly on tvheadend bind adapters by mac, or in ubuntu 14.04 hard to bind numbers?
    And one more, is it possibly to cut some audio pids from streamed channels, so it stream only with audio channels wich i need, or change number of audio channels? Config -> Stream -> Audio Filters does not working properly.

  • Hi,


    it is quite easy with linux:


    1. find out which DVB driver is loaded for the specific DVB card


    2. generate a file in /etc/modprobe.d like, in my case, ddbridge.conf with the content:

    Code
    options ddbridge adapter_nr=0,1,2,3


    3. reload the driver, or reboot, and you will see device numbers are static now


    4. locate /etc/default/tvheadend,



    reboot and TVH will only grab device 0-3


    Best regards

    Edited once, last by sabal9 ().

  • it works great, thank you!
    have some questions, i have 10 dvb-s cards installed, 6 of them used by another software by MAC adress, 2 not used now and 2 i use for tvheadend for 2 differet satellites, after systems reboot, all cards changed their numbers (adapter0, adapterX) and now i have a problem, because tvheadend used adapter numbers. Does anybody know, is it possibly on tvheadend bind adapters by mac, or in ubuntu 14.04 hard to bind numbers?
    And one more, is it possibly to cut some audio pids from streamed channels, so it stream only with audio channels wich i need, or change number of audio channels? Config -> Stream -> Audio Filters does not working properly.


    I just ran a quick test and was able to create an audio filter.


    stream type = blank
    Language = ANY
    Service = Atlantic
    Stream index = 0
    PID = 1220
    Action = EXCLUSIVE
    Although the other audio pids show as "found" by oscam-emu/osemu, they are not really included in the stream (but they are still listed in the PMT.) You can verify they are not there by using something like TSReader as a client, or in VLC, under mediainfo->codec, you will see the tracks are listed but do not show channels, sample rate or bit rate info because there is no data. Unfortunately if you use the rewrtie PMT option for the stream to remove the unused audio tracks, it also removes too much other info, so decryption doesn't work... Maybe a bug report can be written to TVHeadend to fix the PMT rewrite???


  • i have it tried and "Anothe Filters" too and they working exactly as you discribed, that s why i wrote not working properly, i use Stalker MW as server for 2 MAG250 they play OK, but the third is XBMC with simply playlist and i must switch audio channel from eng to rus every time after switching the channel.


    Thanks to all for help.


    - - - Updated - - -


    to: sabal9


    ok will try, but how can i finde driver name, exactly what should i write? i have 2 b2c2 skystar2 and 2 tbs6905 with 4 tuners each card.



  • Hello linoobs,



    a simple dmesg | grep -i dvb , should do it.


    or


    a lspci -s "slot" -vvv, like lspci -s 3:00.0 -vvv, where 3:00.0 is the slot or bus ID.


    in my case:

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!