ProjectsTobii Gaze for Linux
The Tobii Gaze window on its setup page, with a five step checklist and a picker for the screen the tracker sits under

Linux and hardware

Tobii Gaze for Linux

Eye tracking on Linux with a gaze ring that only stream viewers see

tobiifree
About 33 Hzactual sample rate of a tracker sold as 133 Hz
13patches to the driver
21 of 2,000replies sent to the wrong client before the routing fix

Tobii Gaze for Linux draws where a player is looking into an OBS stream, with an overlay that exists only inside OBS, so the player never sees it. It builds on tobiifree by Aetherall, which did the USB reverse engineering that makes the tracker usable on Linux at all. My work sits on top of it, in the driver patches, the calibration tool, a tray app, and the OBS filter.

How it works

The tracker's driver runs as a background daemon, and the other programs talk to it over a socket. The calibration tool teaches the system how the tracker's readings line up with positions on the screen. The tray app turns gaze on and off and sets up the ring, and a filter plugin in OBS draws the ring on the capture of the tracked screen. The app and the filter share the ring's constants, so the preview and the stream draw the same ring.

A purple gaze ring preview with controls for style, opacity, and color
The ring preview and its controls for style, opacity, and color.

Thirteen patches change the driver. They make the daemon send each reply only to the client that asked and let one part own the USB connection to the tracker. They also hold back data for slow readers, report the tracker's status, and tell systemd when it's ready. The README names the patch series as the notice GPL asks for.

Calibration turned out to depend on where you sit. A calibration from the day before, taken at a different seat, left three of the four edge targets 107 to 166 px off. Refitting to that run's own readings left each column off by at most 11 px, which points to the old seat. The coverage check now prints how far you sit from where the calibration was taken, which helps tell a stale calibration from a problem at the screen edges.

Highlights

  1. Measured, not trustedTobii sells the tracker as 133 Hz, and the driver's notes give a 232 byte sample. Neither held up. A sample is 392 bytes, and the tracker ships every fourth frame, which makes about 33 Hz. The code follows what was measured.
  2. A calibration overflow, fixedA 512 byte buffer overflowed on any calibration blob past roughly 478 bytes. The patch enlarges the buffers and bounds every blob against the 4096 byte limit.
  3. Recovers from unpluggingAn unplug is detected instead of looking like an idle device, and the daemon reopens the tracker with a growing wait. It also starts when the tracker isn't there yet.

Built with

  • C
  • C++
  • Qt 6
  • KDE Frameworks
  • libobs
  • Zig

Details

Started
Status
In development
License
GPL 3.0
Source
Not public yet
Built on
tobiifree