Skip to content

Spike S5: tune auto-switch detection window and debounce on real devices #6

Open

Description

@janthoXO

DESIGN.md sections 4.4, 10 and 11 (S5).

Engine has two values that are guesses and still need tuning:

  • debounceDelay = 0.4 s: how long the app waits to group device-list events (for example Bluetooth reconnect storms after wake).
  • autoSwitchWindow = 2 s: a default-device change within this time after a connect, pointing at the newly connected device, counts as a macOS auto-switch instead of a manual choice.

To verify, with USB, Bluetooth, AirPlay and HDMI/DisplayPort devices

  • The order and timing of "device list changed" and "default device changed" events on connect.
  • A lower-ranked device that connects and gets auto-switched by macOS is reverted (table 6.4).
  • A higher-ranked device that connects becomes active.
  • A manual choice in Control Center right after a connect is not reverted, or document that this is a known limitation.
  • Sleep/wake with several Bluetooth devices ends up on the highest-ranked device.
  • Make sure no switching loop happens.

If it fails: find a different signal, or accept occasional misclassification and document it.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions