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

Author Topic: Problems on Windows XP with SFML2 audio  (Read 6785 times)

0 Members and 1 Guest are viewing this topic.

easy

  • Full Member
  • ***
  • Posts: 146
    • MSN Messenger - easy82.contact@gmail.com
    • View Profile
    • Email
Problems on Windows XP with SFML2 audio
« on: September 22, 2011, 11:08:05 am »
Hi!

I've got some Windows XP related problems.

The same version of SFML2 was compiled and installed on Windows XP and on Linux with no problems.

I have compiled my game on Windows, and added the neccessary .dlls: libsndfile-1.dll and openal32.dll, along with the sfml dlls.


A) First of all, it did not load any of my .ogg files (so I have later converted them to .wav). The output of the console was:



Here's a 'corrupt' sound file:

https://legacy.sfmluploads.org/file/65

This only happens on Windows, on Linux it's just fine.
Note that this particular problem was on VirtulaBox!


B) Still on VirtulaBox, sounds are converted to .wav, works both on Windows and on Linux, but on Windows, exiting the program throws this:




C) On a real (non-VirtualBox) Windows XP, starts up fine, but there's no sound. Console output: "Failed to open the audio device". It does not crash on exit as in B).


The most important part for me is part C) the audio not playing on Windows.
Can you help me?

Thanks in advance,
easy

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Problems on Windows XP with SFML2 audio
« Reply #1 on: September 22, 2011, 11:45:59 am »
Quote
The most important part for me is part C) the audio not playing on Windows.
Can you help me?

This error is triggered when no audio device was found, which basically means that your audio is globally broken. I guess it's not true, otherwise you would already have noticed it ;)

Are you sure that it's the openal32.dll file from SFML which is used? For example, you could have another version in C:/Windows/System32.
Laurent Gomila - SFML developer

easy

  • Full Member
  • ***
  • Posts: 146
    • MSN Messenger - easy82.contact@gmail.com
    • View Profile
    • Email
Problems on Windows XP with SFML2 audio
« Reply #2 on: September 22, 2011, 12:51:40 pm »
Quote from: "Laurent"
This error is triggered when no audio device was found, which basically means that your audio is globally broken. I guess it's not true, otherwise you would already have noticed it


Yes, I've got sound otherwise :)

Quote from: "Laurent"
Are you sure that it's the openal32.dll file from SFML which is used? For example, you could have another version in C:/Windows/System32.


What do you mean? Is there an openal32.dll somewhere that comes with SFML?

Edit:
All right, Magic Man, with your versions of the .dlls, the game has sound!
Thank you! I wasn't aware of these libraries! :)

Just to report: it still crashes on exit, and it seems like playing many sounds simultaneously drop the FPS pretty much, and therefore the game lags. I have to investigate the latter more, since it might be the std::vector I'm using for storing temporary sounds... (although it does not happen on Linux)

easy

  • Full Member
  • ***
  • Posts: 146
    • MSN Messenger - easy82.contact@gmail.com
    • View Profile
    • Email
Problems on Windows XP with SFML2 audio
« Reply #3 on: September 24, 2011, 11:48:06 am »
Could someone please try to play this .OGG file with SFML on Windows?
https://legacy.sfmluploads.org/file/65

It says it's 'malformed', but not on Linux.

easy

  • Full Member
  • ***
  • Posts: 146
    • MSN Messenger - easy82.contact@gmail.com
    • View Profile
    • Email
Problems on Windows XP with SFML2 audio
« Reply #4 on: September 27, 2011, 04:27:39 pm »
Hi Laurent!

Still no avail:

I've tried .OGG, .FLAC files also, different Audacity versions, an other .OGG file but SFML2 does not play them. Reasons:





Here's an independent sample .OGG file.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Problems on Windows XP with SFML2 audio
« Reply #5 on: September 27, 2011, 09:23:20 pm »
That's really bad because SFML uses libsndfile which uses the official Ogg/Vorbis library (libvorbis, at xiph.org).
Laurent Gomila - SFML developer

easy

  • Full Member
  • ***
  • Posts: 146
    • MSN Messenger - easy82.contact@gmail.com
    • View Profile
    • Email
Problems on Windows XP with SFML2 audio
« Reply #6 on: September 28, 2011, 04:35:05 pm »
I've just tried it out on a non-VirtualBox WindowsXP, and it was disappointing.

I've made 3 versions of the .exe, one for each music file type: OGG, FLAC, WAV.

The .OGG and .FLAC versions of it does not even start, constole message starts with "Failed to..." something, but it's too fast to read or to capture.

The .WAV version starts, but lags like hell, it's like 1-5-10 FPS, and the music does not play.

I've just installed M.A.R.S. which also uses SFML2, and has .OGG music, and here all the music and sounds plays well, so I don't know what's going wrong, I need to check their sources (and mine).

easy

  • Full Member
  • ***
  • Posts: 146
    • MSN Messenger - easy82.contact@gmail.com
    • View Profile
    • Email
Problems on Windows XP with SFML2 audio
« Reply #7 on: September 28, 2011, 05:05:10 pm »
I can see no magic in their code, and I aslo can't see problems about mine:

What I do is, I open the music, set to loop, and play it.

I think I contact them, maybe they tell me what's the trick.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Problems on Windows XP with SFML2 audio
« Reply #8 on: September 28, 2011, 05:22:54 pm »
Do you mean that their OGG files don't work with your code?
Laurent Gomila - SFML developer

easy

  • Full Member
  • ***
  • Posts: 146
    • MSN Messenger - easy82.contact@gmail.com
    • View Profile
    • Email
Problems on Windows XP with SFML2 audio
« Reply #9 on: September 28, 2011, 05:33:32 pm »
Yes, I've just tried their "menu.ogg" out, the file is malformed, according to the console.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Problems on Windows XP with SFML2 audio
« Reply #10 on: September 28, 2011, 05:34:15 pm »
Weird. So they use a recent revision of SFML 2?
Laurent Gomila - SFML developer

easy

  • Full Member
  • ***
  • Posts: 146
    • MSN Messenger - easy82.contact@gmail.com
    • View Profile
    • Email
Problems on Windows XP with SFML2 audio
« Reply #11 on: September 28, 2011, 05:42:08 pm »
I guess not! But I've sent them a mail, we'll find out. BTW, I use this version: LaurentGomila-SFML-a647c68, which I've downloaded on 09. 14.

Edit: their version was compiled on 04. 26.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Problems on Windows XP with SFML2 audio
« Reply #12 on: September 28, 2011, 05:54:02 pm »
Can you try with the same version as them?
Laurent Gomila - SFML developer

easy

  • Full Member
  • ***
  • Posts: 146
    • MSN Messenger - easy82.contact@gmail.com
    • View Profile
    • Email
Problems on Windows XP with SFML2 audio
« Reply #13 on: September 28, 2011, 06:27:57 pm »
I did but back then there were no soundbuffer... arg! So evidently, it does not run even with their dlls. I'm gonna make a buit with no sounds but music!

Edit: ok, I've tried it, but then also the texture worked elsehow, because now it has problems with textures. I guess I should go with a minimal example instead.

easy

  • Full Member
  • ***
  • Posts: 146
    • MSN Messenger - easy82.contact@gmail.com
    • View Profile
    • Email
Problems on Windows XP with SFML2 audio
« Reply #14 on: September 28, 2011, 07:00:16 pm »
All right, the minimal example worked fine with the dlls compiled by me, so it turned out that my game was still using somehow an other version of openal or libsndfile. Now I've copied these dlls into all the folders, and voilá! It works! :)

 

anything