JSON changes in Kodi 18

  Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
bill_orange Offline
Senior Member
Posts: 201
Joined: Nov 2015
Reputation: 0
Post: #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)::Put 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?
(This post was last modified: 2017-05-28 19:57 by bill_orange.)
find quote
BasJaspers Offline
Junior Member
Posts: 17
Joined: May 2016
Reputation: 0
Post: #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<--
(This post was last modified: 2017-05-29 09:39 by BasJaspers.)
find quote
Tolriq Offline
Banned
Posts: 3,077
Joined: Jun 2009
Location: France
Post: #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.
(This post was last modified: 2017-05-29 10:21 by Tolriq.)
find quote
DaveBlake Offline
Team-Kodi Member
Posts: 2,337
Joined: Jun 2015
Reputation: 67
Location: South West England
Post: #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?
find quote
Tolriq Offline
Banned
Posts: 3,077
Joined: Jun 2009
Location: France
Post: #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}}}]
find quote
hurlbert Offline
Donor
Posts: 35
Joined: Nov 2014
Reputation: 2
Post: #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
find quote
bill_orange Offline
Senior Member
Posts: 201
Joined: Nov 2015
Reputation: 0
Post: #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.
find quote
BigOldBoy Offline
Junior Member
Posts: 42
Joined: Feb 2013
Reputation: 1
Post: #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>
(This post was last modified: 2017-07-03 13:35 by BigOldBoy.)
find quote