Author Topic: Setting audio outputs and passthrough in XBMC Gotham  (Read 4791 times)

0 Members and 1 Guest are viewing this topic.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Setting audio outputs and passthrough in XBMC Gotham
« on: May 21, 2014, 09:08:14 PM »
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.  ::bow

Here is a simple command to turn passthrough on and off.  In some cases this might be enough.
Code: [Select]
<?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.
Code: [Select]
<?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.
« Last Edit: September 10, 2014, 05:46:55 PM by nime5ter »

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2012
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Setting audio outputs and passthrough in XBMC Gotham
« Reply #1 on: September 23, 2015, 12:04:50 PM »
@James -- Do the above commands require Kodi folks to have their settings permissions level set to 'Advanced', do you know?

http://kodi.wiki/view/Settings#Settings_levels
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Setting audio outputs and passthrough in XBMC Gotham
« Reply #2 on: September 23, 2015, 02:37:52 PM »
I don't think the actual commands do, but in order to view Kodi's advanced audio settings such as digital passthrough in the Kodi UI you do need to set the Kodi UI to advanced mode, which you can do in the Confluence skin, but not in some other skins such as Aeon MQ6 for some reason.

Wanilton

  • $upporter
  • Hero Member
  • *****
  • Posts: 559
  • Karma: 6
    • View Profile
    • XBMC Brazil Forum
Re: Setting audio outputs and passthrough in XBMC Gotham
« Reply #3 on: September 24, 2015, 10:29:28 AM »
In MQ6, for change level, you need enter in any item in settings (appearance, weather or other), press left key, show place for change level.





Here good script for change audio output

http://forum.kodi.tv/showthread.php?tid=201896.
« Last Edit: September 24, 2015, 10:33:46 AM by Wanilton »
www.xbmcbrasil.net
XBMC  Brazilian Community Forum - Admin
Windows 8.1 - XBMC Gotham Custom Plus - Aeon MQ 5
My Room Entertaiment´s
About me

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Setting audio outputs and passthrough in XBMC Gotham
« Reply #4 on: September 24, 2015, 02:02:40 PM »
Thanks Wanilton.  That's great to know about.  I don't think it should be hidden like that.  There is no way to know it is there.

Thanks for the script.  We are able to change Kodi's audio output and other settings directly from VoxCommando, so (for me) there is no need to have a special script.