kodi-pvr / pvr.hts

Kodi's Tvheadend HTSP client addon
GNU General Public License v2.0
135 stars 93 forks source link

Cyclic loss of connection to TVHeadend on boot #210

Closed mikesumbler closed 7 years ago

mikesumbler commented 8 years ago

Hi,

Have made the jump from Windows 7 MCE to Kodi, installing the stock pvr.tvheadend.hts from kodi repo (note I had to run a distro-upgrade to get it to work on Kodibuntu)

However every time the system boots there is a period of 2 minutes or so when the connection to tvheadend is made then lost. When the connection finally is made and is stable the channels are loaded. The TV menu then becomes available and the web interface is accessible. I have SSH'd into machine during the connection losses and the checked service was running (which it is).

System info:

Kodibuntu Trusty 14.04LTS Kodi Jarvis kernel: 3.13.0-83-generic

Relevant Hardware: 1xHVR4000 (using only DVB-S frontend, disabled dvb-t) 1xHVR1300

Research suggests this might be associated with muxes without channels but have disabled muxes without channels and to be doubly sure disabled the EPG scan on them. There may also be a permissions issue perhaps. Have configured hts to connect using my user account (root priv's) - perhaps there are two instances running?

Snapshot of live processes during event:

ps -eaf | grep tvh

hts 1373 1 3 19:16 ? 00:04:56 tvheadend -f -u hts -g video
mick 8418 2599 0 21:43 pts/1 00:00:00 grep --color=auto tvh

Syslog extract (13:56:48 to 13:59:06)

tvheadend[2001]: main: Log started tvheadend[2001]: satips: Unable to determine the HTTP/RTSP address tvheadend[2001]: config: loaded tvheadend[2001]: scanfile: DVB-T - loaded 44 regions with 1105 networks tvheadend[2001]: scanfile: DVB-S - loaded 1 regions with 94 networks tvheadend[2001]: scanfile: DVB-C - loaded 17 regions with 53 networks tvheadend[2001]: scanfile: ATSC - loaded 2 regions with 14 networks tvheadend[2001]: linuxdvb: adapter added /dev/dvb/adapter1 tvheadend[2001]: linuxdvb: adapter added /dev/dvb/adapter0 tvheadend[2001]: linuxdvb: unable to open /dev/dvb/adapter0/frontend1 tvheadend[2001]: dvr: Creating new configuration '' tvheadend[2001]: access: No access entries loaded tvheadend[2001]: CSA: Using SSE2 128bit parallel descrambling tvheadend[2001]: epggrab: module eit created tvheadend[2001]: epggrab: module uk_freesat created tvheadend[2001]: epggrab: module uk_freeview created tvheadend[2001]: epggrab: module viasat_baltic created tvheadend[2001]: epggrab: module opentv-skynz created tvheadend[2001]: epggrab: module opentv-skyit created tvheadend[2001]: epggrab: module opentv-skyuk created tvheadend[2001]: epggrab: module opentv-ausat created tvheadend[2001]: epggrab: module pyepg created tvheadend[2001]: epggrab: module xmltv created tvheadend[2001]: spawn: Executing "/usr/bin/tv_find_grabbers" tvheadend[2001]: epggrab: module /usr/bin/tv_grab_huro created tvheadend[2001]: epggrab: module /usr/bin/tv_grab_ar created tvheadend[2001]: epggrab: module /usr/bin/tv_grab_il created tvheadend[2001]: epggrab: module /usr/bin/tv_grab_pt_meo created tvheadend[2001]: epggrab: module /usr/bin/tv_grab_ch_search created tvheadend[2001]: epggrab: module /usr/bin/tv_grab_is created tvheadend[2001]: epggrab: module /usr/bin/tv_grab_dk_dr created tvheadend[2001]: epggrab: module /usr/bin/tv_grab_na_dd created tvheadend[2001]: epggrab: module /usr/bin/tv_grab_hr created tvheadend[2001]: epggrab: module /usr/bin/tv_grab_za created tvheadend[2001]: epggrab: module /usr/bin/tv_grab_no_gfeed created tvheadend[2001]: epggrab: module /usr/bin/tv_grab_na_dtv created tvheadend[2001]: epggrab: module /usr/bin/tv_grab_uk_rt created tvheadend[2001]: epggrab: module /usr/bin/tv_grab_it created tvheadend[2001]: epggrab: module /usr/bin/tv_grab_es_laguiatv created tvheadend[2001]: epggrab: module /usr/bin/tv_grab_uk_bleb created tvheadend[2001]: epggrab: module /usr/bin/tv_grab_eu_egon created tvheadend[2001]: epggrab: module /usr/bin/tv_grab_fr_kazer created tvheadend[2001]: epggrab: module /usr/bin/tv_grab_se_swedb created tvheadend[2001]: epggrab: module /usr/bin/tv_grab_fi created tvheadend[2001]: epggrab: module /usr/bin/tv_grab_se_tvzon created tvheadend[2001]: epggrab: module /usr/bin/tv_grab_in created tvheadend[2001]: epggrab: module /usr/bin/tv_grab_fr created tvheadend[2001]: epggrab: module /usr/bin/tv_grab_eu_epgdata created tvheadend[2001]: epggrab: module /usr/bin/tv_grab_combiner created tvheadend[2001]: epgdb: loaded v2 tvheadend[2001]: epgdb: config 1 tvheadend[2001]: epgdb: channels 0 tvheadend[2001]: epgdb: brands 0 tvheadend[2001]: epgdb: seasons 2572 tvheadend[2001]: epgdb: episodes 8479 tvheadend[2001]: epgdb: broadcasts 9956 tvheadend[2001]: START: HTS Tvheadend version 4.0.9~trusty started, running as PID:2001 UID:108 GID:44, CWD:/ CNF:/home/hts/.hts/tvheadend tvheadend[2001]: htsp: Got connection from 127.0.0.1 tvheadend[2001]: htsp: 127.0.0.1: Welcomed client software: Kodi Media Center (HTSPv25) tvheadend[2001]: htsp: 127.0.0.1 [ Kodi Media Center ]: Disconnected tvheadend[2001]: htsp: Got connection from 127.0.0.1 tvheadend[2001]: htsp: 127.0.0.1: Welcomed client software: Kodi Media Center (HTSPv25) tvheadend[2001]: htsp: 127.0.0.1 [ Kodi Media Center ]: Disconnected tvheadend[2001]: htsp: Got connection from 127.0.0.1 tvheadend[2001]: htsp: 127.0.0.1: Welcomed client software: Kodi Media Center (HTSPv25) tvheadend[2001]: htsp: 127.0.0.1 [ Kodi Media Center ]: Identified as user mick tvheadend[2001]: htsp: 127.0.0.1 [ mick | Kodi Media Center ]: Privileges raised tvheadend[2001]: AVAHI: Service 'Tvheadend' successfully established. tvheadend[2001]: htsp: Got connection from 127.0.0.1 tvheadend[2001]: htsp: 127.0.0.1: Welcomed client software: Kodi Media Center (HTSPv25) tvheadend[2001]: htsp: 127.0.0.1 [ Kodi Media Center ]: Disconnected tvheadend[2001]: htsp: Got connection from 127.0.0.1 tvheadend[2001]: htsp: 127.0.0.1: Welcomed client software: Kodi Media Center (HTSPv25) tvheadend[2001]: htsp: 127.0.0.1 [ Kodi Media Center ]: Disconnected tvheadend[2001]: htsp: Got connection from 127.0.0.1 tvheadend[2001]: htsp: Got connection from 127.0.0.1 tvheadend[2001]: htsp: 127.0.0.1: Welcomed client software: Kodi Media Center (HTSPv25) tvheadend[2001]: htsp: 127.0.0.1 [ Kodi Media Center ]: Disconnected tvheadend[2001]: htsp: Got connection from 127.0.0.1 tvheadend[2001]: htsp: 127.0.0.1: Welcomed client software: Kodi Media Center (HTSPv25) tvheadend[2001]: htsp: 127.0.0.1 [ Kodi Media Center ]: Disconnected tvheadend[2001]: htsp: 127.0.0.1: Welcomed client software: Kodi Med

Bit of a newbie to bug submission, please let me know if you need anything else.

Thanks in advance!

Jalle19 commented 8 years ago

Did you configure the addon manually or did you get a popup saying "tvheadend discovered, do you want to enable it?". I've seen instances where it may take a few seconds before the addon actually starts after a cold boot, but two minutes sounds a bit excessive. Can you paste a Kodi debug log too?

mikesumbler commented 8 years ago

Hi Jalle19,

Thanks for picking this up. I believe I manually configured it. I don't recall a prompt to enable it.

Kodibuntu 14.04LTS is shipped with Kodi Helix, which hts didn't work on. I had to upgrade to Jarvis (but perhaps Isenguard would have also worked) running distro-upgrade from command line via ssh and installing hts from repo (again from ssh commandline). Then enabled it manually in Kodi, adding my username and pw before enabling live tv.

Have attached kodi log, can see a series of errors like these:

ERROR: AddOnLog: Tvheadend HTSP Client: pvr.hts - Command hello failed: No response received

kodi.log.txt

mikesumbler commented 8 years ago

PS - exact Kodi build: 16.0 Git:a5f3a99 (compiled 20/2/16).

Glenn-1990 commented 8 years ago

I had a similar problem today: ERROR: AddOnLog: Tvheadend HTSP Client: pvr.hts - failed to write (Invalid argument) ERROR: AddOnLog: Tvheadend HTSP Client: pvr.hts - failed to transmit ERROR: AddOnLog: Tvheadend HTSP Client: pvr.hts - failed to send hello

Solved it by deleting and readding another user profile in the tvheadend webui. You should also report it here as I believe it's a tvheadend problem: https://tvheadend.org/projects/tvheadend/issues

Jalle19 commented 8 years ago

I've seen this issue myself from time to time on various setups, but it's not always reproducible. Since the connection works later on it would seem to indicate that the problem is in tvheadend, so please follow @Glenn-1990's suggestion and open a ticket on tvheadend.org.

@perexg any idea what's going on here?

mikesumbler commented 8 years ago

Hi all, thanks for continuing to look at this. I originally reported problem on tvheadend forum but was told it was a client issue and it got closed.

However some progress....I removed the HVR4000 and now the problem has stopped. I believe your right this is a tvheadend issue and most likely hardware related. I was having some conflict in the module loading order resulting in the HVR1300 sometimes not being initialized, possibly because the shared modules for the HVR4000 were being sporadically prioritized during boot. To add to this the sat aerial had become water logged (outer casing had perforated and filled cable with water!!). Possibly has damaged the card as dvb-t or s had before I pulled just ceased to tune.

Anyway, one to note but think you can probably close this out now. If I see it again I'll raise it on tvheadend.

Thanks Mike

mikesumbler commented 8 years ago

PS - any suggestions for new DVB-S2 dual/quad card?..... once I've managed to scale the roof!

Jalle19 commented 8 years ago

Any update on this? Does this issue still exist?

samuel235 commented 8 years ago

I'm having the exact error but i have attempted to create a new account and it isn't working here. Maybe this is a different issue compared to this one.

My system is a Raspbery Pi 3, running OSMC 2016.06.02 - a recent release. My kodi version is 2.8.6-kodi-2.8.6-Jarvis-16.0

ckarrie commented 7 years ago

Still exists with latest kodi/tvh

Jalle19 commented 7 years ago

@ckarrie what platform do you use? Does anyone who experience this run something other than OE/LE?

ckarrie commented 7 years ago

@Jalle19 LibreElec, Pi 3, Kodi 8 beta. But seems to be gone:

2017-01-04 22:30:20.026 htsp: 192.168.178.26 [ kodi-dach | Kodi Media Center ]: Disconnected 2017-01-04 22:30:20.028 htsp: Got connection from 192.168.178.26 2017-01-04 22:30:20.029 htsp: 192.168.178.26: Welcomed client software: Kodi Media Center (HTSPv25) 2017-01-04 22:30:20.030 htsp: 192.168.178.26 [ Kodi Media Center ]: Identified as user 'kodi-dach' 2017-01-04 22:30:20.030 htsp: 192.168.178.26 [ kodi-dach | Kodi Media Center ]: Privileges updated

Jalle19 commented 7 years ago

I have a strong feeling this is limited to OE/LE, both based on these comments and my personal experience. @ckarrie so you're saying this issue is completely gone with newer LE builds?

CvH commented 7 years ago

@ckarrie do you use any kind of pre-built channel list? (or a copy from an ubuntu installation or similar)

ckarrie commented 7 years ago

@Jalle19 I don't know if i reproduce it correctly, i just rebooted my pi. No connection loss. Using pvr.hts 3.4.12, Kodi 18.0 alpha (Milhouse) build from 2017-01-03, TVHeadend 4.1-2405~geb495a098.

@CvH no (never heard of a pre-build channel list for TVH).

Jalle19 commented 7 years ago

I have a feeling this has been fixed in Krypton (v17), or possibly in one of the LE releases since Jarvis. I'm gonna go ahead and close this - if the issue still persists for someone then please try the lastest Krypton release of Kodi and post a full debug log to paste.ubuntu.com.