Welcome!

Welcome to the Official BlackBerry Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
New Developer
FranzBB
Posts: 13
Registered: ‎01-28-2010
My Carrier: ATT

Audio streaming problem (BUFFERING_STARTED)

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!

 

 

Please use plain text.
Administrator
MSohm
Posts: 12,957
Registered: ‎07-09-2008
My Carrier: Bell

Re: Audio streaming problem (BUFFERING_STARTED)

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?

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Found a bug? Report it using the Issue Tracker
Please use plain text.
New Developer
FranzBB
Posts: 13
Registered: ‎01-28-2010
My Carrier: ATT

Re: Audio streaming problem (BUFFERING_STARTED)

 

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!

Please use plain text.
Administrator
MSohm
Posts: 12,957
Registered: ‎07-09-2008
My Carrier: Bell

Re: Audio streaming problem (BUFFERING_STARTED)

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.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Found a bug? Report it using the Issue Tracker
Please use plain text.