• 1
  • 2(current)
  • 3
  • 4
  • 5
  • 7
[WINDOWS] Any possibility of adding WASAPI support?
#16
i've spent some of this afternoon trying to build this version.

i'm no computer guru, but i got it built, and it works great!

now i can use prologicII etc, with LPCM output.

thanks for spending time on this ArtVandelae!!
Reply
#17
Damn. How did I miss this thread?

DSPlayer + WASAPI = XBMC for Windows nirvana.
Reply
#18
Mallet21 Wrote:Damn. How did I miss this thread?

DSPlayer + WASAPI = XBMC for Windows nirvana.

dsplayer is independant to the built in dvdplayer, the work ArtVandelae has done is for the inbuilt dvdplayer.

to get wasapi support in dsplayer use reclock as your audio renderer.

edit - http://rapidshare.com/files/317112532/XB...i.rar.html

it works for me, if it doesnt work for you, please do not submit bug reports.

mods, feel free to delete the link.



edit2 - i've used this for a couple of days. i've had no issues whatsoever, this is a cracking addition to xbmc. it really is worth putting in at some point.
Reply
#19
How do you set it up? I ouldn figure out where to set the output. some xml or in the settings menu?
Reply
#20
chumaj001 Wrote:How do you set it up? I ouldn figure out where to set the output. some xml or in the settings menu?

Ditto. I'd really appreciate a quick guide.
Reply
#21
the advanced settings.xml already has the correct config in it. should be up and running from the .rar

i only output lpcm over hdmi, i test wasapi by playing a 5.1 film it shows 5.1 on my amp, and when i play a stereo source, it shows "pro logic II Movie". this (at least for me) only happens with wasapi output.
Reply
#22
I'm glad to hear that it is working for others.

A few notes:
  • Once activated in the advancedsettings.xml file the WASAPI output module will use the audio device specified in the audio setup dialog.
  • WASAPI can only work if the output sample rate and channel count is supported directly by the hardware. If it encounters an unsupported audio format it falls back to DirectSound.
  • WASAPI is capable of bit-perfect output but at this point XBMC converts all 24 and 32 bit audio to 16 bits in the DVDPlayer and PAPlayer cores. As a result formats such as 24 or 32 bit FLAC and Dolby TrueHD are technically not passed through untouched.
Reply
#23
thanks for the info. i did notice that my 24bit files come out as 16bit.

and a big thanks for taking the time to code it!
Reply
#24
i'm trying to apply your patch to SVN version 25500, but i get "1 failed" and some errors when doing it.

does that now mean the patch is too old, or am i missing something?

the errors i see are these:

..\..\xbmc\AdvancedSettings.h(95) : error C2086: 'bool CAdvancedSettings::m_audioEnableWASAPI' : redefinition
3> ..\..\xbmc\AdvancedSettings.h(94) : see declaration of 'CAdvancedSettings::m_audioEnableWASAPI'

which from a quick google means that something is being declared twice? have i done something wrong with the patch?
Reply
#25
If you already patched the source and then did an SVN update operation the changed code should have already been merged in. By reapplying the patch you basically double-patched it and wound up with some duplicated code.

The only suggestions I have are to either look at the errors and remove the offending lines or to revert the merged files and re-patch.
Reply
#26
ArtVandelae Wrote:If you already patched the source and then did an SVN update operation the changed code should have already been merged in. By reapplying the patch you basically double-patched it and wound up with some duplicated code.

The only suggestions I have are to either look at the errors and remove the offending lines or to revert the merged files and re-patch.

ok, thanks for assisting, so its working good your end?

i redownloaded the svn, patched it, and it builds ok. last time i used the "win32buildsetup". how do i get a gl build?

edit2 - thanks! i got it going again, i didnt realise you only needed to patch once.
Reply
#27
problems again!

25538 - http://rapidshare.com/files/321158476/XB...x.exe.html
25717 - http://rapidshare.com/files/321158723/XB...x.exe.html

25538 works, 25717 gives:

Code:
#
10:00:52 T:5100 M:2653167616    INFO: AudioRendererFactory:  not a explicit device, trying to autodetect.
#
10:00:52 T:5100 M:2653085696   ERROR: CWin32WASAPI::InitializeCould not allocate WASAPI device enumerator
#
10:00:52 T:5100 M:2653081600   ERROR: CWin32WASAPI::Initialize: WASAPI initialization failed.
#
10:00:52 T:5100 M:2652823552   DEBUG: CAudioContext::SetActiveDevice - SetActiveDevice from 1 to 2
#
10:00:52 T:5100 M:2652659712   DEBUG: CAudioContext::RemoveActiveDevice - Removing device 1

full log - http://pastebin.com/m4b6faef

Not sure whats gone wrong, compiles fine, just gives that error. gonna get a fresh download of source later, give it another go.
Reply
#28
neil.j1983 Wrote:problems again!

25538 - http://rapidshare.com/files/321158476/XB...x.exe.html
25717 - http://rapidshare.com/files/321158723/XB...x.exe.html

25538 works, 25717 gives:

Code:
#
10:00:52 T:5100 M:2653167616    INFO: AudioRendererFactory:  not a explicit device, trying to autodetect.
#
10:00:52 T:5100 M:2653085696   ERROR: CWin32WASAPI::InitializeCould not allocate WASAPI device enumerator
#
10:00:52 T:5100 M:2653081600   ERROR: CWin32WASAPI::Initialize: WASAPI initialization failed.
#
10:00:52 T:5100 M:2652823552   DEBUG: CAudioContext::SetActiveDevice - SetActiveDevice from 1 to 2
#
10:00:52 T:5100 M:2652659712   DEBUG: CAudioContext::RemoveActiveDevice - Removing device 1

full log - http://pastebin.com/m4b6faef

Not sure whats gone wrong, compiles fine, just gives that error. gonna get a fresh download of source later, give it another go.
What is happening is that when Directsound fails or simply isn't initialized for whatever reason the COM interface needed by WASAPI isn't being initialized (Directsound does a CoInitialize() call which otherwise isn't made elsewhere in the program) and thus the call to CoCreateInstance fails resulting in the above error.

This can be fixed by adding a CoInitializeEx/CoUnintialize pair. They need to be in the main thread as adding them only to the WASAPI class can cause problems if the thread that created the audio sink is terminated while the WASAPI interface is still active. I uploaded a new patch that addresses the issue. For now I just put the COM setup/teardown calls in the XBMC_PC.cpp file in the WinMain function to make absolutely sure that COM is initialized before the main application loop starts and that it isn't uninitialized until the program is ready to exit after everything else has shut down. It also seemed to be the natural location for global Windows specific initialization code. If anyone knows of a better place to put these calls please let me know and I will immediately move them.

As an aside, this should also fix issues with the interface sounds occasionally going silent after video or audio playback using WASAPI.
Reply
#29
ArtVandelae:

Am I correct in stating that it XBMC will either use this or DirectSound ? If yes, should this be selectable Gui Setting .. ie Audio Render instead of advancedsettings ..
The normal XBMC log IS NOT a debug log, to enable debug logging you must toggle it on under XBMC Settings - System or in advancedsettings.xml. Use XBMC Debug Log Addon to retrieve it.
Reply
#30
CrashX Wrote:ArtVandelae:

Am I correct in stating that it XBMC will either use this or DirectSound ? If yes, should this be selectable Gui Setting .. ie Audio Render instead of advancedsettings ..

If the setting is enabled it will use WASAPI if possible. WASAPI outputs the raw audio stream without resampling or mixing so if your hardware (sound card, receiver, etc...) doesn't support the sample rate or number of channels of your media it will fall back to Directsound so the audio will still play.

I ultimately decided against adding a menu option to toggle this since I initially thought that it would only be really beneficial to a small minority of users who, like me, ran HDMI audio to a receiver. If, however, it turns out to be useful to more than a small niche of people it wouldn't be too much trouble to make it a menu item that can be toggled.
Reply
  • 1
  • 2(current)
  • 3
  • 4
  • 5
  • 7

Logout Mark Read Team Forum Stats Members Help
[WINDOWS] Any possibility of adding WASAPI support?0