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
Highlighted
Regular Contributor
Posts: 54
Registered: ‎04-24-2010
My Device: 8900
My Carrier: simulator

Bluetooth Throughput

Hi,

 

I am trying to compute the throughput of my bluetooth device( from which I have to receive some media data (audio & video))

 

For this, I am using RIM bluetooth API's with BluetoothSerialPort configured as follows:

 

port = new BluetoothSerialPort(info, 
	
         BluetoothSerialPort.BAUD_115200, 

	BluetoothSerialPort.DATA_FORMAT_PARITY_NONE|                 		BluetoothSerialPort.DATA_FORMAT_STOP_BITS_1|
	BluetoothSerialPort.DATA_FORMAT_DATA_BITS_8, 
				BluetoothSerialPort.FLOW_CONTROL_NONE, 

	25600, 1024, this);

 

On dataReceived, i just read from port as, port.read(inBuff),  where inBuff is 25Kb(25600) .

The streaming bitrate i get with this is only 64Kbps. If i increase the size of receiver buffer to 32 Kb, bitrate reduces to 12Kbps.

 

Are there any settings that will help me improve the throughput? Please suggest.

Regular Contributor
Posts: 54
Registered: ‎04-24-2010
My Device: 8900
My Carrier: simulator

Re: Bluetooth Throughput

Hi,

 

Can anyone please suggest whether using J2ME Bluetooth API's instead of RIM API's will help in faster steaming from bluetooth device?

 

Thanks!

 

Developer
Posts: 91
Registered: ‎11-24-2009
My Device: Storm

Re: Bluetooth Throughput

Hello,

 

What happen if you decrease the buffer size?

-Luis Fernando

Remember to give Kudos(click on the star at your left) if this helped you.
Click on "Accept Solution" if the problem is resolved.
Espanol? Escribeme un mensaje privado.
Regular Contributor
Posts: 54
Registered: ‎04-24-2010
My Device: 8900
My Carrier: simulator

Re: Bluetooth Throughput

If i reduce the buffer size, streaming bitrate reduces. 20Kb to 25Kb buffer size gives me ~60Kbps rate for the specified port settings.

 

Even If i increase Baud Rate to 230400, bitrate reduces!

 

Will using DataOutputStream and DataInputStream help to increase the streaming rate?

Developer
Posts: 91
Registered: ‎11-24-2009
My Device: Storm

Re: Bluetooth Throughput

Do you have a way to see whats happening on the streamer side? Im my experience sometimes this lack of Throughput depends also on what type of bluetooth radio you are using. 

 

Are you using integrated bluetooth on a computer, usb dongles, branded device?

 

Using DataOutputStream and DataInputStream might help you, but  could be great if you can track what is happening across the board. I had some Throughput issues in the past when coding some bluetooth proximity applications and issues were coming from the usb dongle.

-Luis Fernando

Remember to give Kudos(click on the star at your left) if this helped you.
Click on "Accept Solution" if the problem is resolved.
Espanol? Escribeme un mensaje privado.
Regular Contributor
Posts: 54
Registered: ‎04-24-2010
My Device: 8900
My Carrier: simulator

Re: Bluetooth Throughput

Hi Luis,

 

I am sure about the streamer side. i can see data backed up on BT side because of slower data consumption by my blackberry. 

 

In this code i am using SerialPort. How can i use RFComm instead? Any code snippet for it?

 

Thanks!

Developer
Posts: 91
Registered: ‎11-24-2009
My Device: Storm

Re: Bluetooth Throughput

Well, if you are sure of what is happening outside the blackberry its good. Perhaps you noticed already but there is almost no documentation about bluetooth for blackberry(such as how to make scans, connections, etc)

 

At this moment I dont have any snippet for RFComm connections right here, Im pretty sure I have it somewhere on my backups from the proximity tool. I will try to get it for you. 

 

For now take a look on this link

 

http://supportforums.blackberry.com/t5/Java-Development/Bluetooth-RFCOMM-server-conflicts-on-Media/m...

 

Is a piece of code of some bluetooth server app somebody was developing. It might help you to see if you can implement it.

 

Let me know if that helps you.

-Luis Fernando

Remember to give Kudos(click on the star at your left) if this helped you.
Click on "Accept Solution" if the problem is resolved.
Espanol? Escribeme un mensaje privado.
Regular Contributor
Posts: 54
Registered: ‎04-24-2010
My Device: 8900
My Carrier: simulator

Re: Bluetooth Throughput

Hi Lusi,

 

So, blackberry does support connecting directly to RFCOMM? I wasn't sure, because Android do not open up RFCOMM.

 

If you can share the code snippet, it will be a great help!

in the mean time i will look into the link.

 

Thanks!