If you play a sound on the HTC G1 or Magic via the speaker, the vibrations caused by the speaker makes the accelerometer go crazy. The louder the sound, the worse the effect.
It is discussed here https://groups.google.com/group/android-developers/browse_thread/thread/324a61badc59d58f with no solution.
Someone tried to do some damper code using averaging here https://groups.google.com/group/android-developers/browse_thread/thread/5b4ce338d4c57669/c405d018e26683ab#c405d018e26683ab, however, I tried it out and it reduced the effect, but it was still horrible.
I was thinking maybe there was a better algorithm (not just taking the average) for filtering out the crazy values caused by the sound? Any ideas would be greatly appreciated.
It’s a little annoying, as it really is a hardware problem (accelerometers are not properly shielded from the speaker), however, a software fix would be great.
Cheers.