• 1
  • 222
  • 223
  • 224
  • 225(current)
  • 226
JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC
Is 'keep audio device alive' accessible with JSON? I can't see it in the output of GetSettings. In case there's another approach: I'm asking because I need Kodi to let go of the audio device when launching an emulator (ubuntu/retroarch).
Reply
(2016-10-15, 23:07)wellspokenman Wrote: Is 'keep audio device alive' accessible with JSON? I can't see it in the output of GetSettings. In case there's another approach: I'm asking because I need Kodi to let go of the audio device when launching an emulator (ubuntu/retroarch).

audiooutput.streamsilence
Texture Cache Maintenance Utility: Preload your texture cache for optimal UI performance. Remotely manage media libraries. Purge unused artwork to free up space. Find missing media. Configurable QA check to highlight metadata issues. Aid in diagnosis of library and cache related problems.
Reply
That's it! Thanks Milhouse. Here's the full blob in case others in search of streamsilence docs find this post:
Code:
{  
   "control":{  
      "type":"list",
      "multiselect":false,
      "delayed":false,
      "format":"string"
   },
   "help":"Select the behaviour when no sound is required for either playback or GUI sounds.[CR][Always] Continuous inaudible signal is output, this keeps the receiving audio device alive for any new sounds, however this might also block sound from other applications.[CR][1-10 Minutes] Same as [Always] except that after the selected period of time audio enters a suspended state.[CR][Off] Audio output enters a suspended state. Note: Sounds can be missed if audio enters suspended state.",
   "parent":"",
   "level":"standard",
   "default":1,
   "enabled":true,
   "value":1,
   "label":"Keep audio device alive",
   "options":{"value": -1, "label": "Always"}, {"value": 0, "label": "Off"}, {"value": 1, "label": "1 Minute"}, {"value": 2, "label": "2 Minutes"}, {"value": 3, "label": "3 Minutes"}, {"value": 4, "label": "4 Minutes"}, {"value": 5, "label": "5 Minutes"}, {"value": 6, "label": "6 Minutes"}, {"value": 7, "label": "7 Minutes"}, {"value": 8, "label": "8 Minutes"}, {"value": 9, "label": "9 Minutes"}, {"value": 10, "label": "10 Minutes"},
   "type":"integer",
   "id":"audiooutput.streamsilence"
}
Reply
The JSON-RPC API specifies Application.OnVolumeChanged should return an integer.
http://kodi.wiki/view/JSON-RPC_API/v6#Ap...umeChanged

However, Kodi returns a float.
https://github.com/xbmc/xbmc/blob/master....cpp#L4783

Which one is correct?
Reply
(2016-11-23, 16:45)poisdeux Wrote: The JSON-RPC API specifies Application.OnVolumeChanged should return an integer.
http://kodi.wiki/view/JSON-RPC_API/v6#Ap...umeChanged

However, Kodi returns a float.
https://github.com/xbmc/xbmc/blob/master....cpp#L4783

Which one is correct?

i recall it being a float regardless of what the doc says
Reply
Playing any smart playlist on kodi seems to play the items in random order.

This appear to be a long standing bug, but it makes using Kodi headless form a remote like Yatse impossible as the tracks are always shuffled.

Is this a tracked bug and is there any chance of progress being made on it?

This seems like an obvious deficiency (and the Yatse developer is pointing at the kodi developers.)

2017-01-01 17:47:30.658 Verbose/JsonRpc: d.a@209: Request : [{"jsonrpc":"2.0","id":210,"method":"Playlist.Clear","params":{"playlistid":0}},{"jsonrpc":"2.0","id":159,"method":"Playlist.Add","params":{"playlistid":0,"item":{"directory":"plugin://plugin.audio.spotify/?action=browse_album&albumid=1kCHru7uhxBUdzkm4gzRQc","recursive":true}}},{"jsonrpc":"2.0","id":205,"method":"Player.Open","params":{"item":{"playlistid":0,"position":0}}}]

Seems to always start on the 9th track. No obvious reason why this would be the case.

I can link to many other reports on the same issue on various forums if that would be helpful, but I can reproduce this with debug logs if you want.

Here is a link to people discussing the issue :

https://yatse.tv/redmine/boards/1/topics/17
https://www.reddit.com/r/xbmc/comments/1...dom_order/
http://forum.kodi.tv/showthread.php?tid=162425
Reply
Hi
There is any filter that i can use with "PVR.GetBroadcasts" ? I am trying to find a way to only request channel´s programs that i don´t have in my app yet, for now i have to get all channel´s programs every time that i need to update the EPG.
Regards
Reply
(2017-01-01, 07:24)Jeremy White Wrote: Playing any smart playlist on kodi seems to play the items in random order.

This appear to be a long standing bug, but it makes using Kodi headless form a remote like Yatse impossible as the tracks are always shuffled.

Is this a tracked bug and is there any chance of progress being made on it?

This seems like an obvious deficiency (and the Yatse developer is pointing at the kodi developers.)

2017-01-01 17:47:30.658 Verbose/JsonRpc: d.a@209: Request : [{"jsonrpc":"2.0","id":210,"method":"Playlist.Clear","params":{"playlistid":0}},{"jsonrpc":"2.0","id":159,"method":"Playlist.Add","params":{"playlistid":0,"item":{"directory":"plugin://plugin.audio.spotify/?action=browse_album&albumid=1kCHru7uhxBUdzkm4gzRQc","recursive":true}}},{"jsonrpc":"2.0","id":205,"method":"Player.Open","params":{"item":{"playlistid":0,"position":0}}}]

Seems to always start on the 9th track. No obvious reason why this would be the case.

I can link to many other reports on the same issue on various forums if that would be helpful, but I can reproduce this with debug logs if you want.

Here is a link to people discussing the issue :

https://yatse.tv/redmine/boards/1/topics/17
https://www.reddit.com/r/xbmc/comments/1...dom_order/
http://forum.kodi.tv/showthread.php?tid=162425

just a question more than an answer, is what your showing here even a smart playlist? it seems to be a batch of commands, one of which is to add to the playlist a directory prescribed from an addon, i don't see any .xps files that indicate to me xml descriptive smart playlists...
And fwiw, a batch by json 2.0 definition doesn't have to process them in any particular order so, id be weary that as well.
im not sure how exactly kodi handles batches but when i code i suppose it follows the spec which states order is not guaranteed.
And fwiw haven't yet noticed playlists not doing what i tell it to. not sure about smart ones though

"The Server MAY process a batch rpc call as a set of concurrent tasks, processing them in any order and with any width of parallelism."
Reply
If I understand this correctly this isn't a batch. I"m playing plugin://plugin.audio.spotify/?action=browse_album&albumid=1kCHru7uhxBUdzkm4gzRQc which is a playlist that contains the files in the spotify playlist.

You can see another bug filed here :

https://yatse.tv/redmine/boards/1/topics...message-18

"Yes this is a known Kodi bug with smart play list."

This is either a kodi bug or a yatse bug.

Until someone admits it is their bug, it wont be fixed and I can't use my kodi as a headless appliance like I dreamed of doing.

Can you use yatse and try this and see what I am experiencing?

Both yatse and kodi will dump the actual json being used.
Reply
http://forum.kodi.tv/showthread.php?tid=...pid1975308

http://forum.kodi.tv/showthread.php?tid=...pid2247341

No time to search for more, this is a Kodi issue and it's well known and reported Wink
Reply
@jeremy, Have you tried using the options of the Player.Open command?

I cant remember the exact format but something like "options":{"shuffled":false}
Reply
(2017-01-06, 19:46)ncarthy Wrote: @jeremy, Have you tried using the options of the Player.Open command?

I cant remember the exact format but something like "options":{"shuffled":false}

I don't have access to the yatse code. They just keep insisting it it a kodi bug.

Is there any good tool to simulate json requests to kodi I can test with?
Reply
(2017-01-06, 21:55)Jeremy White Wrote:
(2017-01-06, 19:46)ncarthy Wrote: @jeremy, Have you tried using the options of the Player.Open command?

I cant remember the exact format but something like "options":{"shuffled":false}

I don't have access to the yatse code. They just keep insisting it it a kodi bug.

Is there any good tool to simulate json requests to kodi I can test with?

I do, and I know every single line of it Wink And I do know and practice Kodi code since a lot of years with numerous patches merged, tons of bug report. So you may choose to not believe but it's quite easy to test by yourself.

Create an XSP file, use player.open since 16.x it will most of the time work and respect or not the random parameter but as reported in one of my link 3 post earlier, it will fail for some xsp types like episodes. (And on previous Kodi version result where very inconsistent).

The workaround is to use Kodi playlist and add the playlist via Playlist.Add then start the first item of the playlist.

Adding playlist as files sometimes works but have the great side effect to not expand the playlist inside Kodi playlist system accessible via JSON, so files are queued but you can't see the queue or interact with it.

The problem is that Playlist.Add have a known bug about not respecting order given in the xsp or m3u but fully consider that it's a folder and add the file in alphabetical order. Ignoring XSP order parameter or m3u real order.

Dealing with Kodi JSON is all about compromise and hacks, specially for some parts like playlists. And for playlist there's no good way to cover everything correctly, the best possible way is the workaround Yatse use that at least plays things 100% of the time and allows proper control. At the expense of xsp random bug and m3u reordering. (But Yatse also offer playlist listing in correct order + a play all button that plays in order to address this limitation).
Reply
Tolriq is 100% right of course.

Just to check I tested using the "option" parameter of Player.Open myself and it didn't work so forget that idea.

The problem does not occur at the Player.Open stage, it occurs at the Playlist.Add stage. Basically by calling that particular Playlist.Add command you are adding the songs in some default format, probably how the album is in Spotify's database. For that particular album, it always starts with the 9th song. A different album will have a different start. I don't think it's random, its just how the album was stored on some database somewhere, probably Spotify.com.

If you look at the code in the Spotify addon the developer gets the track list and then sorts it in the addon, then adds them one-by-one to a playlist. He also takes the time to retrieve the metadata about each song, stuff that would be lost if you just use the Playlist.OnAdd with a directory like you did. (its a pretty neat addon)
Reply
Don't get me wrong, but iOS remote app users never had this issue Wink and the json commands aren't "special" !

Code:
{"jsonrpc":"2.0","method":"Playlist.Clear","id":460897777,"params":{"playlistid":0}}

{"jsonrpc":"2.0","method":"Playlist.Add","id":-2067158130,"params":{"playlistid":0,"item":{"directory":"special://profile/playlists/music/Long Tracks.xsp"}}}

{"jsonrpc":"2.0","method":"Player.Open","id":-1809367617,"params":{"options":{"shuffled":false},"item":{"playlistid":0,"position":0}}}

and it starts from the beginning. (and the options parameters in Player.Open is working as expected ALWAYS)

If you want shuffled items:
Code:
{"jsonrpc":"2.0","method":"Playlist.Clear","id":460897777,"params":{"playlistid":0}}

{"jsonrpc":"2.0","method":"Playlist.Add","id":-2067158130,"params":{"playlistid":0,"item":{"directory":"special://profile/playlists/music/Long Tracks.xsp"}}}

{"jsonrpc":"2.0","method":"Player.Open","id":1877953368,"params":{"options":{"shuffled":true},"item":{"playlistid":0,"position":0}}}

If you want the party mode just use:
Code:
{"jsonrpc":"2.0","method":"Player.Open","id":-14808852,"params":{"item":{"partymode":"special://profile/playlists/music/Long Tracks.xsp"}}}

So, can someone explain me when the issues occurHuh
Reply
  • 1
  • 222
  • 223
  • 224
  • 225(current)
  • 226

Logout Mark Read Team Forum Stats Members Help
JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC8