Bug 103145

Summary: Record and replay multiple devices at once
Product: evemu Reporter: Peter Hutterer <peter.hutterer>
Component: generalAssignee: Benjamin Tissoires <benjamin.tissoires>
Status: RESOLVED MOVED QA Contact:
Severity: normal    
Priority: medium CC: peter.hutterer
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Peter Hutterer 2017-10-08 10:17:02 UTC
For race conditions between keyboard and touchpad events (for example) we need to record multiple event logs simultaneously so they all have the same timestamps - same with replaying them later.

I'm thinking maybe:
  evemu-record --multiple /dev/input/event5 /dev/input/event6
and have that automatically go into event5.evemu and event6.evemu rather than stdout. And
  evemu-play --multiple event5.evemu event6.evemu
and auto-pick the event node from the file name?

Otherwise, maybe some --multiple --device /dev/input/event5,event5.log, or something like that?
Comment 1 Benjamin Tissoires 2017-10-10 08:04:14 UTC
The '--multiple' seems either superfluous or plain wrong.

For hid-recorder, I just accept several devices at once and interleave the data in the stdout by adding markers for each device.

Problem with having multiple files is that you might lose the synchronization between the two if you do not run in the same process (this is mitigated by the '--multiple' for evemu-play).

All in all, I think I might actually prefer having 2 separate executable with a different format (somehow compatible) that allows interleaving of 2 devices (maybe with some markers at the beginning that are interpreted as comment from regular evemu-play).
Comment 2 Peter Hutterer 2017-10-10 23:51:09 UTC
We need the --multiple because otherwise we may break the current usage of evemu-record device-node output-file. Then again, it'd be trivial enough to check whether output-file is a character device or not, so we could work around that.

So we could work around that, and for evemu-play as well because we either accept a character device or a event sequence, if we have more than one of the latter, we know it's a multiple device recording.

The problem with a new format is that all analysis scripts I have right now work on the current format and ignore comments. Interleaving would mean either having one device as pure comment data or having some completely new file format.

I'm not worried about synchronisation if they're not replayed in the same evemu-play instance, that use-case really doesn't matter :)

For *visual* synchronisation, we could still print a comment line for every event to all non-sending events. So whenever we print N lines to touchpad.evemu, we also print N times
    # E: <timestamp> - event on event0
into all other files. This way all files have the same length and it's visually quite easy to compare when events happen.
Comment 3 GitLab Migration User 2018-07-29 10:47:05 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/libevdev/evemu/issues/1.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.