OpenAL and Vista: the device is always "universal software",

I write the audio part of the game and I use OpenAL. I want to use some extensions, but tests always fail:

TRACE: AudioManager - Sound device: 'Generic Software' TRACE: AudioManager - Enabling OpenAL extensions... TRACE: AudioManager - Compressor support: NO TRACE: AudioManager - Reverb support: YES TRACE: AudioManager - Chorus support: NO TRACE: AudioManager - Distortion support: NO TRACE: AudioManager - Echo support: NO TRACE: AudioManager - Flanger support: NO TRACE: AudioManager - Frequency shifter support: NO TRACE: AudioManager - Vocal morpher support: NO TRACE: AudioManager - Pitch shifter support: NO TRACE: AudioManager - Ring modulator support: NO TRACE: AudioManager - AutoWAH support: NO TRACE: AudioManager - Equalizer support: NO TRACE: AudioManager - EAX Reverb support: YES 

This is because I only get the Generic Software driver, which only supports reverb and EAX reverb. And not only in my car, but also in others.

Here's how I define drivers for OpenAL:

 ALchar device[256]; ZeroMemory(device, 256); if (alcIsExtensionPresent(NULL, "ALC_ENUMERATE_ALL_EXT")) { strcpy_s(device, 256, alcGetString(NULL, ALC_ALL_DEVICES_SPECIFIER)); } else if (alcIsExtensionPresent(NULL, "ALC_ENUMERATION_EXT")) { strcpy_s(device, 256, alcGetString(NULL, ALC_DEVICE_SPECIFIER)); } TRACE_AUDIOMANAGER("Sound device: '%s'", device); g_System = alcOpenDevice(device); 

According to the specification, the device specifier should return two drivers: "Generic Hardware" and "Generic Software", separated by a NULL terminator.

My sound card is an NVIDIA High Definition Audio device that uses the nvhda32v.sys driver (version 1.0.0.63, updated 11-11-2009).

Why doesn't OpenAL detect my hardware?

+4
source share
4 answers

OpenAL should always return the default sound device, unless you are using a Creative sound card. All extensions are Creative specific. It is also expected to get the OpenGL extension for Intel on the NVIDIA graphics card.

For the record here, how you installed OpenAL:

 // create a default device ALCdevice* device = alcOpenDevice(""); if (!device) { LOG_ERROR("Could not create OpenAL device."); return false; } // context attributes, 2 zeros to terminate ALint attribs[6] = { 0, 0 }; ALCcontext* context = alcCreateContext(device, attribs); if (!context) { LOG_ERROR("Could not create OpenAL context."); alcCloseDevice(device); return false; } if (!alcMakeContextCurrent(context)) { LOG_ERROR("Could not enable OpenAL context."); alcDestroyContext(context); alcCloseDevice(device); return false; } LOG_INFO("[OpenAL] Version: %s", alGetString(AL_VERSION)); LOG_INFO("[OpenAL] Vendor: %s", alGetString(AL_VENDOR)); LOG_INFO("[OpenAL] Renderer: %s", alGetString(AL_RENDERER)); 
+2
source

are you sure check the following line because alcGetString(NULL, ALC_DEVICE_SPECIFIER) returns a string array, try like this:

 char* devices = (char*)alcGetString(NULL, ALC_DEVICE_SPECIFIER); while(devices && *devices !=NULL) { ALCdevice* device = alcOpenDevice(devices); ... ... devices += strlen(devices) + 1; //next device } 
+1
source

for those who are still looking for a way to get all the devices // except for output - stil generic, works for well input //

public: int * CHECK_DEVICES_IN (int MAX_DEVICES) {int devices = 0; char * device [MAX_DEVICES]; int checked = 0; while (devices & lt; = MAX_DEVICES && checked} checked ++;} return devices; / * int return = 0; while (returned

  public:ALchar* DEVICES_IN(int REQUIRED) { ALchar* result="0"; ALchar* device=(ALchar*)alcGetString(NULL,ALC_CAPTURE_DEVICE_SPECIFIER); int POS=0; while(device && device!=NULL && strlen(device)>0 && POS<=REQUIRED) { if(POS==REQUIRED) { result=device; } device+=strlen(device)+1; POS++; } return result; } 
+1
source

Source: https://habr.com/ru/post/1308044/


All Articles