Project

General

Profile

Failover if transport errors too high

Added by Chris M 11 months ago

Hello,

I am using TVHeaded to manage a number of over the air (ATSC) and IPTV streams. Some channels I am able to receive over the air as well as via IPTV, and I would like to use the ATSC stream if it's available and then fail over to the IPTV version if not. What I have done so far is to map both services to a channel, and define the priority of the ATSC to be higher then the IPTV version. This works as expected when changing channels; if my tuner is unavailable for some reason, TVHeadend will seamlessly begin using the IPTV source.

Where I begin to encounter issues is when the ATSC channel is weak enough to cause playback errors (I am receiving channels from far away and sometimes weather conditions will cause the signal strength to drop) but not weak enough to be unavailable altogether. In this situation TVHeaded will lock onto the ATSC version of the channel, and continue trying to play it despite the stream being unwatchable (constant breakups).

I am wondering if it's possible to configure TVHeaded to look at either the transport or continuity error counters, and fail over to the backup source if they exceed a certain threshold.


Replies (4)

RE: Failover if transport errors too high - Added by Dave Pickles 11 months ago

Unfortunately not.

I've looked at this issue, and because of the way the way the code is written it would need a major redesign.

When a timer is triggered, TVH selects the highest-priority input source and tunes it to the service. If TVH receives absolutely no data (because the tuner is broken or the aerial disconnected) then it will select another source, if available. Then TVH spawns a thread to carry out the recording and the timer function exits. If that thread encounters problems it has no way to signal failure because the code which started it is no longer running.

RE: Failover if transport errors too high - Added by Dave H 11 months ago

Why not just record both versions and delete the appropriate one afterwards when you know whether the ATSC is usable?

RE: Failover if transport errors too high - Added by Chris M 11 months ago

Thanks for the replies and the confirmation that this is not supported.

Unfortunately in my case this is used for viewing live TV and not for recordings, so recording multiple streams isn't really an option.

I wonder if the the API exposes error counters? If so, I might be able to scrape the API and then kick streams asynchronously as a work-around.

RE: Failover if transport errors too high - Added by Dave Pickles 11 months ago

I wonder if the the API exposes error counters? If so, I might be able to scrape the API and then kick streams asynchronously as a work-around.

Documentation on the API is at https://github.com/dave-p/TVH-API-docs/wiki/

You can get the status of your input devices from http://user:[email protected]:9981/status/inputs. The user must have admin privilege.

    (1-4/4)