0
0

Hey all,

I have a rather strange problem, which is proving very difficult to track down. 99% of our samples are playing perfectly but the 1% that don’t are confusing me to the brink of insanity.

First a bit about how I’ve implemented FMOD into our project:

We create only one system.

All 3D sounds are loaded into memory as FMOD_HARDWARE | FMOD_3D with createSound()

We play 3D sounds paused with playSample() & FMOD_CHANNEL_FREE, then set their position in the world and unpause them.

The Listener position is set every frame to our camera’s position and orientation – no velocities are use in the project.

Now for the problem, imagine a line of collectable items all with sounds attached to them which get played as they are collected. 99% of the time it works flawlessly, but every now and then (seemingly when I can’t be bother trying to track down the bug anymore) one or two of the sounds won’t play.

All these items share the same sound sample
All the positions appear to be correct
The listener position appears to be correct
There’s plenty of free channels left to be used
and FMOD doesn’t report an error when trying to play the sample.

I’m running out of ideas on what may cause this, so I thought I’d ask to see if anyone have any insight on what might cause this. Oh I almost forgot to mention we’re using version 4.04.06.

Thanks in advance for any help. Now to go back to bug tracking…

  • You must to post comments
0
0

I am already calling System::setHardwareChannels before System::init, but I am calling it like this:

[code:2mk0dizo] System::setHardwareChannels(16,16,16,16)[/code:2mk0dizo]

I will make the change and see if that effects anything, also just to reiterate – during my tests I am only loading in one sound and trying to play it multiple times.

  • You must to post comments
0
0

hi,
What format are the sounds that you loaded? How many virtual voices have you set in System::init?
Are you checking error codes on most commands just in case one of them has failed? I’m not sure why myself, but it could be either a bad value being passed in or some sort of resource running out.
Can you print out the channel handle value each time to see if there is a pattern, ie use printf and %p to see the handle that comes back from playsound.
Otherwise, do you think it would be reproducible, ie you set up a part of your game where you can just repeat the action over and over until it happens again.

  • You must to post comments
0
0

GOOD NEWS!! I have managed to reproduce the bug in the 3D sample of the FMOD API. I havn’t changed anything other than the sound file that gets played with the circle press. It’s still a bit tempremental and still only happens about 2% of the time but it still happens..

  • You must to post comments
0
0

Hi brett,

The sounds are in .VAG format, we’re using 32 virtual channels & 16 HW channels (used to be 8 HW) and I’m using the same error checking as in the samples

[code:rmv6zp3w]void ERRCHECK(FMOD_RESULT result)
{
if (result != FMOD_OK)
{

ifdef DEBUG

    printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result));

endif

    sceKernelExitGame();
}

}[/code:rmv6zp3w]

and sending in the result of every fmod function to this error checking function, so if there was a problem I would expect the game to crash/exit and print the error code.

I will try printing the channel handle and see what I get back from that, otherwise I’m not sure what else I can do. As I said I’m having a hard enough time time to replicate the bug myself let alone making it reproducible, but I’ll see what I can do.

  • You must to post comments
0
0

Still happening, this time I made sure we’re running the latest FMOD, PSP Kernel Firmware and Runtime libraries. And it’s still only happening with the .VAG files, I changed them to .WAV (for testing) and it ran fine.

  • You must to post comments
0
0

After running some more tests and more vigorous error checking ( i wasn’t checking on setting 3d attributes or listener attributes) I’m still getting the same thing. There also seems to be no obvious connection between the failing channel addresses.

0x101f0038
0x101f004a
0x101f008a
0x101f008e
0x101e0098

I’m still going to run some more tests on trying to track down what is causeing this, but it seems that it’s happening randomly, sometimes working fine for 5 tests in a row. Just thinking could it have something to do with the sample file itself?

  • You must to post comments
0
0

looks like we’ve fixed it for the next release, it will be updated in a few hours. (v4.04.15)

  • You must to post comments
0
0

Hi,
Can you make sure there are no nans or infs going into the set3dattributes?
Also are you running System::getChannelsPlaying when you said ‘there are plenty of free channels’ to be sure of that?

Those numbers are not actually channel addresses, they are bitfields which contain the reference count and raw channel number.

The fact that it was 1f then 1e (reference count) in those handles might mean there is some channel stealing happening?

  • You must to post comments
0
0

[quote="brett":igfxbc54]
Can you make sure there are no nans or infs going into the set3dattributes?[/quote:igfxbc54]

The only uncommon if the occasional -0 (we have to flip the z axis), otherwise it’s all fine. Same with the listener attributes

[quote="brett":igfxbc54]
Also are you running System::getChannelsPlaying when you said ‘there are plenty of free channels’ to be sure of that?[/quote:igfxbc54]

Yes, I print out the currently used channels every frame – never goes above 2 (only playing these sounds currently) and drops when the sound doesn’t play – but definately makes a call to System::playSound.

[quote="brett":igfxbc54]
Those numbers are not actually channel addresses, they are bitfields which contain the reference count and raw channel number.

The fact that it was 1f then 1e (reference count) in those handles might mean there is some channel stealing happening?[/quote:igfxbc54]

Like I said above currently these are the only sounds playing in the test cases. and those were only the numbers being returned for the sounds that didn’t play. Should I print them out before and after calling System::playSound?

  • You must to post comments
0
0

oh i thought the channel handles were good ones mixed with ones that failed.

id rather see the channel handles for good ones then ones that failed if you can pick them out, to see if there’s anything different about the ones that failed. It might not be relevant anyway, there could be some other PSP style strangeness going on with libSAS.

Other things to try and disable every sound except for that one (even if theyre not playing at the time, dont let them play at all), and change the sound you use to a different sound to see if the sound has anything to do with it. (does it happen to be stereo? there could be something going on there if it is, because on psp we have to split a stereo sound into 2 separate mono voices)

  • You must to post comments
0
0

I will put a printout next time I run this test, and indicate which sound is not playing. As for disabling every sound but this one, that will prove to be tricky.

As I said above they all use the same sound file (Item.vag) to play when the user collects the item – this will be replaced in the next test to see if the sound file itself might be causing the strangeness – and I’ve tried both racing through the collectibles and collecting them one-by-one waiting for FMOD to free all channels (getChannelsPlaying returns 0) both tests prove that it is happening ‘randomly’.

Will post results soon.

  • You must to post comments
0
0

Ok, I’ve now replaced the sound file with a freshly created one, still in .vag format – default creation.

Excuse all the text but here is a printout of what I’m getting. The last sound didn’t play even thought it was reported that it did
[code:2nq3cyze]Attempting to play sample "Voice/Level1/Item.vag"
Channel Handle before: 0x0
Channel Handle after: 0x101c0056
SoundPos: 130.00 129.00 -138.00

Attempting to play sample "Voice/Level1/Item.vag"
Channel Handle before: 0x0
Channel Handle after: 0x101f002a
SoundPos: 131.00 129.00 -138.00

Attempting to play sample "Voice/Level1/Item.vag"
Channel Handle before: 0x0
Channel Handle after: 0x101c0058
SoundPos: 132.00 129.00 -138.00

Attempting to play sample "Voice/Level1/Item.vag"
Channel Handle before: 0x0
Channel Handle after: 0x101f002c
SoundPos: 133.00 129.00 -138.00

Attempting to play sample "Voice/Level1/Item.vag"
Channel Handle before: 0x0
Channel Handle after: 0x101c005a
SoundPos: 134.00 129.00 -138.00

Attempting to play sample "Voice/Level1/Item.vag"
Channel Handle before: 0x0
Channel Handle after: 0x101f002e
SoundPos: 135.00 129.00 -138.00

Attempting to play sample "Voice/Level1/Item.vag"
Channel Handle before: 0x0
Channel Handle after: 0x101c005c
SoundPos: 136.00 129.00 -138.00

Attempting to play sample "Voice/Level1/Item.vag"
Channel Handle before: 0x0
Channel Handle after: 0x101f0030
SoundPos: 137.00 129.00 -138.00

Attempting to play sample "Voice/Level1/Item.vag"
Channel Handle before: 0x0
Channel Handle after: 0x101c005e
SoundPos: 138.00 129.00 -138.00

Attempting to play sample "Voice/Level1/Item.vag"
Channel Handle before: 0x0
Channel Handle after: 0x101f0032
SoundPos: 139.00 129.00 -138.00

Attempting to play sample "Voice/Level1/Item.vag"
Channel Handle before: 0x0
Channel Handle after: 0x101c0060
SoundPos: 140.00 129.00 -138.00

Attempting to play sample "Voice/Level1/Item.vag"
Channel Handle before: 0x0
Channel Handle after: 0x101f0034
SoundPos: 141.00 129.00 -138.00

Attempting to play sample "Voice/Level1/Item.vag"
Channel Handle before: 0x0
Channel Handle after: 0x101c0062
SoundPos: 142.00 129.00 -138.00

Attempting to play sample "Voice/Level1/Item.vag"
Channel Handle before: 0x0
Channel Handle after: 0x101f0036
SoundPos: 143.00 129.00 -138.00

Attempting to play sample "Voice/Level1/Item.vag"
Channel Handle before: 0x0
Channel Handle after: 0x101c0064
SoundPos: 144.00 129.00 -138.00

Attempting to play sample "Voice/Level1/Item.vag"
Channel Handle before: 0x0
Channel Handle after: 0x101f0038
SoundPos: 145.00 129.00 -138.00

Attempting to play sample "Voice/Level1/Item.vag"
Channel Handle before: 0x0
Channel Handle after: 0x101c0066
SoundPos: 146.00 129.00 -138.00

Attempting to play sample "Voice/Level1/Item.vag"
Channel Handle before: 0x0
Channel Handle after: 0x101f003a
SoundPos: 147.00 129.00 -138.00

Attempting to play sample "Voice/Level1/Item.vag"
Channel Handle before: 0x0
Channel Handle after: 0x101c0068
SoundPos: 148.00 129.00 -138.00

Attempting to play sample "Voice/Level1/Item.vag"
Channel Handle before: 0x0
Channel Handle after: 0x101f003c
SoundPos: 149.00 129.00 -138.00

Attempting to play sample "Voice/Level1/Item.vag"
Channel Handle before: 0x0
Channel Handle after: 0x101c006a
SoundPos: 150.00 129.00 -138.00

Attempting to play sample "Voice/Level1/Item.vag"
Channel Handle before: 0x0
Channel Handle after: 0x101f003e
SoundPos: 151.00 129.00 -138.00

Attempting to play sample "Voice/Level1/Item.vag"
Channel Handle before: 0x0
Channel Handle after: 0x101c006c
SoundPos: 152.00 129.00 -138.00

Attempting to play sample "Voice/Level1/Item.vag"
Channel Handle before: 0x0
Channel Handle after: 0x101f0040
SoundPos: 153.00 129.00 -138.00

Attempting to play sample "Voice/Level1/Item.vag"
Channel Handle before: 0x0
Channel Handle after: 0x101c006e
SoundPos: 154.00 129.00 -138.00

Attempting to play sample "Voice/Level1/Item.vag"
Channel Handle before: 0x0
Channel Handle after: 0x101f0042
SoundPos: 155.00 129.00 -138.00

Attempting to play sample "Voice/Level1/Item.vag"
Channel Handle before: 0x0
Channel Handle after: 0x101c0070
SoundPos: 156.00 129.00 -138.00

Attempting to play sample "Voice/Level1/Item.vag"
Channel Handle before: 0x0
Channel Handle after: 0x101f0044
SoundPos: 157.00 129.00 -138.00

Attempting to play sample "Voice/Level1/Item.vag"
Channel Handle before: 0x0
Channel Handle after: 0x101c0072
SoundPos: 158.00 129.00 -138.00

// This sound didn’t play
Attempting to play sample "Voice/Level1/Item.vag"
Channel Handle before: 0x0
Channel Handle after: 0x101f0046
SoundPos: 159.00 129.00 -138.00[/code:2nq3cyze]

For my next test I’m going to see if playing them in software has any difference, I just wish I could reproduce this easier than constant testing…

  • You must to post comments
0
0

Yeah, the software test didn’t work at all. I forgot that VAG files need to be loaded in hardware mode. BUT…

I replaced the VAG file with a AT3 file (same sound, different format) and it’s working fine – so far. Will keep you updated if it still happens, but so far so good.

  • You must to post comments
0
0

If you use AT3, it will be decompressed into memory and software mixed. This is not what you want on psp.
Are you using the reduced library? You should be unless you have a very specific need for a certain fmod feature that is not normally used in games (ie dsp effects, different file formats, these can be expensive on psp).

That helps though, it says that there is probably nothing wrong with the system except the psp hardware interface.
If you call System::setHardwareChannels(0,16,0,16); before System::init can you see if the original vag works ok? It may be that certain voices fail due to load or something.

  • You must to post comments
Showing 14 results
Your Answer

Please first to submit.