Juce Audio Not Working on Vista

I couldn’t find specific posts in previous threads–just posts on horror stories intalling vista, but I finally bit the bullet, installed Vista on a second drive to get a clean installation, and tried my app. On Windows XP, AudioDeviceManager::getCurrentAudioDevice always returned something, defaulting to the default device. So, I assumed it would on Vista, but it just returns 0. This is my mistake, but before fixing it, I tried the Juce demo app to make sure audio was working.

The graphics parts of the Juce demo app run ok (including OpenGL), but as soon as you go to the audio section, it pops a message box that says: “Couldn’t open an output device” on the first line, “Error opening Primary Sound Capture: ‘No Driver’” on the second line. I opened the device manager and found no devices selected, so apparently Vista doesn’t have the idea of a default audio device. Anyway, I selected an output device but was unable to select an input device, receiving the same message box as before minus the “Couldn’t open an output device” line. It also reset the output device to no device selected. However, I was able to get audio from the test button if I didn’t attempt to set an input device.

I then tried playing an Aiff file, which appeared to work, but there was no audio. I then installed ASIO4All and reran the demo app. The device manager showed “not connected” for the input channels and no sound played when the test button was pushed. The ASIO4ALL control panel would sometimes show the device as working, sometimes as not, and sometimes as “beyond logic”.

Does anyone have any ideas on what’s going on or how to get audio working on Vista? For my part, I’m going to try some external audio devices and see if I can make any headway.

I just installed the Novation X-Station drivers and set it as the default device. Audio worked fine. I then tried to set the default device back to the primary device (internal audio). I could do this for the output but not the input because it was inactive. It turns out that the internal input is only active if something is actually plugged in. Once I plugged in something, I could get the Juce demo to work using the internal audio. My guess is that playback in the demo mixes incoming audio with that from the file and since the input device was inactive in the tests described in the previous post, attempting to read them prevented the playback from outputting any sound. The reason the test button worked in the device manager was probably because no attempt was made to read incoming audio.

Well at least I found a bug in my program that hidden by a reasonable OS. Vista’s requirement that you have to plug something into the microphone input before it’s considered active was probably done to cut down on noise when nothing’s plugged in, but it’s sure gonna break some apps.

Are you using the svn tip for this?

No, it was version 597. I just tried the current tip (version 718) and it works fine with input disabled.