waleedAhmad1 / google-glass-api

Automatically exported from code.google.com/p/google-glass-api
0 stars 0 forks source link

Bluetooth becomes much slower after upgrading to XE16 #485

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Start a bluetooth connection between Glass and mobile
2.Send a large (60KB) byte array from mobile to Glass
3.

What is the expected output? What do you see instead?
In XE12, the data transferring rate was around 300KB/s. After upgrading to 
XE16, the average transferring rate becomes 30KB/s.

What version of the product are you using? On what operating system?
Glass XE16.

Please provide any additional information below.

Original issue reported on code.google.com by yihua...@gmail.com on 23 Apr 2014 at 4:11

GoogleCodeExporter commented 9 years ago
Thanks for the report! We're going to investigate but might need your help 
getting more information on this issue.

Best,
Alain

Original comment by ala...@google.com on 23 Apr 2014 at 4:25

GoogleCodeExporter commented 9 years ago
The bluetooth connection part is the same as the Bluetooth Chat sample app.
The data to be transferred is the byte array of a compressed jpeg image (around 
60KB).
I use DataOutputStream and DataInputStream to transfer and receive that byte 
array.

On the mobile side:
DataOutputStream dos = new DataOutputStream(socket.getOutputStream());

byte[] image = ...// The byte array of a compressed bitmap. 
dos.writeInt(image.length);
dos.write(image);

On the Glass side:
DataInputStream dis = new DataInputStream(socket.getInputStream());
int size = dis.readInt();
byte[] image = new byte[size];
long start = System.currentTimeMillis();
dis.readFully(image,0,size);
long end = System.currentTimeMillis();

The transferring rate is calculated by size/(end-start)KB/s.
After upgrading Glass to XE16, I found that the transferring rate becomes about 
10 times slower.

Original comment by yihua...@gmail.com on 23 Apr 2014 at 4:46

GoogleCodeExporter commented 9 years ago
Thanks for the details! Could you also answer those questions:
  * What phone are you using?
  * Android version running on the phone.
  * Are you connected through MyGlass?

Original comment by ala...@google.com on 23 Apr 2014 at 7:13

GoogleCodeExporter commented 9 years ago
I'm using Samsung Galaxy s3 mini, and the Android version is 4.1.2.
I'm not connected through MyGlass. I made a app based on BluetootChat sample 
app to handle to bluetooth connection, and send image from mobile to Glass.
Btw I tried the screencast functionality using MyGlass and found that the 
performance didn't change much from XE12. I don't know whether it's because 
MyGlass is transferring much less data every frame or using other magic. But 
the bluetooth transferring rate is bad on my app.

Original comment by yihua...@gmail.com on 23 Apr 2014 at 7:36

GoogleCodeExporter commented 9 years ago
More test:
I did more tests based on ScreenCast on MyGlass, and found that:
Using Record Video on Glass is fast and has higher frame rate. It seem like 
there is a great optimization against Glass camera.
Sliding around the pictures on Glass has a huge latency. I guess in this 
situation Glass just takes screenshot and compresses it, then sends the image 
data to MyGlass, which is essentially the same with my app.

Original comment by yihua...@gmail.com on 23 Apr 2014 at 8:39

GoogleCodeExporter commented 9 years ago
We experienced this slowdown too.  The iphone's MyGlass-based screencasting 
used to be fairly smooth in XE12. Not in XE16.2

Original comment by eug...@wearableintelligence.com on 2 May 2014 at 5:54