How ancientjames/multivox works
Main Components
• Hardware/Driver Layer: At the heart of the system is the driver code that creates a shared voxel buffer and then scans it out to the LED panels in sync with the physical rotation. This is primarily in the src/driver directory (including gadget-specific configuration files under gadgets) and associated modules (gpio.c, rotation.c, etc.).
• Voxel Buffer / Shared Memory: A central, shared memory structure that both the driver and client (content generation) components interact with.
• Client/Application Layer: This includes the “multivox” launcher (src/multivox) and the various volumetric demos (“toys” in src/toys). This part handles content generation for the display.
• Common/Platform Layer: Under src/platform one finds common routines for graphics, image handling, math functions, and voxel management that are reused across different client applications.
• Simulator: The src/simulator directory contains a software “Virtex” that mimics the hardware’s output, rendering the voxel buffer in an X11/OpenGL window. It serves as a diagnostic and development tool for when the physical hardware isn’t available.
• Python Utilities: In the python directory there are tools for calibration, pattern generation, point cloud streaming, and converting 3D models (obj2c.py) so that they can be embedded as header files.
Relationships and Interactions
• The Driver Module (src/driver) continuously reads hardware signals (e.g., GPIO inputs for rotation sync) and scans the shared voxel buffer to light up the LED panels.
• The Client/Application Layer (multivox and toys) writes 3D content to the shared voxel buffer for display, and users interact with these via a bluetooth gamepad.
• The Simulator (src/simulator) accesses the same voxel buffer as the driver, but instead renders it in an X11 window using OpenGL calls.
• The Python utilities serve supporting roles—they can generate calibration patterns, stream point clouds to remote viewers (or for testing with the physical device), or transform 3D model files to C header files for embedding in the application.
• Hardware-specific configuration (e.g., gadget settings and GPIO mappings) is abstracted into device-specific headers (e.g., gadget_rotovox.h, gadget_vortex.h) to adapt the driver layer for different display configurations.
Architectural Patterns and Design Principles
• The project clearly separates concerns: the low-level driver functions that directly interact with hardware, and the high-level applications/demos that generate visual content.
• There is a modular design where each “toy” or demo in the src/toys directory is self-contained, suggesting an extensible plugin-like approach via cartridges managed by the multivox launcher.
• The use of a shared memory/voxel buffer is central to the design, ensuring that both driver and client code (or simulator) operate on the same core data structure.
• The project is set up for direct hardware interfacing on a Raspberry Pi (using memory-mapped GPIO access), implying real-time performance considerations, which is why the code even pins processes to specific cores.
Final Recommendations for the Principal Software Engineer
– Hardware (Raspberry Pi, LED panels, GPIO inputs, Bluetooth gamepad/audio)
– Driver/Hardware Abstraction Layer (with a note on device-specific configuration via gadgets)
– Shared Voxel Buffer (core to the data flow between modules)
– Client Layer: Multivox launcher and individual volumetric toys/demos
– Simulator: Soft-rendering of the voxel buffer output via OpenGL/X11
– Supporting Python tools for calibration and model conversion/streaming
• Detail each block with submodules where appropriate (for example, list the different driver files and their functions).