On my T-Mobile G1 (firmware 1.1, build PLAT-RC33), developing in SDK1.1r1, I am experiencing a problem where playing sounds causes the output of the accelerometer and orientation sensors to fluctuate wildly. The degree of fluctuation is directly proportional to the volume of the sound being played.
I am using SensorManager per the documentation and examples : <========= From my implementation of SensorListener> public void init() { SensorManager sm = (SensorManager) cx..getSystemService (Context.SENSOR_SERVICE); boolean success = sm.registerListener(this, SensorManager.SENSOR_ORIENTATION, SensorManager.SENSOR_DELAY_GAME); // success is true, i.e. no problems acquiring the sensor } public void onSensorChanged(int sensor, float[] values) { if (sensor == SensorManager.SENSOR_ORIENTATION) { // print/draw/do something with the sensor output in values [] } } <==========> I have tried playing sounds with both SoundPool and MediaPlayer, with identical results. When a sample is played at max volume the Orientation sensor outputs will bounce around as much as +-/30 degrees. All axes are affected. I have tested and confirmed this behaviour for SENSOR_ACCELEROMETER, SENSOR_ORIENTATION, and SENSOR_ORIENTATION_RAW. Other sensors may also be impacted, but I haven't tested them. I have also tested with all of the available sensor resolutions -- SENSOR_DELAY_FASTEST through SENSOR_DELAY_UI. All result in the same behavior. On a random guess I tried muting the microphone with AudioManager.setMicrophoneMute(true) -- same results. I thought to try testing this in the Android emulator to see if it might be hardware-related, but unfortunately there is currently no accelerometer/orientation sensor support in the emulator. Is this a known problem? Or am I doing something wrong here? Thanks --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---