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.

inside custom component

Java Development

Reply
New Developer
jsdf
Posts: 32
Registered: ‎04-30-2009
My Device: Pearl 8120

Problems playing streaming audio in simulator on 4.5.0+ apps with 4.3.0 code

Hi everyone,

 

This is a strange issue that I hope someone might have insight into.

I am developing an application with the 4.3.0 JDE in Eclipse.  The primary purpose of the application is to play streaming audio from a server, where the audio is typically in mp3 format.

 

The application works well on a 4.3.0 JDE simulator and 4.3.0 Blackberry Pearl device, on both Wifi and Edge.  It can browse the network and initiate playback correctly with the javax.microedition.media.Player.  URLs through the simulator append ;deviceside=true across all simulators, and URLs through the device make use of the techniques in the Network Diagnostic application to identify the appropriate method.  The simulators are not launching the MDS-CS simulator.

 

On 4.5.0, 4.6.1.94, and 4.7.0.75 simulators, however, I experience problems.  The application is able to browse through the list of files correctly (meaning, it can send requests and receive data and graphics from an HTTP web service without issue).  However, when it comes down to playing a file, various incorrect results ocur, based on the version of the device tested.

 

8120 running 4.5.0 : gets past player.realize(), player.prefetch(); gets stuck on player.start()

8900 running 4.6.1.94: gets stuck on player.realize() until I receive MediaException: TCP receive timed out

9500 running 4.7.0.75: player.realize() blocks, occasionally throwing MediaException: Connection Closed or MediaException: Connection Closed (although, on one occasion of about 10 tries, I was able to get through the chain and play about 13 seconds of audio before it simply stopped playing and refused to buffer any more).

 

My simulation process is:

- Build app

- Copy into simulator directory

- Run via batch file

- Use BB JDE app > Debug > Attach To > Simulator to get debugging information

 

The player code is roughly:

url = NetworkManager.buildUrl(url); // add ;deviceside=true for simulator

player = Manager.createPlayer(url);
player.addPlayerListener(this); // listen for updates/stops/closes
player.setLoopCount(1);
player.realize();

player.prefetch();

player.start(); // start (or resume) player

 

I was able to have a tester test the application on a Blackberry Bold on AT&T, and the audio played well according to them.  However, I do not have a Bold or Storm, and without a working simulator debugging is going to be very very difficult.

 

Does anyone have suggestions?  Is this a case of different JDE --> poor results?  Or is it a problem with the simulator and audio?

Thanks in advance,

J

Please use plain text.
New Developer
jsdf
Posts: 32
Registered: ‎04-30-2009
My Device: Pearl 8120

Re: Problems playing streaming audio in simulator on 4.5.0+ apps with 4.3.0 code

Bump!  Anyone have any recommendations?
Please use plain text.
Administrator
MSohm
Posts: 14,241
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: Problems playing streaming audio in simulator on 4.5.0+ apps with 4.3.0 code

The first step is to determine if this is an issue with the network configuration or with the media file itself.  Since it works on a real BlackBerry smartphone it is likely to be a network issue with the BlackBerry Simulator.

 

Are you able to play the same files in the BlackBerry Browser of the BlackBerry Simulator and/or when embeding them within your application (similar to the embededmediademo included with the BlackBerry JDE)?  Is there any sort of proxy or network restriction in your environment? 

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
New Developer
ceci_lga
Posts: 10
Registered: ‎01-20-2010
My Device: BlackBerry Bold 9000
My Carrier: AT&T

Re: Problems playing streaming audio in simulator on 4.5.0+ apps with 4.3.0 code

I am having the same problem: trying to retrieve and play mp3 files, using 4.5.  Some files play all the way through.

Others (longer than one minute) play almost all the way, but then stop retrieving data before all the data has been

requested.  And sometimes no request at all is made.

Please use plain text.