Kodi Community Forum
Wasapi audio issues - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Game support (https://forum.kodi.tv/forumdisplay.php?fid=292)
+--- Thread: Wasapi audio issues (/showthread.php?tid=349096)



Wasapi audio issues - LegzRwheelz - 2019-11-09

Hey guys, so I am trying to launch a bat file i converted to exe, to launch youtube kids in fullscreen using advance launcher, I don't get audio though. I know that this is because I have wasapi: default as my sound device. I did some searching and found a thread regarding this issue running emulators and tried using the  (ancient and abandoned plugin) audio profiles as well as turning off stereo upmix. Neither have worked for me. So I am reaching out in hopes that someone may have an idea. 

That being said, I remember a few years back seeing a thread for launching hyperspin (that I cant seem to word correctly to track down), it seems like the script (autohotkey I BELIEVE) would put kodi to sleep after being executed then once hyperspin was closed, it would then "wake up" kodi and resume functionality. (This could be used for any win32 exe) I never used said script back then because i didn't realize what I was missing by not using wasapi, I had a bat file i created that launched HS just fine and left "well enough" alone. 

My question is this, would using a script like this "release" the exclusive audio "handling" so I can run apps with kodi running in the background? I am no scripter genius but it seems that Kodi could be put to sleep once its sent to the background. 

Ignorance truly was bliss all those years ago. Thank you for reading and sitting through my rambling. If you have any advice, I will be your guinea pig.


RE: Wasapi audio issues - ghizzu - 2019-11-10

(2019-11-09, 14:57)ctindell81 Wrote: My question is this, would using a script like this "release" the exclusive audio "handling" so I can run apps with kodi running in the background? I am no scripter genius but it seems that Kodi could be put to sleep once its sent to the background. 
 
I've set a slightly modified version of IAGL that uses 2 AutoHotkey compiled scripts to minimize Kodi before launching Retroarch and to maximize it after Retroarch is exited, so -I think- just like you wanna do. Well, Kodi will release WASAPI, BUT you must set "Keep Audio Device Alive" and "Send low volume noise" (in System/Audio) both to OFF. For the record, here are my AHK scripts:

Minimize Kodi:

SetWorkingDir %A_ScriptDir%
WinMinimize, Kodi ahk_class Kodi
ExitApp


Maximize Kodi:

SetWorkingDir %A_ScriptDir%
WinMaximize, Kodi ahk_class Kodi
WinWait, Kodi ahk_class Kodi
WinActivate, Kodi ahk_class Kodi

ExitApp

But, for some reasons, on my system this only works if Kodi display mode is set to "Use fullscreen window".


RE: Wasapi audio issues - ghizzu - 2019-11-10

Update: after further testing, I discovered that Kodi releases WASAPI only the first time that an external program is launched. The subsequent launches, it doesn't. I don't know why this is happening. This doesn't happens with DirectSound, though.


RE: Wasapi audio issues - LegzRwheelz - 2019-11-11

(2019-11-10, 12:23)ghizzu Wrote:
(2019-11-09, 14:57)ctindell81 Wrote: My question is this, would using a script like this "release" the exclusive audio "handling" so I can run apps with kodi running in the background? I am no scripter genius but it seems that Kodi could be put to sleep once its sent to the background. 
 
I've set a slightly modified version of IAGL that uses 2 AutoHotkey compiled scripts to minimize Kodi before launching Retroarch and to maximize it after Retroarch is exited, so -I think- just like you wanna do. Well, Kodi will release WASAPI, BUT you must set "Keep Audio Device Alive" and "Send low volume noise" (in System/Audio) both to OFF. For the record, here are my AHK scripts:

Minimize Kodi:

SetWorkingDir %A_ScriptDir%
WinMinimize, Kodi ahk_class Kodi
ExitApp


Maximize Kodi:

SetWorkingDir %A_ScriptDir%
WinMaximize, Kodi ahk_class Kodi
WinWait, Kodi ahk_class Kodi
WinActivate, Kodi ahk_class Kodi
ExitApp

But, for some reasons, on my system this only works if Kodi display mode is set to "Use fullscreen window". 

I really want to thank you for the reply and help. I will try this out once the kids are in bed. This sounds exactly like what I need. I already had all three of these settings set like you detailed. I will still try this out to see if your issues are specific to your system. If anything, it seems like a great starting point. Thank you, soo freaking much. You are awesome.


RE: Wasapi audio issues - LegzRwheelz - 2019-11-13

Ok, so i have done some testing. Wasapi *DOES NOT* get released using these scripts....HOWEVER. I do believe i have a borked install of windows and need to reinstall. I am downloading 1909 right now and will be reinstalling and do some further testing. I have all sorts or random quirky things happening. Like in the sound control panel it shows (unknown) under speaker configuration in the right-click menu. Certain games that use launchers have difficulties ending their tasks after launching and no amount of alt-f4-ing or ending the task in task manager helps. Im running windows from a SSD so things *should* be snappy...some things are worse than an hdd in some cases. So after my iso downloads, i am going to be reinstalling windows and seeing how this script works for me


RE: Wasapi audio issues - LegzRwheelz - 2019-11-30

So I figured it out, its dead simple and doesn't require any scripts. Go to your sound control panel (in windows 10 sound settings) , click on your default device>properties>advanced tab>check both boxes (allow applications to take exclusive control of this device and give exclusive mode to applications priority)>apply>ok.

In KODI Settings>system>audio>audio output device>DirectSound [your device name]>enter
after you set that, make sure "allow passthrough" is enabled, then on "Output Passthrough Device" chose "wasapi [your default sound device]"

Now, everything should just work, because the only time kodi has exclusive control, is when your playing media within kodi. If you're launching any external apps, kodi doesnt have exclusive control, because you set the default device as the directsound, rather than wasapi. All passthrough codecs play fine as well, I haven't been able to test Atmos as i don't have an Atmos receiver, but Dolby TrueHD, DTS-HD, DTS, DD, DD+, DTS-MA, and PCM audio all work flawlessly. I am able to launch YoutubeKids within chrome, Netflix, hulu, LaunchBox/BigBox just fine without any audio device errors/no sound issues. I hope this helps. Happy Holidays @ghizzu