Jump to content
  • Advertisement
Sign in to follow this  
plafium

OpenAL snaps, crackles, and pops

This topic is 4514 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I am making a sound manager in c++ using OpenAL. I already have streaming long OGGs working fine. The problem is at the very beginning of the song, there is always a loud POP, and the song skips a beat. I didn't worry too much when I was playing songs, but for sound effects that last a second this obviously isn't good. Does anyone else have experience with annoying pops at startup? I need to know how to get rid of the pops before I go crazy. -using gentoo linux amd64 2.6.16 -openal 20050504-r2 -using two buffers, 32768 bytes each

Share this post


Link to post
Share on other sites
Advertisement
32768 bytes per buffer is probably too much to get good interactivity for sound effects -- that's about 1/6 of a second IIRC. Try three buffers of 8192, if you need lower latency.

The pop probably comes from you not filling the buffers right. The easiest way to set up the streaming is to clear both buffers to 0, then queue both buffers, then fill each next buffer with data from the file when the buffer has played out.

Slightly less easy is to pre-fill the buffers with the first N bytes of decoded data, rather than clearing to 0. I would only try doing that after I'd gotten streaming with pre-clearing working.

Also make sure that the sound card is, generally, actually working, turned on, volume up, etc, before you start playing the sound. Some sound cards have horrible transients when turning on and off. It might be a good idea to keep playing silence when no sound is required, to avoid those artifacts.

Share this post


Link to post
Share on other sites
As it turns out, it was my linux drivers at fault. It ran without any problems on a windows machine. Although thats interesting about emptying the buffers, queueing, then filling with data, thats what I had thought of while lying in bed :)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!