0
0

Our low level PS3 programmer has been soaking our game overnight and a couple times he has gotten a floating point exception in ChannelRealManual3D::set2DFreqVolumePanFor3D when it does the acos:

[code:rpqzsw2d]mAngleToListener = FMOD_ACOS(fbpan_base) * (180.0f / FMOD_PI);[/code:rpqzsw2d]

I have put asserts for any FMOD_ERR_INVALID_FLOAT or FMOD_ERR_INVALID_VECTOR and they were not hit so he thinks it is due to floating-point roundoff and just needs a clamp like this:

[code:rpqzsw2d]
// Clamp the dot product — minor floating-point roundoff can push
// the value slightly outside the range [-1,1].
if (fbpan_base < -1.0f)
fbpan_base = -1.0f;
else if (fbpan_base > 1.0f)
fbpan_base = 1.0f;

    mAngleToListener = FMOD_ACOS(fbpan_base) * (180.0f / FMOD_PI);[/code:rpqzsw2d]

Does that make sense? Can we get this added?
thanks

  • You must to post comments
0
0

hm we actually did this for PSP, we didnt think it would appear in PS3, maybe it is related because they’re both sony and both use an innacurate acos routine. We’ll just put the clamp in for all platforms for our next release.

  • You must to post comments
0
0

Great, thanks.

  • You must to post comments
0
0

It seems that versions 4.18.03 and 4.19.03 for 32-bit Linux also have this bug.

  • You must to post comments
0
0

[quote="FX-Racer":2kpj36qa]It seems that versions 4.18.03 and 4.19.03 for 32-bit Linux also have this bug.[/quote:2kpj36qa]

This error happens when glibc 2.8 is installed.

racer[2234] trap divide error ip:f7b749b5 sp:ff9551d0 error:0 in libfmodex.so.4.19.03[f7b29000+11b000]

It doesn’t happen with glibc 2.5 or 2.7.

  • You must to post comments
0
0

No this is not the same bug, that was a one off.

Your calls to fmod functions are most likely passing invalid floats to fmod (nan/inf). Use the fmodexL version (logging version) which has extra error checking and look for FMOD_ERR_INVALID_FLOAT. The usual culprits are Channel::set3DAttributes System::set3DAttributes

  • You must to post comments
Showing 5 results
Your Answer

Please first to submit.