Skip to content
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

[Kodi] PVR selection empty #3546

Closed
quthla opened this issue May 5, 2018 · 14 comments
Closed

[Kodi] PVR selection empty #3546

quthla opened this issue May 5, 2018 · 14 comments

Comments

@quthla
Copy link

quthla commented May 5, 2018

The PVR channel selection is empty.

Thing kodi:kodi:myKodi "Kodi" @ "" [ipAddress="libreelec", port=9090] {
    Channels:
        Type pvr-open-tv : pvr-open-tv [
            group="Alle Kanäle"
        ]
}

String myKodi_pvropentv             "Play PVR TV channel"       { channel="kodi:kodi:myKodi:pvr-open-tv" }

Selection item=myKodi_pvropentv

I am using Kodi 18 master.

@cweitkamp

@quthla quthla changed the title [Kodi] Binding does not determine player status correct [Kodi] PVR selection empty May 6, 2018
@cweitkamp
Copy link
Contributor

cweitkamp commented May 6, 2018

Hi @quthla,

Which UI / App do you use for displaying your sitemap? Be aware that currently only PaperUI or HABPanel support automatically population of the Selection elements (see eclipse-archived/smarthome#4942).

@quthla
Copy link
Author

quthla commented May 6, 2018

In PaperUI no selection is working. https://screenshots.firefox.com/ZCRo4FqAkYd5pfRk/ubuntu

And since updating to 2.3 the volume control correctly shows the volume but can't change it anymore.

@cweitkamp
Copy link
Contributor

cweitkamp commented May 6, 2018

Can you provide some DEBUG logs? The binding refreshes the PVR channels every five minutes.

I am going to try the volume issue in a few minutes.

Kodi 18 master

Can you tell me a little bit more about your system? Which distribution? OpenELEC, LibreELEC, other? milhouse build?

// Edit: I Can confirm the volume issue. Will provide a fix soon.

@quthla
Copy link
Author

quthla commented May 6, 2018

21:08:35.587 [DEBUG] [di.internal.protocol.KodiClientSocket] - Error during callMethod(Favourites.GetFavourites): socket not initialized
java.io.IOException: socket not initialized
        at org.openhab.binding.kodi.internal.protocol.KodiClientSocket.sendMessage(KodiClientSocket.java:181) ~[?:?]
        at org.openhab.binding.kodi.internal.protocol.KodiClientSocket.callMethod(KodiClientSocket.java:206) ~[?:?]
        at org.openhab.binding.kodi.internal.protocol.KodiConnection.lambda$1(KodiConnection.java:297) ~[?:?]
        at org.eclipse.smarthome.core.cache.ExpiringCache.refreshValue(ExpiringCache.java:81) ~[?:?]
        at org.eclipse.smarthome.core.cache.ExpiringCache.getValue(ExpiringCache.java:61) ~[?:?]
        at org.eclipse.smarthome.core.cache.ExpiringCacheMap.get(ExpiringCacheMap.java:186) ~[?:?]
        at org.eclipse.smarthome.core.cache.ExpiringCacheMap.putIfAbsentAndGet(ExpiringCacheMap.java:132) ~[?:?]
        at org.eclipse.smarthome.core.cache.ExpiringCacheMap.putIfAbsentAndGet(ExpiringCacheMap.java:117) ~[?:?]
        at org.openhab.binding.kodi.internal.protocol.KodiConnection.getFavorites(KodiConnection.java:292) ~[?:?]
        at org.openhab.binding.kodi.handler.KodiHandler.updateFavoriteChannelStateDescription(KodiHandler.java:530) ~[?:?]
        at org.openhab.binding.kodi.handler.KodiHandler.lambda$0(KodiHandler.java:506) ~[?:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
        at java.lang.Thread.run(Thread.java:748) [?:?]
21:08:35.596 [DEBUG] [nhab.binding.kodi.handler.KodiHandler] - Received unknown PVR channel group 'All channels'. Using default.
21:08:35.596 [DEBUG] [di.internal.protocol.KodiClientSocket] - Error during callMethod(PVR.GetChannels): socket not initialized
java.io.IOException: socket not initialized
        at org.openhab.binding.kodi.internal.protocol.KodiClientSocket.sendMessage(KodiClientSocket.java:181) ~[?:?]
        at org.openhab.binding.kodi.internal.protocol.KodiClientSocket.callMethod(KodiClientSocket.java:206) ~[?:?]
        at org.openhab.binding.kodi.internal.protocol.KodiConnection.lambda$4(KodiConnection.java:762) ~[?:?]
        at org.eclipse.smarthome.core.cache.ExpiringCache.refreshValue(ExpiringCache.java:81) ~[?:?]
        at org.eclipse.smarthome.core.cache.ExpiringCache.getValue(ExpiringCache.java:61) ~[?:?]
        at org.eclipse.smarthome.core.cache.ExpiringCacheMap.get(ExpiringCacheMap.java:186) ~[?:?]
        at org.eclipse.smarthome.core.cache.ExpiringCacheMap.putIfAbsentAndGet(ExpiringCacheMap.java:132) ~[?:?]
        at org.eclipse.smarthome.core.cache.ExpiringCacheMap.putIfAbsentAndGet(ExpiringCacheMap.java:117) ~[?:?]
        at org.openhab.binding.kodi.internal.protocol.KodiConnection.getPVRChannels(KodiConnection.java:759) ~[?:?]
        at org.openhab.binding.kodi.handler.KodiHandler.updatePVRChannelStateDescription(KodiHandler.java:542) ~[?:?]
        at org.openhab.binding.kodi.handler.KodiHandler.lambda$0(KodiHandler.java:508) ~[?:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
        at java.lang.Thread.run(Thread.java:748) [?:?]


It says All channels there though I set it to Alle Kanäle-

Milhouse builds but I build them myself with some changes

@quthla
Copy link
Author

quthla commented May 7, 2018

https://nopaste.xyz/?094c78e5706d93e1#Ht4rGhiWL5vOAPO4u7WIqaU1qCAYes1tgF9c7j34enA=

The binding is sending quite many requests.

@cweitkamp
Copy link
Contributor

cweitkamp commented May 7, 2018

@quthla Thank you very much for your help. I will look through them soon.

I submitted a fix for the volume issue (PR #3549).

@quthla
Copy link
Author

quthla commented May 8, 2018

Turns out it's working at least in HABPanel but judging by the log there is still some fixing needed.

@cweitkamp
Copy link
Contributor

cweitkamp commented May 8, 2018

I looked through your log file and tried to analyze the situation. It seems that different Kodi versions / PVR clients handle some methods slightly different.

May I ask you to do another test? Please change the channel configure for the group of your pvr-open-radio channel to "Alle Kanäle" like you did for the pvr-open-tv channel. In my setup the PVR channel group id for PVR radio channels is 2. I assumed that is the default. In your case it is -1 which looks weird.

I added another check to prevent some IllegalStateException if the list of favorites is empty (see cweitkamp@fb7afd2). According to the API the method should return an empty list but I received a null value instead.

Shall I upload a test version for you?

@quthla
Copy link
Author

quthla commented May 9, 2018

Thing kodi:kodi:myKodi "Kodi" @ "" [ipAddress="libreelec", port=9090] {
    Channels:
        Type pvr-open-tv : pvr-open-tv [
            group="Alle Kanäle"
        ]
        Type pvr-open-radio : pvr-open-radio [
            group="Alle Kanäle"
        ]
}

15:16:08.480 [DEBUG] [di.internal.protocol.KodiClientSocket] - Error during callMethod(Favourites.GetFavourites): socket not initialized
java.io.IOException: socket not initialized
        at org.openhab.binding.kodi.internal.protocol.KodiClientSocket.sendMessage(KodiClientSocket.java:181) ~[?:?]
        at org.openhab.binding.kodi.internal.protocol.KodiClientSocket.callMethod(KodiClientSocket.java:206) ~[?:?]
        at org.openhab.binding.kodi.internal.protocol.KodiConnection.lambda$1(KodiConnection.java:297) ~[?:?]
        at org.eclipse.smarthome.core.cache.ExpiringCache.refreshValue(ExpiringCache.java:81) ~[?:?]
        at org.eclipse.smarthome.core.cache.ExpiringCache.getValue(ExpiringCache.java:61) ~[?:?]
        at org.eclipse.smarthome.core.cache.ExpiringCacheMap.get(ExpiringCacheMap.java:186) ~[?:?]
        at org.eclipse.smarthome.core.cache.ExpiringCacheMap.putIfAbsentAndGet(ExpiringCacheMap.java:132) ~[?:?]
        at org.eclipse.smarthome.core.cache.ExpiringCacheMap.putIfAbsentAndGet(ExpiringCacheMap.java:117) ~[?:?]
        at org.openhab.binding.kodi.internal.protocol.KodiConnection.getFavorites(KodiConnection.java:292) ~[?:?]
        at org.openhab.binding.kodi.handler.KodiHandler.updateFavoriteChannelStateDescription(KodiHandler.java:530) ~[?:?]
        at org.openhab.binding.kodi.handler.KodiHandler.lambda$0(KodiHandler.java:506) ~[?:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
        at java.lang.Thread.run(Thread.java:748) [?:?]
15:16:08.532 [DEBUG] [di.internal.protocol.KodiClientSocket] - Error during callMethod(PVR.GetChannelGroups): socket not initialized
java.io.IOException: socket not initialized
        at org.openhab.binding.kodi.internal.protocol.KodiClientSocket.sendMessage(KodiClientSocket.java:181) ~[?:?]
        at org.openhab.binding.kodi.internal.protocol.KodiClientSocket.callMethod(KodiClientSocket.java:206) ~[?:?]
        at org.openhab.binding.kodi.internal.protocol.KodiConnection.lambda$3(KodiConnection.java:727) ~[?:?]
        at org.eclipse.smarthome.core.cache.ExpiringCache.refreshValue(ExpiringCache.java:81) ~[?:?]
        at org.eclipse.smarthome.core.cache.ExpiringCache.getValue(ExpiringCache.java:61) ~[?:?]
        at org.eclipse.smarthome.core.cache.ExpiringCacheMap.get(ExpiringCacheMap.java:186) ~[?:?]
        at org.eclipse.smarthome.core.cache.ExpiringCacheMap.putIfAbsentAndGet(ExpiringCacheMap.java:132) ~[?:?]
        at org.eclipse.smarthome.core.cache.ExpiringCacheMap.putIfAbsentAndGet(ExpiringCacheMap.java:117) ~[?:?]
        at org.openhab.binding.kodi.internal.protocol.KodiConnection.getPVRChannelGroups(KodiConnection.java:724) ~[?:?]
        at org.openhab.binding.kodi.internal.protocol.KodiConnection.getPVRChannelGroupId(KodiConnection.java:748) ~[?:?]
        at org.openhab.binding.kodi.handler.KodiHandler.getPVRChannelGroupId(KodiHandler.java:301) ~[?:?]
        at org.openhab.binding.kodi.handler.KodiHandler.updatePVRChannelStateDescription(KodiHandler.java:540) ~[?:?]
        at org.openhab.binding.kodi.handler.KodiHandler.lambda$0(KodiHandler.java:507) ~[?:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
        at java.lang.Thread.run(Thread.java:748) [?:?]
15:16:08.585 [DEBUG] [nhab.binding.kodi.handler.KodiHandler] - Received unknown PVR channel group 'Alle Kanäle'. Using default.
15:16:08.588 [DEBUG] [di.internal.protocol.KodiClientSocket] - Error during callMethod(PVR.GetChannels): socket not initialized
java.io.IOException: socket not initialized
        at org.openhab.binding.kodi.internal.protocol.KodiClientSocket.sendMessage(KodiClientSocket.java:181) ~[?:?]
        at org.openhab.binding.kodi.internal.protocol.KodiClientSocket.callMethod(KodiClientSocket.java:206) ~[?:?]
        at org.openhab.binding.kodi.internal.protocol.KodiConnection.lambda$4(KodiConnection.java:762) ~[?:?]
        at org.eclipse.smarthome.core.cache.ExpiringCache.refreshValue(ExpiringCache.java:81) ~[?:?]
        at org.eclipse.smarthome.core.cache.ExpiringCache.getValue(ExpiringCache.java:61) ~[?:?]
        at org.eclipse.smarthome.core.cache.ExpiringCacheMap.get(ExpiringCacheMap.java:186) ~[?:?]
        at org.eclipse.smarthome.core.cache.ExpiringCacheMap.putIfAbsentAndGet(ExpiringCacheMap.java:132) ~[?:?]
        at org.eclipse.smarthome.core.cache.ExpiringCacheMap.putIfAbsentAndGet(ExpiringCacheMap.java:117) ~[?:?]
        at org.openhab.binding.kodi.internal.protocol.KodiConnection.getPVRChannels(KodiConnection.java:759) ~[?:?]
        at org.openhab.binding.kodi.handler.KodiHandler.updatePVRChannelStateDescription(KodiHandler.java:542) ~[?:?]
        at org.openhab.binding.kodi.handler.KodiHandler.lambda$0(KodiHandler.java:507) ~[?:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
        at java.lang.Thread.run(Thread.java:748) [?:?]
15:16:08.646 [DEBUG] [di.internal.protocol.KodiClientSocket] - Error during callMethod(PVR.GetChannelGroups): socket not initialized
java.io.IOException: socket not initialized
        at org.openhab.binding.kodi.internal.protocol.KodiClientSocket.sendMessage(KodiClientSocket.java:181) ~[?:?]
        at org.openhab.binding.kodi.internal.protocol.KodiClientSocket.callMethod(KodiClientSocket.java:206) ~[?:?]
        at org.openhab.binding.kodi.internal.protocol.KodiConnection.lambda$3(KodiConnection.java:727) ~[?:?]
        at org.eclipse.smarthome.core.cache.ExpiringCache.refreshValue(ExpiringCache.java:81) ~[?:?]
        at org.eclipse.smarthome.core.cache.ExpiringCache.getValue(ExpiringCache.java:61) ~[?:?]
        at org.eclipse.smarthome.core.cache.ExpiringCacheMap.get(ExpiringCacheMap.java:186) ~[?:?]
        at org.eclipse.smarthome.core.cache.ExpiringCacheMap.putIfAbsentAndGet(ExpiringCacheMap.java:132) ~[?:?]
        at org.eclipse.smarthome.core.cache.ExpiringCacheMap.putIfAbsentAndGet(ExpiringCacheMap.java:117) ~[?:?]
        at org.openhab.binding.kodi.internal.protocol.KodiConnection.getPVRChannelGroups(KodiConnection.java:724) ~[?:?]
        at org.openhab.binding.kodi.internal.protocol.KodiConnection.getPVRChannelGroupId(KodiConnection.java:748) ~[?:?]
        at org.openhab.binding.kodi.handler.KodiHandler.getPVRChannelGroupId(KodiHandler.java:301) ~[?:?]
        at org.openhab.binding.kodi.handler.KodiHandler.updatePVRChannelStateDescription(KodiHandler.java:540) ~[?:?]
        at org.openhab.binding.kodi.handler.KodiHandler.lambda$0(KodiHandler.java:508) ~[?:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
        at java.lang.Thread.run(Thread.java:748) [?:?]
15:16:08.702 [DEBUG] [nhab.binding.kodi.handler.KodiHandler] - Received unknown PVR channel group 'Alle Kanäle'. Using default.
15:16:08.705 [DEBUG] [di.internal.protocol.KodiClientSocket] - Error during callMethod(PVR.GetChannels): socket not initialized
java.io.IOException: socket not initialized
        at org.openhab.binding.kodi.internal.protocol.KodiClientSocket.sendMessage(KodiClientSocket.java:181) ~[?:?]
        at org.openhab.binding.kodi.internal.protocol.KodiClientSocket.callMethod(KodiClientSocket.java:206) ~[?:?]
        at org.openhab.binding.kodi.internal.protocol.KodiConnection.lambda$4(KodiConnection.java:762) ~[?:?]
        at org.eclipse.smarthome.core.cache.ExpiringCache.refreshValue(ExpiringCache.java:81) ~[?:?]
        at org.eclipse.smarthome.core.cache.ExpiringCache.getValue(ExpiringCache.java:61) ~[?:?]
        at org.eclipse.smarthome.core.cache.ExpiringCacheMap.get(ExpiringCacheMap.java:186) ~[?:?]
        at org.eclipse.smarthome.core.cache.ExpiringCacheMap.putIfAbsentAndGet(ExpiringCacheMap.java:132) ~[?:?]
        at org.eclipse.smarthome.core.cache.ExpiringCacheMap.putIfAbsentAndGet(ExpiringCacheMap.java:117) ~[?:?]
        at org.openhab.binding.kodi.internal.protocol.KodiConnection.getPVRChannels(KodiConnection.java:759) ~[?:?]
        at org.openhab.binding.kodi.handler.KodiHandler.updatePVRChannelStateDescription(KodiHandler.java:542) ~[?:?]
        at org.openhab.binding.kodi.handler.KodiHandler.lambda$0(KodiHandler.java:508) ~[?:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
        at java.lang.Thread.run(Thread.java:748) [?:?]

Yes, you can upload it.

@cweitkamp
Copy link
Contributor

cweitkamp commented May 10, 2018

Here you are: org.openhab.binding.kodi-2.3.0-SNAPSHOT.jar.zip

See PR #3557

Please keep in mind that a reason for the java.io.IOException: socket not initialized exception is that your Kodi instance is offline, in hibernate or suspend mode. Please make sure to active it before testing.

@quthla
Copy link
Author

quthla commented May 10, 2018

Please keep in mind that a reason for the java.io.IOException: socket not initialized exception is that your Kodi instance is offline, in hibernate or suspend mode. Please make sure to active it before testing.

This can't be the issue as it's turned on 24/7 and in the big log you can see it's making requests miliseconds before and after the exception which work fine.

Additionally my favourites list isn't empty at all.

{"id":1,"jsonrpc":"2.0","result":{"favourites":[{"title":"","type":"window"},{"title":"","type":"window"},{"title":"","type":"window"},{"title":"","type":"window"},{"title":"","type":"window"},{"title":"","type":"window"},{"title":"","type":"window"},{"title":"","type":"window"},{"title":"","type":"media"}],"limits":{"end":9,"start":0,"total":9}}}

I redacted the titles.

@quthla
Copy link
Author

quthla commented May 10, 2018

WIth test version:
Volume working
PVR channels in HABPanel: No choices available - check widget config
Same for favourites
Exceptions gone
Favourites.GetFavourites returns correct items

@cweitkamp
Copy link
Contributor

Updated test version: org.openhab.binding.kodi-2.3.0-SNAPSHOT.jar.zip

I added some improvements to open a favorite which is not a media item and thus cannot be played.

@quthla
Copy link
Author

quthla commented May 11, 2018

Issues seem to be resolved. Thank you

@quthla quthla closed this as completed May 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants