Transport Exploration

We want to build a fast and easy to use basic transport layer to stream (mostly) binary data like sound or video from the robot to other computers. This should ideally not do any costly marshalling like it is done within the SOAP layer of NaoQi.

Underlying toolkits

Some possibilities:

First results

  • A simple proof of concept was built using Spread, see attached files for audio recorded using this.
  • Video sending also works, see "benchmark" results below.
  • Some first (not really successful) test with Asio...

Benchmarks

Some numbers of how fast we can send 640x480 YUV422 video over the network. Without any communication overhead, we can grab around 30 fps on the robot.

Using Spread

These numbers are almost unchanged if we switch from FIFO to UNRELIABLE messages...

...
Average fps after 2350 frames in 229.229 seconds: 11.1076 (last 50 frames), 10.2518 (since beginning).
Average fps after 2400 frames in 233.664 seconds: 11.274 (last 50 frames), 10.2712 (since beginning).
Average fps after 2450 frames in 238.106 seconds: 11.2542 (last 50 frames), 10.2895 (since beginning).
Average fps after 2500 frames in 242.663 seconds: 10.9719 (last 50 frames), 10.3023 (since beginning).

Using (Boost.)Asio

This is a first simple test with Asio, using synchronous (i.e. blocking, not asynchronous) I/O over a simple TCP socket. It's not a perfectly tuned implementation and it is still very buggy (the image is garbled, looks cut in half), so take those numbers with at least a dozen grains of salt:

Average fps after 50 frames in 6.16767 seconds: 8.10679 (last 50 frames), 8.10679 (since beginning).
Average fps after 100 frames in 11.9418 seconds: 8.65924 (last 50 frames), 8.37391 (since beginning).
Average fps after 150 frames in 17.6628 seconds: 8.73987 (last 50 frames), 8.49245 (since beginning).
Average fps after 200 frames in 23.338 seconds: 8.81013 (last 50 frames), 8.5697 (since beginning).
Average fps after 250 frames in 29.1206 seconds: 8.64663 (last 50 frames), 8.58498 (since beginning).
Average fps after 300 frames in 34.8296 seconds: 8.75815 (last 50 frames), 8.61336 (since beginning).

After correcting a bug (incorrect buffer sizes...), we now get the following performance (over tcp) & correct images:

...
Average fps after 3950 frames in 310.421 seconds: 13.0615 (last 50 frames), 12.7247 (since beginning).
Average fps after 4000 frames in 314.244 seconds: 13.0792 (last 50 frames), 12.729 (since beginning).
Average fps after 4050 frames in 318.06 seconds: 13.1028 (last 50 frames), 12.7335 (since beginning).
Average fps after 4100 frames in 321.87 seconds: 13.121 (last 50 frames), 12.7381 (since beginning).
Average fps after 4150 frames in 325.703 seconds: 13.0441 (last 50 frames), 12.7417 (since beginning).
Average fps after 4200 frames in 329.5 seconds: 13.171 (last 50 frames), 12.7466 (since beginning).

test44k.wav (528 KB) J. Wienke, 11/30/2010 04:28 PM

test48k.wav (528 KB) J. Wienke, 11/30/2010 04:28 PM