Files
xcl/THIRD_PARTY.md
ivall 2b4bb431e4 xapu: decode the title's Opus packets into its output buffer; libopus where Windows has none (PR #294, simnJS)
A retail game is mute under XCL: it does not use XAudio2 but sends its sound to the
console's audio decoder (xapu), and XCL answered every xapu command with silence. Everything
goes to stream 0 through XApuEnqueueCommand: Activate (kind 1) with the channel count and
48 kHz, Process (kind 3) with one raw Opus packet (CELT fullband 20 ms) and a float output
buffer, Deactivate (kind 2). The title reads the decoded PCM back, mixes it and plays its
mix itself through Windows Spatial Audio, so XCL only decodes into its buffer.

- hle/acphal.rs: the first Activate of a stream makes its decoder, a later one with the same
  layout resets it; Process decodes into the title's output and returns the frames written;
  a packet that does not decode, or a stream not connected, still gets silence. report.json
  gets xapu counters, the log a summary every 5 s; XCL_TRACE_APU=1 traces the commands.
- hle/opus.rs: when Media Foundation has no Opus decoder (Wine), libopus is loaded at run
  time from %XCL_OPUS_DIR% or next to xcl.exe (not distributed; THIRD_PARTY.md); Windows
  keeps its own decoder.
2026-11-24 00:42:08 +01:00

26 lines
3.2 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# XCL third-party sources
XCL is licensed under **GPL-2.0-only** (`LICENSE`). Below is everything that comes from outside,
together with its license and how it is used. Files that contain logic ported from another project
carry a note in their header about its origin and the date of changes (GPL-2.0 §2a requirement).
| Source | License | What in XCL | How |
|---|---|---|---|
| [AnyPS5](https://github.com/boykopovar/AnyPS5) | GPL-2.0-only | recompiler (`crates/xcl/src/gpu/recomp/`) – portions of logic marked in the files | port to Rust/HLSL with annotation |
| [FFmpeg](https://ffmpeg.org/) | LGPL-2.1+ | XMA1/XMA2 decoder and tables (`crates/xcl/src/hle/xma2/`) – after `libavcodec/wmaprodec.c`, `wmaprodata.h`, `wma.c`, `sinewin_tablegen.h`, `libavutil/float_dsp.c`, `tx_template.c` | port to safe Rust with annotation |
| [AMD Machine-Readable GPU ISA](https://gpuopen.com/machine-readable-isa/) | MIT | `crates/xcl/src/gpu/rdna2_spec.rs` (generated by `scripts/gen_rdna2.py`) | encoding and instruction tables |
| [AMD addrlib](https://gitlab.freedesktop.org/mesa/mesa/-/tree/main/src/amd/addrlib) (Mesa) | MIT | `crates/xcl/src/gpu/tiling_tables.rs` (generated by `scripts/gen_tiling.py` from `gfx10SwizzlePattern.h`); GFX10 mip chain / mip tail layout in `gpu/tiling.rs` (after `Gfx10Lib::ComputeSurfaceInfoMacroTiled`) | swizzle tables; layout logic ported with annotation |
| [LLVM](https://github.com/llvm/llvm-project) | Apache-2.0 WITH LLVM-exception | `tests/data/llvm-amdgpu/*` (test data, not part of the program); GFX10 buffer format values (`UfmtSymbolicGFX10`) in `gpu/recomp/emit.rs` | test vectors; hardware facts |
| [WinDurango](https://github.com/WinDurango/WinDurango) | LGPL-3.0 | no code; d3d12_x.dll export numbers (facts) in `crates/xcl/data/stubdb.toml` | reference only |
| [libHttpClient](https://github.com/microsoft/libHttpClient) | MIT | no code; XTaskQueue/XAsync contract | specification |
| Windows XGameRuntime (`System32\xgameruntime.dll`) | system | class GUIDs and slot order of the GDK thunk protocol in `hle/xgameruntime/api.rs` (facts, determined by analysis); APIs XCL does not implement are forwarded to it at runtime | interoperability; not distributed |
| docs.xbox.com | documentation | signatures, enums, structs written independently | reference |
| Rust crates (`Cargo.lock`) | MIT / BSD-2 / Zlib / Unlicense (or with an MIT alternative) | build dependencies | statically linked |
| [libopus](https://opus-codec.org/) (`opus.dll`) | BSD-3-Clause | Opus decoding where Windows has no `MSOpusDecoder.dll` (Wine): loaded at runtime from `%XCL_OPUS_DIR%` / next to xcl.exe (`hle/opus.rs`) | **not** distributed with XCL |
| DXC (`dxcompiler.dll`, `dxil.dll`) from the Windows SDK | NCSA (dxcompiler) / Microsoft (dxil) | HLSL → DXIL compilation at runtime | loaded from the user's SDK, **not** distributed with XCL |
| Windows system libraries (d3d12, dxgi, xaudio2_9, mfplat, MSOpusDecoder, ole32 …) | system | target APIs | GPL-2.0 "system library" exception |
When adding dependencies: compatible with GPL-2.0-only are MIT, BSD, Zlib, ISC, Unlicense, LGPL-2.1(+),
GPL-2.0(+), MPL-2.0 (via its Secondary License clause). Incompatible: Apache-2.0 without an alternative,
GPL-3.0, LGPL-3.0, AGPL.