HTSP connection lost while playing TvHeadend Recordings

Hey,

Been playing back some recordings made with TvHeadend on my Vero4k+ and pretty consistently experiencing an issue where approximately 30 minutes into watching the recording I get a banner pop up indicating “HTSP client has lost connection” and the playback of the recording stops.

The recordings are stored on my NAS mounted in the Vero using autofs. I play DVDs and Blu-rays from the same NAS with no issues. The TvHeadend server runs on the same Vero4k I am playing back from and I have configured the client to use a localhost IP (127.0.0.1)

Last night I was able to replicate the issue while capturing debug logs:
https://paste.osmc.tv/ojigawodov

Any thoughts on what might be happening?
Thanks :slightly_smiling_face:

It looks like the connection drops for a while, but it’s not clear why.

2020-09-08 18:45:13.432 T:3474924256   ERROR: AddOnLog: Tvheadend HTSP Client: pvr.hts - unable to connect to 127.0.0.1:9982

Could you try recording to local storage and seeing if that helps?

Sam

Hey Sam,

Thanks for checking my logs and replying.

Yep, happy to give that a go. Just to clarify, do you mean the internal storage of the Vero? Or a USB or HDD connected to the Vero? If the latter, then I might struggle as I don’t have a hub and all the USB ports are taken.

Completed a recording to local storage last night
/home/osmc/Recordings

Playing the recording this morning gives the same issue
https://paste.osmc.tv/uqinosayoq

I don’t understand how you can lose connection to localhost…

This means the service is falling over.

TVHeadend has its own logs, can you paste these / do they show anything?

Thanks Sam.

I got the tvheadend logs with

journalctl -u tvheadend

https://paste.osmc.tv/oqirarayic

Based on what I can see, they don’t seem to help much either. Just saying disconnected and then almost immediately reconnected :disappointed:
But maybe you can see something I can’t…

EDIT:
I just had a thought, the logs I grabbed above are just a subset of the larger set I grabbed before. Is that correct?
If so, is there another way to get the separate tvheadend logs?

I’m referring to the actual TVHeadend logs - not exactly sure where they are stored but should be configurable in the TVH web interface.

Thanks Sam,

Checked out the TvHeadend docs and you were right, there was the ability to enable TvHeadend debug logs and add them to the system logs. Just needed to enable “Debug to syslog” and “Debug trace (low level)” and specify what subsystems I wanted logging for as below:

image

Have run another round of debug logging capturing the additional TvHeadend debug logs.
https://paste.osmc.tv/osozutudub

I don’t really understand what I’m looking at. But have noticed there seems to be a lot of this being reported…

ERROR: CAESinkALSA - snd_pcm_writei(-32) Broken pipe - trying to recover

That’s probably related to the buffer running out but not the direct cause of the issue

Sam

Is there anything else in the logs that might relate to the issue?
Or is the information there insufficient?

Just wondering if there is further information I can grab.

Hi,

I’ve had another look at the logs.
Unfortunately I can’t see any obvious reason. The TVHeadend forums have some reports of this, but there doesn’t seem to be a general solution.

This is interesting: Loosing connection during recording playback and crash · Issue #402 · kodi-pvr/pvr.hts · GitHub. Could there be some load on the server side?

1 Like

When recorded the file to the local storage, did you try to directly play the mkv file using the kodi? (I assume it’s an mkv since I saw the tvheadend profile name ‘MKV_local’ in your logs)
Is the file incomplete?

Interesting indeed! They are reporting the exact same issue. Though the last update there was over a year ago and nobody seemed to find a solution.

Just tried that this morning and the recording seems to play fine with no issues whatsoever… Also on a side note I tried playing it with my TVHeadend iPad client app and also seemed to have no issues… :thinking:

I’ve been meaning to follow through this HowTo and try to get it setup. Maybe this is my best solution going forward.

If it’s not too much hassle – is it possible for you to set up a mount so you can play the recordings directly from the NAS and not via TVH for a few days and let us know how you get on?

Sam

1 Like

Certainly! Not too much hassle at all.
I’ll report back on how I go in a bit.

1 Like

Please keep in mind this setup will rename and move your recorded files. Afterwards they won’t be available for streaming in TVH anymore, but instead will show up as the correct movies and shows in Kodi.

1 Like

Hi Sam,

Just reporting back on testing playback directly from the NAS accessed through a mount and not via TVH.

Have not had any of the issues of losing connection. Thanks for the suggestion and help. Looks like it was some issue with TVH itself.

I’m happy to use this directly from the NAS :slightly_smiling_face:

1 Like

Glad to hear this!