![]() |
Solved How can I use JSON-RPC to change my Audio output device - 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: Solved How can I use JSON-RPC to change my Audio output device (/showthread.php?tid=362723) |
How can I use JSON-RPC to change my Audio output device - graysky - 2021-05-20 I understand that the following curl command should be able to change an audio output device. When I try it on 19.1, the curl call works, but it selects the incorrect audio device if I check by going to System>Audio>Audio output device. Note I did find JSON-RPC_API/v12 which does not show audiooutput.audiodevice at all.On my system, there are 8 audio devices per my kodi.log but when I check after executing the below command, "HDA Intel, DHMI #0" is displayed but I expect that "HDA Intel, SAM SAMSUNG on HDMI#1" to be there. Code: % curl -v -H "Content-type: application/json" -d '{"jsonrpc":"2.0","method":"Settings.SetSettingValue", "params":{"setting":"audiooutput.audiodevice","value":"hdmi:CARD=HDMI,DEV=1"},"id":1}' http://localhost:8080/jsonrpc -u xbmc:xbmc I flagged asking a mod to move this to the right section, thanks: https://forum.kodi.tv/forumdisplay.php?fid=174 RE: How can I use JSON-RPC to change my Audio output device - DarrenHill - 2021-05-20 Thread moved as requested RE: How can I use JSON-RPC to change my Audio output device - graysky - 2021-05-21 My problem was solved by @lotte67890's advice in this thread. Seems the syntax for the value to send has changed and cannot be directly extracted from the log without appending a literal "ALSA:" like so: Code: curl -v -H "Content-type: application/json" -d '{"jsonrpc":"2.0","method":"Settings.SetSettingValue","params":{"setting":"audiooutput.audiodevice","value":"ALSA:hdmi:CARD=HDMI,DEV=1"},"id":1}' http://localhost:8080/jsonrpc -u xbmc:xbmc To parrot from the linked thread, to find this value, run: Code: % curl -v -H "Content-type: application/json" -d '{"jsonrpc":"2.0","id": 1, "method":"Settings.GetSettingValue", "params": {"setting": "audiooutput.audiodevice"} }' http://localhost:8080/jsonrpc -u xbmc:xbmc |