WASAPI not used even when hard-coded
#1
My setup:

Kodi 17.1
HDMI to Yamama Amp (and then on to a projector)

I have my advancedsettings.xml set to hardcode the WASAPI GUID for my HDMI interface.
I have passthru enabled.
I've set the Audio Keep-Alive timer to Always/None/1 Minute and 10 minutes, and I've alternated the "Low volume noise" on/off.

I've read though several threads and it seems to be a common issue:

http://forum.kodi.tv/showthread.php?tid=...ght=wasapi
1357945 (post)
133755 (thread)

Typically I will startup my Amp (the HTPC is always runnning) and then proceed to start a movie, and typically I end up with DirectSound because the Amp shows PCM instead of whatever the native format is. If I stop the movie and restart it will typically be correctly set to WASAPI after that.

Here is the log:
https://pastebin.com/ZteTG4E0


At 20:26 I start Star Wars:

Code:
20:26:50.436 T:7368  NOTICE: VideoPlayer: Opening: smb://10.0.0.7/movies/Star Wars - Episode IV - A New Hope (1977).mkv
20:26:50.436 T:7368 WARNING: CDVDMessageQueue(player)::Put MSGQ_NOT_INITIALIZED
20:26:50.439 T:7368   ERROR: DXVA::CProcessorHD::IsFormatSupported: Unsupported format 104 for 1.
20:26:50.439 T:7368   ERROR: DXVA::CProcessorHD::IsFormatSupported: Unsupported format 105 for 1.
20:26:50.440 T:5820  NOTICE: Creating InputStream
20:26:50.557 T:5820  NOTICE: Creating Demuxer
20:26:50.663 T:5820  NOTICE: Opening stream: 0 source: 256
20:26:50.663 T:5820  NOTICE: Creating video codec with codec id: 28
20:26:50.663 T:5820  NOTICE: CDVDVideoCodecFFmpeg::Open() Using codec: H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
20:26:50.663 T:5820  NOTICE: Creating video thread
20:26:50.663 T:5820  NOTICE: Opening stream: 2 source: 256
20:26:50.663 T:6332  NOTICE: running thread: video_thread
20:26:50.664 T:5820  NOTICE: Finding audio codec for: 86020
20:26:50.664 T:5820  NOTICE: Creating audio thread
20:26:50.664 T:5820  NOTICE: Opening stream: 4 source: 256
20:26:50.664 T:2180  NOTICE: running thread: CVideoPlayerAudio::Process()
20:26:50.664 T:6332  NOTICE: CDVDVideoCodecFFmpeg::GetFormat - Creating DXVA(1920x1080)
20:26:50.674 T:2180  NOTICE: Creating audio stream (codec id: 86020, channels: 7, sample rate: 48000, no pass-through)

I do it again at 20:27 with the same result, and then at 20:29 I try again:

Code:
20:29:19.368 T:7368  NOTICE: VideoPlayer: Opening: smb://10.0.0.7/movies/Star Wars - Episode IV - A New Hope (1977).mkv
20:29:19.368 T:7368 WARNING: CDVDMessageQueue(player)::Put MSGQ_NOT_INITIALIZED
20:29:19.368 T:7368   ERROR: DXVA::CProcessorHD::IsFormatSupported: Unsupported format 104 for 1.
20:29:19.368 T:7368   ERROR: DXVA::CProcessorHD::IsFormatSupported: Unsupported format 105 for 1.
20:29:19.368 T:6824  NOTICE: Creating InputStream
20:29:19.423 T:6824  NOTICE: Creating Demuxer
20:29:19.480 T:6824  NOTICE: Opening stream: 0 source: 256
20:29:19.480 T:6824  NOTICE: Creating video codec with codec id: 28
20:29:19.480 T:6824  NOTICE: CDVDVideoCodecFFmpeg::Open() Using codec: H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
20:29:19.480 T:6824  NOTICE: Creating video thread
20:29:19.480 T:6824  NOTICE: Opening stream: 2 source: 256
20:29:19.480 T:6824  NOTICE: Finding audio codec for: 86020
20:29:19.480 T:6824  NOTICE: Creating audio thread
20:29:19.480 T:7932  NOTICE: running thread: video_thread
20:29:19.480 T:6824  NOTICE: Opening stream: 4 source: 256
20:29:19.481 T:6864  NOTICE: running thread: CVideoPlayerAudio::Process()
20:29:19.482 T:7932  NOTICE: CDVDVideoCodecFFmpeg::GetFormat - Creating DXVA(1920x1080)
20:29:19.491 T:6864  NOTICE: Creating audio stream (codec id: 86020, channels: 6, sample rate: 48000, pass-through)

This time it works and I had passthru.

What can I do (config/hack/workaround) to get WASAP playback everytime? Is there something else I can do configuration wise to ensure I get WASAPI?
Reply
#2
Typically the HDMI handshake is needed for waspi to hold, otherwise the default DirectSound is used. Windows audio (wiki) and Audio quickstart guide (wiki) the pin 19 trick sometimes is used http://forum.kodi.tv/showthread.php?tid=...pid1357945
Reply
#3
Thanks for the links to the wikis. I understand that HDMI handshaking is required. When is that done? In my scenario, I turn on the Amp and projector I see the windows audio device goes from "unplugged" state to being the default and enabled audio device. Does Kodi do something at that point, or is it only once I start playback. Given that it seems to fix it self sometimes with multiple attempts, I guess it is making this determination at media playback time?

Is there a way to set a number of retries so that the WASAPI negotiation has a higher success rate?
Reply
#4
Try restarting kodi when the amplifier is on.
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply
#5
(2017-05-20, 01:08)nickr Wrote: Try restarting kodi when the amplifier is on.

Yup, that works. I'm hoping to have a stable solution that works for the family though. If this isn't considered a bug in Kodi then I will move on to hacky workaround solutions.
Reply
#6
The conventional wisdom has always to turn on other devices before your kodi computer. Is there a reason to turn off your amp?
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply
#7
(2017-05-20, 01:23)nickr Wrote: The conventional wisdom has always to turn on other devices before your kodi computer. Is there a reason to turn off your amp?

This install is in my home theatre so it is used regularly, but might be a day or two between uses. I would not want to keep my amp on 24/7.
Reply
#8
Could you copy your xml code in advancedsettings.xml to pastebin and share the link to it here? just want to sanity check what you've done as other people have had success with doing what you've done. If what you've done is right and it really is failing in your case then the only option is an edid override to fool your pc into thinking the amp is always on, see http://forum.kodi.tv/showthread.php?tid=251833
Reply
#9
(2017-05-20, 10:31)jjd-uk Wrote: Could you copy your xml code in advancedsettings.xml to pastebin and share the link to it here? just want to sanity check what you've done as other people have had success with doing what you've done. If what you've done is right and it really is failing in your case then the only option is an edid override to fool your pc into thinking the amp is always on, see http://forum.kodi.tv/showthread.php?tid=251833

Hi,

Here is my advancedsettings.xml:

Code:
<advancedsettings>
  <audiooutput>
    <audiodevice>WASAPI:{F8DCDE74-0531-432D-AB26-CA31B0DCC46A}</audiodevice>
    <passthroughdevice>WASAPI:{F8DCDE74-0531-432D-AB26-CA31B0DCC46A}</passthroughdevice>    
  </audiooutput>
</advancedsettings>

Thanks for posting the edid hack. I guess I have 3 kludgy hacks to choose from: 1) restart Kodi as necessary 2) try the pin 19 hack, 3) the EDID driver hack. It frustrates me that there isn't a cleaner solution to this seemly common problem that could be implemented entirely with Kodi.

Nevertheless I'm not willing at this point to dive into Kodi's internals to try and figure out a solution. I will investigate each of the workarounds and see if one works.

Thanks for your assistance,

Damon
Reply
#10
Quote: It frustrates me that there isn't a cleaner solution to this seemly common problem that could be implemented entirely with Kodi.
Frustrates all of us when High-bandwidth Digital Content Protection was implemented. https://en.wikipedia.org/wiki/High-bandw...Protection

If you come up with the solve, please share.
Reply
#11
Edid is not really what I'd call a hack.
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply
#12
(2017-05-21, 01:33)nickr Wrote: Edid is not really what I'd call a hack.
 I have the exact same setup as OP.  Always running HTPC, and an amp that I'd rather not leave on all the time.  When I used to have a pioneer amp, hardcoding in advancedsettings worked well.  When I switched to a Yamaha AVR, that became problematic.  It seems the kodi devs don't consider a more robust solution a priority, but thankfully what worked best for me is counter intuitive.

removed the entry from advancedsettings.xml and set it once to WASAPI and then it has stayed at WASAPI ever since.  Changing audio drivers in Windows, and the creators update in Windows both caused a switch back to direct sound, but they would have broken advancedsettings.xml since the UUID of the audio devices would have changed too.  In those situations you will need to re-select the WASAPI devices again.
Reply
#13
(2017-12-26, 15:02)damonbrodie Wrote:
(2017-05-21, 01:33)nickr Wrote: Edid is not really what I'd call a hack.
 I have the exact same setup as OP.  Always running HTPC, and an amp that I'd rather not leave on all the time.  When I used to have a pioneer amp, hardcoding in advancedsettings worked well.  When I switched to a Yamaha AVR, that became problematic.  It seems the kodi devs don't consider a more robust solution a priority, but thankfully what worked best for me is counter intuitive.

removed the entry from advancedsettings.xml and set it once to WASAPI and then it has stayed at WASAPI ever since.  Changing audio drivers in Windows, and the creators update in Windows both caused a switch back to direct sound, but they would have broken advancedsettings.xml since the UUID of the audio devices would have changed too.  In those situations you will need to re-select the WASAPI devices again. 
Same here and I don't really understand why Kodi switching to DirectX everytime I boot a PC. I turn on TV first, CEC would turn on AVR, boot PC after that CEC from PC would flip input (even if it is already there) and no WASAPI, had to manually set it back. I really doubt that's HDCP handshake as my previous AVR did not support HDCP2.0 and I didn't have it at all. Anyway I gave up that fight and flipped Windows to Test mode and set EDID, that also solved an issues with loosing 4K.
Reply
#14
Possibly wasapi is not fully ready when kodi starts.
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply
#15
(2017-12-27, 21:10)nickr Wrote: Possibly wasapi is not fully ready when kodi starts.
I was about to write up a bunch of suggestions etc, but I erased all of it because I don't have a firm understanding of how the audio interfaces are established, and re-established after initialization.

-Is the WASAPI handshake with Windows or with Kodi?  (Assuming it is with Kodi)
-I assume Kodi attempts the handshake upon startup.  What happens if the AVR is off when this happens, but is later turned on?
-If there is not currently a WASAPI connection in place when Kodi starts up media (say a movie) does it re-attempt the WASAPI connection at that time?
Reply

Logout Mark Read Team Forum Stats Members Help
WASAPI not used even when hard-coded0