6 Commits

Author SHA1 Message Date
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
raylitebull 6da1947ece XAudio2: pure-Rust XMA1/XMA2 decoder 2026-11-21 22:30:28 +01:00
raylitebull c3b10f104a XAudio2: real Opus decoder via Windows MSOpusDecoder MFT
- 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.
2026-11-21 17:26:36 +01:00
ivall 0b17b2e79f README with a detailed status table; drop the shader gallery; no personal paths in docs
- 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.
2026-11-21 15:03:42 +01:00
ivall 98d32ecc65 Translate the repository to English: comments, log/error/CLI messages, tests, docs, HANDOFF
Text only (1771 lines changed one for one); tests that compare output text updated with it.
2026-11-21 15:01:20 +01:00
ivall 8fa7fa0fa3 Initial XCL source and TTPF viewer 2026-11-20 21:03:53 +01:00