Kodi Community Forum

Full Version: Instant recording failing randomly
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

As the title suggests i'm having issues with Instant recording failing randomly, but rather frequently.
I've posted this in the tvheadend secyion aswell, but I'm unsure whether the issue is with kodi, tvheadend or the tvheadend addon itself.

My set up:
OTA using HDHomerun - Rpi2 dedicated backend
Tvheadend 4.2
mixture of Rpi and PC frontends
All running Libreelec

Issue:
watching a channel, hit record, message pops up saying ''recording started'' hitting record again completes the recording. Seems to work as it should...
However, watch the channel for a while or maybe switch to a different channel, try the same thing i get "error check log for details''
Switch to another channel, recording works fine.
Switch back to channel that's failing, try record and get the error.

The logs don't seem to show too much however.

I enable debug logging and the only errors that show are as follows:
22:07:16 246.681641 T:1577235360 ERROR: AddOnLog: Tvheadend HTSP Client: pvr.hts - Command addDvrEntry failed: Channel does not exist
22:07:16 246.681793 T:1577235360 ERROR: PVR - AddTimer - addon 'Tvheadend:10.0.0.23:9982 [connected]' returned an error: server error
22:07:16 246.681854 T:1577235360 ERROR: PVR - AddTimer - cannot add timer to client '3890': server error

it's saying "channel does not exist" but... I'm watching it, so i know that's not true.

To fix this, i have to clear my epg data before i can record that channel again. After that, instant recording will work for these channels for a while, then it'll start returning the same error message.

My thoughts;
It seems to be an issue with guide based recording and the way the addon is handling EPG. This did not happen when i was using NPVR, ever.
The reason i believe this... When i get the error and instant recording stops working for a particular channel that im watching, if i switch to the TV Guide and select "add timer", type "One time" the recording starts straight away. If i select type "One Time (guide-based)" the error message pops up telling me to check log for details. Clear the EPG, try again, starts working as it should for a short period then will start to failing on random channels again.

It's hard to pinpoint the problem as it seems to happen to any channel randomly, clearing the epg fixes the issue but only shortly... in a matter of minutes the issue returns.

I'm hoping someone else is experiencing the same issues. This is really driving me nuts.

As i said this happens to all channels, randomly. It does not seem to be specific to any one channel.


Possible problem:
I think kodi instant record is sending the wrong message to the backend. It's sending a timer for a "one time (guide-based)" recording and I would have thought it should be sending a simple "one time" request because it shouldn't matter about the guide when instant recording, it should simply start recording the current channel until you stop it. I'm not sure if the "instant record" feature is handled by Kodi or the pvr addon though. Hopefully someone can shed done light on this.
Which version of Kodi are you using?

There is no tvheadend 4.2, only daily snapshots of unstable frequently changing code that some day will result in a stable 4.2 release.

Could you please check whether the problem you reported also occurs with latest stable version of tvheadend which currently is 4.0.9?
Instant recording is implemented the way that if epg data is available, the current show will be recorded. Only, if there is no epg data a "manual" recording on that channel for a predefined amount of time will be scheduled (default is 120 min).

For epg based timers, tvheadend Client add-on will extract the channel to record from the epg date of the event to record.

Could it be the case that your problems start the moment epg data gets available for the channel in question? This would be a strong indicator for tvheadend (for whatever reason) sending broken epg data to Kodi.
Hi Ksooo,

thanks for your response. I'm using latest kodi 16, Libreelec 7

This problem also occurred on TVheadend 4.0.9, it's one of the reasons I switched to NPVR, and the fact that timeshifting was rubbish in 4.0.9

(2016-04-27, 08:34)ksooo Wrote: [ -> ]Could it be the case that your problems start the moment epg data gets available for the channel in question? This would be a strong indicator for tvheadend (for whatever reason) sending broken epg data to Kodi.
I'm not sure I understand your question.
Kodi fetches EPG from Tvheadend fine. All my channels display EPG and are never empty.
I thought that maybe the "time and date" were out of sync, so I enabled Asynchronous EPG transfer but it makes no difference instant recording will randomly fail.... then after a few minutes, I try again and it works.
I've tried every possible setting in tvheadend to fix this and haven't been able to fix it.
But it appears to definitely be an issue with EPG.

(2016-04-27, 08:34)ksooo Wrote: [ -> ]Instant recording is implemented the way that if epg data is available, the current show will be recorded. Only, if there is no epg data a "manual" recording on that channel for a predefined amount of time will be scheduled (default is 120 min).

Why does it work this way?
If I'm watching a channel and hit the record button, it should manually record the channel for the duration applied in the setting " instant record duration" regardless if there is EPG data or not. Why does it use EPG to determine what to record? that seems over complicated and contradicts the Live-TV setting "instant recording duration"
(2016-04-27, 09:06)loggio Wrote: [ -> ]Hi Ksooo,

thanks for your response. I'm using latest kodi 16, Libreelec 7

This problem also occurred on TVheadend 4.0.9, it's one of the reasons I switched to NPVR, and the fact that timeshifting was rubbish in 4.0.9

(2016-04-27, 08:34)ksooo Wrote: [ -> ]Could it be the case that your problems start the moment epg data gets available for the channel in question? This would be a strong indicator for tvheadend (for whatever reason) sending broken epg data to Kodi.
I'm not sure I understand your question.
Kodi fetches EPG from Tvheadend fine. All my channels display EPG and are never empty.
I thought that maybe the "time and date" were out of sync, so I enabled Asynchronous EPG transfer but it makes no difference instant recording will randomly fail.... then after a few minutes, I try again and it works.
I've tried every possible setting in tvheadend to fix this and haven't been able to fix it.
But it appears to definitely be an issue with EPG.

Wanted to say that this seems to be an issue with the epg data tvheadend sends to Kodi. Every epg event has a unique id that is sent by tvheadend to Kodi. When scheduling an epg based recording this unique id is sent back by Kodi to tvheadend. The error message you provided indicates that tvheadend does not know the event id it must have sent earlier to Kodi! If you ask me, this is a tvheadend issue, not a Kodi issue. But as I'm not able to reproduce this and thus being unable to debug the problem, this is just an eduacetd guess.

(2016-04-27, 09:06)loggio Wrote: [ -> ]
(2016-04-27, 08:34)ksooo Wrote: [ -> ]Instant recording is implemented the way that if epg data is available, the current show will be recorded. Only, if there is no epg data a "manual" recording on that channel for a predefined amount of time will be scheduled (default is 120 min).

Why does it work this way?
If I'm watching a channel and hit the record button, it should manually record the channel for the duration applied in the setting " instant record duration" regardless if there is EPG data or not. Why does it use EPG to determine what to record? that seems over complicated and contradicts the Live-TV setting "instant recording duration"

There is no right and wrong here. You see it this way, others don't. Whoever did the implementation (obviously not me ;-) decided on that, back then.
(2016-04-27, 09:49)ksooo Wrote: [ -> ]Wanted to say that this seems to be an issue with the epg data tvheadend sends to Kodi. Every epg event has a unique id that is sent by tvheadend to Kodi. When scheduling an epg based recording this unique id is sent back by Kodi to tvheadend. The error message you provided indicates that tvheadend does not know the event id it must have sent earlier to Kodi! If you ask me, this is a tvheadend issue, not a Kodi issue. But as I'm not able to reproduce this and thus being unable to debug the problem, this is just an eduacetd guess.

Yes, it's definitely a weird issue.
As I said, it'll record the channel one minute. I'll stop the recoding, try again and it'll return an error. Sometimes this happens, sometimes it doesn't. If I wait a while, it'll start working again.

In order to reproduce this, sometimes I have to cycle through all my channels pressing the record button to start and then stop the recording on each channel.. eventually i'll hit a channel that spits out the error.

(2016-04-27, 09:49)ksooo Wrote: [ -> ]There is no right and wrong here. You see it this way, others don't. Whoever did the implementation (obviously not me ;-) decided on that, back then.

Fair enough. Pretty confusing way of doing things I must say.

Thanks for your response
Took a look at the respective Kodi source code again and found that I was wrong with my first comment. In fact, Kodi always schedules an instant recording starting "now" ending after "instant recording length" settings value.

If people observe other behavior this is due to - strictly speaking - bugs in the pvr client add-ons they use. Those add-ons, for instance pvr.hts, do not implement instant timers like they should according to the specs.

Anyway, I'm currently thinking about making behavior configurable the way that people can decide what shall happen if they hit "record" - "instant recording", "epg based recording" if avail, "ask", ...
Seems that you are using pvr.hts (tvheadend), thus suffering from the pvr.hts bug to record the current show instead of creating an instant timer. I yesterday submitted a bug fix PR for pvr.hts for this. Kodi Krypton will behave as you expect, once this PR got merged.

https://github.com/kodi-pvr/pvr.hts/pull/226
(2016-05-18, 08:08)ksooo Wrote: [ -> ]Seems that you are using pvr.hts (tvheadend), thus suffering from the pvr.hts bug to record the current show instead of creating an instant timer. I yesterday submitted a bug fix PR for pvr.hts for this. Kodi Krypton will behave as you expect, once this PR got merged.

https://github.com/kodi-pvr/pvr.hts/pull/226

awesome. This would be great. I was left scratching my head thinking... kodi has settings for "instant recording duration" etc... but the addons are ignoring it and only recording the show... What's the point in having these settings?

i'd much prefer to have an instant recording act as an instant recording and not as a guide based recording. it just doesn't make sense to have it any other way.


Cheers,
i'll keep my eye out for this merge.

I forgot to subscribe to my thread, so I wasn't seeing any reply's on this.

Thanks for looking into this, I really appreciate it.
Here we go: 9847 (PR)
This is perfect. Should make all party's happy!


Question: will developers have to modify their addons to support this feature?
(2016-05-21, 09:36)loggio Wrote: [ -> ]Question: will developers have to modify their addons to support this feature?

No.
Awesome, thanks once again!
Hmm... Still not merged?
(2016-05-29, 01:09)loggio Wrote: [ -> ]Hmm... Still not merged?


Will be merged not before June as Kodi development cycle forbids to merge features after 20th of a month. Last days of a month are reserved for fixes. ;-)