Summary
CAN message timestamps produced by PCBUSB drift increasingly behind wall-clock time after the host Mac has gone through one or more sleep/wake cycles since boot. This surfaces downstream as incorrect dating in BLF/CSV logs (e.g., via python-can's PcanBus), where log timestamps lag real time by roughly the machine's cumulative sleep duration.
Environment
- macOS version 26.5.1, Macbook Pro
- PCBUSB library version: 0.13
- Accessed via python-can PcanBus interface
Steps to Reproduce
- Boot/wake the Mac and note current wall-clock time.
- Put the machine to sleep for a known duration (e.g., ~10–15s).
- Wake the machine and immediately start a CAN capture session via PCBUSB (directly, or through python-can).
- Compare elapsed wall-clock time since session start against the elapsed time reported in the message timestamps.
Observed Behavior
In a controlled test, wall-clock time advanced by 73.6s over the test window while the reported elapsed timestamp only advanced by 60.9s — a 12.7s shortfall that matches the recorded macOS sleep duration for that period. This was consistent across repeated tests: the timestamp gap tracks cumulative sleep time, not elapsed real time.
We also ruled out connection/re-enumeration as the cause: unplugging and reconnecting the adapter for 60 seconds did not reset or correct the drift, indicating the underlying counter itself is not sleep-aware, independent of USB connection state.
Expected Behavior
Message timestamps should track wall-clock elapsed time regardless of intervening system sleep, so that logs (BLF/CSV) reflect accurate real-world timing for post-test analysis.
Impact
Any capture session on a Mac that has slept since boot will produce logs with a timestamp offset equal to the accumulated sleep duration. This affects any timestamp-dependent post-processing (event correlation, cross-referencing with other timestamped data, compliance/test records).
Additional Notes
We've confirmed this is not a bug in downstream consumers — python-can's BLF writer and CSV converter simply persist the timestamp values they receive from PCBUSB unmodified. The drift is present in the raw values coming out of the library itself.
Happy to provide raw capture logs, sleep/wake timestamps, and our test harness if useful for reproduction.
Summary
CAN message timestamps produced by PCBUSB drift increasingly behind wall-clock time after the host Mac has gone through one or more sleep/wake cycles since boot. This surfaces downstream as incorrect dating in BLF/CSV logs (e.g., via python-can's PcanBus), where log timestamps lag real time by roughly the machine's cumulative sleep duration.
Environment
Steps to Reproduce
Observed Behavior
In a controlled test, wall-clock time advanced by 73.6s over the test window while the reported elapsed timestamp only advanced by 60.9s — a 12.7s shortfall that matches the recorded macOS sleep duration for that period. This was consistent across repeated tests: the timestamp gap tracks cumulative sleep time, not elapsed real time.
We also ruled out connection/re-enumeration as the cause: unplugging and reconnecting the adapter for 60 seconds did not reset or correct the drift, indicating the underlying counter itself is not sleep-aware, independent of USB connection state.
Expected Behavior
Message timestamps should track wall-clock elapsed time regardless of intervening system sleep, so that logs (BLF/CSV) reflect accurate real-world timing for post-test analysis.
Impact
Any capture session on a Mac that has slept since boot will produce logs with a timestamp offset equal to the accumulated sleep duration. This affects any timestamp-dependent post-processing (event correlation, cross-referencing with other timestamped data, compliance/test records).
Additional Notes
We've confirmed this is not a bug in downstream consumers — python-can's BLF writer and CSV converter simply persist the timestamp values they receive from PCBUSB unmodified. The drift is present in the raw values coming out of the library itself.
Happy to provide raw capture logs, sleep/wake timestamps, and our test harness if useful for reproduction.