Sounds don't always play

swifft

24-01-2011 17:13:33

Sounds don't always play. Hi I am working on a project where we have character dialog that needs to play. These files are ~4 seconds each. I have tried streamed, non-streamed, pre-loading, not pre-loading, .wav, and .ogg but no matter what I do sometimes these files will not play. I have roughly 20 of these files that play one at a time. It seems the first few always play correctly, but once it gets to around the 10th file they start to not play.

stickymango

26-01-2011 11:47:11

How many sources does your hardware support, it should say in the log file?

Also, are you using BOOST?

swifft

26-01-2011 14:41:40

Well I'm having some issues finding that inside the log. I see some info about OpenAL and the "types" of sounds it will support, but no info on the number of hardware channels supported that I see. I was able to fix my issue although I'm confused still about the original problem...let me explain.

At first I was trying to load all the vo at the start of the application and keep it loaded until the app closed. Unfortunately this didn't work because after the app stays open for long enough, the vo just stops playing all together. So I switched to a system that loads the vo needed per "level". When I made this switch, the sounds just stopped playing on the first run-through. I was able to fix this by creating a sound listener and checking to make sure all files had finished loading before playing them. So my issue is fixed, but I'm still curious as to why my initial implementation didn't work. Why is it that if a sound stays "loaded" too long, it becomes unusable. There may be no answer here as I have seen this same issue with other sound systems, but if anyone knows the mighty sticky will.

btw...I am using boost.

stickymango

26-01-2011 22:24:34

Hmmm, I don't see why there should be an issue, the loading/playing should be queued up to be executed as soon as possible, could you elaborate on exactly how you play the sounds in-game?

You load all sounds at the start then at pre-defined times or random intervals you play each vo in-turn? but after soo long it stops playing any sound? Are these sounds 3D or stereo? how many sounds?

The number of sources should be specified towards the bottom of the OgreOggSound log block: 'Created # sources for simultaneous sounds', this represents the number of sounds that the sound device can play or allocate to sounds simultaneously, basically if you have more sounds then sources the management drops into a round robin style handler, which uses some parameters to determine which sounds can be played at any one time.

Its possible you've identifed a bug in this system so it would be nice to replicate this and fix it, so any information describing how to replicate it would be very useful.

Glad its kind of working for you now but it sounds like a bug somewhere...

stickymango

26-01-2011 22:48:57

I tried a simple example by creating 20 short ogg sounds, creating them all up front then on a keypress launching each one in turn.

I tried thrashing through quickly playing all 20 about 4 times in a row without any issues, I also tried playing through them all with random delays over about 2-3 minutes with no problem, if you could produce a test app that would be a big help!

Thanks,

swifft

28-01-2011 14:42:07

I did a search for OgreOggSound inside the Ogre.log file and there are only three lines:

15:49:10: Loading library .\OgreOggSound
15:49:10: Installing plugin: OgreOggSound
15:49:10: MovableObjectFactory for type 'OgreOggISound' registered.

I did a search for 'Created # sources for simultaneous sounds' and got nothing.

Is there another log file that I'm missing?

stickymango

28-01-2011 14:58:08

Hmmm, odd.

Provided your Ogre LogLevel is Normal or above it should print out a chunk of info when you call init():

14:58:08: *****************************************
14:58:08: *** --- Initialising OgreOggSound --- ***
14:58:08: *** --- OgreOggSound v1.19 --- ***
14:58:08: *****************************************
14:58:08: *** --- OpenAL version 1.1
14:58:08: *** --- AVAILABLE DEVICES --- ***
14:58:09: *** --- Generic Software
14:58:09: *** --- Choosing: Generic Software (Default device)
14:58:09: *** --- OpenAL Device successfully created
14:58:09: *** --- OpenAL Context successfully created
14:58:09: *** --- SUPPORTED FORMATS
14:58:09: *** --- AL_FORMAT_MONO16 -- Monophonic Sound
14:58:09: *** --- AL_FORMAT_STEREO16 -- Stereo Sound
14:58:09: *** --- AL_FORMAT_QUAD16 -- 4 Channel Sound
14:58:09: *** --- AL_FORMAT_51CHN16 -- 5.1 Surround Sound
14:58:09: *** --- AL_FORMAT_61CHN16 -- 6.1 Surround Sound
14:58:09: *** --- AL_FORMAT_71CHN16 -- 7.1 Surround Sound
14:58:09: *** --- EFX Detected
14:58:09: *** --- 1 Auxiliary Effect Slot(s)
14:58:09: *** --- 1 Auxiliary Send(s) per Source
14:58:09: *** --- EFFECTS SUPPORTED:
14:58:09: *** --- 'Reverb' Support: YES
14:58:09: *** --- 'EAX Reverb' Support: YES
14:58:09: *** --- 'Chorus' Support: NO
14:58:09: *** --- 'Distortion' Support: NO
14:58:09: *** --- 'Echo' Support: NO
14:58:09: *** --- 'Flanger' Support: NO
14:58:09: *** --- 'Frequency shifter' Support: NO
14:58:09: *** --- 'Vocal Morpher' Support: NO
14:58:09: *** --- 'Pitch shifter' Support: NO
14:58:09: *** --- 'Ring modulator' Support: NO
14:58:09: *** --- 'Autowah' Support: NO
14:58:09: *** --- 'Compressor' Support: NO
14:58:09: *** --- 'Equalizer' Support: NO
14:58:09: *** --- FILTERS SUPPORTED:
14:58:09: *** --- 'Low Pass' Support: YES
14:58:09: *** --- 'High Pass' Support: NO
14:58:09: *** --- 'Band Pass' Support: NO
14:58:09: *** --- XRAM NOT Detected
14:58:09: *** --- EAX 2.0 Detected
14:58:09: *** --- Created 100 sources for simultaneous sounds
14:58:09: *** --- Using BOOST threads for streaming
14:58:09: *** --- Recording devices available:
14:58:09: ***--- 'Realtek HD Audio Input'
14:58:09: *****************************************
14:58:09: *** --- OgreOggSound Initialised --- ***
14:58:09: *****************************************

NOTE the section:
14:58:09: *** --- Created 100 sources for simultaneous sounds

swifft

28-01-2011 15:15:39

This is very strange. I have that section but it is missing some of the lines that you have there. For instance there is no 'Initialising OgreOggSound' header or footer. Here is what I have in my log for sound stuff:

15:49:28: *** --- AVAILABLE DEVICES --- ***
15:49:29: *** --- Generic Hardware
15:49:29: *** --- Generic Software
15:49:29: *** --- Choosing: Generic Hardware (Default device)
15:49:29: *** --- OpenAL Device successfully created
15:49:29: *** --- OpenAL Context successfully created
15:49:29: *** --- SUPPORTED FORMATS
15:49:29: *** --- AL_FORMAT_MONO16 -- Monophonic Sound
15:49:29: *** --- AL_FORMAT_STEREO16 -- Stereo Sound
15:49:29: *** --- AL_FORMAT_QUAD16 -- 4 Channel Sound
15:49:29: *** --- AL_FORMAT_51CHN16 -- 5.1 Surround Sound
15:49:29: *** --- AL_FORMAT_61CHN16 -- 6.1 Surround Sound
15:49:29: *** --- AL_FORMAT_71CHN16 -- 7.1 Surround Sound
15:49:29: *** --- EFX Detected
15:49:29: *** --- 1 Auxiliary Effect Slot(s)
15:49:29: *** --- 1 Auxiliary Send(s) per Source
15:49:29: *** --- EFFECTS SUPPORTED:
15:49:29: *** --- 'Reverb' Support: YES
15:49:29: *** --- 'EAX Reverb' Support: YES
15:49:29: *** --- 'Chorus' Support: NO
15:49:29: *** --- 'Distortion' Support: NO
15:49:29: *** --- 'Echo' Support: NO
15:49:29: *** --- 'Flanger' Support: NO
15:49:29: *** --- 'Frequency shifter' Support: NO
15:49:29: *** --- 'Vocal Morpher' Support: NO
15:49:29: *** --- 'Pitch shifter' Support: NO
15:49:29: *** --- 'Ring modulator' Support: NO
15:49:29: *** --- 'Autowah' Support: NO
15:49:29: *** --- 'Compressor' Support: NO
15:49:29: *** --- 'Equalizer' Support: NO
15:49:29: *** --- FILTERS SUPPORTED:
15:49:29: *** --- 'Low Pass' Support: YES
15:49:29: *** --- 'High Pass' Support: NO
15:49:29: *** --- 'Band Pass' Support: NO
15:49:29: *** --- XRAM NOT Detected
15:49:29: *** --- EAX 2.0 Detected


As you can see, my info ends right before it should print out the number created sources. It also says nothing about OgreOggSound or the OpenAL version.

stickymango

30-01-2011 21:47:28

The log differences are down to an inconsistency in the log detail level I've used, I've corrected that now and committed an update so you can try that to get some extra information..