Kodi Community Forum
Live TV doesn't work on Openelec [tvheadend server] - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: Raspberry Pi (https://forum.kodi.tv/forumdisplay.php?fid=166)
+---- Thread: Live TV doesn't work on Openelec [tvheadend server] (/showthread.php?tid=148646)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30


RE: Live TV doesn't work on Openelec [tvheadend server] - gogiman - 2013-03-10

Hi guys,

I am not sure if you already know about other "workaround" found for this issue.
Maybe it will also help to get the right fix here.
You can read about it here: http://forum.stmlabs.com/showthread.php?tid=4673&page=6


RE: Live TV doesn't work on Openelec [tvheadend server] - popcornmix - 2013-03-10

(2013-03-09, 00:55)xoox Wrote: I finally found a solution for the problems with playing Live-TV from Tvheadend on Raspberry Pi.

Does this patch work with tvservice running from a file?
I'm trying to debug the problem using a test file. E.g.
Code:
tvheadend -r freesat_11126500_V.ts

and the I-frame patch to pvr.hts-linux-arm.zip plus the proxy.
The best I've got is a couple of seconds of video followed by 20 seconds of buffering. (Although black screen is more usual).

I'd like someone to confirm running tvheadend from a file is a viable platform to debug this from.


RE: Live TV doesn't work on Openelec [tvheadend server] - Jeilong - 2013-03-11

I tried the Xoox's proxy. It works fine for SD channels (although the aspect ration was initially wrong, but setting the aspect ratio to "Stretch 16:9" and save for all videos fixed this). I also noticed that the info report framerates of 15-20fps. It should be 25fps. It doesn't look that bad though.

For HD, I still get black screens. Not sure why. I will try to get some logging tomorrow.


RE: Live TV doesn't work on Openelec [tvheadend server] - doveman2 - 2013-03-11

Yeah, I have to use the "Stretch 16:9" as well. Unfortunately, save for all videos will affect Movies as well as LiveTV I guess so we kinda need a separate setting for TV.


RE: Live TV doesn't work on Openelec [tvheadend server] - doveman2 - 2013-03-11

Darn, just got in and turned on the Pi and I'm getting the "no hardware present" error again.

top shows that tvhpiproxy is running as is tvheadend and going to the web interface, under Status - Active Subscriptions it lists whatever channel I select from XBMC.

I tried connecting with XBMC on my PC and TVH client set to 192.168.1.69:9983 and get the same error. So I killed tvhpiproxy and ran it again with tvhpiproxy 192.168.1.69:9983 and set the TVH client on the Pi and PC to connect to that, but still get the same error. tvhpiproxy shows it's receiving connections from my PC (192.168.1.64) and the Pi (192.168.1.69).

Hmm, checking lsusb -t shows that the tuner is connected. I plugged it into the next port on my hub and it showed up again.I can already only use three ports on my 7-port Belkin F5U700 hub, due to issues with the Pi and cascaded hubs and I've got the remote receiver plugged into the one usable port on the inside of my case, so there's only the two on the outside I can use. The tuner was working in the first one yesterday so I don't know why it would now not work in that port. If it's going to keep "disappearing" like this and I have to keep moving it between the two ports to get it working again that's obviously going to be impractical.

Anyway, at the moment with tvhpiproxy running on 192.168.1.69:9983 I can connect to it with both the Pi and PC and watch different channels, although it stutters on the Pi when starting a channel on the PC and some channels on the PC it says "No input detected" (I just got this on one channel on the Pi as well). After closing XBMC on the PC I looked over at the Pi running on the TV and it was very out of sync. I also am still getting these pauses whilst TV is playing and the XBMC pause bar appears up the top and then it carries on again. http://pastebin.com/Hppx7GwT


RE: Live TV doesn't work on Openelec [tvheadend server] - doveman2 - 2013-03-11

Just watched a programme on iPlayer and after about 50mins I started getting spammed with messsages saying tvheadend disconnected/reconnected/command failed. After I finished the programme I tried LiveTV again and it worked OK. I'm now on the TV Channels menu with LiveTV stopped and I'm seeing the light for one of the tuners in my Dual USB tuner either staying on or flickering on and off. Normally on the PC these lights only come on when I'm watching/recording something and thus actively using the tuner. I guess it might be using the tuner to update the EPG but in that case I'd expect it to stay on and then go off when it's finished. Perhaps there's a bug in the EPG grabbing code though and it's repeating the grab in a cycle. I know on the PC with Mediaportal I had to set it to grab only on BBC One as that retrieves the EPG for all the channels from there and takes about 7mins but I don't think TVheadend lets me set it to do that. Active subscriptions doesn't show that it's doing anything. I don't know what's up with xbmc.log either as it's 01:28 now and it hasn't been updated since 00:18. (EDIT: Just remembered I disabled debug logging, so that explains it Wink )

http://pastebin.com/RrQjrTVY

I found this in var/log/messages though http://pastebin.com/YvngYgH0

I'm not sure why it's trying to create all these .tmp files but I'd prefer it not to as obviously constantly writing to my SD/USB is going to wear it out, so I think I'd better disable tvheadend/tvhpiproxy until I know more about this.

I can't edit autostart.sh to remove tvhpiproxy at the moment though. Using WinSCP it seems the permissions have changed to 0755 and SSHing in and trying to chmod it says it's a read-only filesystem (nevermind, rebooting has allowed me to edit it, even though the permissions are still 0755!)


RE: Live TV doesn't work on Openelec [tvheadend server] - skiboysteve - 2013-03-11

I have the same issue. I can play SD and HD content, including recordings, over the network with my raspberry pi but I can't play live TV. When I start a live tv item, it stutters constantly. Totally unwatchable.

I have a PC client as well, and it doesn't have this problem.

my software is a little different. My tv server is mediaportal on a PC. That PC also runs XBMC. Live TV on that machine works fine. The raspberry pi runs raspbmc. Everything works fine except live TV.

I was considering buying another raspberry pi and USB tuner to run a tv server... But there is no way I'm going to invest in that considering this issue

help!!


RE: Live TV doesn't work on Openelec [tvheadend server] - xoox - 2013-03-11

(2013-03-11, 03:15)doveman2 Wrote: I found this in var/log/messages though http://pastebin.com/YvngYgH0

I'm not sure why it's trying to create all these .tmp files but I'd prefer it not to as obviously constantly writing to my SD/USB is going to wear it out, so I think I'd better disable tvheadend/tvhpiproxy until I know more about this.

I can't edit autostart.sh to remove tvhpiproxy at the moment though. Using WinSCP it seems the permissions have changed to 0755 and SSHing in and trying to chmod it says it's a read-only filesystem (nevermind, rebooting has allowed me to edit it, even though the permissions are still 0755!)

Tvheadend wanted to save some settings in the tmp-files, but there was a problem with the permissions in the addon_data folder. As you had also problems with editing autostart.sh there might have been a general problem with your storage-partition.


RE: Live TV doesn't work on Openelec [tvheadend server] - Psik - 2013-03-11

Thanks Xoox, script worked for me (NZ Freeview)

However the HD Streams now encountered CPU issues.
I had a look through your python code and have made a few HACKS (dirty dirty hacks) to improve the CPU usage, although it is still quite a bit higher than I think it should be, I have removed the (somewhat) unnecessary H264 decoding that was going on for every frame. It now only decodes H264 until it registers the first I-Frame then it passes the data through without decoding it first.

I can now play all my HD channels, although changing channels is hit and miss (as I am no longer scanning for muxpkt/subscription start on all the frames)
However if a channel change doesn't work, stopping and selecting the other channel manually works fine (and rather quickly)

Also having the same issues with the 1088->1080p that everyone else here has listed. Its odd, as I'm sure I've had HD channels running when the wind happened to blow the right way and you got an I-Frame first up without having to do anything.

Anyways you can find the file here
(Haven't got my head around Git yet)


RE: Live TV doesn't work on Openelec [tvheadend server] - doveman2 - 2013-03-11

(2013-03-11, 08:50)xoox Wrote: Tvheadend wanted to save some settings in the tmp-files, but there was a problem with the permissions in the addon_data folder. As you had also problems with editing autostart.sh there might have been a general problem with your storage-partition.

If it's just settings it writes that's OK, I just don't want it constantly writing a timeshift file whenever I watch TV. If it needs to, I'd want to redirect it to my PC's RAMDisk (\\X4\R), which is what I use for Mediaportal's timeshifting files when I use that. Do you know if TVH uses timeshifting files and if so, whether I can make it use my PC's RAMdisk?

The permissions thing is a bit weird. As you say, there may have been a general problem with my storage partition but I'm not sure how the permissions could just change by themselves and then be fixed by rebooting. Certainly autostart.sh showed the same permissions before and after rebooting but I don't know if there's a higher-level permissions, say for the /storage folder, that overwrites the individual file permissions. The other possibility is that somehow I was no longer recognised as Owner, as the 0755 permission only gives Write access to the Owner, but again that would be weird as I was logging in with WinSCP with the same root/openelec credentials as ever and TVH shouldn't have suddenly changed from Owner to something else and lost permission to write to the tmp files. As OE runs as root anyway, I'm not even sure there is another user that it could have somehow changed to.


RE: Live TV doesn't work on Openelec [tvheadend server] - lassej5 - 2013-03-11

(2013-03-09, 00:55)xoox Wrote: I finally found a solution for the problems with playing Live-TV from Tvheadend on Raspberry Pi.

The two main problems are:

- The I-Frame issue. Omxplayer needs an I-Frame first. This was already discussed and there were special pvr.hts add-on versions trying to fix this issue.

- The other problem is with HD LiveTV on a lot of channels. Tvheadend submits height=1088 in the subsciptionStart message. Omxplayer seems to have problems, it needs height=1080 to start the stream correctly.

What I've done to solve this problems:
I wrote a Python Tvheadend proxy which is used between XBMC/Pi and Tvheadend. The proxy drops the first frames until an I-Frame arrives and corrects the height from 1088 to 1080. The benefits of this solution:
- This workaround can be used until Tvheadend or pvr.hts add-on or Omxplayer are corrected.
- You don't need a special version of OpenELEC, Tvheadend etc. Just use your current installation.
- The solution doesn't affect other clients (PC/Laptops etc.) as you only pass your Pi(s) through the proxy

You can download TvhPiProxy here: https://github.com/polini/TvhPiProxy

TvhPiProxy has beta status. My Python-knowledge is very limited, so the script could be optimized perhaps. But it works. I had 100% success rate with the proxy up to now.

I seem to get at syntax error when i try to run the script.

Code:
File "./tvhpiproxy.py", line 65
    except Exception, e:
                    ^
SyntaxError: invalid syntax

I'm running this version of python on Arch Linux
python-3.3.0-3

Any help is greatly appreciated.

Thanks


RE: Live TV doesn't work on Openelec [tvheadend server] - navster - 2013-03-12

@xoox - big thanks for your script dude, it has resolved the black screen issues for my setup which is based aound a Tvheadend Ubuntu backend system serving SD only MPEG-2 Freesat UK service to my RPi-TV system in the kitchen and the wife is happy again! I could not find exact instructions on how to use your script for my setup so ended up doing the following which may help somone with a similar setup to mine:

1. copy text from script at https://github.com/polini/TvhPiProxy/blob/master/tvhpiproxy.py
2. open a terminal and type "sudo vi /etc/tvhpiproxy.py"
3. past text from step 1 to file and save
4. change file permission for script execution with "sudo chmod 755 /etc/tvhpiproxy.py"
5. from Ubuntu dash home search for and launch Startup Application
6. Add>Browse>File Sytem>etc>tvhpiproxy.py>open
7. give it a name and comment then click Add>Close
8. reboot Ubuntu host and the tvhpiproxy.py script will now be running from startup
9. go to the RPi and change PVR Add-On HTSP port from 9982 to 9983 and reboot

I still have some issues around buffering and audio sync loss on some channels but am certain these are general XBMC PVR and add-on issues which no doubt the great development community will iron out in good time :-)


RE: Live TV doesn't work on Openelec [tvheadend server] - 0nicram0 - 2013-03-12

(2013-03-12, 00:14)navster Wrote: 1. copy text from script at https://github.com/polini/TvhPiProxy/blob/master/tvhpiproxy.py
...
Hi
In my case it hadn't helped me. I still have problems with watching tv, but I admmit, it works a little bit better.

I have problem with "hdmi disconnecting" also. When I watching tv my screen is disconnecting for a while, like plug out and plug in again hdmi cable. At that moment on tv is displaying information about resolution. Debug is silent at that moments.
When i playing from smb share, some 1080p material everything is ok, without any problems. Problem appear only with LiveTV :/


RE: Live TV doesn't work on Openelec [tvheadend server] - adamsutton - 2013-03-12

Having spent some more time playing with this, I'm afraid to say that I think that this proxy is just a very long winded approach to doing a usleep(X). For me it does nothing, and without it I get SD playback anyway (although startup is a bit slow for known reasons). HD playback worked once (which I admit was teh first time in a long time) but not since (Note: I wasn't actually using the proxy, just doing the same things directly in pvr.hts).

I think this would explain the massive variation in performance people are seeing on their pi's (with and without this proxy). @popcornmix is currently investigating the issues within omxplayer and time permitting I'll try and give him some help. Maybe we'll eventually find the answer...

From what I can tell the 1080v1088 doesn't cause a problem (omxplayer should deal with this), though I may yet be proven wrong. And we are still looking at whether this is wrong.

If you have a timeshift enabled TVH server, the wait-for-iframe will have no effect (other than possibly to add to X). This is because with timeshift enabled, the normts feature is enabled. Among other things this ensures the subscription/stream always begins with an i-frame.

Adam


RE: Live TV doesn't work on Openelec [tvheadend server] - 0nicram0 - 2013-03-12

I'm wondering, is it a pvr.hts plugin problem or openelec problem? imho openelec plays from file without any problems and it could be just pvr addnon problem.
I can be a beta tester.