2- If I run XBMC on PC the "pass-through output device" in XBMC changes obviously. What's really annoying is when I watch a movie on surround system next, I always have to go into settings and change it back to HDMI. Is there a direct XBMC command to change pass-through device?
Actually in Gotham there seems to be an undocumented method for modifying various "settings" including a lot of the audio stuff. Finally! A giant thank-you to Nime5ter for sleuthing this one out.
Here is a simple command to turn passthrough on and off. In some cases this might be enough.
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 1.9.5.1-->
<command id="256" name="set digital pass through {1}" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>XJson.Raw</cmdType>
<params>
<param>Settings.SetSettingValue</param>
<param>"setting":"audiooutput.passthrough", "value":{1}</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<phrase>set digital pass through</phrase>
<payloadList>true, false</payloadList>
</command>
Obviously you can modify the above command to suit your linguistic preferences... It's probably easier to create one command for on and one for off and then you can make some nice phrases for each.
Here's an entire group dedicated to switching devices.
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.0.0.8-->
<commandGroup open="True" name="xbmc introspect json" enabled="True" prefix="" priority="0" requiredProcess="" description="">
<command id="206" name="get settings" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>XJson.Raw</cmdType>
<params>
<param>Settings.GetSettingValue</param>
<param>"setting":"audiooutput.audiodevice"</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>XJson.ParseTokens</cmdType>
<params>
<param>{value}</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>System.SetClipboardText</cmdType>
<params>
<param>{LastResult}</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<phrase>get settings</phrase>
</command>
<command id="255" name="set output TV" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>XJson.Raw</cmdType>
<params>
<param>Settings.SetSettingValue</param>
<param>"setting":"audiooutput.audiodevice", "value":"DIRECTSOUND:{CBAEC640-FA2D-47C3-9B01-460EA6AA1A82}"</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>XJson.Raw</cmdType>
<params>
<param>Settings.SetSettingValue</param>
<param>"setting":"audiooutput.passthrough", "value":false</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<phrase>set output</phrase>
<phrase>TV, Samsung, H D M I</phrase>
</command>
<command id="274" name="set output Onkyo" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>XJson.Raw</cmdType>
<params>
<param>Settings.SetSettingValue</param>
<param>"setting":"audiooutput.audiodevice", "value":"DIRECTSOUND:{EE835631-2CEB-4513-B266-4E5FF1AC19A9}"</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>XJson.Raw</cmdType>
<params>
<param>Settings.SetSettingValue</param>
<param>"setting":"audiooutput.passthroughdevice", "value":"DIRECTSOUND:{EE835631-2CEB-4513-B266-4E5FF1AC19A9}"</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>XJson.Raw</cmdType>
<params>
<param>Settings.SetSettingValue</param>
<param>"setting":"audiooutput.passthrough", "value":true</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<phrase>set output</phrase>
<phrase>Onkyo, optical, stereo, receiver</phrase>
</command>
<command id="270" name="set output plantronics" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>XJson.Raw</cmdType>
<params>
<param>Settings.SetSettingValue</param>
<param>"setting":"audiooutput.audiodevice", "value":"DIRECTSOUND:{12305E34-BC70-4C65-990E-A9079A98D39F}"</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>XJson.Raw</cmdType>
<params>
<param>Settings.SetSettingValue</param>
<param>"setting":"audiooutput.passthrough", "value":false</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<phrase>set output</phrase>
<phrase>plantronics, headset</phrase>
</command>
<command id="262" name="set digital pass through {1}" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>XJson.Raw</cmdType>
<params>
<param>Settings.SetSettingValue</param>
<param>"setting":"audiooutput.passthrough", "value":{1}</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<phrase>set digital pass through</phrase>
<payloadList>true, false</payloadList>
</command>
</commandGroup>
Two of my devices (TV and headset) work best as non-passthrough devices, so for those two, I am setting the value for
audiooutput.audiodevice to the correct device ID, and then setting
audiooutput.passthrough to
false.
With my other device (my onkyo digital receiver) I prefer to set it as the device for everything and then let XBMC decide to use passthrough or not depending on the file. So in this case I am setting both
audiooutput.audiodevice and
audiooutput.passthroughdevice to the correct ID for my Onkyo and then setting
audiooutput.passthrough to
true.
But how to get the correct device IDs?
I think the easier way is to first go into XBMC and set the audio device to the one you wand the ID for. Then execute the VC command "get settings". This command will get the ID from XBMC and copy it to your clipboard.