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

Author Topic: Problems with sf::Music  (Read 4148 times)

0 Members and 1 Guest are viewing this topic.

BlastRock

  • Newbie
  • *
  • Posts: 21
    • View Profile
Problems with sf::Music
« on: May 01, 2010, 08:37:24 pm »
Hi,

I got some huge problems with sf::Music. I tried using the code given in the SFML Audio tutorial and I encoded an ogg file with oggenc.

The result is that the program uses 100% of my CPU. I tried commenting the line Music.Play(), it doesn't change anything, the process still uses 100% of my cpu.
I have another problem that may be related, the music stops playing after a while (sometime it happens just a few seconds after it started) but it seems that Music.GetStatus() still returns Playing. Also, the program won't exit, even if I wait until the "end" of the music. I never managed to have the file played until the end.

Here is the output of the test :
g++ music.cpp -lsfml-audio -lsfml-system && ./a.out
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
music.ogg :
 278.733 sec
 44100 samples / sec
 2 channels
Playing...

I don't think the bt_audio things are related to my problem.

I'm using Ubuntu 9.10 with SFML 1.6. Any help would be appreciated.

scross

  • Newbie
  • *
  • Posts: 14
    • View Profile
Problems with sf::Music
« Reply #1 on: May 01, 2010, 08:39:54 pm »
Yeah, I think it's an ubuntu audio problem. I had the same thing and the following command fixed it:

Code: [Select]
sudo apt-get purge bluez-alsa

(from http://ubuntuforums.org/showthread.php?t=1136720&page=2 )

BlastRock

  • Newbie
  • *
  • Posts: 21
    • View Profile
Problems with sf::Music
« Reply #2 on: May 01, 2010, 08:45:39 pm »
Thanks for the reply.

Indeed, this has solved the bt_audio problem, these messages don't appear anymore, but the program still takes all my cpu and can't play the file until the end :(

BlastRock

  • Newbie
  • *
  • Posts: 21
    • View Profile
Problems with sf::Music
« Reply #3 on: May 01, 2010, 09:32:13 pm »
Okay, just solved the problem. SFML uses OpenAL which isn't configured on my system. OpenAL uses PulseAudio by default (still on my system) which seems to be the most buggy audio server ever made. Just switching to another OpenAL driver solves the problem.