Kodi Community Forum

Full Version: HDMI Issue? or Audio Issue? Kodi doesn't play audio upon start
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
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
Hello @abarylak

I've only read the first paragraph of your epic Wink and then looked at the log. Unfortunately you haven't enabled debug mode.

Please ensure you have enabled debugging in Settings>System Settings>Logging, restarted Kodi then replicated the problem.
Like, i said this has been a random issue and i have been trying everything else i could think of to fix this.  I will turn on debug mode every time i shut down Kodi from now on in order to try to capture this issue in debug mode.  I cannot reproduce this issue on command so i will have to prepare for the issue and get the logs when i can.  I will post back when I have any more information or the debug logs.  Thanks.
This issue did occur again, and i had debug mode turned on with the advanced audio debugging enabled.  Here is the log for that:

Hopefully that helps try to figure this out.
I see you have this available connection to your AV Receiver...
20:25:22.217 T:2044  NOTICE:     Device 4
20:25:22.217 T:2044 NOTICE: m_deviceName : {57AE7AF5-8A1B-4A9E-957D-97EF0AD973CA}
20:25:22.217 T:2044 NOTICE: m_displayName : HDMI - SONY AVAMP-24 (NVIDIA High Definition Audio)
20:25:22.217 T:2044 NOTICE: m_displayNameExtra: WASAPI: SONY AVAMP-24 (NVIDIA High Definition Audio)
20:25:22.217 T:2044 NOTICE: m_deviceType : AE_DEVTYPE_HDMI
20:25:22.217 T:2044 NOTICE: m_channels : FL,FR,FC,LFE,BL,BR,SL,SR
20:25:22.217 T:2044 NOTICE: m_sampleRates : 192000
20:25:22.217 T:2044 NOTICE: m_dataFormats : AE_FMT_RAW
20:25:22.217 T:2044 NOTICE: m_streamTypes :

But, you seem to be using this one instead...
20:25:22.239 T:5480   DEBUG: CActiveAESink::OpenSink - DIRECTSOUND Initialized:
20:25:22.239 T:5480 DEBUG: Output Device : SPDIF - SPDIF Interface (TX1) (VIA HD Audio)
20:25:22.239 T:5480 DEBUG: Sample Rate : 44100
20:25:22.239 T:5480 DEBUG: Sample Format : AE_FMT_FLOAT
20:25:22.239 T:5480 DEBUG: Channel Count : 2
20:25:22.239 T:5480 DEBUG: Channel Layout: FL,FR
20:25:22.239 T:5480 DEBUG: Frames : 661
20:25:22.239 T:5480 DEBUG: Frame Size : 8

Maybe start by changing that in Settings>System Settings>Audio. Make sure you are using WASAPI and not DirectSound.
Well, that's where the confusion starts i guess.  I have tried configuring Kodi explicitly in the past to use the WASAPI version of my Sony receiver, and still experienced this issue.  I have recently switched to using the WASAPI Default device in kodi since if i minimize Kodi the Windows volume controller identifies the Sony AVAMP as the connected audio device and plays sounds in windows correctly, but kodi still does not work.  If i check the audio configuration in kodi when this is happening it shows that it is still configured to use the WASAPI default device.  If i remember correctly in the past, when i had explicitly selected the SONY AVAMP device in Kodi, if the audio wasn't working, it wouldn't even show the SONY AVAMP in the configuration in the UI until i went through my convoluted pattern to restore audio functionality.

So, I only have HDMI connected from my computer to the receiver, and have always only used HDMI to transmit the audio.  I can explicitly select the WASAPI SONY AVAMP device the next time, and capture those logs if you would like when this happens again.  I see no reason why this would harm anything, so i will make that explicit change and report back when i get more logs.

Let me know if there is anything else i can try because i have been trying every different combination of settings and configuration i can think of, and even when i do have audio working, i still have an issue where windows doesn't recognize DTS-HD and other advanced 7.1 formats as supported by my receiver, even though the exported edid inf shows that those formats are supported and the receiver i have shows it supports them.  So, i'm still open to the possibility that I'll have to configure something differently.  The 7.1 passthrough issue i started in a different thread, i don't know if it is related to this issue or not, but i thought i'd try to solve this basic audio functionality issue first before progressing with the passthrough issue.  @Karellen you already responded to my other thread about that, but i just thought i'd bring it up in case these things are related.

Sorry for the rambling post.  I'll try explicitly setting the WASAPI SONY AVAMP as the sound device in Kodi instead of the WASAPI default while leaving all my other configurations in tact for now, and i'll capture the debug logs the next time this issue occurs (who knows, maybe this won't happen again due to all the other changes i've done since i started having this issue).  I'll let you know how this goes.
(2017-12-08, 01:50)abarylak Wrote: [ -> ]I can explicitly select the WASAPI SONY AVAMP device the next time, and capture those logs if you would like when this happens again.  I see no reason why this would harm anything, so i will make that explicit change and report back when i get more logs.
That sounds good. At the moment it is the only error we can see (my previous post) so trying to locate another error with the modified settings will be useful.

Also check your audio drivers in Windows. @jjd-uk has a great guide and collection of images on this, but I just can't seem to locate it. Hopefully he will pop through and post the link. Smile

This is a screenshot of my audio settings for Denon AVR and hopefully there may be a difference you can spot.
When doing EDID override did you follow this 251833 (thread)

The guide Karellen is referring to is a rather old one here 146911 (thread) some bits still have relevance however, there's also this guide for checking Windows settings are correct Windows_audio (wiki)

It's sounds to me that the HDMI device is being lost and it's switching output to spdif as shown in that log as a consequence.

Make sure the HDMI connection is set as the Default Device in Sound -> Playback tab as shown in the screenshot has posted.

Then to prevent switching of devices (assuming you only ever use the HDMI connection) then right click on any other devices showing and select Disable (for example if Karellen had similar issues I'd advice disabling the Speakers, Realtek Digital Output, Realtek Digital Output (Optical) devices as shown in the screenshot).

If still having problems the HDMI as the only enabled device then post another debug log.
Hi, the next time i started up after explicitly selecting the SONY AVAMP device for audio, i ran in to the same issue again.  Here is the new debug log:

Also, I'm sure your skeptical that i have allowed the ability to for programs to take exclusive control over the audio device, but i assure you i have.  I can include the second kodi log from the next startup after performing my switch user trick and got audio back.  Or i can include screenshots if you'd like.

Let me know if there is anything else I can try or change to try to fix this.  Thanks.
Yes, I can see all the errors. If you go into your log and start at line 200 which is stating that your audio devices are unsupported.

From Line 215, it lists all your available devices. Then at line 326 it tries to load your WASAPI device, fails and reverts back to DirectSound SPDIF.

The error is AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED but I am not sure if that is incorrect Audio Driver or incorrect shared (should be exclusive) setting for your WASAPI driver. Hopefully someone can clarify.

I have also left a note for the developers to clarify for me Smile
Yes, i was looking at those messages in there as well.  It's just really strange.  I compared the non-working log to the working log, and noticed some strange differences, and i don't know why there are differences at all.  So, i'm open to the possibility of this being a setup issue like a driver problem or something, but I don't understand why it just works if i shut down kodi, initiate a switch user, log back in as same user, then launch Kodi again.  Nothing else changes, so i don't know what is causing this to fail or get back to normal.  Here is a pastebin of the working logs beginning section with the audio stuff if you want to look at it as well.

Also, correct me if i'm wrong, but i should only need to install the Nvidia driver in order to get audio thru display port/hdmi, correct?  It wouldn't make sense that audio drivers like the Via stuff would be needed for hdmi since i'm not using the optical or anything.  But i'm open to other possibilities.

I have also double checked that the audio properties does have the checkboxes selected for allowing exclusive access.  Here is a screenshot to confirm just in case:
Hopefully there is an actual image above this line.
Allow applications to take exclusive control of the device must be selected
(2017-12-09, 13:46)afedchin Wrote: [ -> ]https://imgur.com/a/As6Ij
Allow applications to take exclusive control of the device must be selected
Thank you for that, but please refer to the Image link in my previous post showing that the option you specified is indeed checked in my audio configuration.

The only thing I can think of is that when i have the audio problem, the option is somehow unselected, but i'll have to check that the next time i experience the issue.  It's just one more thing to look at to try to figure this out.
I just had another occurrence of this issue.  I have uploaded my kodi logs as well as posted a screenshot showing my kodi audio configuration (just the first page), and the playback device configuration settings.  This image was while the audio was not working in Kodi but was working in windows directly (clicking the audio systray icon and adjust the volume results in sound from my speakers).  

Here is the link to my logs: https://pastebin.com/u3sNiBNU

Here is the screenshot: https://imgur.com/f10U9vo

Let me know if there is anything else i can provide to help with this.  Thanks!
The log is quite verbose: Basically your audio driver configuration is fully nuts. There is no support of 16 bit int at all. Kodi will work the same as windows the very moment you only choose DirectSound - as this only needs FLOAT output.

Disable all passthrough, choose DirectSound for playback. 

The only alternative is fixing the sound card driver installation.

Quote:m_dataFormats     : AE_FMT_FLOAT,AE_FMT_RAW

Only Float and our format to indicate RAW PT. We are missing AE_FMT_S16NE - not sure what is going on with your installation. That VIA SPDIF device is the worst :-) it answers to nothing at all :-)
Pages: 1 2