Excuse me, the correct link of my above message is: http://groups.google.com/group/android-developers/browse_thread/thread/4e7a0eabd2727864/8d8cbb7421af147b?lnk=gst&q=SoundPool%3A+playing%2Fstopping-delaytime+sometimes+greater+300+ms
Greetings Ulrich On 4 Nov., 14:44, Ulrich Althöfer <[email protected]> wrote: > Yes, I can confirm the error message: > "AudioFlinger write blocked for 53 msecs" > Have a look at the entry: > "SoundPool: playing/stopping-delaytime sometimes greater 300 > ms"http://groups.google.com/group/android-developers/browse_thread/threa... > > I have got no answers at all to those problems here. > > Greetings > Ulrich > > On 4 Nov., 14:32, Mike <[email protected]> wrote: > > > Hello, > > > I am using MediaPlayer to play background music and SoundPool to play > > sound effects. All Audio data is stored in .ogg file format. > > Sometimes it happens that the MediaPlayer playback is interrupted for > > a fraction of a second if SoundPool.play() is called. Whenever this > > happens, the following two warnings are printed to logcat: > > > 11-04 01:49:05.113: WARN/AudioTrack(51): obtainBuffer timed out (is > > the CPU pegged?) 0x2b6e8 user=000cc520, server=000cb710 > > 11-04 01:49:05.113: WARN/AudioTrack(51): *** SERIOUS WARNING *** > > obtainBuffer() timed out but didn't need to be locked. We recovered, > > but this shouldn't happen (user=000cc520, server=000cb710) > > > Do you have any ideas what could cause the warning messages and/or how > > to avoid them? I.e. how to prevent SoundPool.play() from interrupting > > MediaPlayer playback? > > > An other warning that's sometimes appearing is: > > 11-04 01:55:49.793: WARN/AudioFlinger(51): write blocked for 89 msecs > > There seems to be no connection to the above messages, but do you have > > any ideas what causes this message and/or how to avoid it? > > > Here's some more detailed background information, maybe they are > > useful: > > My OpenGL powered game is split into three threads: One for rendering, > > one to take care about the game logic and the main thread to process > > user input. > > All Audio data is accessed through a central AudioManager class, which > > is only used in the game logic thread. (So this does not seem like a > > threading issue. Needless to say that synchronizing all methods has > > not solved the problem). > > The game runs smoothly at ~60 frames per second. According to DDMS the > > game causes ~33% system load (~10% in kernel space and ~23% in user > > space) on a G1. Even the idle task gets ~24% CPU time assigned while > > the game is running and input happens through the touch screen! (So it > > does not look like a performance problem) > > The MediaPlayer playback interruption always happens if SoundPool.play > > () is called in response of a touch screen input. Although touch > > screen input and SoundPool.play() happen in different threads. I've > > tried suspending the UI thread for various different delays between 8 > > and 32 msec after a MotionEvent has been processed, but again, without > > success... > > > I've spent days optimizing the game and finding the cause of the > > interrupted MediaPlayer playback, but without success. Now I've run > > out of ideas. So any advice that could help solving the problem is > > highly appreciated! > > > Thanks in advance, > > Mike. > > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

