commit 516d4a8c6a39b15912cdcb8e310c26d7f11b8ba0
parent 91329febb83f8803b3d249fcd02be7dab8e23c5e
Author: Vineet Kumar <git@vineetk.net>
Date: Wed, 25 Nov 2026 02:30:08 +0100
packages/vr: patch libsurvive for trying to fix the calibration
from https://github.com/collabora/libsurvive/issues/336
Diffstat:
1 file changed, 56 insertions(+), 1 deletion(-)
diff --git a/epistemia/packages/vr.scm b/epistemia/packages/vr.scm
@@ -26,7 +26,62 @@
(file-name (git-file-name name version))
(sha256
(base32
- "1kpp5lxyz10c5sgsgrb0igny9d737byh4w4m626zxngm2nvlqqgv"))))
+ "1kpp5lxyz10c5sgsgrb0igny9d737byh4w4m626zxngm2nvlqqgv"))
+ (patches (list (plain-file "0001-ootx-Respect-disable-calibrate-when-detecting-lighth.patch" "\
+From ec9f580245c6419bb4ef77fe0d4db1dbb4e77b5d Mon Sep 17 00:00:00 2001
+From: Vineet Kumar <git@vineetk.net>
+Date: Wed, 25 Nov 2026 02:18:56 +0100
+Subject: [PATCH] ootx: Respect disable-calibrate when detecting lighthouse
+ movement
+
+Signed-off-by: Vineet Kumar <git@vineetk.net>
+---
+ src/survive_process_gen2.c | 16 ++++++++++++++--
+ 1 file changed, 14 insertions(+), 2 deletions(-)
+
+diff --git a/src/survive_process_gen2.c b/src/survive_process_gen2.c
+index aa2c9da..590275f 100644
+--- a/src/survive_process_gen2.c
++++ b/src/survive_process_gen2.c
+@@ -48,7 +48,9 @@ static void ootx_packet_clbk_d_gen2(ootx_decoder_context *ct, ootx_packet *packe
+ BaseStationData *b = &ctx->bsd[id];
+ b->OOTXChecked |= true;
+ FLT accel[3] = {v15.accel_dir[0], v15.accel_dir[1], v15.accel_dir[2]};
+- bool upChanged = norm3d(b->accel) != 0.0 && dist3d(b->accel, accel) > 1e-3;
++ bool upChanged = !survive_configi(ctx, \"disable-calibrate\", SC_GET, 0) &&
++ norm3d(b->accel) != 0.0 &&
++ dist3d(b->accel, accel) > 1e-3;
+
+ if (upChanged) {
+ SV_VERBOSE(10, \"OOTX up direction changed for %x (%f)\", b->BaseStationID, norm3d(b->accel));
+@@ -95,7 +97,16 @@ static void ootx_packet_cblk_d_gen1(ootx_decoder_context *ct, ootx_packet *packe
+ BaseStationData *b = &ctx->bsd[id];
+ b->OOTXChecked = true;
+ FLT accel[3] = {v6.accel_dir_x, v6.accel_dir_y, v6.accel_dir_z};
+- bool upChanged = norm3d(b->accel) != 0.0 && dist3d(b->accel, accel) > 1e-3;
++ bool upChanged =
++ !survive_configi(ctx, \"disable-calibrate\", SC_GET, 0) &&
++ norm3d(b->accel) != 0.0 &&
++ dist3d(b->accel, accel) > 1e-3;
++
++ if (upChanged) {
++ SV_INFO(\"Gen1 OOTX up direction changed for %x: delta=%f\",
++ b->BaseStationID,
++ dist3d(b->accel, accel));
++ }
+
+ bool doSave = b->BaseStationID != v6.id || b->OOTXSet == false || upChanged || b->mode != v6.mode_current;
+ b->sys_unlock_count = v6.sys_unlock_count;
+@@ -120,6 +131,7 @@ static void ootx_packet_cblk_d_gen1(ootx_decoder_context *ct, ootx_packet *packe
+ b->accel[2] = v6.accel_dir_z;
+ b->mode = v6.mode_current;
+
++ SV_INFO(\"Resetting Gen1 lighthouse %d position\", id);
+ survive_reset_lighthouse_position(ctx, id);
+
+ SURVIVE_INVOKE_HOOK(ootx_received, ctx, id);
+--
+2.55.0\n")))))
(build-system cmake-build-system)
(arguments (list #:tests? #f))
(inputs (list zlib-ng