01-28-2010 09:49 AM
Hi all,
I'm trying to create a simple streaming mp3 player, i've created a small project just to test the Player object and it works fine, at least for the first few seconds.
When i start() the player, I hear the music for about 10 to 15 seconds, then on the simulator logs i see this:
SMP: BUFFERING = 0
and suddenly the music stops and my PlayerListener object receives the "BUFFERING_STARTED" message.
After that It does not receive anything and I'm unable to resume the playing.
Here is my code:
...
try {
System.out.println("Initializing Player...");
p = Manager.createPlayer("http://server.com/music.mp3;deviceside=true");
p.addPlayerListener(this);
System.out.println("Setting Loop Count...");
p.setLoopCount(-1);
System.out.println("Starting Player...");
p.start();
System.out.println("Player started!");
} catch (IOException ioe) {
System.out.println("1 - Player IOException!" + ioe.getMessage());
} catch (MediaException e) {
System.out.println("2 - Player MediaException!" + e.getMessage());
}
Tha API documentation for MMAPI says that the BUFFERING_STARTED is "Posted when the Player enters into a buffering mode.", as far as I know it should resume the playing from when it stopped once the buffering has completed, but the buffering seems to never complete, it just hangs in BUFFERING_STARTED!
This problem happens only if I stream an mp3 from a remote server, I installed apache2 on my machine and from there the streaming works perfectly!
Am I missing something?
Thanks for your help!
02-01-2010 01:59 PM
What BlackBerry Smartphone model and BlackBerry device software version are you testing on? You can find this under Options, About on the BlackBerry Smartphone.
Does this happen on any remote server or just a specific one? If it is a specific server, can you provide a sample URL? If it's not, it could be caused by a network issue in your environment.
Are you able to play the same URL from within the BlackBerry Browser?
02-02-2010 03:09 AM
Hi and thanks for your help,
I just found what the problem could be. I captured the TCP traffic with wireshark and saw that when the PlayerListener receives the BUFFERING_STARTED message, the TCP receive window size of the device is zero. This probably means that the BB simulator is overloaded for some reason and it can't process no more data, so the player starts buffering and sometimes, after a while it throws some sort of timeout error (the error code is 5).
Does this make sense?
I'm using a simulated BB Storm 9500 v4.7.0.75
Unfortunately i can't provide you a sample url, sorry....
Thanks again!
02-02-2010 10:13 AM
Are you able to reproduce this in version 5.0 of the BlackBerry 9500 simulator?
Version 4.7.x of the simulators had some connectivity issues that have been resolved.