AudioDeviceManager problems since upgrading to windows 10

Hi everyone,


So i've been working on a project with a group of people for a while now. Absolutely love Juce but i seem to have hit a problem since upgrading to windows 10. It seems that everytime an AudioDeviceManager function is called Visual Studio triggers a breakpoint because of an access violation. This happens whenever getCurrentAudioDevice() is called. It's strange, however, as this had not occurred at all until the upgrade. Any help would be greatly appreciated.

Is audio working for you in other (not JUCE) apps in general in Windows 10? I recently had an issue where my Windows update broke my audio drivers and spent a half an hour debugging why getCurrentAudioDevice was returning a nullptr. It simply didn't have any audio devices to return. Also, if you are initializing the AudioDeviceManager from a saved state (for example from your preferences file) then make sure that selectDefaultDeviceOnFailure is true when calling initialise (as the audio device name may have changed).

Strangely it is working in all other applications. Me and a colleague have been debugging and running a test application to try and figure it out. So far when running :


the availableDeviceTypes shows "windows audio" and further examination displays the right device (realtek...)

but for some reason the currentAudioDevice always reads as null

specifically: _vfptr is showing <unable to read memory>


Thankyou for getting back to me so quickly. Still running lots of tests to try and figure this out.


EDIT:  selectDefaultDeviceOnFailure is indeed set to true

Just out of interest. I have managed to get things to work within the juce demo. BUT only because I am manually selecting the device in the deviceSelectorComponent of the Audio Settings juce demo.

Came up with a temporary solution. I now have an audioDeviceSelectorComponent at startup. Atm everything seems to be working fine again. Thanks once again for your speedy reply Fabian. Was really appreciated. Still very unsure as to why it wasn't automatically selecting the output but this will do fine for now.

Can you see which device it's trying to select by default just after launching the application?

So with windows audio (which devicemanager is selecting) the output is automatically setting to none. If i select direct sound however it is selecting a default output as Realtek... as it should.

Also with windows audio I get no sound coming through the speakers; even with an output device selected.

Matt - have you set your default audio device for Windows since upgrading? All my audio apps were failing until I removed missing devices and set Realtek as the default device.

Weirdly, my JUCE app bombed the first time I ran it,  but was OK on subsequent attempts.

Indeed I have. Listed correctly under services also. Can't figure this out for the life of me.

I have the same problem on a thinkpad w520 I upgraded to win10 with a conexant 20672 smartaudio hd card. I think it's related to drivers. With the lenovo driver I get crashes with all applications using wasapi. They report samplerate 0.

With the driver win10 installs by itself, most applications work and report the correct samplerate, but JUCE applications do not. The default audio application does not launch and I get this debug output: "Couldn't open the input device" on an assert in AudioAppComponent::setAudioChannels.

Juce Demo launches, but as soon as I try to select an audio input or output I get "Error opening Primary Sound Driver: "Unknown error: -2147023170""

Any help would be greatly appreciated. I'll try some more laptops in the meantime.

Ok I finally was able to work around the problem after googling some more (as usual 5 min after posting on the JUCE forum :P ). After reading about disabling windows 10 audio enhancements I went back to the much newer lenovo driver. Then in the windows playback & recording devices configuration window, I disabled all audio enhancements. On the output it's an independent "enhancements" tab while for the input the switch is part of "advanced". This allow JUCE applications to work correctly.

I have no idea whether this is a bug in windows 10, a bug in the driver(s) or a problem in JUCE, but for my development purposes, this workaround is fine. Distributing a standalone JUCE audio application on windows 10 might be problematic however right now. On the lenovo forums I saw that this problem affects a large number of lenovo laptops sharing the same hardware.