Skip to content

driver_vive: downgrade unknown lightcap report from error to warning#355

Open
rocketmark wants to merge 1 commit intocollabora:masterfrom
rocketmark:upstream-pr/lightcap-unknown-report
Open

driver_vive: downgrade unknown lightcap report from error to warning#355
rocketmark wants to merge 1 commit intocollabora:masterfrom
rocketmark:upstream-pr/lightcap-unknown-report

Conversation

@rocketmark
Copy link
Contributor

Summary

survive_data_cb_locked calls SV_ERROR(SURVIVE_ERROR_HARWARE_FAULT, ...) when it receives a USB lightcap report ID it doesn't recognise. SV_ERROR terminates 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_V1 case already handles a similar situation with SV_INFO and 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 with SV_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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant