TGViewer
C++ - Reddit C++ - Reddit @r_cpp · 230 subscribers
Post #25024 24
DMA is Dead: Zero-Copy Audio via Capability-Based Shared Memory in a C++26 Microkernel

Authors: Rajeshkumar Venugopal, Third Buyer Advisory, Claude 4.6

Description: A C++26 microkernel inspired by QNX Neutrino demonstrates that DMA is unnecessary for real-time audio transfer. Four user-space processes share a single 3840-byte stereo PCM buffer through capability-based memory grants — zero memory copies, zero DMA, zero kernel-mode drivers. The producer writes interleaved 48kHz/16-bit stereo samples, grants read-only capabilities to an audio driver, a VU meter (sub-region: left channel only), and a waveform visualizer (user-space read-back). IPC transfers only a 4-byte capability ID. The driver reads PCM data directly from the producer's buffer via std::span. Revoke cascades: munmap kills all grants. IPC round-trip latency: 1.31 microseconds (Apple M3, -O2), faster than QNX Neutrino on 600MHz ARM (\~2us) and FreeRTOS context switch on Cortex-M4 (\~7us). 14 invariants formally verified by Z3 (SMT solver): 9 IPC state machine proofs + 5 capability grant proofs. No counterexample exists for any invariant. 67 Catch2 tests, 252 assertions, all passing. BSD 2-Clause licensed. No Java, no Alloy, no DMA.

Keywords: microkernel, QNX, Neutrino, C++26, zero-copy, shared memory, capability-based security, DMA-free, real-time audio, IPC, message passing, send/receive/reply, priority inversion, formal verification, Z3, SMT, F#, alloy-fsx, Catch2, resource manager, PPS, publish-subscribe, stereo PCM, RTOS, embedded systems, BSD license

License: BSD-2-Clause

Repository: https://github.com/chanakyan/qnx-micro

Related: https://github.com/chanakyan/alloy-fsx https://github.com/chanakyan/mars_pathfinder

https://redd.it/1sr5ex1
@r_cpp
GitHub GitHub - chanakyan/qnx-micro: C++26 microkernel inspired by QNX Neutrino. BSD 2-Clause. C++26 microkernel inspired by QNX Neutrino. BSD 2-Clause. - chanakyan/qnx-micro
More from @r_cpp
  1. Oct 5, 2026Declarative GUI toolkit Slint 1.18 Released https://slint.dev/blog/slint-1.18-released htt…
  2. Oct 5, 2026I dislike Rust libraries with a C++ API Cargo compilation model only really works if you a…
  3. Oct 5, 2026CppCon https://cppcon.org/2026/ https://redd.it/1whu7nr @r_cpp
  4. Oct 5, 2026Inja is a template engine for modern C++ https://github.com/pantor/inja https://redd.it/1w…
  5. Oct 5, 2026Bringing Correctly Rounded Math to Production with LLVM-libc https://devblogs.microsoft.co…
  6. Oct 5, 2026C++ Salary expectations Mods: Please note that I am not looking for jobs or trying to brea…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →