upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime/opus_decoder/README.md
diff options
context:
space:
mode:
authorJan Trencansky <jan.trencansky@protonmail.com>2026-11-26 16:55:04 -0500
committerJan Trencansky <jan.trencansky@protonmail.com>2026-11-26 16:55:04 -0500
commitdf92abca8ee2a8f9093efea7fcaa4dadc3ddaebc (patch)
tree97ef8f95544fe263049d3f7360823f16100de209 /runtime/opus_decoder/README.md
parent49a0b69fcdb80db1f2a44ce7ca0ab8dfdec1e403 (diff)
parente5a7c8942678b323f655939c81f5d8855d20c248 (diff)
Merge main e5a7c8942 into shadow-aliased-guard (#1867)
One conflict, runtime/README.md: this branch rewrote the LEONIDA_SHADOW_ALIAS_MS row, main (#2163) added the LEONIDA_SHADOW_KEEP row after it. Both rows kept; the keep row's "aliased" now reads "aliased while they can't be guarded at every address", since aliased pages are no longer copied without a sign of a write. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'runtime/opus_decoder/README.md')
-rw-r--r--runtime/opus_decoder/README.md33
1 files changed, 33 insertions, 0 deletions
diff --git a/runtime/opus_decoder/README.md b/runtime/opus_decoder/README.md
new file mode 100644
index 000000000..2b516e496
--- /dev/null
+++ b/runtime/opus_decoder/README.md
@@ -0,0 +1,33 @@
1# Opus decoder C ABI
2
3This crate exposes a C ABI around the BSD-3-Clause `opus-pure` package for the console audio
4decoder (`xapu.dll`). The command protocol lives in `runtime/shims/xapu_chad.cpp`; this crate only
5decodes one Opus packet into interleaved f32 PCM, resets the decoder, and (for tests) encodes a
6synthetic tone.
7
8## Build
9
10```sh
11cargo fmt --manifest-path runtime/opus_decoder/Cargo.toml -- --check
12cargo test --manifest-path runtime/opus_decoder/Cargo.toml --locked
13cargo build --release --manifest-path runtime/opus_decoder/Cargo.toml --locked
14```
15
16`runtime/CMakeLists.txt` builds this crate for `x86_64-pc-windows-msvc` at configure time when
17`cargo` is on `PATH` and links it into `gta6rt` and `xapu_chad_test` with
18`LEONIDA_HAVE_OPUS_DECODER` defined. The first build fetches `opus-pure` from crates.io. Set
19`CARGO_NET_OFFLINE=true` for a configure that uses only the local Cargo cache.
20
21Without `cargo`, when the build fails, or with the `cl.exe` fallback of `scripts/build_runtime.ps1`,
22the XAPU path stays silent. Use `-DLEONIDA_REQUIRE_OPUS_DECODER=ON` to require the decoder in a
23CMake build.
24
25To link an already-built `leonida_opus_decoder.lib` without invoking `cargo` during CMake
26configure, pass `-DLEONIDA_OPUS_DECODER_LIB=<path>`.
27
28## Facts and credit
29
30The `xapu.dll` command protocol (connect input/output, per-stream command budget, activate /
31process / reset / deactivate, result order) follows Marvisak/VIctory
32`crates/victory-hle/src/modules/apu.rs` (GPL-3.0-or-later), which this repository already credits for
33other modules. `opus-pure` is BSD-3-Clause and stays a dependency; no code from it is copied.