Skip to main content
GameDev.net gamedev.net
🔒 Locked

OpenAL Linux No Sound

Started by ProvenDantheman Mar 11, 2013 at 8:08 PM 3 replies 2k views
Original Post
ProvenDantheman
ProvenDantheman

Hello, I've been trying to program basic sound in linux with OpenAL. However, when I compile the code and run, I get no sound. I've linked to lopenal and lalut.

When I compile using this code, I get an error in the console that says dev/dsp can't be found...



alutInit(&argc, argv);
ALuint buffer = alutCreateBufferHelloWorld();
ALuint source; alGenSources(1, &source);
alSourcei(source, AL_BUFFER, buffer);
alSourcePlay(source);
return(0);
_paf
_paf

I use OpenAL, but i'm not familiar with alut, and the alutCreateBufferHelloWorld() function, but i'm assuming that it creates a buffer, and loads an existing audio clip in it, so the error might be because that audio clip doesn't exist.

Do you have a "dev/dsp" folder with whatever audio file the application opens?

Honestly i don't think the function creates a sound on the fly, but loads an external clip, perhaps from the OpenAL framework?

Basically make sure the folder and whatever file it's needed exists in your computer, and it should work... I think...

Bacterius
Bacterius

/dev/dsp isn't a folder but a virtual device for processing audio under Linux. This likely means that while you've got the OpenAL headers and library, you're missing the actual OpenAL driver. What audio provider are you using? ALSA? PulseAudio? Something else?

“If I understand the standard right it is legal and safe to do this but the resulting value could be anything.”
ProvenDantheman
ProvenDantheman

I'm fairly certain I'm using the most up to date version of pulse.

ProvenDantheman
ProvenDantheman

I'm about to explode. This problem is hindering me from getting anything done angry.png I ran the command openal-info. This is my output...

Available playback devices:
!!! none !!!
Available capture devices:
!!! none !!!
Default playback device:
Default capture device:
ALC version: 1.1

!!! Failed to open default device !!!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.