04-27-2012 06:42 AM - edited 04-27-2012 06:43 AM
In my last project, we're using a javax.microedition.media.Player to play a small wav file (its duration is a few seconds). I'm using setLoopCount(-1) to play it indefinitely. the file is included in the app resources.
The player is initialized and prefetched when the app first launches. When a certain event occours, we call start() on it. We call stop() again at user request.
For some reason it works fine on almost every BB model, but it fails on a 8520. The sound starts and stops fine a couple of times, but at some point, the start call throws this exception:
n: play: Media processor busy
I've tried modifying the code and putting Thread.sleep calls after start and stop, to prevent a high frequency sequence of calls (start-stop-start-stop-...) breaking the player, but it doesn't work.
I'm at a dead end here and this is a very important project. Any help would be appreciated.
Solved! Go to Solution.
04-30-2012 03:29 AM
I've seen similar issues in the Developer Issue Tracker. But assuming it is a bug in the OS (which I think it is, otherwise how could I explain it working for hours in 4.5.x, 4.6, 6.0 and 7.0 OSes and crashing in minutes for 5.0 Curves) , then I'll be out of luck since upgrading devices is not an option.
Anyone has a hint on what the media processor is, or how could I prevent it going so busy?
04-30-2012 10:25 AM
I'm currently catching the exception and closing the player. Then calling again createPlayer, realize and prefetch. This breaks the no-sound deadlock and the wave file is played again.