When running my audio application, ported from Windows, on Ubuntu Virtualbox, it reports the following:
Devices found:
OpenAL Soft
OpenAL Soft 40964 in alcOpenDevice: AL_INVALID_OPERATION
The line it runs on:
ALCdevice device = alcOpenDevice( NULL ); // Also tried "OpenAL Soft"
Ubuntu audio is working properly. What am I missing?
CMakeLists:
target_link_libraries( ${PROJECT_NAME}
"myengine"
"openal"
)
I installed libopenal1 on the target VM
Apparently, the
alGetError()will return this error before a context is created. Starting fromalcMakeContextCurrent()I can use this function to check for errors.It now plays audio!
So for
alcOpenDevice()andalcCreateContext()I had to comment out thealGetError()error checking. Though I could still check whether the device was opened successfully usingif( !device )