Win How to switch audio output easily?
#1
Sad 
Hi all and thanks in advance,

I have an HTPC connected to the TV via HDMI and AV via SPDIF (Using latest stable Frodo on Windows 7). Sometimes I want to have sound via TV speakers (HDMI exit) and other times I want via AV (when I watch a film).

When I want to make the change I have to navigate to Settings menu, audio output and configure the sound exit and compatible formats (on TV I have to disable DTS and others, and activate when I use SPDIF). I really would appreciate a way to change this easily, the perfect scenario would be a shortcut on keyboard, so today I've been during three hours looking for information and "googling" for it with no succefull result.

1.-My first attemp has gone with the dual audio patch, but is not supported on Frodo Sad.

2.-Then I've found an interesting program called AudioSwitch, that allows to easily change the audio output used on Windows. The problem here is that XBMC doesn't allow to use "Current Windows Audio output", so it has no effect on XBMC.

3.- Then I've found another chance, using an script and linking it to a keyboard shortcut, but it seems to not to work on XBMC 12.2 and 12.3.

4.- Then I've read about creating two profiles, but if I've understand ok, It would affect to all the XBMC config, not only audio settings, so if I add contents (fims for examble) to the program, or change some other thing, I would be forced to change on the two profiles. Further this, with this method I have to restart XBMC to make changes take effect.

I really would appreciate any help since I can't believe that something so simple can be so difficult to make, I suppose that many people wants to swith audio from TV to AV, I can't believe there is no way to do this.

Regards
Reply
#2
I think XBMC v13 Gotham has some ability to switch settings using JSON-RPC, but I'm not sure on the details
Reply
#3
hi,
i use "method 4", via 2 different profiles. i do it the following way: if i add new plugins or movies i make sure that i use my masteruser profil (with hdmi audio). after that i delete my second profil (with speakers output), copy and rename the masterprofile to profile "2" and change output to speakers. that takes less than 1 minute. via modifying the keymap i have for every of the two profiles a key on my remote. so i can switch audio outputs via remote, but i have not to restart xbmc for that. this works "on the fly", but to take effect you have to restart the stream
Reply
#4
With Gotham, it´s possible using JSON-RPC, here one example

Code:
{"jsonrpc":"2.0","method":"Settings.SetSettingValue", "params":{"setting":"audiooutput.audiodevice","value":"DIRECTSOUND:{3AE5C20B-DAA5-4E9E-AEA1-5ED6D355C1DF}"},"id":1}
MediaBrazil forum Website - Youtube Channel
MQ9-1.6.0.29 - 09.15.2023 - Aeon MQ Skin Team
MarcosQui Website Donate and support us.
Reply
#5
hi wanilton,
can you (or anyone other with knowledge about these json script things) give a short instruction how to get this running( is there other software needed, can i switch audiooutput via remote...?). i think many users are looking for a comfortable way to switch audio output via remote....
Reply
#6
I'm interested in this too. Please provide more info.
Reply
#7
I am very interested in this and have had a play around with it

This is what is working for me in linux

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
replace ALSA:hdmi:CARD=NVidia,DEV=1 in the above example (aswell as the address and port), with which audio device you want to switch to, I found my device by searching the xbmc.log for attempting to open

From what I have been able to find so far is the available commands are in here: https://github.com/xbmc/xbmc/blob/662d14...ttings.xml

EDIT: I just noticed this is windows, here is how to use curl to send jsonrpc commands in windows http://wiki.xbmc.org/index.php?title=HOW...mmand_Line
Reply
#8
unfortunately i am not very experienced in programming python, but it would be awesome to have a service addon to switch audio devices.
It even would be better if the service addon can parse the audio devices from the xbmc log file and make it selectable through the addon settings.
i think it even could be possible to switch the audio device automatically depending which player is used (audio, video).

any ideas?
Reply
#9
I do the following:
Connect your htpc with hdmi to your AV and from your AV to your TV.
Now i can choose with remote from AV to have sound to tv or to have sound to my surround set
Reply
#10
(2014-04-14, 11:00)Tassadar Wrote: Sometimes I want to have sound via TV speakers (HDMI exit) and other times I want via AV (when I watch a film).

A lot of AV receivers have this option built in. Something like 'tv passthrough mode' or something.
Reply
#11
I use HDMI audio or SP-DIF surround. I used the dual-audio patch in Eden, then 2 profiles in Frodo. Now, in Gotham, I just select the "passthrough" option to switch between HDMI/stereo and 5.1 optical.

Big problem...There has to be an easier way to get to this option other than :

1) while a video is playing hit enter, audio, drop down and select, then back out of the menu... whew!
or
2) go to settings, system, audio, scroll down, select passthrough, then back to the video... whew! again!

There has got to be a way to add the "passthrough" toggle to a keyboard command (script?)...
any ideas please?
Reply
#12
I'm interested too

I have passthrough set in my denon x2000 but it doesn't work with xbmc,works fine with popcorn hour
Reply
#13
I've set it up once and it works.
Don't see the use of changing it.
Just curious why you want to change how the audio is outputted,
What's the use of it ?
LibreElec Kodi | Aeon MQ ?
Reply
#14
See my 3ad

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

If i don't change enable passthrough option i can't hear anything from tv (when option is enabled) and i get only stereo from av if it is not enabled

(in my denon passthrough is enabled and with popcorn hour works perfectly)
Reply
#15
Use a script to toggle audio outputs/speaker config/pass through mode/etc via jsonrpc (example above) and map it to a remote/keyboard key. I have a script running in the background which pings my avr, if its on it automatically switches xbmcs audio settings. Works really well.
Reply

Logout Mark Read Team Forum Stats Members Help
How to switch audio output easily?0