-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Timer in VDR with VPS enabled leads to annoying Reminders in Kodi 19 #162
Comments
Please supply a full debug log and can take a look. Also screenshots please. @AlwinEsch @ksooo i don’t see any obvious reason from the addon code why this happens. |
OK, lets create a timer in VDR Live with VPS enabled (sorry for German locale) Lets start kodi and go to TV Timer overview, a new reminder is created Logfile (kodi.log): https://paste.kodi.tv/uluqezecur.kodi |
Thanks. Could you move the debug log to a paste site like paste.kodi.tv? Then it’s easier to access/read and doesn’t clutter the issue. |
Also, this is an INFO log and not a DEBUG log. Try following: https://kodi.wiki/view/Log_file/Easy |
Really? Wait, let me enable "Enable component-specific logging"... |
Ok, I wonder is there something going wrong or missing under hood. We moved from a C API to a C++ API in Kodi 19 and there could be a subtle issue causing this. I found this error in your log:
But I see similar errors for many of the Kodi API calls. @AlwinEsch any ideas what’s happening? |
Any news on this one? I do see the very annoying pop-ups in Kodi for all my timers in vdr (which all do use VPS) since Kodi 19 too. Anything I could to to help? |
Can you explain what VPS is? |
https://en.m.wikipedia.org/wiki/Programme_Delivery_Control |
I wonder if for some reason the VPS timer is not being created. Or that the VDR protocol version is somehow being reported incorrectly causing the timer types to not be created ( pvr.vdr.vnsi/src/ClientInstance.cpp Line 1004 in 021a238
|
Indeed, I do find something fishy in the kodi.log: but: I do use the vnsiserver Plugin from the following GIT repository https://github.com/mdre77/vdr-plugin-vnsiserver |
Ok, I think we are getting closer to the problem. Unfortunately I don’t have a VDR setup so can’t debug. @AlwinEsch is this something you could check? |
There seems to be a more general communication issue between the kodi plugin and the vnsiserver on vdr side when the plugins starts up: (the same sequence even happens if I do run the vdr instance on the same computer as kodi and access to plugin via 127.0.0.1) There is a sginificant delay when the plugin starts. ERROR : AddOnLog: pvr.vdr.vnsi: SupportChannelScan - Can't get response packed There are no corresponding errors in the log of the vdr! But from then on things look good (and almost everything is working - live tv, playing of records, timers created via kodi and timers created via vdr ). Would there be a way to create a VPS timer via Kodi? I do not see anything like that in Kodi. |
If the kodi addon understood the capabilities of the VDR backend then it should have VPS timers available. The fact it does not means that something is going wrong initially which is what needs fixing. |
O.k. I see. And am fully agreeing. As a test I did comment out that
test in ClientInstance.cpp in CVNSIClientInstance::GetTimerTypes. And now the Timers are handled correctly. So the initial failing calls must be fixed ... unfortunately my C++ capabilites are somewhat limited ... but I do have a working setup with the ability to build the kodi plugin as well as the vdr side quite easily for testing if that would help. |
Can you search your log for I can add a PR with some logging if you can try it out. |
Result: 2022-01-08 12:32:05.816 T:36245 ERROR : AddOnLog: pvr.vdr.vnsi: ChannelScan - Can't get response packed |
Anything printing the protocol version? |
I added some code in front of the check: The result is: So Indeed, the GetProtocol Macro delivers a wrong number at the time the SupportRecordingsUndelete function is called. But later on it is correct. Is the session to vnsiserver handling in an extra thread??? |
Can you try the latest version of the PR: #173 I've tried to force a login before calling those functions. |
Compiles, but unfortunately makes kodi crashing during startup ... |
Here is definitely some race going on. After creation of the Instance via ADDON_STATUS CPVRAddon::CreateInstance the next what happens is already a CVNSIClientInstance::GetCapabilities call, before a cVNSISession::Login call happens. Thus the m_protocol is still at 0 at that point in time. Which makes some other calls to fail. |
Ya, I see the same from the log above. If I knew which call to wait on that would be easy enough to add. the problem is login is called from numerous places and I don’t know which is the right one to wait on. But if we figure that out it’s pretty easy. Or maybe we just try waiting for the first login call. |
O.k. now I have tried to wait until at least one login has happened in GetCapabilities and things do work then. But as being a C-Coder (30 years ago), my code is for sure not well suited to be commited. |
Multiple GetCapabilities Calls are intended. Guys, here is how "asnc connect" protocol (a bit simplified) works:
HTH |
The fact that GetCapabilities as @ksooo has said is called multiple times is fine. What we really need is to make sure that GetTimerTypes is not called prior to a login call happening as this is the source of the problem. Likely the addon is reporting it’s connected before it actually is due to some issue with the TCP calls (this is just a hunch). |
Why? GetTimerTypes is also called multiple times, like GetCapabilties and others. The add-on must simply give the information it has at time of the call. I have the same situation (some timer types only available if backend has at least a certain version) with pvr.hts and it is working fine. |
For some reason the version of the backend does not get loaded prior to any timer types call. We need to figure out why that is. |
For me it looks like the whole code is not written with the assumption in mind that some Methods are called before a connection is available. The second call to GetCapabilites does not seem to "fix" the wrong answers from the first call. I can get everything to work correctly for the VPS timers when I do wait at the begin of GetCapabilities until we are logged into the vnsi server. This works for me, but I would not consider it to be "the fix" |
The addon shouldn’t need to worry about the order. But I reckon in this case the addon is mis-reporting some state which is causing this problem. |
@micclass62 please activate PVR compenent logging in addition to enable debug logging and send a new log. |
@micclass62 seems that you are able to modify and compile the add-on by yourself. So, can you tell us what exactly the second GetTimerTypes call returns? Is the protocol version set properly on second call? |
Here you go: https://paste.kodi.tv/ikelibalav.kodi I have added a line that prints the Protocol Version inside the GetTimerTypes method ... |
Thanks. There goes something wrong at the add-on side.
if (GetProtocol() >= 9)
{
cRequestPacket vrp;
vrp.init(VNSI_TIMER_GETTYPES);
auto vresp = ReadResult(&vrp);
if (!vresp)
{
kodi::Log(ADDON_LOG_ERROR, "%s - Can't get response packed", __func__);
return PVR_ERROR_NO_ERROR;
} So, root cause for your problem is that timer types cannot be obtained from the backend for whatever reason. |
Yes, the errors can be observed all the time. But it is definitely not the network nor the vdr/vnsi-sever. I did a test with the vdr/vnsi-server running on the same host as kodi and accessed the vnsi-server via 127.0.0.1 with exactly the same behaviour. |
@AlwinEsch by any chance, did the move from P8PLATFORM to kissnet break something here???? Please have a look and report back here. Thanks. |
Hello, I could find now a less intrusive change to fix (better: work around) the VPS-Timers not appearing issue. It does NOT fix the underlying issue of something going wrong in the network communication as discussed above. But: If I do change in pvr.vdr.vnsi/src/ClientInstance.cpp the order of the creation of the Timers (in essence do the VPS Timer add immediately atfer the Protocol > 9 check, my VPS timers do show up correctly.
Can we get this somehow until we do find the correct resolution? The issue is VERY annoying as I do see Pop-UPs all the time when watching a movie while there are some recordings going on. Unfortunately I can only build kodi on my Linux Workstation, but not for the Android platform (which is my main platform for watching TV - either on an tablet or on a FIre4k stick on TV) so I would be very much interessted into getting the fix for all my devices. Cheers, |
For this is to be fixed properly we’ll need to wait until @AlwinEsch has some time to take a look. Any other attempts other than fixing the comms problem are just getting lucky with timing or they are hacks. If you need something why not create a PR and use the builds from Jenkins in the meantime? |
Becomed this weekend a bit more time and created a fix request about. Here the related request #174, the way is a bit ugly but on tests it has worked 😅. |
For other OS's to test are binaries available here https://jenkins.kodi.tv/blue/organizations/jenkins/kodi-pvr%2Fpvr.vdr.vnsi/detail/PR-174/3/artifacts For your Linux you need to compile by self and can be done with add of this patch https://github.com/kodi-pvr/pvr.vdr.vnsi/pull/174.patch to your code for tests. |
Thank a lot! This seems in deed to fix the issue. I have rebuild my local linux client (with a minor adjustment as I am still at Matrix) and things go smooth now. Startup of the vnsi client is now fast (not waiting multiple times for timeouts any more) and timers are correct. |
Brought in the requests and releases on Nexus and Matrix. |
Steps to reproduce:
Now Kodi 19 has a timer of type "Reminder" that will pop up before the start.
There is no chance to disable the reminder.
Up to Kodi 18 the timer was of type "VPS" without annoying reminder.
The text was updated successfully, but these errors were encountered: