2017-12-05, 04:18
This is a very complicated issue for me, hopefully this is something that is solvable for someone with more knowledge about this subject. Randomly when i start my Kodi instance on my always on Windows 10 machine (connected to a receiver and TV), Kodi doesn't play any audio (even when navigating menus). I did look in the logs, and I see the following error messages:
19:52:38.747 T:13812 ERROR: CAESinkWASAPI::InitializeExclusive: IsFormatSupported failed (AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED)
19:52:38.747 T:13812 ERROR: CAESinkWASAPI::Initialize: WASAPI initialization failed.
Now, i'll try to provide as much additional information as i can below:
To answer the obvious question first, Yes, my audio properties does have exclusive access allowed for my HDMI NVIDIA High Definition Audio device.
So, my setup first, Windows 10 professional 1709 (Fall Creators Update), Nvidea Quatro 2000 with a display port to HDMI adapter > Sony STR-DN2010 Receiver > Video only out to TV.
My Computer is always turned on with the Media user account always logged in on the console. I have also configured the Topology in the Nvidia driver to load the settings from an EDID file i exported from the Nvidia driver as well so that hopefully all the resolution configuration and everything was retained through the receiver turning off and on and everything.
History and previous solutions:
This seems to have started happening in Windows 8.1 but I had a solution that was working as well. I figured out that if i initiated a Switch User action (e.g. Ctrl+Alt+Delete then selected Switch User), but went straight back into my media user account (not actually switching), then the audio would work again. I could even do this with Kodi currently running. So, I configured my Harmony Remote along with AutoHotKey to run a set of commands every time I started my "HTPC" action to start my Receiver, TV, then run the switch user command on the computer, select the Media user again then start Kodi. This was working fine to solve this issue. However, i'm not sure if i was getting the same error message in the logs that i'm getting now, so it may have been a different issue with the same type of symptoms, but we'll never know now.
On to Windows 10, initially it behaved the same way and i was still doing the Switch User workaround. Then, as i updated Windows 10 I started getting less overall issues, and eventually was able to completely remove the Switch User workaround and everything still worked fine.
Then, i upgraded to Windows 10 version 1709 (Fall creators update). Now, I was getting 2 different issues randomly.
First was the same issue where a Switch User command would resolve the issue. However, the method used to initiate a switch user (running tsdiscon.exe) in 1709 wouldn't default the selected user to the currently logged in user, but instead would default to the "last user to login to the system". To clarify I have tweaked windows to allow multiple RDP sessions, so i regularly log in as my administrator user to perform changes or media updates. So, it would sometimes default to the administrator user and therefore a simple switch back to the same user doesn't work anymore, mainly because i'm not able to string together the correct timing adjustments and key presses to make the switch user trick work.
Second, there is an issue where randomly the audio device through HDMI just doesn't get recognized at all. This then required me to restart the computer to get the audio working. I did find a solution for this issue though, by using the devcon.exe tool to reset the graphics driver. So, i reset the graphics driver, wait a couple seconds via AutoHotKey then launch Kodi. Since implementing this workaround, I only have the first issue randomly happen.
I'm at the edge of reinstalling my entire computer back to a previous version of windows 10. I'm also about to roll back to 17.1 instead of 17.6 due to stability issues, but that is a different issue.
So, i'm curious if there is anyone that has come across this, or if there is a solution someone has found, or if this is a bug in the Kodi application which is preventing the ability to get exclusive control of the audio device. If there's anything i can try, or change, please let me know. I have also tried exporting the EDID inf from Monitor Info and installing that as the monitor in Device Manager. But that has not resolved this issue yet. If anyone can help, that would be great.
Logs from most recent error and fixing using the switch user manually via keyboard: https://pastebin.com/ye9h3C2n
19:52:38.747 T:13812 ERROR: CAESinkWASAPI::InitializeExclusive: IsFormatSupported failed (AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED)
19:52:38.747 T:13812 ERROR: CAESinkWASAPI::Initialize: WASAPI initialization failed.
Now, i'll try to provide as much additional information as i can below:
To answer the obvious question first, Yes, my audio properties does have exclusive access allowed for my HDMI NVIDIA High Definition Audio device.
So, my setup first, Windows 10 professional 1709 (Fall Creators Update), Nvidea Quatro 2000 with a display port to HDMI adapter > Sony STR-DN2010 Receiver > Video only out to TV.
My Computer is always turned on with the Media user account always logged in on the console. I have also configured the Topology in the Nvidia driver to load the settings from an EDID file i exported from the Nvidia driver as well so that hopefully all the resolution configuration and everything was retained through the receiver turning off and on and everything.
History and previous solutions:
This seems to have started happening in Windows 8.1 but I had a solution that was working as well. I figured out that if i initiated a Switch User action (e.g. Ctrl+Alt+Delete then selected Switch User), but went straight back into my media user account (not actually switching), then the audio would work again. I could even do this with Kodi currently running. So, I configured my Harmony Remote along with AutoHotKey to run a set of commands every time I started my "HTPC" action to start my Receiver, TV, then run the switch user command on the computer, select the Media user again then start Kodi. This was working fine to solve this issue. However, i'm not sure if i was getting the same error message in the logs that i'm getting now, so it may have been a different issue with the same type of symptoms, but we'll never know now.
On to Windows 10, initially it behaved the same way and i was still doing the Switch User workaround. Then, as i updated Windows 10 I started getting less overall issues, and eventually was able to completely remove the Switch User workaround and everything still worked fine.
Then, i upgraded to Windows 10 version 1709 (Fall creators update). Now, I was getting 2 different issues randomly.
First was the same issue where a Switch User command would resolve the issue. However, the method used to initiate a switch user (running tsdiscon.exe) in 1709 wouldn't default the selected user to the currently logged in user, but instead would default to the "last user to login to the system". To clarify I have tweaked windows to allow multiple RDP sessions, so i regularly log in as my administrator user to perform changes or media updates. So, it would sometimes default to the administrator user and therefore a simple switch back to the same user doesn't work anymore, mainly because i'm not able to string together the correct timing adjustments and key presses to make the switch user trick work.
Second, there is an issue where randomly the audio device through HDMI just doesn't get recognized at all. This then required me to restart the computer to get the audio working. I did find a solution for this issue though, by using the devcon.exe tool to reset the graphics driver. So, i reset the graphics driver, wait a couple seconds via AutoHotKey then launch Kodi. Since implementing this workaround, I only have the first issue randomly happen.
I'm at the edge of reinstalling my entire computer back to a previous version of windows 10. I'm also about to roll back to 17.1 instead of 17.6 due to stability issues, but that is a different issue.
So, i'm curious if there is anyone that has come across this, or if there is a solution someone has found, or if this is a bug in the Kodi application which is preventing the ability to get exclusive control of the audio device. If there's anything i can try, or change, please let me know. I have also tried exporting the EDID inf from Monitor Info and installing that as the monitor in Device Manager. But that has not resolved this issue yet. If anyone can help, that would be great.
Logs from most recent error and fixing using the switch user manually via keyboard: https://pastebin.com/ye9h3C2n