Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Crashing after "Failed to open the audio device".  (Read 6759 times)

0 Members and 1 Guest are viewing this topic.

drpitch

  • Newbie
  • *
  • Posts: 18
    • View Profile
Crashing after "Failed to open the audio device".
« on: June 28, 2009, 02:07:09 pm »
Hi all,

Sometimes I'm getting a "Failed to open the audio device" message on the console output when I run my application using SFML. After that message, the application crashes.

Source code lines of my app thatares using audio SFML commands are:
Code: [Select]

m_sound_buffer = new sf::SoundBuffer();
if(!m_sound_buffer->LoadFromFile(GetConfigFile()->GetDataPath() + "mig.ogg"))
{
  return;
}
m__sound = new sf::Sound(*m_sound_buffer, true);


Console output:
Failed to open the audio device
An internal OpenAL call failed in soundbuffer.cpp (46) : AL_INVALID_OPERATION, t
he specified operation is not allowed in the current state
An internal OpenAL call failed in soundbuffer.cpp (300) : AL_INVALID_OPERATION,
the specified operation is not allowed in the current state
An internal OpenAL call failed in sound.cpp (51) : AL_INVALID_OPERATION, the spe
cified operation is not allowed in the current state
An internal OpenAL call failed in sound.cpp (53) : AL_INVALID_OPERATION, the spe
cified operation is not allowed in the current state
An internal OpenAL call failed in sound.cpp (54) : AL_INVALID_OPERATION, the spe
cified operation is not allowed in the current state
An internal OpenAL call failed in sound.cpp (55) : AL_INVALID_OPERATION, the spe
cified operation is not allowed in the current state
An internal OpenAL call failed in sound.cpp (56) : AL_INVALID_OPERATION, the spe
cified operation is not allowed in the current state
An internal OpenAL call failed in sound.cpp (57) : AL_INVALID_OPERATION, the spe
cified operation is not allowed in the current state

Stack frame:
openal32.dll!00b8c5eb()
[Frames below may be incorrect and/or missing, no symbols loaded for openal32.dll]
openal32.dll!00b8ba5c()
kernel32.dll!7c80b729()

Error message:
Unhandled exception at 0x00b8c5eb in app.exe: 0xC0000005: Access violation reading location 0x00000000.

I guess that application crashes because it can't initalize the audio device, but my application doesn't realize of the error and then tries to load the .ogg file. How could I know if my audio device is initalized properly or not??

Thanks!

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Crashing after "Failed to open the audio device".
« Reply #1 on: June 28, 2009, 03:06:51 pm »
This error shouldn't happen, you probably have something wrong in your configuration. What OS are you using? How did you install OpenAL?
Laurent Gomila - SFML developer

drpitch

  • Newbie
  • *
  • Posts: 18
    • View Profile
Crashing after "Failed to open the audio device".
« Reply #2 on: June 28, 2009, 04:22:10 pm »
Hi Laurent,

I'm using Windows XP and Visual Studio 2008 (C++).

Hum..about how I installed OpenAL, I really don't remember exactly, since installed it  some months ago, but taking a look at the dll files I see that:
1) I've got libsndfile-1 and openal32.dll on the executable folder of my application (I just copied the files from the extlibs folder of SFML SDK). I followed thet Tutorial "Getting started - SFML and Visual Studio").

2) I've taken a look to the installed applications from "Add or remove applications" of Control Panel and I see that there's also installed OpenAL....There's a openal32.dll on c:\windows\system32 folder with a different size that the one located on my application folder...

Maybe the problem is there, although I don't know if dll files of my application folder are ignored...How should OpenAL be installed??

Thanks for your time.

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6286
  • Thor Developer
    • View Profile
    • Bromeon
Crashing after "Failed to open the audio device".
« Reply #3 on: June 28, 2009, 07:22:17 pm »
See here: http://www.sfml-dev.org/forum/viewtopic.php?t=822

I guess downloading OpenAL and libsndfile again and reinstalling them might help.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

drpitch

  • Newbie
  • *
  • Posts: 18
    • View Profile
Crashing after "Failed to open the audio device".
« Reply #4 on: June 28, 2009, 07:36:44 pm »
Thanks, I'll try it and post back with the results ;)

OniLinkPlus

  • Hero Member
  • *****
  • Posts: 500
    • View Profile
Crashing after "Failed to open the audio device".
« Reply #5 on: August 30, 2009, 10:16:58 am »
I'd just like to say that although I'm not getting this error, my friend is getting it when he tries to run the exact same Application. Yes, I sent him all of the files and DLLs. As soon as he runs the program, it crashes and the Console says "Failed to open the Audio Device". He's running Vista and I'm running Win7, and he just updated all of his drivers and it still doesn't work. The Application uses the Static Version of the latest build of SFML2. I tried replacing the DLLs, and it still doesn't work for him.
I use the latest build of SFML2

CodingMadeEasy

  • Newbie
  • *
  • Posts: 38
    • MSN Messenger - petetheheat_represent@msn.com
    • AOL Instant Messenger - 622+Amaretto+Ave
    • Yahoo Instant Messenger - petetheheat_baller@yahoo.com
    • View Profile
    • http://www.youtube.com/CodingMadeEasy
Crashing after "Failed to open the audio device".
« Reply #6 on: February 02, 2011, 10:48:40 pm »
I know this post is over a year old but just so people in the future can see how to solve this problem I'll post it here. What you have to do is copy all those .dll files to your debug folder.  I had the same problem and I just did that and it works now. It sometimes says failed to load audio device but when I run it immediately after it runs fine with the sound and everything! :D

So I hope that this helps anybody who happens to see this in the future