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

Author Topic: Could not open /dev/dsp, problem reproducing audio  (Read 9101 times)

0 Members and 1 Guest are viewing this topic.

m33plays

  • Newbie
  • *
  • Posts: 4
    • View Profile
Could not open /dev/dsp, problem reproducing audio
« on: January 10, 2012, 05:36:09 pm »
Hello everyone,
I'm really new to SFML and game programming, fairly new with Ubuntu, and just decent with C programming (C++ work in progress).

I installed SFML on my Ubuntu 10.10 and I successfully manage to run some tests and create my first basic version of Pong. Now...I tried to add sounds to my game simply adding after the initialization

Code: [Select]
if(!introMusic.OpenFromFile("music.ogg")){
return;
}

introMusic.Play();


When I compile I have no errors, but when I run the program the music doesn't start and I get the following message in the terminal

Quote
AL lib: oss.c:169: Could not open /dev/dsp: No such file or directory


I googled it and looked around for a solution but I couldn't find one...
The thing is that there is no /dev/dsp in my PC, so my guess is that the program is trying to open the wrong device. Maybe I didn't installed properly libsndfile and/or openal, so I tried reinstall them via Synaptic Package Manager.

Ah..all the other sounds work on my computer

Thank you in advance for any help you can give me!
Happy programming to everyone!

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Could not open /dev/dsp, problem reproducing audio
« Reply #1 on: January 10, 2012, 06:36:26 pm »
I have no idea.

Have you tried to install PulseAudio and/or ALSA?
Laurent Gomila - SFML developer

m33plays

  • Newbie
  • *
  • Posts: 4
    • View Profile
Could not open /dev/dsp, problem reproducing audio
« Reply #2 on: January 10, 2012, 08:14:02 pm »
I checked PulseAudio and it seems it's installed correctly...as soon as I can I'll try to update ALSA, I've seen that I don't have the latest version...I don't know if this can be the issue but I'll try and I'll see what happens!

m33plays

  • Newbie
  • *
  • Posts: 4
    • View Profile
Could not open /dev/dsp, problem reproducing audio
« Reply #3 on: January 11, 2012, 01:11:09 pm »
I reinstalled everything but the problem persists unfortunately...
Does anyone have other ideas? Anything I can try?

m33plays

  • Newbie
  • *
  • Posts: 4
    • View Profile
Could not open /dev/dsp, problem reproducing audio
« Reply #4 on: January 11, 2012, 03:09:36 pm »
For anyone interested, I found a solution:
For some reasons OpenAL tries to use OSS instead of ALSA (even if it generally uses ALSA and I don't have OSS support). The solution I found on this link here http://www.finiderire.com/post/2008/07/14/SFML-%3A-tout-voir-et-rien-installer is to use the alsa-oss wrapper that force the use of ALSA whenever OSS is called instead (another solution would be to recompile the kernel with the support for OSS).

Now I have a new problem though: I can launch the executable from terminal using the command
Code: [Select]
aoss ./name_program
but I can't find a way to set Eclipse to use the aoss command, in order to save time. Does anyone know if it is possible?

No, wait! I just managed to do it: in the launch configuration window, select the "Environment" table and create a new variable called LD_PRELOAD with a Value /usr/lib/libaoss.so

Everything's fine now ;)
But don't worry I think I'll need your help again pretty soon!