475 Commits
Author SHA1 Message Date
David Scott 45f2ef7fef Packaging: containerised CI, Flatpak/AppImage, bundled simd, licence notices, and release-please (#53) 2026-09-10 14:34:56 -04:00
David ScottandClaude Opus 5 cd67cb1689 fix: three crashes found while packaging (#54)
* fix: zero the settings structs so --help does not free garbage

`monocoque --help` aborted with `free(): invalid pointer` on Debian forky --
found by installing the released debian-latest .deb on the distro it is built
for. gdb put it in monocoquesettingsfree() called straight from main().

The early-exit paths (`--help`, `--version`, bad parameters) jump to
cleanup_final before any field of Parameters or MonocoqueSettings is
assigned, and cleanup_final calls monocoquesettingsfree() and freeparams(),
which free every pointer in both. malloc leaves those pointing at whatever
was in the heap block. It is undefined behaviour everywhere; forky's glibc is
simply the first to check, which is why the same source looked healthy on
Debian stable and both Fedoras.

calloc in all three entry points -- monocoque.c, monocoque-cli.c (the `monocoque`
binary) and monocoque-gui.c.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* fix(sound): return from sounddev_init so shaker devices survive setup

Only 2 of 24 configured sound devices came up -- "Could not initialize Sound
Device" for the other 22 -- and no shaker fired, on a rig whose PipeWire graph
looked perfect: monocoque streams connected into all six filter chains, every
node running.

sounddev_init() is declared int and fell off its end without returning, so
new_sound_device() read whatever was left in the return register and treated
that as the error code. The PulseAudio streams had already connected by then;
the device objects were simply freed and never fed telemetry again, which is
why the graph looked right and nothing shook.

Undefined behaviour, so it varies by build: the same config drives shakers
from a locally compiled monocoque and not from the packaged one. Now returns
usb_generic_shaker_init()'s own result.

Verified against a live Assetto Corsa session on real hardware: 26 devices
initialised, no failures, shakers working.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* fix(gui): stop gmonocoque segfaulting on a config without an api key

gmonocoque died before drawing a window, in libconfig:

  #0 config_setting_get_member () from libconfig.so.9
  #1 config_setting_lookup ()
  #2 populate_device_list ()

find_default_config() required sim, api and car to all be present on an
entry and skipped the entry if any lookup failed, so it returned -1;
populate_device_list passed that -1 straight to config_setting_get_elem,
got NULL back, and config_setting_lookup dereferenced it.

No real config has all three. conf/monocoque.config -- the example this
project's own README points at -- sets sim and car and never mentions api,
so this crashed for anyone following the documentation. It stayed hidden in
the Flatpak build only until that manifest was given access to the real
~/.config/monocoque; against an empty config there was nothing to look up.

A key that isn't there no longer disqualifies a match, a -1 falls back to
the first entry (which is what a single-entry config means anyway), and both
NULL paths now return with a message instead of dereferencing. Verified by
rebuilding the Flatpak and launching gmonocoque against the real config that
crashed it: the window opens and stays up.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-04 16:26:53 -04:00
David Scott 501d72fb1e Enable multilib for 32-bit Proton bridge support in distrobox install (#52)
* Add distrobox installer/uninstaller for immutable distros

Adds install-distrobox-dev.sh and uninstall-distrobox-dev.sh under
tools/distro/distrobox/, for setting up monocoque + simapi/simd inside
an Arch Linux distrobox container on immutable distros (Bazzite,
Silverblue, etc.) where native package managers aren't available.

The installer enables the multilib repo and installs wine + lib32-glibc
so the 32-bit Proton bridge executables (e.g. acbridge.exe) have the
32-bit dynamic linker they need — without this, bridge processes fail
silently with a bare "No such file or directory".

Fixes two bugs found before submitting:
- install script's chmod/help-text referenced wrapper script names
  without the -dev suffix used by the actual `cat >` heredocs, which
  would abort the script under set -e on the first chmod
- uninstall script targeted the "simracing" container/install dir
  instead of "simracing-dev", which would silently no-op (or worse,
  target the wrong container) for anyone who also has a non-dev
  simracing container

* Fix typo'd URL to simracing-utilities in install script

The repo is actually named cescofry/simracing-utilties (missing "i"),
not simracing-utilities as originally written - the correctly-spelled
URL 404s.

* Fold fixes into the existing install-distrobox.sh instead of a -dev copy

The previous two commits on this branch added new install-distrobox-dev.sh/
uninstall-distrobox-dev.sh files, but tools/distro/distrobox/install-distrobox.sh
and uninstall-distrobox.sh already exist upstream (#41, #47) — the "-dev"
files were a personal working copy (container renamed to simracing-dev)
that should never have been committed as new files.

This removes the -dev files and instead patches the real
install-distrobox.sh directly with the actual fixes:
- Enable the multilib repo and install wine/lib32-glibc, so the 32-bit
  Proton bridge executables (e.g. acbridge.exe) have the 32-bit dynamic
  linker they need — without this they fail silently with a bare
  "No such file or directory".
- Fix the simracing-utilities URL typo (real repo is simracing-utilties).

uninstall-distrobox.sh needed no changes — the container/install-dir
mismatch found earlier was an artifact of the -dev copy's own renaming,
not a bug in the real upstream script.

* Enable multilib + wine/lib32-glibc, fix simracing-utilities URL typo

These are the actual fixes intended by the previous commit's message —
they didn't get staged there because a stale pathspec in the same `git
add` invocation aborted it before reaching this file.
2026-09-02 00:35:30 -04:00
David Scott 340752857d publish test mode simdata to SIMAPI.DAT shared memory (#51)
`monocoque test` used to only drive locally-initialized devices directly,
so external tools that read SIMAPI.DAT the same way a real running sim
populates it (dashboards, telemetry viewers) saw nothing during a test
run. Opens the shared memory segment at the start of tester() and mirrors
each simdata update into it via a new update_devices() helper, which also
replaces the ~20 duplicated inline device-update loops throughout tester()
with a single call site.

On exit the segment is reset to an inactive frame (simon=false,
SIMAPI_STATUS_OFF) rather than left at whatever the last active-play frame
was - otherwise external readers see the test run as a sim that's still
actively driving forever, since nothing writes to SIMAPI.DAT again until
the next test/play run.
2026-09-02 00:34:07 -04:00
Paul Dino Jones 1cd36de5d5 add dependencies required by nappgui to README 0.3.6 2026-08-21 18:27:13 -04:00
Paul Dino Jones 2431113131 update dependencies in debian control file 2026-08-21 18:26:01 -04:00
Paul Dino Jones 722cc4eb4e add curl and glew dependencies 0.3.5 2026-08-21 15:45:43 -04:00
Paul Dino Jones 48baedf202 add glu dependency 0.3.4 2026-08-21 15:26:52 -04:00
Paul Dino Jones fdbae6198b temporarily add libcurl as dependency 0.3.3 2026-08-21 15:19:33 -04:00
Paul Dino Jones 1f81a6bc96 removed unneeded include 0.3.2 2026-08-21 15:14:15 -04:00
Paul Dino Jones 89e33cf196 add include guard 0.3.1 2026-08-21 15:09:34 -04:00
Paul Dino Jones 7924ef474e add copyright, icons, and gmonocoque to debian packages 0.3.0 2026-08-21 14:49:38 -04:00
Paul Dino Jones d8c85bdc95 Add gmonocoque to fedora 43 build spec 2026-08-21 14:49:13 -04:00
Paul Dino Jones 19c5afa329 add copyright file to package build 0.2.32 2026-08-21 13:36:14 -04:00
Paul Dino Jones 27aea767d8 Add nappgui to dependencies list 2026-08-21 13:33:50 -04:00
Paul Dino Jones 062a4e77ce add header to copyright file 2026-08-21 13:13:51 -04:00
Paul Dino Jones 68b273376d adding copyright file for debian packages 2026-08-21 13:11:46 -04:00
Paul Dino Jones 698ed02987 adding desktop file 2026-08-21 12:53:05 -04:00
Paul Dino Jones ecaf41265a move things around in CMake file 2026-08-20 17:11:13 -04:00
Paul Dino Jones dd93098f39 added gui code 2026-08-18 16:39:24 -04:00
Paul Dino Jones 6d4567facf Only add gui subdirectory on gui builds 0.2.31 2026-06-25 19:35:09 -04:00
Paul Dino Jones 7f52462b68 Add mgui when building gui. Compile as PIE. Add nappgui submodule 0.2.30 2026-06-25 16:28:10 -04:00
Paul Dino Jones 945a04ee66 Add mgui when building gui 2026-06-25 16:24:05 -04:00
Paul Dino Jones 4a30a9735e Add targets for library, cli and gui components 2026-06-25 13:27:19 -04:00
Paul Dino Jones 27b7da8c89 disable arch builds for now 0.2.29 2026-06-24 16:16:27 -04:00
Paul Dino Jones 78cc80064a Fix issue with new haptic code on usb devices and consolidate some function calls 2026-06-23 20:07:53 -04:00
Paul Dino Jones 8eb433f01e Refactor haptic code and devices that rely on it, to more easily allow devices to use the haptic attributes 2026-06-23 13:29:49 -04:00
Paul Dino Jones c4fa9e4138 custom nspawn script for arch build 0.2.28 2026-06-22 13:09:50 -04:00
Paul Dino Jones a9f49d91b9 update to use parent arch pkgbuild workflow action 0.2.27 2026-06-22 12:54:14 -04:00
Paul Dino Jones 87818b6a22 specify correct arch build action 0.2.24 0.2.25 0.2.26 2026-06-22 12:44:31 -04:00
Paul Dino Jones 17dcdcde23 fix path to PKGBUILD 0.2.23 2026-06-22 12:34:38 -04:00
Paul Dino Jones 5c0f871415 Update path to PKGBUILD 0.2.22 2026-06-22 12:32:47 -04:00
Paul Dino Jones 44b9dce139 Add arch build to CI 0.2.20 0.2.21 2026-06-22 12:27:52 -04:00
Paul Dino Jones a776085b76 Add arch build to CI 0.2.19 2026-06-22 12:25:49 -04:00
Paul Dino Jones 0d30170de0 Set buffer size to 64 bytes for simnet pedals. Send 0 for frequency and amplitude when no effect is playing 2026-06-11 18:28:21 -04:00
Paul Dino Jones 2aee847d7c update to latest simapi for ac evo 0.2.18 2026-06-09 13:05:59 -04:00
Paul Dino Jones 9712396c6f Add initial support for simnet pedals 2026-06-01 16:00:13 -04:00
Paul Dino Jones 6a36c2825f further fix return codes on serial devices 0.2.17 2026-05-29 18:21:52 -04:00
Paul Dino Jones 2b787cba00 cleanup the way errors are returned for arduino type devices 2026-05-29 14:28:24 -04:00
Paul Dino Jones 3c81f749b8 various fixes for weirdness with serial devices 2026-05-28 16:25:55 -04:00
David Scott 3c1b1948fd create a rootful, privileged distrobox container (#47) 2026-05-27 13:49:30 -04:00
Paul Dino Jones 3b10509ecd add some directives that seem necessary for debian 0.2.16 2026-05-25 23:58:33 -04:00
Paul Dino Jones b734330d38 fix lua linking 0.2.15 2026-05-25 23:36:57 -04:00
Paul Dino Jones eb95db1dda rename lua in headers 0.2.14 2026-05-25 23:13:53 -04:00
Paul Dino Jones 3a803550ea add more lua variables back to cmake 0.2.13 2026-05-25 23:11:04 -04:00
Paul Dino Jones 26e0e87cd7 add macro for lua 5.4 backwards compatibility so we can compile against lua 5.4 or 5.5 0.2.12 2026-05-25 23:03:57 -04:00
Paul Dino Jones 7f17a5307c refer explicitly to lua 5.4 in headers 0.2.11 2026-05-25 20:46:47 -04:00
Paul Dino Jones ae87a2eaa5 add more dependencies to install.sh 2026-05-25 19:54:08 -04:00
Paul Dino Jones 738a181d61 force lua 5.4 in cmake 2026-05-25 19:53:47 -04:00
Paul Dino Jones ba6c624a59 Improve lua dependency detection for linking 2026-05-25 19:17:47 -04:00