Switching audio outputs through API ?
#1
Good day !

I've got XBMC set up where it's outputing to 2 different TV sets through an HDMI matrix. I've got a problem where only 1 of the sets can use the sound off of the HDMI, and the other uses optical. Until I get a bit more money to buy a decent multi-zone receiver, I'm stuck with this setup.

No I have no problem switching audio sources, but some times it gets a bit confusing for other members in the house. I've already got a home "dashboard" set up that handles a bunch of tasks, and creating a new task for "switch audio to romm X" would be really awesome.

To do this, I need to be able to switch audio outputs from an API call. You can do it through the UI, so I figure it's probably not a long stretch away from being able to do it through an API call.

Also, second part to this question : Is there a way to switch audio outputs without restarting XBMC ? I've got a small process manager that I wrote that kills XBMC then restarts it, but it would be cool if I didn't need to do this.

Thanks !
Eric.
KODI:
Windows 10, 32 GB of ram, AMD Phenom X6 @ 2.80 ghz, Using onboard video card with HDMI out
Reply
#2
Currently switching audio outputs through JSON-RPC API (which is the API you would probably be using) is not possible. The problem is not the switching itself but getting it done right so that it also shows correctly in the settings dialog. It's a bit complicated to explain but generally the way changing settings in XBMC is currently implemented makes it very very difficult to change a setting from outside the settings dialog (which would be the case when doing it through JSON-RPC).
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#3
Is there any way to do this doing a DB call or changing some setting in an XML file ? I know it's ugly/dangerous to do, especially for including as a feature within XBMC, but if it's doable, I would do it myself locally and be happy with that lol.
Oh and I already have the code for reloading XBMC, so I don't mind closing xbmc, making the change, reloading xbmc.
KODI:
Windows 10, 32 GB of ram, AMD Phenom X6 @ 2.80 ghz, Using onboard video card with HDMI out
Reply
#4
Hmmm, I just posted about wishing I could do this in another thread due to issues with the new AudioEngine...

http://forum.xbmc.org/showthread.php?tid...pid1131018

Even if there were a way to do it with an API call that did not update the UI then it would fix the AE issue I spoke of as we would be changing it back as soon as the XBMC thread is unpaused and returned to anyway. I just need to free up the busy device until we come back to XBMC.
Reply
#5
+1 for this - with exclusive wasapi locking going on with AE (which it would seem doesn't release in the GUI even if no gui sounds is selected) - I'm going to need this with my Add-on:XSqueeze (wiki)

Addons I wrote &/or maintain:
OzWeather (Australian BOM weather) | Check Previous Episode | Playback Resumer | Unpause Jumpback | XSqueezeDisplay | (Legacy - XSqueeze & XZen)
Sorry, no help w/out a *full debug log*.
Reply
#6
I also need this feature.

For now, I'm always using my optical output to my A/V receiver but i would be great to switch for optical to HDMI to play 2.0 videos on my TV.

No need to switch on A/V receiver = less power consumption => XBMC is ecological Big Grin
Sorry for my english, but, you know, I'm French so ...

Main HTPC : Odroid-C2 running CoreELEC with Titan Bingie
Secondary HTPC : Freebox Mini 4K running Android TV with Titan Bingie
Reply
#7
(2012-06-22, 11:14)mikebzh44 Wrote: I also need this feature.

For now, I'm always using my optical output to my A/V receiver but i would be great to switch for optical to HDMI to play 2.0 videos on my TV.

No need to switch on A/V receiver = less power consumption => XBMC is ecological Big Grin

Does your receiver support standby passthrough? My Yamaha does and I can use XBMC with my receiver in standby mode, I just have to make sure I make the change in the gui to not enable DTS or AC3 passthrough. The receiver still uses about 3W/Hr in standby, but that's far less than having it on to use XBMC.
Reply
#8
I can't use my receiver as an HDMI hub as it's not 1080/24p compliant so :

HTPC -> HDMI -> TV to get 1080/24p
HTPC -> S/PDIF -> receiver to get AC3/DTS
Sorry for my english, but, you know, I'm French so ...

Main HTPC : Odroid-C2 running CoreELEC with Titan Bingie
Secondary HTPC : Freebox Mini 4K running Android TV with Titan Bingie
Reply
#9
(2012-06-18, 21:24)Montellese Wrote: Currently switching audio outputs through JSON-RPC API (which is the API you would probably be using) is not possible. The problem is not the switching itself but getting it done right so that it also shows correctly in the settings dialog. It's a bit complicated to explain but generally the way changing settings in XBMC is currently implemented makes it very very difficult to change a setting from outside the settings dialog (which would be the case when doing it through JSON-RPC).

Maybe ugly...., but isn't it possible to write a wrapper around this settings dialog so we can interact with json?
Reply
#10
I'd love this feature to happen...
Reply

Logout Mark Read Team Forum Stats Members Help
Switching audio outputs through API ?0