sharpdx / SharpDX

SharpDX GitHub Repository
http://sharpdx.org
MIT License
1.7k stars 639 forks source link

XAudio2 can't initalize under win10 #1030

Closed mcdis closed 6 years ago

mcdis commented 6 years ago
new XAudio2();

The instance has created but DeviceCount throw exception. Version is 2.8 2.7 and 2.9 can't create (Dll not found exception). App - 64 bit Win10 10.0.14393

tridexanders commented 6 years ago

I had the same issue about Null able type must have value when trying to create new, note was using VB.net !!! but works if i revert to previous version of sharpDX audio on GIT HUB !!!1

AudioDX: Version is 2.8

App - 64 bit Win10

mikestek commented 6 years ago

I have a similar issue. If I use the default version then I get the 'Nullable object must have a value' when creating the MasteringVoice. It happens for x86 and x64, desktop and uwp. If I force 2,7 then it works on desktop.

SergeyBaryshev commented 6 years ago

Same here like mikestek said.

Some info: With 4.0.1 (previous version of SharpDX) on Win10 with Default or null parameter constructor creates AudioDX as 2.8 and on Win7 as 2.7 automatically. Now (4.1.0) it only works with 2.7 by manually.

waltdestler commented 6 years ago

Not sure if this is actually the same issue as OP's, but I too am getting the 'Nullable object must have a value' exception when creating the MasteringVoice. If anyone has a workaround without forcing 2.7, that'd be awesome. Otherwise I guess I'll have to downgrade back to 4.0.1.

ghost commented 6 years ago

@waltdestler I think it's the same. I'm also having the same problem. I had to revert to 4.0.1.

h1cks commented 6 years ago

I have also reverted back, but to 4.1.0 I believe.

munawarb commented 6 years ago

Downgrading to 4.0.1 of XAudio2 fixed the issue for me. Thanks guys for all the pointers! For the longest time I thought it was something on my end.

xoofx commented 6 years ago

Could you try with the preview version 4.2.0-ci284 just to make sure this is working? I tested it on the samples and it was, so I would like to confirm that it is fixing this issue before promoting it to 4.2.0. The 4.1.0 version of SharpDX had actually many codegen regressions and is barely usable.

ghost commented 6 years ago

Personally, 4.2.0-ci284 works for me.

h1cks commented 6 years ago

Tested my code fully on 4.0.1 and was fine. So promoted to 4.2.0-ci284 and MasteringVoice is missing the volume property. I also have installed 4.2.0 and has same issue. Volume property has disappeared since 4.0.1

h1cks commented 6 years ago

Just to add, I didnt test 4.2.0-ci284 due to the compile issues.

ghost commented 6 years ago

Yeah, keep in mind with my test, that my engine is still in pre-alpha so isn't using almost any of the audio features. So that's why I could compile it seems. My code isn't using any volume property just yet. Only the initialization works.

xoofx commented 6 years ago

Tested my code fully on 4.0.1 and was fine. So promoted to 4.2.0-ci284 and MasteringVoice is missing the volume property. I also have installed 4.2.0 and has same issue. Volume property has disappeared since 4.0.1

@jkoritzinsky maybe a regression there too?

ghost commented 6 years ago

@h1cks , are you sure that the Volumeproperty belongs into the MasteringVoiceclass? The VS's object viewer doesn't show me for 4.0.1 a Volumeproperty either. It's the Voiceclass that has one property named Volume, though.

h1cks commented 6 years ago

@SouldomainTM Can confirm that 4.0.1 has a mastering voice Volume attribute, in mastering voice there is a SetVolume but there is no volume attribute, this is actually off the inherited class "Voice" which both sourcevoice and mastering voice share. The mastering voice was the only time I was using the attribute of Volume. Confirmed its voiceclass.

ghost commented 6 years ago

@h1cks , I think you may want to make a new thread for this issue. The Volumeproperty isn't in4.2.0 preview either. There is only some SetVolume, and GetVolumemethod in Voiceclass.

jkoritzinsky commented 6 years ago

@xoofx The signature for SetVolume isn't compatible with the property generator. I'd suggest manually writing the property or just using the GetVolume and SetVolume methods until I add a feature to the property generation to account for defaulted parameters.

h1cks commented 6 years ago

I will attempt to retry the release candidate tonight. I have also discovered a side issue which I will raise as a seperate ticket.

xoofx commented 6 years ago

@xoofx The signature for SetVolume isn't compatible with the property generator. I'd suggest manually writing the property or just using the GetVolume and SetVolume methods until I add a feature to the property generation to account for defaulted parameters.

Ok, that's unfortunate that I didn't catch this during the SharpGen switch, because I would have prefer that we don't introduce API regression.

Anyway, ok, so @h1cks please use GetVolume/SetVolume instead on the new API

feliwir commented 5 years ago

I am still getting this issue with SharpDX.XAudio2 4.2.0 stable. The error message is this: DeviceCount = '_device.DeviceCount' threw an exception of type 'System.InvalidOperationException'. I get this when creating the XAudio2 device and i am crashing when the mastering voice is created.

For some reason this error only occurs in my .NET Core 2.1 console application. In my xunit test (.NET Core 2.1 aswell) this doesn't happen.