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

Author Topic: crash with audio on vista/visual studio 2008  (Read 20229 times)

0 Members and 1 Guest are viewing this topic.

93interactive

  • Newbie
  • *
  • Posts: 39
    • View Profile
    • http://93-interactive.com
crash with audio on vista/visual studio 2008
« on: September 08, 2009, 09:22:49 am »
Hello,

i have tried to start playing audio samples in my game, but it crashes the application under vista / visual studio 2008 and svn branch of sfml 2.0

i have stripped everything down as much as possible, so i now have a soundfile class, that looks like this:

Code: [Select]

class SoundFile {
private:
sf::SoundBuffer buffer;

public:
sf::Sound sound;

SoundFile() {}

bool Load(const char *name);
};


i do not even have to used it, just the fact to do something like this:

Code: [Select]

class MyApp {
private:
SoundFile sound;
};


does crash the application with the following messagte:

Code: [Select]

First-chance exception at 0x76fb2f3d in MyApp.exe: 0xC0000005: Access violation reading location 0x00000044.
Windows has triggered a breakpoint in MyApp.exe.

This may be due to a corruption of the heap, which indicates a bug in MyApp.exe or any of the DLLs it has loaded.

This may also be due to the user pressing F12 while MyApp.exe has focus.


i have installed newest openal and libsndfile and copied it to the binary folder.

any ideas?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
crash with audio on vista/visual studio 2008
« Reply #1 on: September 08, 2009, 09:30:31 am »
Are you mixing debug and release configurations?

Do you use the OpenAL and libsdnfile DLLs provided in the SFML SDK?

Does this code work with SFML 1.5 or the SVN trunk?
Laurent Gomila - SFML developer

93interactive

  • Newbie
  • *
  • Posts: 39
    • View Profile
    • http://93-interactive.com
crash with audio on vista/visual studio 2008
« Reply #2 on: September 08, 2009, 10:16:11 am »
Quote from: "Laurent"
Are you mixing debug and release configurations?


i dont know where to get debug versions of openal and libsndfile, so i am currently working only in release configuration.

Quote

Do you use the OpenAL and libsdnfile DLLs provided in the SFML SDK?


tried both, versions provided by sfml and the newest from original homepages

Quote
Does this code work with SFML 1.5 or the SVN trunk?


yes, both work fine, unfortunately i need 2.0 features.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
crash with audio on vista/visual studio 2008
« Reply #3 on: September 08, 2009, 10:26:58 am »
Quote
i dont know where to get debug versions of openal and libsndfile, so i am currently working only in release configuration.

I'm just talking about SFML libraries. It makes no difference for openal and libsndfile because they are C libraries.

Quote
tried both, versions provided by sfml and the newest from original homepages

You have to use the DLLs in sfml2\extlibs (especially libsndfile which is a new version). Make sure that you don't have other versions in your systems folder (or any folder which is in the PATH).
Laurent Gomila - SFML developer

93interactive

  • Newbie
  • *
  • Posts: 39
    • View Profile
    • http://93-interactive.com
crash with audio on vista/visual studio 2008
« Reply #4 on: September 08, 2009, 11:31:47 am »
using the libs from sfml2\extlibs it still crashes. i can see in the logfile, that it loads the right libraries. one thing that makes me a bit suspicious ist, that i run a 64 bit vista, and it loads a lot of dll's from the 64 bit system directory, including for example dsound.dll

i am not a experienced windows user, but at least under linux mixing 32 bit with 64 bit is a very bad idea, could this be the problem? and if so, is there a way around?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
crash with audio on vista/visual studio 2008
« Reply #5 on: September 08, 2009, 11:43:21 am »
I don't know. But if it works with other versions of SFML, then it may not be a problem.

The only way to get more informations about the crash would be to recompile OpenAL Soft in debug and run a debugger.
Laurent Gomila - SFML developer

93interactive

  • Newbie
  • *
  • Posts: 39
    • View Profile
    • http://93-interactive.com
crash with audio on vista/visual studio 2008
« Reply #6 on: September 08, 2009, 06:26:48 pm »
well i tried for several hours now, but it seems that you need the commercial visual c++ to compile openal

if someone out there could send me a debug version of openal i could give it a try

it seems btw, that it breaks down on initializing the device

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
crash with audio on vista/visual studio 2008
« Reply #7 on: September 08, 2009, 08:43:26 pm »
Quote
well i tried for several hours now, but it seems that you need the commercial visual c++ to compile openal

Why do you say so? The commercial version of VC++ only brings MFC and a profiler.
Laurent Gomila - SFML developer

93interactive

  • Newbie
  • *
  • Posts: 39
    • View Profile
    • http://93-interactive.com
crash with audio on vista/visual studio 2008
« Reply #8 on: September 09, 2009, 05:21:16 am »
yes, and openal wants to include atlconv.h and afxres.h which seems to be part of MFC.

but as told i am a windows noob, so maybe i am just missing something.

anyway, am i the only one experiencing a crash as soon as audio comes into play on the 2.0 branch?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
crash with audio on vista/visual studio 2008
« Reply #9 on: September 09, 2009, 08:46:57 am »
Quote
yes, and openal wants to include atlconv.h and afxres.h which seems to be part of MFC.

Weird. What if you build it with MinGW?

Quote
anyway, am i the only one experiencing a crash as soon as audio comes into play on the 2.0 branch?

So far, yes.
Have you tried to find the exact revision at which the problem appeared?
Laurent Gomila - SFML developer

sfPaul

  • Newbie
  • *
  • Posts: 6
    • View Profile
the same problem
« Reply #10 on: September 17, 2009, 04:42:50 pm »
hello laurent!
i've the same problem! i can compile my program but i cannot start it. i use sfml2 of the svn repository and msvc 2008. my operating system is windows vista.
i hope you can help us with our problem!
thank you in advance!
paul

Wolfram

  • Newbie
  • *
  • Posts: 13
    • View Profile
crash with audio on vista/visual studio 2008
« Reply #11 on: September 17, 2009, 05:00:21 pm »
Hello,
I've got a similar problem.
If I make a projekt with sounds it freezes or doesn't do anything!
No window, no sounds,..., just nothing.
I tried several examples/ projects, but I've got the same problem.
I use Windows 7, MSVC2008-Express and SFML2 branch from SVN.
I tried the debug and the release SFML-dlls with debug/release compilation. (no errors, no warnings)
I use the libsndfile-1.dll and the openal32.dll from extlibs/bin.
With SFML 1.5 I've got no problems, only with SFML2 from the branch.

Wolfram

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
crash with audio on vista/visual studio 2008
« Reply #12 on: September 17, 2009, 09:12:28 pm »
Wolfram, did you check the output of std::cerr (normally the console)? Isn't there any error message?

You can also try to debug your application in order to find the point where it freezes.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Wolfram

  • Newbie
  • *
  • Posts: 13
    • View Profile
crash with audio on vista/visual studio 2008
« Reply #13 on: September 18, 2009, 12:22:38 pm »
Quote
Wolfram, did you check the output of std::cerr (normally the console)? Isn't there any error message?

Some applications starts, but the console window/sfml window/... doesn't appear!
The application doesn't do anything.
In the task manager i can see that the application runs, but that's all :(

Quote
You can also try to debug your application in order to find the point where it freezes.

I'm not very experienced in using the debugger.
But the debugger doesn't stop running, and i can't see any errors. :(
The application runs, but it doesn't do anything! (no console window, no sfml-window)
This problems I've got only with SFML2 branch from SVN.

EDIT:
I found out, that my applications runs when I link the static sfml-libs.
But if I use the dynamic ones, it doesn't work.
I don't understand it^^

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
crash with audio on vista/visual studio 2008
« Reply #14 on: September 18, 2009, 03:17:09 pm »
Did you link the SFML and CRT (c-runtime) libraries correctly?

You should get used to the debugger because it is a very powerful tool. A good debugger can save you hours of desperation. The one of MSVC++ lets you see the runtime state of your application, read the variable's values, step statement by statement throught the code, set up conditional breakpoints, and a lot more.

Compile your project in debug mode. Place breakpoints early in your code (at the beginning of main() or even earlier, if you use static/global objects which are initialized before main()) by clicking left to the code line - a red sphere will appear. Then press "start debugging" (the green triangle) and check whether your breakpoint is reached. You can experiment a while, maybe you can use console outputs additionally.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development: