Kodi Community Forum

Full Version: Live TV doesn't work on Openelec [tvheadend server]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
(2013-03-11, 18:54)lassej5 Wrote: [ -> ]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
I had similar problems.
Just login to your Pi or Linux server and get the file directly by running: "wget https://raw.github.com/polini/TvhPiProxy...piproxy.py"

There might be different problems:
1. Using Windows and Samba share: problems with encoding. UTF-8 marker in the beginning of the file is a problem. In addition could be also problem nr. 2.
2. Copy-paste to SSH window. Something might change the quotes or something (many MS programs and web pages try to replace quotes and some other special symbols with "more beautiful" ones) and the result is also non working script.
3. Something else.

So the best solution is to download the file directly on the system you want to use it.

(2013-03-12, 13:07)0nicram0 Wrote: [ -> ]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.
Have you read the thread?

There are two problems:
1. Tvheadend sends out streams that do not start with I-frame.
2. omxplayer does not like streams not starting with I-frame.

So there are two possible fixes.
1. Modify Tvheadend (server, not plugin) to not output anything before I-frame
2. Modify omxplayer to discard everything until first I-frame is received.
All,

The problems identified here are NOT definitive causes of the problems on the pi. The only definitive problem that we know exists is that omxplayer does not properly handle the pvr buffering states and this causes random things to happen, which is why there is variation between machines. This is a path which is almost exclusively used by TVH (I think VDR may also use it) and so won't affect most other use cases, so the fact it does/doesn't play this that and the other is mostly irrelevant.

As I have already pointed out above, TVH indeed does NOT guarantee an i-frame at the start of a subscription unless "normts" is enabled. This is enabled by default for anyone running a timeshift capable (and enabled) TVH server. That includes myself and many others that still get random performance on the pi. So this is (if indeed it is) only part of the problem.

And it would not be right to handle this in TVH, though as noted above it can already be enabled by the client. Because this is a streamed service (which though currently only via TCP could one day be moved to UDP) and having no defence in the client/player is a BAD idea.

But popcornmix is looking into the problems and we are making some progress.

Adam
I guess that answers my question about whether TVH on the Pi is making Timeshifting files on the SD/USB then Wink

Obviously not (by default anyway) otherwise we'd all have i-frames at the start of the stream and LiveTV would work sometimes at least (without tvhpiproxy I just get a black screen every time).
(2013-03-12, 13:53)adamsutton Wrote: [ -> ]The only definitive problem that we know exists is that omxplayer does not properly handle the pvr buffering states and this causes random things to happen, which is why there is variation between machines.
which is what i've been telling since day 1, but why believe the guy who implemented it ;-)

Quote:As I have already pointed out above, TVH indeed does NOT guarantee an i-frame at the start of a subscription unless "normts" is enabled. This is enabled by default for anyone running a timeshift capable (and enabled) TVH server. That includes myself and many others that still get random performance on the pi. So this is (if indeed it is) only part of the problem.
according to popcornmix this should not be a problem on the pi
Dev,

The problems i have now with live-tv is

1/10 chance of actual channel will work (the proxy changes this to 9/10).
A/V out of sync
audio goes away
buffer messages( i think the proxy makes this worse)..

my guess is that the sync problem and "audio goes away" is caused by the buffer issue..

but how is it that if use tvheadend via htsp/zeroconf as video source the there is no such issue?(buffering still but not that much) they both use omxplayer and XBMC?

pidvbip have no such issue and if one uses omxplayer directly?

HTSP used via video source is not the i want to go, the pvr addon is the on i want to use...
(2013-03-13, 11:57)HarryL Wrote: [ -> ]Dev,

The problems i have now with live-tv is

1/10 chance of actual channel will work (the proxy changes this to 9/10).
A/V out of sync
audio goes away
buffer messages( i think the proxy makes this worse)..

my guess is that the sync problem and "audio goes away" is caused by the buffer issue..

but how is it that if use tvheadend via htsp/zeroconf as video source the there is no such issue?(buffering still but not that much) they both use omxplayer and XBMC?

pidvbip have no such issue and if one uses omxplayer directly?

HTSP used via video source is not the i want to go, the pvr addon is the on i want to use...

I am seeing very similar behaviour to yours, out of sheer curiosity I tried the proxyscript on a fresh build of Raspbmc last night but it appears as though Live TV + proxyscript in my setup is much more stable with Openelec so have switched back to this for now. Am also using the HTSP video source work around for channels that Live TV add-on is struggling with, hopefully popcornmix will solve the puzzle soon :-)
Navster,

which version of openelec do you use? nightly? or release candidate?

where is yout tvheadend server installed network or local on raspberry pi?
(2013-03-13, 16:25)HarryL Wrote: [ -> ]Navster,

witch version of openelec do you use? nightly? or release candidate?

where is yout tvheadend server installed network or local on raspberry pi?

My TVHeadend server resides on a Ubuntu x86 system which has a CAT6 connection to my router. The RPi connects via Edimax USB wifi dongle and is running the latest Rbej custom release of Openelec from this forum, which is in fact based on the nightlies. I have also enabled the default medium overclock setting in the config.txt file and have soldered the LIRC GPIO infra red receiver to my motherboard.
(2013-03-11, 18:54)lassej5 Wrote: [ -> ]
(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

run it as python2 tvhpiroxpy.py

you are running it with python3 and that won't work.
Make sure you haven't accidentally downloaded the script as a webpage, which is what happened when I first downloaded it and I got a similar error when trying to run it (before realising I'd downloaded a webpage and not the script!) I had to copy the text of the script manually and paste it into a new text document I created.
(2013-03-13, 19:38)oliv3r Wrote: [ -> ]
(2013-03-11, 18:54)lassej5 Wrote: [ -> ]
(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

run it as python2 tvhpiroxpy.py

you are running it with python3 and that won't work.

That did the trick. Thank you! :-)

I cloned the script from git so i knew it was not a problem with formatting.
For me, this python script does nothing useful. Without this script - SD plays fine, hd plays 1/10 times, also causes restarts my pi sometimes. With this script: SD does not work smoothly, hd does not work smoothly as well.
I think this python script causes high cpu load, so there are no remaining resources to play tv. This is not good workaround. When should we expect fix in xbmc?

Maybe this python script can be solution in case when tvheadend resides on other machines (not pi itself) - but, pi does not have enough resources to run tvheadend, live tv and this script. So this is no real solution.
(2013-03-15, 00:08)giaur Wrote: [ -> ]For me, this python script does nothing useful. Without this script - SD plays fine, hd plays 1/10 times, also causes restarts my pi sometimes. With this script: SD does not work smoothly, hd does not work smoothly as well.
I think this python script causes high cpu load, so there are no remaining resources to play tv. This is not good workaround. When should we expect fix in xbmc?

Maybe this python script can be solution in case when tvheadend resides on other machines (not pi itself) - but, pi does not have enough resources to run tvheadend, live tv and this script. So this is no real solution.

Well for me without the script SD doesn't work at all, so even though it causes high CPU it's currently the only way I can get TV working on my Pi, although I had some issues still and gave up for now.
Any news on this?
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