Changing audio settings via JSON-RPC - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32) +--- Forum: Kodi Application (https://forum.kodi.tv/forumdisplay.php?fid=93) +---- Forum: JSON-RPC (https://forum.kodi.tv/forumdisplay.php?fid=174) +---- Thread: Changing audio settings via JSON-RPC (/showthread.php?tid=192491) |
Changing audio settings via JSON-RPC - teeedubb - 2014-04-17 Hi all, I read in this thread thats its possible to change audio outputs via json-rpc and I have been able to do so with the following command: Code: curl -v -H "Content-type: application/json" -X POST -d '{"jsonrpc":"2.0","method":"Settings.SetSettingValue", "params":{"setting":"audiooutput.audiodevice","value":"ALSA:hdmi:CARD=NVidia,DEV=1"},"id":1}' http://localhost:9191/jsonrpc However, trying something similar with audiooutput.channels or audiooutput.passthrough (options I found here) I get errors and there is no change in xbmc. Code: $ curl -v -H "Content-type: application/json" -X POST -d '{"jsonrpc":"2.0","method":"Settings.SetSettingValue", "params":{"setting":"audiooutput.channels","value":"3"},"id":1}' http://localhost:9191/jsonrpc * Hostname was NOT found in DNS cache Debug log of this error. Ive tried a whole lot of variations with no success. So Im curious if its possible to change other audio settings via json-rpc, and if so, can anyone point me in the direction of the correct syntax to use? Thanks in advance. RE: Changing audio settings via JSON-RPC - Montellese - 2014-04-17 Well "audiooutput.channels" is an integer setting and "3" is not a valid integer value but a string value. So you need to provide the value as an integer. And audiooutput.passthrough is a boolean setting so you need to provide a boolean value (true/false). RE: Changing audio settings via JSON-RPC - teeedubb - 2014-04-17 Any chance you can provide a working example? I tried various combinations, I tried using integers for channels and true/false for passthroigh but I didn't get anywhere, I'm not overly familiar with jsonrpc and the syntax's that are required. Pretty pretty please RE: Changing audio settings via JSON-RPC - joethefox - 2014-04-17 the list of all settings with their id, types, default values, etc. etc.. -> http://pastebin.com/RVvBjrfp enjoy! P.S. some settings may vary and can depend from the platform where XBMC is running. The above comes from a linux box. RE: Changing audio settings via JSON-RPC - teeedubb - 2014-04-18 Thanks for the link joethefox, that will make it easier to see what options can be changed. Unfortunately Im not getting anywhere with putting the json-rpc command together. Ive disabled json compact output, but I cant work out whats wrong. Code: $curl -v -H "Content-type: application/json" -X POST -d '{"jsonrpc":"2.0","method":"Settings.SetSettingValue", "params":{"setting":"audiooutput.passthrough","value":"true","type":"boolean"},"id":1}' http://localhost:9191/jsonrpc Code: $ curl -v -H "Content-type: application/json" -X POST -d '{"jsonrpc":"2.0","method":"Settings.SetSettingValue", "params":{"setting":"audiooutput.passthrough","value":"true"},"id":1}' http://localhost:9191/jsonrpc RE: Changing audio settings via JSON-RPC - Montellese - 2014-04-18 Please first take some time to learn the JSON notation. Code: "true" Code: true So you're request should be Code: {"jsonrpc":"2.0","method":"Settings.SetSettingValue", "params":{"setting":"audiooutput.passthrough","value":true},"id":1} RE: Changing audio settings via JSON-RPC - teeedubb - 2014-04-18 DOH! I missed the lack of quotes on another request I was using as an example Thanks for your help Montellese, the commands now work |