Delay before touch is active
This document explains the short delay there can be before touch is active when the system starts, when a USB touch device is plugged in, or when a touch screen is switched back to the computer (for example by a KVM switch or a monitor's input switch), in UPDD 7.
Delay recognising a USB device
During system startup, or when a device is hot plugged, there is a delay of between 5 and 10 seconds before the device is discovered and ready to use, as explained in Hardware interfaces.
The UPDD Console shows the state of each UPDD device and is refreshed periodically while it is on display. When a USB device is plugged in it can therefore take a short time to be discovered and start working, and for its status to be updated in the Console.
Device change debounce
When devices are connected, Windows and the other operating systems send a series of device change messages, for the touch device and for every other device being reconnected (keyboard, mouse, video and so on). The driver does not know which device change relates to the touch device, and responding to every message can cause problems, so it uses a technique called debounce: it ignores device changes until none has been seen for 2 seconds, then looks for its devices.
With some devices, trying to take control immediately, or while the device changes are still arriving, often results in unreliability. The 2-second delay from the driver, plus the time the devices take to settle down, is in our opinion the fastest reconnect that gives good reliability in all situations.
The device_change_debounce setting
UPDD 7.0.50 introduced the global setting device_change_debounce. If it is not set, the debounce period is 2000 ms (2 seconds). Setting it to 0 turns off the debounce processing completely:
upddutils global set device_change_debounce 0
Any other non-zero value leaves the debounce period at 2000 ms: only 0 changes the behaviour. It is possible to experiment with this on a case by case basis. The setting is listed in the driver settings reference.
Example: switching a touch screen back to Windows (2022)
In August 2022 a customer with a system that could switch its touch screen between Windows and Android reported a delay of between 4.5 and 10 seconds before touch was ready after switching back to Windows. These are our findings, from the UPDD debug log running at the time of the switch.
When the devices were reconnected to Windows there was a series of device change messages, deferred by the debounce:
2022/08/15-11:34:08: DBG: Device change event deferred - debounce
2022/08/15-11:34:08: DBG: Device change event deferred - debounce
2022/08/15-11:34:09: DBG: Device change event deferred - debounce
2022/08/15-11:34:10: DBG: Device change event deferred - debounce
The device changes arrived over a 2-second period, and the driver then waited its own 2 seconds: about 4 seconds in total. If the last event corresponds to the touch device, the touch device is not ready until 2 seconds after the switch.
In a second capture, the device change was seen at 14:30:56; 4 seconds later the first devices started to connect, and 2 seconds after that the touch device (VID 314C, PID 0100) appeared:
2022/08/15-14:30:56: TRC: OSConnectorW32::DoDeviceChange()
2022/08/15-14:30:59: TRC: Entering GetHidDevicePaths
.
2022/08/15-14:31:01: TRC: OSConnectorW32::OnEnumHIDDevices()
2022/08/15-14:31:01: TRC: Entering GetHidDevicePaths
2022/08/15-14:31:01: TRC: Found: \\?\hid#vid_314c&pid_0100&mi_01&col02#9&2efcf615&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}
.
2022/08/15-14:31:01: TRC: Entering GetUpddDevicePaths: upddhid
We concluded that although by default UPDD waits for the system to settle down, the devices only become ready after a similar time, and UPDD works as soon as the devices are available.
For review
- Facet platform changed from windows to all: the debounce is in the shared OSConnector (updd/osconnector.cpp:51-58, 146-151) and the enumeration delay in 50607 is not platform-specific; the 2022 example is marked Windows.
- 50795 said 'you can set a lower value'. The source takes any non-zero value as a fixed 2000 ms (updd/osconnector.cpp:57-58, review E16); the text now says only 0 changes the behaviour. If a configurable period is intended, that is a driver change.
- 50393 (UPDD 6 Windows timings: 10 s retry, 1 minute wait) and 50524 (explorer.exe not the shell, wisptis.exe 2-minute delay, DelayedDesktopSwitchTimeout) are retired and nothing is taken from them. If custom-shell kiosks still report a 2-minute delay on Windows 10/11, 50524's registry setting may deserve a line here once confirmed.