aharpour / bluecove

Automatically exported from code.google.com/p/bluecove
0 stars 0 forks source link

Slow write to device via btspp on Mac OS X 10.6.3 #112

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Open a StreamConnection to device (e.g.
btspp://btspp://0012F302C40F:1;authenticate=false;encrypt=false;master=false)
2. Connect PrintStream to the StreamConnection's OutputStream
3. Write data to device via PrintStream's print method.
4. Compare performance of Bluecove release 2.1.0 on Mac OS 10.5 with 32 bit
Java 1.5 to Bluecove 2.1.1-SNAPSHOT on Mac OS 10.6 with 64 bit Java 1.6.

What is the expected output? What do you see instead?
Write times are 3x slower with 2.1.1-SNAPSHOT on Mac OS 10.6 with 64 bit
Java 1.6 than with 2.1.0 release on Mac OS 10.5 with 32 bit Java 1.5.

What BlueCove version are you using (include build number for SNAPSHOT)? On
what operating system and jvm? Is this 64-bit or 32-bit OS and jvm?
2.1.0 release from 12/16/2008
2.1.1 SNAPSHOT 62 from 4/1/2010 Built on Mac OS 10.6.3 with Developer Tools
(XCode) 3.2

Please provide any additional information below.
Please use "Attach a file" when uploading stack traces or other big files!
Attached is the Java program that I have run on both of the above
platforms. It connects to a bluetooth enabled robot, sends commands a
receives responses.  The "Write Time" reported on 64 bit OS X 10.6 were
approximately 3x larger than those for 32 bit OS X 10.5.  The "Flush Time"
and "Read Time" reported were similar on both platforms.

Running the program compiled against the avetana JSR82 library showed
similar write times on both platforms.

Original issue reported on code.google.com by braug...@gmail.com on 4 Jun 2010 at 5:47

Attachments:

GoogleCodeExporter commented 9 years ago
I found a hack that speeds up the writes with the targeted robotic device. I'm 
not sure the hack would be generally useful though.  Here it is none the less:

In OSXStackRFCOMM.mm

1. in RFCOMMConnectionWrite::run()
 a. comment out notify = this; to prevent callback.
 b. add writeComplete=true; at end of method.

2. in Java_com_intel_bluetooth_BluetoothStackOSX_connectionRfWrite
 a. change kDurationMillisecond * 500 to kDurationImmediate in call to MPWaitForEvent

As I said this works with my device but may not be a general solution.

Original comment by braug...@gmail.com on 4 Aug 2010 at 5:24

GoogleCodeExporter commented 9 years ago
Mac os X 10.6.3

Original comment by tatoetharlay on 7 Apr 2013 at 3:37

GoogleCodeExporter commented 9 years ago
good

Original comment by tatoetharlay on 7 Apr 2013 at 3:46