driver_vive: downgrade unknown lightcap report from error to warning#355
Open
rocketmark wants to merge 1 commit intocollabora:masterfrom
Open
driver_vive: downgrade unknown lightcap report from error to warning#355rocketmark wants to merge 1 commit intocollabora:masterfrom
rocketmark wants to merge 1 commit intocollabora:masterfrom
Conversation
SV_ERROR with SURVIVE_ERROR_HARWARE_FAULT crashes the process when an unrecognised USB lightcap report ID is received. New tracker firmware routinely emits report IDs that older libsurvive versions do not know; crashing on an unrecognised ID makes libsurvive incompatible with any firmware newer than it was built against. The adjacent VIVE_REPORT_USB_TRACKER_LIGHTCAP_V1 case already uses SV_INFO and ignores the packet. Apply the same treatment to the unknown case: log a warning and continue so tracking on all known report types is unaffected.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
survive_data_cb_lockedcallsSV_ERROR(SURVIVE_ERROR_HARWARE_FAULT, ...)when it receives a USB lightcap report ID it doesn't recognise.SV_ERRORterminates the process. New tracker firmware routinely emits report IDs that older libsurvive versions don't know about — this makes libsurvive incompatible with any firmware newer than the version it was built against.The adjacent
VIVE_REPORT_USB_TRACKER_LIGHTCAP_V1case already handles a similar situation withSV_INFOand ignores the packet. The unknown-ID case should do the same.Demonstration
BEFORE fix:
Tracker firmware updated, emits new report ID 0xNN
libsurvive: SV_ERROR(SURVIVE_ERROR_HARWARE_FAULT, "unknown type ... 0xNN")
Process: terminated
Result: tracking dead after firmware upgrade, requires libsurvive rebuild
AFTER fix:
Tracker firmware updated, emits new report ID 0xNN
libsurvive: SV_WARN("unknown type ... 0xNN; ignoring")
Packet dropped, all known report types continue processing normally
Result: tracking continues; unknown packet logged once for diagnostics
Impact
Any deployment that runs firmware newer than the libsurvive build is exposed. SteamVR regularly pushes tracker firmware updates; users who update firmware without recompiling libsurvive will hit this immediately.
Change
One file,
src/driver_vive.c.SV_ERROR(SURVIVE_ERROR_HARWARE_FAULT, ...)replaced withSV_WARN(...). The message gains"; ignoring"to make it clear the packet is dropped and tracking continues.Found via
Observed in production: tracker firmware update caused libsurvive to terminate on first lightcap packet with
SURVIVE_ERROR_HARWARE_FAULT. The new firmware emitted a report ID not present in the known-ID list. Rolling back firmware restored operation; this patch restores forward compatibility without requiring a firmware rollback or libsurvive rebuild.