SynoCommunity / spksrc

Cross compilation framework to create native packages for the Synology's NAS
https://synocommunity.com
Other
3.02k stars 1.23k forks source link

TVHeadEnd SPK #65

Closed Diaoul closed 12 years ago

Diaoul commented 12 years ago

That seems easy as it is shipped with web interface.

jjLDN commented 12 years ago

@schumi2004. No. I haven't. That is the first time I have ever installed something like that on my DS (before I would even doubt in usefulness of such solution but now I have to admit the idea is really tempting and the reason for it is package I have found on SynoCommunity which repo I have added to other sources in Package Center, do it came out "automagically" yesterday. I am digging now into oscam installation for DS with Atom processor on board which is not so easy. You mentioned NewCS, so I will look towards it. Maybe that one is gonna be more lucky. Don't take it offensive, you did great job, but I believe the whole idea of making 3rd party apps is to make users life simple. So instead of compiling several kernel, drivers and other stuff now there is a chance to make something as a "one nice solution" form a till z. I can imagine, the thing with live tv on nas drives might be really difficult, so maybe would be beneficial to deploy oscam package as well as a part of two package solution for tv on Synology. And the reason for that is there is few other people apparently not so knowledgeable reporting the same "issue" as myself, because they got no experience with that and they don't know but they just found the package in Package Center as myself. I understand the part with compiling-installing the driver for particular model of tv card is most difficult and it has to be done by each user separately. But everything else might come in nice package or two without need to create folder, subfolders, giving attributes etc. What is the card reader you mentioned? In tutorial for oscam install in requirement there is card reader. What is it?Does it have to be a particular card reader? I've got only tv usb card? Won't it work?

EDIT-------------------------------------------------------------------

On the other hand actually I use Synology for IPTV. In fact it is serviio which I have added few xml tv streams and I use for tv, but it is specific internet tv, not the real dvb broadcast.

EDIT 2 ---------------------------------------------------------------

I just noticed you have already requested creating oscam spk for synology :) That would be brilliant.

You really doing great job here.

schumi2004 commented 12 years ago

@jjLDN well actually @Diaoul is ;)

So you noticed this package in package center and thought to give it a go but didn't knew anything about it and now it's somehow useless for you? I have added several third party repo's to my Synology and even i found several package which i think what the heck, and came in the same situation you are now. The idea about 3rd party packages to make life simple i understand but this doesn't mean the end user doesn't need to take knowledge of the app and how things work. ;)

In short why i need a Smargo Cardreader is that my provider has encrypted almost every channel so i need this card to decrypt these channels to watch them. Could be different on your end.

jjLDN commented 12 years ago

Yeah. Exactly. So I am getting this knowledge now. So I am really glad you know such thing from your experience :) In fact I used to put any new package that appears in Package Center or I can find extra on internet independently (Zarafa) and test it and learn. Usually, like in some other situations (patters' Minecraft server) I had to learn how to download and install several dependencies (apart of java spk itself it needed two other thing in one folder during the installation) for java to run minecraft server, but actually he mentioned that on his blog. Therefore my life was easier and knowledge came easier to get ;) On the other hand Mr Misslehugger needed java package and he built it by himself (one and nice solution) even though it was breach of terms from Oracle (java package should be downloaded independently form Oracle server after registration). But for me, my life was easier :) The result is two independent java installations running concurrently on my nas box. :( So that's why I liked the approach of @Diaoul which stated by one occasion he didn't want to port something because that would involve java package and he wanted to avoid that. Apparently the crucial role here plays an information. If it is easy to get (come i.e. in package itself) saves a lot of time. The typical are ports. Only in few package that info is included in some kind of info section or screen. Most of the time the first run of spk tells me which port I should open in firewall, which makes my life little bit harder :) My conclusion would be to put some extra information about particular port of the application ported to synology on the main website of SynoCommunity in package description next to general information of the program itself or in package itself.

In my situation I have two different usb DVB-t sticks - one Freecom and another Elgato Eyetv which I have used a while ago on my pc and mac accordingly. I don't have any real encrypted channels (I quit my contract with sky, so my sky hd box plays only free-to-air channels which is more or less content of dvb-t) On the other hand one of the costs of quiting the contract is my sky hd box doesn't want to record any more even though it comes with the hard drive. So I can use it as a regular sat tv tuner but not as a pvr (apparently no one so far cracked the firmware for sky hd box). When I spotted the Tvheadend as an app I though I don't really need that, but I could use it functionality of recording which is really ok for me keepeng in mind I have got nearly unlimited space on my nas box comparing to sky hd box.

So keeping the long story short - I would be happy to use only usb dvb-t stick and the channels it can receive. The thing which is worrying me is in oscam installation there is number of the device - tv card we use that we have to copy and paste in a file which is displayed by smargo reader. I am not sure if that would work without that information.

PS. I am really excited cause today is release date of DSM 4.1 I found info that DSM itself should allow to use tv sticks in it, so I will find out soon I hope.

jjLDN commented 12 years ago

Ok. The Video Station doesn't suuport my tv usb stick, so still tvheadend is tempting. :)

schumi2004 commented 12 years ago

@jjLDN what stick do you use?

jjLDN commented 12 years ago

Elgato Eye TV DTT model several years old but still currently in sale:

http://www.elgato.com/elgato/int/mainmenu/products/tuner/DTT08/product1.en.html

BlueWombat commented 12 years ago

@jjLDN I never thought your intention was to sounds offensive, quite the opposite. I thought to myself that you only ended up sounding like it either because of lingual limitations, or because you maybe weren't that used to expressing yourself in text. Lastly some people just end up sounding different than they intend simply by improper use of punctuation, exclamation marks and etc. So I figured I'd just smooth the tension a bit, before anyone ended up fighting each other verbally:-)

@schumi2004 I think you misread what I wrote. My problems weren't with OSCam, as I haven't actually given it a go yet. My issues were merely getting Tvheadend to recognize my XMLTV grabber, which isn't designed by me, but downloaded elsewhere and reported working with Tvheadend. I've tried placing it in several different locations where Tvheadend should look for grabbers, I've tried changing permissions, ownership etc. All to no avail. Therefor I'd like to know if you have such a grabber running for your EPG data? And if so, where you've located it? And if I could get a copy f your script, permissions etc, for comparison?

And to both of you, maybe you should rather discuss OSCam in the topic that you @schumi2004 created for the purpose? Just so we don't clutter up this topic with not directly related talk, and make life simpler for new readers;-)

jjLDN commented 12 years ago

@sirgadget Well, I believe we still discuss Tvheadend in relation to oscam (in away that might look like upside down), Oscam I haven't even touched yet, but whenever I would try I will definitely use the oscam topic :)

schumi2004 commented 12 years ago

@sirgadget can you share your xmltv grabber so i can test in tvheadend?

BlueWombat commented 12 years ago

@jjLDN Okay:-)

My issue is currently, that I haven't had success compiling the driver for my Hdhomerun, and haven't been able to test the ClearQM channels of my DVB-C provider yet. So therefor it dosen't make sense venturing into OSCam just yet.

But if you do decide to go with OSCam, you can download a precompiled package for DD-WRT from the projects forum, given that you use a router with a specific architecture, a certain Broadcom CPU. You can buy an inexpensive router, many prefer a particular one from ASUS, because of the ROM size, so it has room for plenty of extensions. Have heard very positive thing of the setup, and even one And if you purchase a couple of Diablocam WiFi's, and a CAS 3 or higher, you can even upload some firmware to them, which makes them fetch decryption keys via newcamd protocol, and for that you can use your OSCam instance as source. This enables you to use OSCam for decrypting the signal of the built-in tuner in your tv:-)

Haven't tested any of this myself yet, but heard positive results:-)

BlueWombat commented 12 years ago

@schumi2004 I shared further up the thread, but hereit is again:-) http://pastebin.com/NUWNJmk4

schumi2004 commented 12 years ago

@sirgadget sorry missed it, was just looking for it if it wasn't posted already up the thread.

Will let you know how it turns out.

BlueWombat commented 12 years ago

@schumi2004 Great stuff, thanks!:-)

schumi2004 commented 12 years ago

Havent tested it yet but this is what i found on TVHeadend FAQ

Electronic Program Guide (EPG)¶

Where does Tvheadend scan for XMLTV grabbers? /bin /usr/bin /usr/local/bin /usr/bin/perlbin/vendor All directories specified in the $PATH environment variable

source: https://www.lonelycoder.com/redmine/projects/tvheadend/wiki/FAQ

Maybe we can change location in tvheadend config somewhere. $PATH variable

jjLDN commented 12 years ago

@sirgadget Thank you for your insight. Actually I use Netgear router with Open WRT onboard :) I am quite familiar with that version of linux. First time I have ever heard of oscam package was my custom firmware for the router. But if tv stick won't be supported it doesn't make any sense to go any further.

BlueWombat commented 12 years ago

@jjLDN Well, you could invest in the Sundtek TV-stick, it's a dual DVB-T/C stick, and they've precompiled drivers that can run on our NAS'.

Also, you could use the Diablo CAM's with the OSCam server for having a simple extendable cardsharing facility in your home, as opposed to fx. a SmartWI.

Also, you do realise OSCam isn't mandatory for running Tvheadend, don't you? It's solely for issueing decryption keys, and you mentions that you use FTA atm, so you don't need OSCam, unless you're planning a subscription again:-)

BlueWombat commented 12 years ago

@schumi2004 Haven't located the config file yet, ut already tried all of those paths, no success so far:-/

I'm not sure if this is because I don't have any channels onboard yet, but it would be strange if it was related.

Diaoul commented 12 years ago

Here is the PATH variable Tvheadend is started with : https://github.com/SynoCommunity/spksrc/blob/develop/spk/tvheadend/src/dsm-control.sh#L9

jjLDN commented 12 years ago

@sirgadget Actually I don't. I though it is mandatory to run oscam altogether with tvheadend. If that's the case Tvheadend doesn't work for me. I got problems with closing this app. Looks like after stopping the package it still runs in ram, so it is not possible to enable it back again, because of warning message that port is being used. It is not possible to restart synology when this app is running. I have already mentioned about problems which appear in gui of the app itself, so I won't repeat this time. :(

schumi2004 commented 12 years ago

@sirgadget So far i'm also unable to load xmltv file from tvheadend webui but it seems i'm not the only one. Several topics on tvheadend forum discussing this. Mostly a permission or location issue. Don't have time to pin point this out today since gf is wanna watch some tv but will check this out later this week.

@jjLDN Very strange problems you have with starting ans stopping tvheadend, i have totaly no issues stopping and starting tvheadend on my DS211.

BlueWombat commented 12 years ago

@jjLDN Okay, but now you know, FYI, I have the same problem with the process tree not being properly stopped.

@schumi2004 Thanks for your work so far, I'll try and tinker with it myself, and I'd much appreciate it if you were to stumble upon a solution:-) Regarding the issue with the process tree not being stopped, that both @jjLDN and I are experiencing, it could be Architecture related. As I see you have a DS211 (Marvel Kirkwood (ARM)), and he has a DS712+ (Intel Atom Single-Core), and I have a DS1010+ (Intel Atom Dual-Core).

@Diaoul Thanks, this should help me further, as I can see it should look in the same folders as usual, it must be a permission thing, I'll keep digging, and report back if/when I find a solution:-)

schumi2004 commented 12 years ago

@sirgadget to bad this happens to both of you. What's kinda strange is that it's cross compiled so it's compiled matching both of your architecture, you should expect it should give a warning if something goes bad. Fooks on tvheadend forum als cross compile this and it seems to work for them.

Things you could try is to digg the internet searching for other users using (almost) same setup and there experience. Compile tvheadend on nas your self, check stick compatibility with synology etc. For example my provider requires a smart card to decrypt digital channels and there for i needed a smargo card reader and oscam.

Only issue so far is that indeed i'm unable to use xmltv scraper but since i don't need that (provider is sending epg info) i didn't tested it until you mentioned it.

For the rest it's running smooth here. Only 1 lock-up but that's because my nas was downloading stuff at full bandwidth and since my nas isn't a high-end version it couldn't handle it.

Mean while i'll go spamming tvheadend forum finding out why xmltv isn't working.

Edit: Last time i needed to do a complete re-install my NAS because i screwed up, before i got my stick working i needed to plug it in/out several times (the needed restarts for tvheadend) and also different ports before it was seen.

BlueWombat commented 12 years ago

@schumi2004 Thanks for all your investigating, and your very detailed answers:-)

Regarding the process thing, I might try and compile it myself once again, have done this before.

Regarding OSCam or not, I too am planning to use it, it just isn't mandatory to begin with, as my cable provider offer three different packages, where your feed to yor apartment gets hooked onto one of three different splitters, containing different channel sets, Basic, Medium, Full. And if you're content with that, you don't need a Smartcard at all, as they're ClearCAM. but you have the possibility to opt-in on specific channels, and that's when yo need a smartcard, and I have a few opt-in channels (all my favourites). So I'll be using OSCam, just think I'll run it off a DD-WRT router instead, as I can then reboot my NAS, without loosing tv feed on my TV's.

Regarding XMLV, my provider too sends EPG-data, but first of all I didn't realize until yesterday Tvheadend supported it, hasn't always been the case. Second, they only provide I believe three days ahead, with my XMLTV provider I get one week ahead, plus large nice looking logo's, which I don't get from my cable provider.

Regarding the tuner, I'm using an HDHomerun, or rather, will be using. There's an official Linux CLI app for scanning channels and configuring it with, and then there's an open-source driver for it called DVBHDHomerun, which wraps around the HDHomerun channel list. This makes the HDHomerun turn up as a standard dual-tuner, so the software can know when two channels are received, as HDHomerun normally just exposes every channel as a URL which means Tvheadend wouldn't be aware of both tuners being busy. Bith though I've followed a tutorial for compiling it, i've been unable to so far, which means that I currently only have Tvheadend working, and no actual tv-feed.

Hope it all made sense.

jjLDN commented 12 years ago

@sirgadget Any luck on compiling the package for Atom?

BlueWombat commented 12 years ago

@jjLDN You mean Tvheadend? Haven't tried it since getting Tvheadend as SPK. If you mean Dvbhdhomerun then no, not yet.

justme1968 commented 12 years ago

just a quick heads up.

with my patch from https://github.com/SynoCommunity/spksrc/issues/166 and a lot of self compiled stuff i have now a running tvheadend/xmltv/dvbhdhomerun setup on a ds1510+.

thanks !

jjLDN commented 12 years ago

Is there any chance for Tvheaend apk to be fixed?

BlueWombat commented 12 years ago

@justme1968 Could your provide us your compiled Dvbhdhomerun driver, plus neccessary libs, startup scripts etc?... Then I don't have to go through hassle of compiling it myself.

As I've mentioned before, I've so far been unabæe to do it, though following a tut. Think it has something to do withwhich account I'm trying to compile under, but not sure.

If I ever succeed in compiling it, I might give it a go with compiling it to an SPK with a configuration interface myself, and collaborate with @Diaoul on it, instead of letting him to do everything. This might speed things up, given that I can compile it to begin with.

justme1968 commented 12 years ago

@sirgadget where can i send the files? what exactly goes wrong if you compile it yourself?

one more thing: hdhomerun does not provide the feeds as urls i think and tvheadend does notice if a channel is blocked.

BlueWombat commented 12 years ago

@justme1968 It keeps prompting me that I have insufficient rights to all sorts of different things, end whener I sudoed, the make script would file, just annoying, and as I'm a busy guy, I just haven't had the time properly investigate further.

Yes, the HDHomerun itself does it this way, it's just a bunch of streaming urls, one for each channel, that's why the Dvbhdhomerun driver was created to begin with, as Tvheadend dosen't have native support for HDHomerun, like MythTV has. And if you simply add the url's to Tvheadend via the IPTV tab, it won't know that it's using x tuners, and thinks it can record on all feeds at once.

justme1968 commented 12 years ago

@sirgadget hmmm. strange. i just compiled everything directly on the ds as root.

i beg to differ. at least my hdhomerun works differently. i have to tell the device (with the hdhomerun_config) on what tuner it should broadcast what channel to which ip. this is done by the set commands. after this is done there is exactly one (or two if both tuners are used) url to view. if you stop viewing on this url the home run device stops sending and will not send again until it is told so by the set command of the hdhomerun_config. so basically there are just one or two urls and you have to tune them to the channel you want to view. if one of these urls is in use you get a message that the channel is in use. even without the dvbhomern driver.

you can not add the urls to the iptv tab as there would be no way to tune to a station.

BlueWombat commented 12 years ago

@justme1968 Well, I've seen people creating m3u playlists of their channel list, and having it loaded in VLC, or another player like it. And the way they specifiy channel number, is with something like a querystring to the tuners URL. This way you could add it to the IPTV tab, though it wouldn't be able to know how many simultaneous streams it could use. You could of course use it if you fixed one tuner for each available channel, that would be one sick, and expensive setup, but it could be done:-)

jjLDN commented 12 years ago

@sirgadget The downside of using regular tv tuner even it is a digital one is I channel can be viewed, streamed at the time via one tuner head. In case of dual tv tuners that would make two streams. On another hand using the tricks like yours you could think about fetching all stream/channels in one multiplex being transmitted simultaneously which could make even 9 channels on one multiplex - makeing a m3u list to choose one of them would be A WOW.

BlueWombat commented 12 years ago

@jjLDN You're right. Yeah, it could be possibleto recieve all the channels in that multiplex, don't know if the firmware of the HDHomerun will allow it, but it sure would be cool. Then I could get just a couple, and watch/record all channels at once, given the box could handle it;-)

jjLDN commented 12 years ago

I have seen the patch by @justme1968 has been officially accepted. So when we can expect the fixed package?

Diaoul commented 12 years ago

Not yet because there is the issue of Tvheadend not stopping correctly that needs to be addressed before

Diaoul commented 12 years ago

I could not reproduce the stopping issue. If someone is experiencing this, I suggest to report to tvheadend bug tracker directly.

justme1968 commented 12 years ago

the start/stop script from the spk does not stop tvheadend. i have reported it in the tvheadend site and got no answer. in m start/stop script i have added a 'killall -9 tvheadend' and a second wait after the kill and wait. this is a little bit clumsy but works.

Diaoul commented 12 years ago

Well of course it works, -9 sends the QUIT signal forcing the process to exit.

Diaoul commented 12 years ago

In SSH, after hitting the start button, do:

ps | grep tvheadend

And put the results here. On my side I only have a single process.

justme1968 commented 12 years ago

currently i have 12 tvheadend processes running.

maybe killing the process group would work. i will try it the next time i stop it.

schumi2004 commented 12 years ago

Before: DS211> ps | grep tvheadend 21882 root 2960 S grep tvheadend 30177 tvheaden 139m S /usr/local/tvheadend/bin/tvheadend -f -c /usr/local/tvheadend/var -p /usr/loca

After: DS211> ps | grep tvheadend 22123 root 2960 S grep tvheadend

Diaoul commented 12 years ago

I think @justme1968 is using x86 and @schumi2004 88f628x. That's one difference.

@justme1968: After a cold start of your DiskStation, when you start Tvheadend using the Package Center, you have 12 processes? Could you output the result of the command ps | grep tvheadend right after starting the package?

justme1968 commented 12 years ago

@Diaoul after a fresh start of tvheadend using the package center there are 9 instances running.

Diaoul commented 12 years ago

I'm not that interested in the number of instances but more in the ps | grep tvheadend output please

jjLDN commented 12 years ago

k1Dn3T> ps | grep tvheadend 14894 tvheaden 35124 S /usr/local/tvheadend/bin/tvheadend -f -c /usr/local/tvheadend/var -p /usr/local/tvheadend/var/tvheadend.pid 14898 tvheaden 35124 S /usr/local/tvheadend/bin/tvheadend -f -c /usr/local/tvheadend/var -p /usr/local/tvheadend/var/tvheadend.pid 14899 tvheaden 35124 S /usr/local/tvheadend/bin/tvheadend -f -c /usr/local/tvheadend/var -p /usr/local/tvheadend/var/tvheadend.pid 14900 tvheaden 35124 S /usr/local/tvheadend/bin/tvheadend -f -c /usr/local/tvheadend/var -p /usr/local/tvheadend/var/tvheadend.pid 14901 tvheaden 0 Z [tvheadend] 14902 tvheaden 35124 S /usr/local/tvheadend/bin/tvheadend -f -c /usr/local/tvheadend/var -p /usr/local/tvheadend/var/tvheadend.pid 14904 tvheaden 0 Z [tvheadend] 14905 tvheaden 35124 S /usr/local/tvheadend/bin/tvheadend -f -c /usr/local/tvheadend/var -p /usr/local/tvheadend/var/tvheadend.pid 15871 root 2544 S grep tvheadend

BlueWombat commented 12 years ago

@justme1968 Sorry I haven't gotten back to you on where you could upload the drivers. I finally managed to compile it, now I just get an error in userhdhomerun, with a isctl32 command not working, because the driver is 64-bit, and userspace app is 32bit.

It's so frustrating, could you send me your working driver and usersspace files, and libhdhomerun?

mikkel at mikkelp dot com

justme1968 commented 12 years ago

i'll send you the drivers when i'm back from vacarion.

for the 32/64 Bit issue: you habe to use the Same Compiler for the Kernel and User Space Part. i habe used the synology supplied for both and Compiled directly on the diskstation.

Hope this helps Andre

Von meinem iPhone gesendet

Am 15.08.2012 um 15:18 schrieb sirgadget notifications@github.com:

@justme1968 Sorry I haven't gotten back to you on where you could upload the drivers. I finally managed to compile it, now I just get an error in userhdhomerun, with a isctl32 command not working, because the driver is 64-bit, and userspace app is 32bit.

It's so frustrating, could you send me your working driver and usersspace files, and libhdhomerun?

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

BlueWombat commented 12 years ago

@justme1968 Thanks Andre:-)

Yeah, unfortunately when I try thin on my Ubuntu machine, it gives me this weird error that some of the linkers supplied with compiler can't beloaded, that's why I dropped cross compilation to begin with.

justme1968 commented 12 years ago

i think i remember there was something wirth the linker.... i think a symlink from the linker to a Name with the prefix that all Other Cross Tools have worked.

i have used the syno provided Compiler directly on the diskstation.

andre

Von meinem iPhone gesendet

Am 15.08.2012 um 15:46 schrieb sirgadget notifications@github.com:

@justme1968 Thanks Andre:-)

Yeah, unfortunately when I try thin on my Ubuntu machine, it gives me this weird error that some of the linkers supplied with compiler can't beloaded, that's why I dropped cross compilation to begin with.

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