05-07-2010 01:36 PM
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.
05-07-2010 11:54 PM
What happen if you decrease the buffer size?
05-08-2010 12:05 AM
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?
05-08-2010 12:41 AM
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.
05-08-2010 01:02 AM
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?
05-08-2010 01:21 AM
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
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.
05-08-2010 02:07 AM
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.