A tool to estimate the latency

In a series of posts I am talking about the sixaxis emulator latency.

What kind of latency am I talking about? Basically, the time between event reception from PC peripherals, and event emission to the PS3. The most critical event to me is a mouse left clic in a FPS game.

The most accessible estimation is to measure the difference between usb timestamps. See this post for more details. I created a small utility to make this estimation easier. It has to be launched in a terminal, but I am thinking to add it some day in sixemugui.

matlo@matlo-hcpc:~/hack/test$ wget http://diyps3controller.googlecode.com/svn/trunk/tools/sixemulat.c
matlo@matlo-hcpc:~/hack/test$ gcc -lm -o sixemulat sixemulat.c

matlo@matlo-hcpc:~/hack/test$ lsusb
Bus 003 Device 008: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
Bus 003 Device 005: ID 046d:c041 Logitech, Inc. G5 Laser Mouse

matlo@matlo-hcpc:~/hack/test$ ./sixemulat
usage: ./sixemulat <mouse bus id> <mouse device id> <dongle bus id> <dongle device id>
matlo@matlo-hcpc:~/hack/test$ ./sixemulat 3 5 3 8

Be sure to use the correct mouse/dongle bus/device ids, specifically if you have several mice and/or several dongles!

Sixemulat displays:
– the number of caught left clics
– the worst latency
– the average latency

About a hundred of samples should be enough to get significant values.

The average latency is an interesting value, but the most important value is the worst latency. Commercial products will tend to give you only the average latency, as it is a lower (generally half) value…

I only tested this tool with two logitech mice. If it doesn’t work for you, please get in touch with me.

4 Replies to “A tool to estimate the latency”

  1. Everyone seems to assume the USB adapter is less latency than Bluetooth. I read in this post: /?p=102 that the USB added latency was 5 ms average, 6.7 ms worse.

    This is great, however, is this faster than the Bluetooth for sure? The USB adapter must use a Serial-USB converter, adding latency.

    In older post: /?p=56 , added latency is 11 ms… However, the testing method is different in this test (using audio), which is different from the new method (reading packets).

    Has anyone tested the latency between USB and Bluetooth options?

  2. In the first post you are quoting, it’s not added latency (no comparison with a sixaxis or anything else), it’s latency between two usb packets (the one coming from the mouse and the one coming from the adapter back – for this test, the adapter is plugged to the PC instead of the PS3).

    With bluetooth, I measured about 12ms worst case, and about 6ms average (between the usb packet coming from the mouse and the usb packet sent to the bt dongle).

    This is coherent with the following statements:
    – GIMX+USB can run at 250Hz, which means at least 4ms worst case and at least 2ms average.
    – GIMX+BT can only run at 100Hz, which means at least 10ms worst case and at least 5ms average.

Leave a Reply

Your email address will not be published. Required fields are marked *