Git Product home page Git Product logo

walt's Introduction

WALT Latency Timer

DISCLAIMER: This is not an official Google product.

WALT is designed to measure the latency of physical sensors and outputs on phones and computers. It can currently perform the following measurements:

  • Tap latency - time from the moment a finger-like probe touches down (or up) on the screen until the kernel timestamps an ACTION_DOWN (or ACTION_UP) event. This physical contact with the screen is timed using an accelerometer mounted on the probe.
  • Drag latency (scroll).
  • Screen draw latency - using a photodiode that detects whether the screen is black or white.
  • Audio output and microphone latencies.
  • MIDI input and output latencies

The WALT app for Android can be installed from Google Play or downloaded in the releases section; the iOS app must be built from source.

WALT photo

Notes

  • Hardware build instructions can be found in this repository under hardware/.
  • Clock synchronization details are described here.
  • The Android/iOS device and Teensy clocks have a tendency to diverge due to differing clock frequencies. This means they will go out of sync after several minutes. The workaround is to use the app to re-sync the clocks. Some, but not all tests in the app will sync the clocks when starting a measurement.
  • Python code used to communicate with WALT from Linux and ChromeOS can be found here.

walt's People

Contributors

benjaminfair avatar bobbysue22 avatar dturner avatar ggfan avatar kamrik avatar pqu avatar raphaelwimmer avatar sahiljain avatar vapier avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

walt's Issues

WALT Android app hangs if Teensy not programmed

When plugging in a Teensy that is not programmed with the correct Arduino code, the android app starts and shows a blank screen for some 10 seconds.

It probably tries to sync clocks and doesn't get the expected replies.

Allow resizing the window on ChromeOS

Currently the window looks like a vertical screen about 1/3 of the width of the chromebook screen. This may be related to the forced portrait orientation in the manifest.

Investigate recording enqueue latency

Currently the recording enqueue latency is not reported in final results has pretty high variance. Investigate if it's better to timestamp right after SetRecordState() in startRecording.

Also take a look at playback side for cold start, might also be better to timestamp after SetPlayState().

Number picker in settings don't save the number if only keyboard used

When typing a number into the number picker using the keyboard and then pressing ok on the dialog the number doesn't get saved.

It does get saved if the enter button is first clicked on the keyboard or if the spinner is tapped.

This might be tricky, the text field seems to be somehow buffered by the keyboard.

WALT firmware for Adafruit ADXL335 board

Love the WALT tool! Experienced some frustration with the Tap Latency functionality though, until I discovered that the WALT firmware wasn't actually getting any data from the Adafruit ADXL335 accelerometer board. The firmware only targets the pins for the on-board ADXL335 accelerometer; the Adafruit ADXL335 accelerometer board maps to different pins on the Teensy arduino processor.

I recommend one of two solutions. Either:

  • connect the Adafruit ADXL335 accelerometer pins to the same pins as the on-board ADXL335; this has the drawback of making those GPIO header pins unusable for anything else though.
  • change the firmware so that the user can select one of the two options with only minimal effort. Attached is an update to the walt.ino file that uses a #define to select one of the two modes. This still requires the user to make the change and upload the correct firmware though, so perhaps there's a better solution, like storing both binary versions on the phone/tablet and allowing the user to select which one to upload, or something like that...

Thanks,
Jason

walt.txt

Crash when returning to the app after disconnecting WALT

If the WALT app opened due to the device being connected, then opened again in such a way that no new intent is created (such as from the recents menu), the app will request permission to access a (nonexistent) USB device. If "OK" is chosen, a crash occurs.

Display histograms for results

When a series of measurements is done it would be way more interesting to see a histogram rather than just a median. Maybe show a live one that gets updated with each rep.

Tap Latency test should show average latency

2 feature requests:

  • Tap latency should show a numerical value for the average latency, without this you have to manually record the result of each tap and calculate the average latency yourself
  • Also would be useful to show the sum of touch2kernel and kernel2java

Brightness curve test reports data from previous test

Expected Output:

u
758108 11
758706 11
759308 11
.
.
.
end

Actual Output:

1737914 11
1739008 11
u
758108 11
758706 11
759308 11
.
.
.
end

A few data points from the end of the previous test are being reported in the next test. This bug does not appear the first time you run the brightness curve test, but on every test after that exactly 2 erroneous lines are printed before the beginning of the current test (marked with u). This bug does not appear on ChromeOS with the tcp bridge setup, and it does not appear on Android with the usb hub/ethernet setup.

Might be related: when running the brightness curve test, and then running Diagnostics -> Reconnect, an error is printed:
Unable to communicate with WALT: Unexpected response from WALT. Expected "v", got ""

Add measurement of the display transition profile

It can take some 7ms for the display to go from black to white. It would be really good to see the shape of the brightness curve as a function of time.

Currently we also time the display transition based on a hard-coded threshold value (in arduino code). It's important to know where on the curve this threshold is for a particualar display.

Sharing the log file often fails due to missing folders or permissions

It looks like the old way of sharing or sending attachments by writing a world readable file to some place like Documents folder is now deprecated. The new way of passing the permissions along via an intent was too magical for me to figure out in one day. Ideally we want the app to create a dedicated folder of it's own that would be world readable so that the log files can be accessed by any other app for viewing or sending. The log files should also have a timestamp as part of the file name.

Screen latency in full screen mode

  • Allows measuring at the very top of the screen.
  • Potencially can be different from normal mode due to difference in graphics pipeline.

App for iOS

It'd be really great if WALT could be used on iOS devices as well. This would allow like-for-like comparison of various performance metrics.

Remove the use of synced clock in payer.c

player.c uses the clock struct assuming it was synchronized via USB. In order to make it work with on ARC++ where synchronization is via TCP we need to switch to returning time in nanoTime() reference (same as CLOCK _MONOTONIC). And do the adjustment to WALT time in Java land.

Problem with bridge mode with remote desktop

To be able to test our devices which doesn't have USB host, we are using pywalt bridge mode, and forward the mort using adb reverse.
This needed to change the IP in APK source code to 127.0.0.1

Doing this, we hit some clock issues.
Checking the drift, or forcing re-sync of clocks doesn't seem to raise anything. Latency is always around 120us.

This has been tested on an Android 5.1 phone, both in USB Host mode and adb reverse bridged mode.
USB host mode works properly, adb reverse bridged mode raises negative dt, all events are dropped because of this.

Sometimes we notice small abs(dt) like -20, but sometimes it looks like the dt is coming from previous tap.
For instance if we wait ~ 15s between two taps, we notice a ~15s dt.

Have you got some ideas on where to look at?

Add a "settings" screen

We need to be able to change a bunch of settings that are currently hard-coded.

Some settings are

  • Number of reps for each type of measurement
  • Delays between measurements
  • Thersholds for waht is condidered to be a "reasonable" reading

Scroll latency testing?

Would it be possible to add scroll latency testing also for Android phones and tablets?
I.e. when the app detects a scroll event, we could flip the screen from/to black/white.
So, by detecting the tap down event (as with tap latency), and then with the screen sensor detect the screen update, we should be able to quantify the scroll (start) latency as well.

Set or check volume level before audio test

For audio output test to work well the volume level needs to be high.
Experiment with the following:

  • Increase WALT sensitivity to allow lover volume, check if it adds too much noise
  • Automatically set volume to max before starting the test (might be limited by system)
  • Check the volume level and alert if it's low

Add AAudio support

Be great if the WALT Android app could use AAudio for running tests since this is likely to have better performance in future.

Input audio latency test fails with "WARNING: No sound detected"

Tested on Nvidia Shield K1 build MRA58K

Steps to repro

  • Connect Android device to WALT
  • Run app and tap 'Audio latency'
  • Tap the microphone icon

Expected result:

  • Input latency test is run

Actual result

  • The following message is displayed: WARNING: No sound detected

Jack detection on some devices

Some phones (Spreadtrum reference design for instance) uses the "T" pin to detect jack presence.
Considering it is left floating in the schematic, on those devices, the jack plug is not detected.

Wiring a 100-Ohms resistor on the pin fixed the issue.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.