Bug #3025
Multiple recordings of the same event have the same ID
0%
Description
This causes problem for Kodi since the addon (pvr.hts) blindly trusts that the IDs from the server are unique. See this log snippet:
DEBUG: AddOnLog: Tvheadend HTSP Client: pvr.hts - recording id:2130620946, state:scheduled, title:Die Truman Show, desc: Satire über Medienmanipulation, in der ein Versicherungsagent ohne sein Wissen seit 30 Jahren Star einer weltweit live übertragenen Fernseh-Seifenoper ist., error:none DEBUG: AddOnLog: Tvheadend HTSP Client: pvr.hts - recording id:2130620946, state:recording, title:Die Truman Show, desc: Satire über Medienmanipulation, in der ein Versicherungsagent ohne sein Wissen seit 30 Jahren Star einer weltweit live übertragenen Fernseh-Seifenoper ist., error:none
These are two separate recordings.
History
Updated by Sam Stenvall about 9 years ago
@perexg can you point me to the code that generates these IDs so I can take a stab at fixing this? I would not like to add a workaround for this to pvr.hts.
Updated by Sam Stenvall about 9 years ago
Updated by Jaroslav Kysela about 9 years ago
This id is unique. It looks like a bug somewhere else. The id uniqueness is checked in src/idnode.c - idnode_insert() function. This fcn should abort with "Id node collision" message if no unique ids is available after 5 retries.
Updated by Sam Stenvall about 9 years ago
The log snippet comes from a user so I'm not sure how to replicate it. I have noticed though that if you record an event, then stop the recording and record it again, two recordings will be created (obviously) but you can only play the first one. I think that could be related, I'll try to grab some new logs.
Updated by Jaroslav Kysela about 9 years ago
I looked to the kodi log from the user (pvr.hts issue) and to the tvh code. There is a check which prevents to add two duplicate recordings. Perhaps, the pvr.hts is confused by this ? But TVH should return success = 0 response in that case.
TVH shows "delete entry .. start time .. scheduled for recording by .. (duplicate with ..)" in log when the duplication is detected.
Updated by Sam Stenvall about 9 years ago
Not really sure what you're saying here. Judging by the log tvheadend definitely sends two items with the same ID, that's what I'm worried about.
Updated by B C about 9 years ago
just by looking at the log snippet, one line says scheduled, the other recording......
Updated by Sam Stenvall about 9 years ago
@perexg so are you saying it shouldn't be possible to record the same program twice?
Updated by B C about 9 years ago
maybe I don't understand exactly the problem. When I schedule a recording (just added manually in tvh webif, which starts immediately), I get the following in the log:
13:08:53 T:140103611565824 DEBUG: AddOnLog: Tvheadend HTSP Client: pvr.hts - recording id:1359933164, state:scheduled, title:Test, desc:, error:none
13:08:53 T:140103611565824 DEBUG: AddOnLog: Tvheadend HTSP Client: pvr.hts - recording id:1359933164, state:recording, title:Test, desc:, error:none
I do expect the recording id to be the same for the schedule and the recording
Updated by B C about 9 years ago
BTW i get this twice:
13:08:53 T:140103611565824 DEBUG: AddOnLog: Tvheadend HTSP Client: pvr.hts - recording id:1359933164, state:recording, title:Test, desc:, error:none
13:08:54 T:140103611565824 DEBUG: AddOnLog: Tvheadend HTSP Client: pvr.hts - recording id:1359933164, state:recording, title:Test, desc:, error:none
one second apart but with the same T:140103611565824
Updated by B C about 9 years ago
ok, but still I did schedule only one recording and see the same as your log snippet, so IMHO no dublicate id
Updated by Jaroslav Kysela about 9 years ago
I also don't understand the issue. Basically, if htsp client enters a new recording - the addDvrEntry method is issued from client. If tvh detects the duplicate parameters (same user, same DVR config, identical start time), it will respond with "success" = 0 reply.
Then we have the async replies from the tvh server - dvrEntryAdd , dvrEntryUpdate . These messages are generated when a new DVR entry is created / updated. I'm not able to determine which reply the pvr.hts plugin logs. The update async reply might be generated multiple times to notify client about the state changes.