Commit Graph

26 Commits

Author SHA1 Message Date
Herman S.
0efd3a9610 [APU] Move XmaContext::Block() to base class with RAII locking 2026-03-09 14:15:14 +09:00
AllanCat
10cecae4c2 [XMA] Fixed min output space gating to match Consume() write granularity
The decoder gate required a full frame of free blocks (4 mono / 8 stereo +
padding) before allowing a decode pass, but Consume() only writes
subframe_decode_count blocks per call. Games like TGM Ace with
subframe_decode_count=2 on a small ring buffer could never meet the old
threshold, causing a permanent decoder stall.
2026-03-07 11:46:21 +09:00
Herman S.
4757ab0931 [APU] Fix ffmpeg upgrade related logspam 2026-03-04 13:05:37 +09:00
Herman S.
cd5df622a9 [3PP] Switch FFmpeg to latest release with port of xmaframes codec
And pull out all the xenia specific build junk into
third_party/ffmpeg-xenia rather than keeping it checked in the
submodule
2026-03-04 13:05:31 +09:00
Herman S.
bc54720559 [XMA] Fix consume-only context resetting output buffer offsets
And remove the now-unused HasTightOutputBuffer heuristic
2026-02-26 10:28:49 +09:00
Herman S.
80a78c509f [XMA] Write back output_buffer_read_offset in StoreContextMerged 2026-02-24 14:32:54 +09:00
Herman S.
6265698eef [XMA] Swap input buffer on unresolvable split headers 2026-02-24 14:32:54 +09:00
Herman S.
d68ff7243a [XMA] Fix consume-only path write offset and drain check 2026-02-24 14:32:54 +09:00
Herman S.
6ee55aafb4 [XMA] Guard against subframe_decode_count being 0 2026-02-24 14:32:54 +09:00
Herman S.
013320c051 [XMA] Implement loop subframe precision 2026-02-24 14:32:54 +09:00
Herman S.
8586cc196d [XMA] Add diagnostic logging to new decoder 2026-02-24 14:32:49 +09:00
Herman S.
51c5936566 [XMA] convert GetNextPacketReadOffset from recursion to iterative loop 2026-02-24 12:41:08 +09:00
Herman S.
470e62af22 [XMA] detect full packet skip sentinel and advance rather than overshoot 2026-02-24 12:41:02 +09:00
Herman S.
a1eef3a2b8 [XMA] swap to valid buffer instead of stalling when current is invalid 2026-02-24 12:40:56 +09:00
Herman S.
d759938979 [XMA] skip split frame tails instead of decoding as complete frames 2026-02-24 12:40:47 +09:00
Herman S.
cc53e0252a [XMA] don't queue output subframes when frame decode fails 2026-02-24 12:40:39 +09:00
Herman S.
2c75055caf [XMA] treat frame_size 0 as end-of-packet padding (XMA1 compat) 2026-02-24 12:40:31 +09:00
Herman S.
d9747704be [XMA] Reserve headroom per decoded frame and account for it in gating
The 3-bit field at +24bit in DWORD 1 of the XMA context was named
subframe_skip_count but never actually used for skipping subframes.
Testing across multiple titles (PGR4, Halo Reach) shows the field
might control extra output buffer blocks that must be reserved per decoded
frame. Renaming the field to output_buffer_padding to reflect this
observed behavior and adding padding to the minimum output space threshold

Pdding blocks are reserved from the output budget after each frame is
fully consumed, preventing the decoder from overrunning the space
that the game expects to remain free.

This is still likely not entirely correct but reduces some of the
observed noise in current implementation.
2026-02-18 18:14:44 +09:00
Herman S.
2d6b7c6ca1 [XMA] Fix dedicated thread stalls by blocking guest audio thread
Includes various other thread safety and timing related adjustments
2026-02-17 13:57:32 +09:00
Herman S.
6e5b2a95b0 [XMA] Fix multiple audio issues in new decoder
- Handle XMA2 frames with headers split across packet boundaries
  (fixes audio cutoff in Capcom games)
- Output buffer minimum space check using actual frame size instead
  of SDC-based formula, allowing tight-buffer contexts to decode
  (fixes PGR4 engine sounds)
- Gate consume-only context clearing with tight-buffer heuristic to
  prevent disrupting playback while still allowing stream completion
  signaling (fixes Borderlands 2 dialog)
- Clamp read offset 0 to packet header size to prevent decode rejection
  loop (fixes Dirt 2 crashes)
2026-02-17 13:56:24 +09:00
Herman S.
7213f7e69b [XMA] Fix consume-only context clear being overwritten in new decoder 2026-02-17 13:54:19 +09:00
Herman S.
ea056849fa [XMA] Fix recursive lock acquisition in new decoder 2026-02-17 13:54:05 +09:00
Gliniak
dd29365970 [APU] Switched to New XMA decoder as default
- Added codepath for "consume only" pass. This should resolve constant clicking in Source engine games.
- Added smaller performance improvements to decoder
2025-12-01 23:58:33 +01:00
Margen67
4cb783bf22 Header cleanup 2025-07-19 14:42:21 -07:00
Gliniak
3318ab5d4c [3PP] Uplifted FMT version and adjusted messages 2024-12-12 20:28:11 +01:00
Gliniak
122f58c9dd [APU] Added new XMA decoder as config option. 2024-03-26 09:39:23 +01:00