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.
- Add hle::opus: RFC 6716 TOC/packet parser (exact Table 2 frame durations for
all 32 configs, codes 0-3, 120 ms limit), RFC 7845 OpusHead parser/builder,
framing extractor (Ogg Opus, [u16 LE len][pkt] blocks with zero padding, raw
packets), and stateful Decoder backed by dynamically loaded mfplat.dll +
MSOpusDecoder.dll (1-2 ch single-stream and 3-8 ch multistream via RFC 6716
Appendix B self-delimited splitting).
- Wire Opus voices (WAVE_FORMAT_OPUS 0x704F and WAVE_FORMAT_EXTENSIBLE with
MFAudioFormat_Opus) in hle::xaudio2 to decode to PCM16, wrap
IXAudio2VoiceCallback to manage decoded buffer lifetimes and forward the
title's original pBufferContext, flush decoder state on FlushSourceBuffers,
and map tokens back in GetState.
- Add AudioStats counters (opus_voices, opus_buffers_decoded,
opus_decode_errors), unit tests covering SILK/Hybrid/CELT/5.1/framing/lifetime,
and an Opus voice check in tests/testtitle + e2e.
- README: what works (area, details, how it is verified) and what is missing (needs the exe /
not done yet / not planned), requirements incl. the system XGameRuntime.
- gallery/ removed: renders of game shaders do not belong in the repository (the ignored test
still writes them to a local XCL_GALLERY_DIR).
- THIRD_PARTY.md: AMD addrlib (tiling tables, mip chain layout) and the Windows XGameRuntime
(thunk protocol facts, forwarded APIs).
- HANDOFF / design spec: personal paths replaced by placeholders.