JSON changes in Kodi 18
#1
The Function call for playing playlists does not appear to work the same in Kodi 18 as in Kodi 17.

I am not able to play music playlists using the Kodi-Alexa skill for the Amazon Echo. Apparently there have been changes.

Here is the playlist:

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<smartplaylist type="songs">
<name>Classical</name>
<match>all</match>
<rule field="genre" operator="is">
<value>Classical</value>
</rule>
<limit>100</limit>
</smartplaylist>


This result from the Kodi logfile is this:

16:13:25.428 T:1943417488 NOTICE: VideoPlayer: Opening: special://profile/playlists/music/Classical.xsp
16:13:25.428 T:1943417488 WARNING: CDVDMessageQueue(player):Tongueut MSGQ_NOT_INITIALIZED
16:13:25.429 T:1855976352 NOTICE: Creating InputStream
16:13:25.433 T:1855976352 NOTICE: Creating Demuxer
16:13:25.437 T:1855976352 ERROR: Open - error probing input format, special://profile/playlists/music/Classical.xsp
16:13:25.437 T:1855976352 ERROR: OpenDemuxStream - Error creating demuxer
16:13:25.438 T:1855976352 NOTICE: CVideoPlayer::OnExit()
16:13:25.438 T:1943417488 ERROR: Playlist Player: skipping unplayable item: 0, path [special://profile/playlists/music/Classical.xsp]
16:13:25.446 T:1943417488 NOTICE: CVideoPlayer::CloseFile()
16:13:25.446 T:1943417488 NOTICE: VideoPlayer: waiting for threads to exit
16:13:25.446 T:1943417488 NOTICE: VideoPlayer: finished waiting
16:13:25.446 T:1943417488 NOTICE: CVideoPlayer::CloseFile()
16:13:25.446 T:1943417488 NOTICE: VideoPlayer: waiting for threads to exit
16:13:25.446 T:1943417488 NOTICE: VideoPlayer: finished waiting

The playlist works fine run manually.

The developer of the Kodi skill suggests that a parameter in the playlist function call used in his skill may have been depreciated between Kodi 17 and 18. He uses call Player.Open with the "file" parameter set to the playlist file. Is that possible? If so what would be the correct JSON string to play the music playlist classical?
Reply
#2
I am having the same problem with a photo player I made.

I use the following actions:
Clear playlist:
Code:
{"jsonrpc":"2.0","method":"Playlist.Clear","params":{"playlistid":2},"id":1991}
This returns an OK

Add items to playlist
Code:
{"jsonrpc":"2.0","method":"Playlist.Add","params":{"playlistid":2,"item":{"directory":"smb://172.16.63.31/Pictures/Cars/"}},"id":1992}
This retruns an OK

Open Playlist
Code:
{"jsonrpc":"2.0","method":"Player.Open","params":{"item":{"playlistid":2,"position":1}},"id":1993}
This starts the playlist but only returns the current playing picture. All JSON control is now lost, so every new send JSON command does nothing.

I will update this post when I have some logging information from the Kodi client.

The Log states that the player is not a video file:
Code:
10:35:34.895 T:140629568907008  NOTICE: EMBY.kodimonitor -> Method: Player.OnPlay Data: {"item":{"file":"smb://172.16.63.31/Pictures/Cars/Ferrari F430.jpg","type":"picture"},"player":{"playerid":2,"speed":1}}
10:35:34.901 T:140629568907008   ERROR: EXCEPTION: XBMC is not playing any videofile
10:35:34.903 T:140628844566272   DEBUG: CSMBFile::Close closing fd 10000
10:35:34.903 T:140628844566272   DEBUG: Finished background loading slot 0, 1: smb://172.16.63.31/Pictures/Cars/Ferrari F430.jpg
10:35:34.904 T:140629543728896   DEBUG: Skin Helper Service --> Kodi_Monitor: sender xbmc - method: Player.OnPlay  - data: {"item":{"file":"smb://172.16.63.31/Pictures/Cars/Ferrari F430.jpg","type":"picture"},"player":{"playerid":2,"speed":1}}
10:35:34.923 T:140630346320000   DEBUG: Loading the next image 2: smb://172.16.63.31/Pictures/Cars/Ferrari.jpg
10:35:34.923 T:140628844566272   DEBUG: CSMBFile::Open - opened smb://172.16.63.31/Pictures/Cars/Ferrari.jpg, fd=10000
10:35:34.956 T:140628844566272   DEBUG: CSMBFile::Close closing fd 10000
10:35:34.956 T:140628844566272   DEBUG: Finished background loading slot 1, 2: smb://172.16.63.31/Pictures/Cars/Ferrari.jpg
10:35:35.133 T:140629568907008  NOTICE: EMBY.ga_client -> ERROR:: XBMC is not playing any videofile
                                            Traceback (most recent call last):
                                              File "/storage/.kodi/addons/plugin.video.emby/resources/lib/ga_client.py", line 24, in wrapper
                                                return func(*args, **kwargs)
                                              File "/storage/.kodi/addons/plugin.video.emby/resources/lib/kodimonitor.py", line 76, in onNotification
                                                self._on_play_(data)
                                              File "/storage/.kodi/addons/plugin.video.emby/resources/lib/kodimonitor.py", line 96, in _on_play_
                                                item = xbmc.Player().getVideoInfoTag()
                                            RuntimeError: XBMC is not playing any videofile
10:35:35.133 T:140629568907008  NOTICE: EMBY.ga_client -> ERROR:: log_error: onNotification
                                             args: (<kodimonitor.KodiMonitor object at 0x7fe6b80e6b50>, 'xbmc', 'Player.OnPlay', '{"item":{"file":"smb://172.16.63.31/Pictures/Cars/Ferrari F430.jpg","type":"picture"},"player":{"playerid":2,"speed":1}}')
                                             kwargs: {}
10:35:35.134 T:140629568907008   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.RuntimeError'>
                                            Error Contents: XBMC is not playing any videofile
                                            Traceback (most recent call last):
                                              File "/storage/.kodi/addons/plugin.video.emby/resources/lib/ga_client.py", line 24, in wrapper
                                                return func(*args, **kwargs)
                                              File "/storage/.kodi/addons/plugin.video.emby/resources/lib/kodimonitor.py", line 76, in onNotification
                                                self._on_play_(data)
                                              File "/storage/.kodi/addons/plugin.video.emby/resources/lib/kodimonitor.py", line 96, in _on_play_
                                                item = xbmc.Player().getVideoInfoTag()
                                            RuntimeError: XBMC is not playing any videofile
                                            -->End of Python script error report<--
Reply
#3
The picture issue also occurs on 17.3

Only possible culprit would be https://github.com/xbmc/xbmc/pull/12058

For V18 playlist the culprit is https://github.com/xbmc/xbmc/pull/11175

Too bad the keepers are no more present Wink Anyway you both should try to open issues on trac as this forum is not really read by actual devs.
Reply
#4
(2017-05-29, 10:19)Tolriq Wrote: For V18 playlist the culprit is https://github.com/xbmc/xbmc/pull/11175
Are you sure about that, looking briefly I'm not sure I see the connection?

Also the OP says "The Function call for playing playlists does not appear to work the same in Kodi 18 as in Kodi 17", but that PR was backported into Krypton with https://github.com/xbmc/xbmc/pull/11169, so v17 and v18 should behave the same.

But I may just need to look more closely Smile

Is the "Kodi-Alexa skill for the Amazon Echo" part just a distraction? Is there a more general issue playing smartplaylists from JSON?
Reply
#5
Absolutely not sure Angel I've just used a black voodoo trick to summon you here as you did merge that PR and vaguely talks about playlists Wink

And now that you are summoned I know you'll fix the issue. Sorry about that.

Anyway does work on 17.3, not works on 18 for sure.

Code:
{ "jsonrpc": "2.0", "method": "Player.Open", "params": { "item":{"file":"special://profile/playlists/music/fff.xsp" }},"id": 1 }

JSON xsp support was always tricky (still does not correctly take in account order parameter) (http://forum.kodi.tv/showthread.php?tid=68263&page=226 for some insight of a recent new attempt Wink )

As a free gift to OP, Yatse use a Kodi playlist to bypass most of those problems (still works for v18)

Code:
[{"id":321,"jsonrpc":"2.0","method":"Playlist.Clear","params":{"playlistid":0}},{"id":653,"jsonrpc":"2.0","method":"Playlist.Add","params":{"playlistid":0,"item":{"recursive":true,"directory":"special://profile/playlists/music/fff.xsp"}}},{"id":860,"jsonrpc":"2.0","method":"Player.Open","params":{"item":{"playlistid":0,"position":0}}}]
Reply
#6
(2017-05-29, 13:44)Tolriq Wrote: Absolutely not sure Angel I've just used a black voodoo trick to summon you here as you did merge that PR and vaguely talks about playlists Wink

And now that you are summoned I know you'll fix the issue. Sorry about that.

Anyway does work on 17.3, not works on 18 for sure.

Code:
{ "jsonrpc": "2.0", "method": "Player.Open", "params": { "item":{"file":"special://profile/playlists/music/fff.xsp" }},"id": 1 }

JSON xsp support was always tricky (still does not correctly take in account order parameter) (http://forum.kodi.tv/showthread.php?tid=68263&page=226 for some insight of a recent new attempt Wink )

As a free gift to OP, Yatse use a Kodi playlist to bypass most of those problems (still works for v18)

Code:
[{"id":321,"jsonrpc":"2.0","method":"Playlist.Clear","params":{"playlistid":0}},{"id":653,"jsonrpc":"2.0","method":"Playlist.Add","params":{"playlistid":0,"item":{"recursive":true,"directory":"special://profile/playlists/music/fff.xsp"}}},{"id":860,"jsonrpc":"2.0","method":"Player.Open","params":{"item":{"playlistid":0,"position":0}}}]

I'm still getting the blocking on Player.Open on 17.3 on Android. Thanks
Reply
#7
This post is from the 'Amazon Echo for Kodi' forum:

Post #1545

Just FYI, @bill-orange (and anyone else that cares), I think they broke something with regard to Playlist.Add, even in the latest Debian package for 17.3. 17.3-dmo2 is abysmally slow here, and 17.3-dmo1 is fine.
Reply
#8
Hello, I found this post as I was searching for help. I am a new developer to Kodi and am trying to call a xsp video playlist from my addon, and then return to my addon. I can call it just fine, but it never returns. I know there is a way, and your post shows that there is a way. Would you be able to give me a sample code to work from? Thanks so much.


[quote='bill_orange' pid='2593506' dateline='1495994188']
The Function call for playing playlists does not appear to work the same in Kodi 18 as in Kodi 17.

I am not able to play music playlists using the Kodi-Alexa skill for the Amazon Echo. Apparently there have been changes.

Here is the playlist:

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<smartplaylist type="songs">
<name>Classical</name>
<match>all</match>
<rule field="genre" operator="is">
<value>Classical</value>
</rule>
<limit>100</limit>
</smartplaylist>
Reply
#9
Any word on this issue? Is this an intentional change to Kodi 18 or a bug?

Playlists will not work on the Alexa skill and Kodi 18. A work-around solution for the Alexa-Kodi developers is not a good option long term.
Reply
#10
Thank you everyone !
{ "jsonrpc": "2.0", "method": "Player.Open", "params": { "item":{"file":"special://profile/playlists/music/fff.xsp" }},"id": 1 }

I'm glad it worked with kodi 17.3
But when it comes to playlist it plays the first song.
So how to get into it randomly?
Thank all!
Reply
#11
Has there been any activity on this issue?

Playlists will not work on the Alexa skill and Kodi 18. A work-around solution for the Alexa-Kodi developers is not a good option long term.
Reply
#12
The simple answer is no, there has been no work on this and, to my knowledge at least, none is planned.

There have been many player changes in Leia, it would seem that one of them has stopped calls like
Code:
{"jsonrpc": "2.0", "method": "Player.Open", "params": { "item":{"file":"special://profile/playlists/music/zzzz.xsp" }},"id": 0 }
from working.

However this works
Code:
[{"jsonrpc": "2.0", "id": 0, "method": "Playlist.Clear", "params": {"playlistid": 0}},
{"jsonrpc":"2.0","id":0,"method":"Playlist.Add","params":{"playlistid":0,"item":{"recursive":true, "directory":"special://profile/playlists/music/zzzz.xsp"}}},
{"jsonrpc":"2.0","id":0,"method":"Player.Open","params":{"item":{"playlistid":0,"position":0}}}]

I would take that as the way playback of playlists is achieved via JSON from v18 onwards.

Feeling peeved that changes to Kodi has broken the JSON API, well unfortunately that just happens because there are not enough skilled people working on Kodi development to avoid it. Be happy that there is a sequence of commands that achieve what you want.
Reply
#13
(2018-01-22, 20:56)DaveBlake Wrote: However this works
Thank you, thank you, thank you. I have spent days trying to find this.
Reply

Logout Mark Read Team Forum Stats Members Help
JSON changes in Kodi 180