v17 Switch audio output between earpod and AVR(passthrough)
#1
I'm using different audio output device, like earpods when working and AVR when watching movies.

The thing is with AVR, I need to enable passthrough, and with Kodi 16 or earlier version, I somehow managed to keep the passthrough option enabled all the time and switch output devices without problems. However after upgraded to Kodi 17 today, I found the earpods don't work anymore when passthrough option is enabled - I need to turn off passthrough to get sound from earpods.

Now I have to check passthrough when switching to AVR, and uncheck it when using earpods, that's a bit of trouble as you can imagine. So any chance I can get it work the old way?

I'm not getting back to the old version because the new skin is aaawsomeWink
Reply
#2
I'm digging out this old thread since I have the same problem:

I watch movies passing through the sound to my 7.1 amplifier hooked to the SP/DIFF on the PC.

When my kid goes to bed, I use my stereo headphones on the 3.5mm line output, switching the PC's audio output to "speakers". Obviously, the stereo headphones cannot decode the DTS stream passed through to them, which is why I have to deactivate passthrough every time and switch it back on later. That's quite a hassle given that there is no keystroke for "allowing passthrough", is there?

Any suggestions??

For starters, a keystroke "toggle allowing passthrough" would be of big help!!!

What is the preferred way to easily switch from a multi channel amplifier to a stereo headphone set? Is the way I do it too complicated to begin with?

I do want to avoid hooking my headphones to the receiver as this would bring up new sorts of problems...

Thank you!
Reply
#3
FWIW, I used to switch between S/PDIF and my Avantree Leaf Bluetooth transmitter in Windows 8.1, though I did have to use an Autohotkey keyboard macro to disable and re-enable the surround formats in the Windows Sound control panel for S/PDIF, because I found no way to do this programmatically through proper scripting. The same Sound control panel exists in Windows 10, so it may still work. Reviewing my Windows 8.1 image backup, I had Kodi configured to use WASAPI:default for audio device and specifically S/PDIF for the passthrough device. Disabling the surround formats for S/PDIF in the Sound control panel made things fine when the Leaf was the default audio device. I remember thinking, "Kodi must see that surround isn't enabled in Windows for its "passthroughdevice" (S/PDIF), so it punts it to its "audiodevice" (WASAPI:default), using the guisettings.xml terms, and with the Windows default playback device being temporarily the Leaf, I got the behavior I wanted, Kodi using the 2 channel Leaf for output, with surround formats playing back fine.

For the AHK macro, I had Ctrl+Win+A switching between my two output devices, and Ctrl+Shift+Win+A used internally by the macro to trigger the DisplayFusion function "Set next playback device as default," which served to toggle between them as I only had two. There are other ways to do the latter without DisplayFusion, but that was easiest for me. The default state is for S/PDIF to be default playback device with surround formats enabled. Kodi cannot be running while the macro executes. I think the following AHK script excerpt should run standalone. The key line is:

Code:
Send {Down}{Down}{Space}^{Tab}{Down}{Space}{Down}{Space}{Enter}{Enter}

After the macro opens the Sound control panel, it moves down the playback device list and opens the Properties dialog for S/PDIF, which was the second one in my two-item list, so "{Down}{Down}{Space}". Then it activates the second tab in Properties and toggles DD5.1 and DTS on or off, so "^{Tab}{Down}{Space}{Down}{Space}". Finally, it OKs out of the two dialogs with "{Enter}{Enter}". I hated having to do it this way, but it did work, and it was a single keypress, Ctrl+Win+A, to toggle between S/PDIF and the Leaf. It worked for all applications, and it didn't require using a separate Kodi profile.

Finally, note that I had only two audio devices, so the DisplayFusion function "Set next playback device as default" served to switch between them. Having more than two would have made things more complicated.

Code:

g_ByClass = ByClass
g_ByTitle = ByTitle

#^a::
    ModWait()
    SetTitleMatchMode 3
    path = %A_WinDir%\system32\control.exe
    RunOrActivate("Sound", path . " mmsys.cpl", g_ByTitle)
    WinWaitActive, Sound
    if ErrorLevel
        return
    Send {Down}{Down}{Space}^{Tab}{Down}{Space}{Down}{Space}{Enter}{Enter}
    Send #^+a
    return

RunOrActivate(idWnd, path, findMethod = "ByClass")
{
    global g_ByClass
    if (findMethod = g_ByClass)
        prefix := "ahk_class "
    else
        prefix := ""
    id := prefix . idWnd
    IfWinNotExist %id%
        Run %path%
    else
    {
        WinActivate
        WinShow
    }
}

ModWait()
{
    KeyWait Shift
    KeyWait Ctrl
    KeyWait Alt
    KeyWait LWin
    KeyWait RWin
}
Reply
#4
(2019-01-05, 16:13)Wesendonck Wrote: Any suggestions??
Audio Profiles
Reply
#5
That should work. Thank you so much!
Reply

Logout Mark Read Team Forum Stats Members Help
Switch audio output between earpod and AVR(passthrough)0