Commit Graph

331 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
Herman S.
9371e73d92 [APU] Fix audio crashes during shutdown 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
Gliniak
4b0007bfe5 [XMP] Fixed error caused by incorrect audio allocation for FFMPEG 2026-03-06 20:48:25 +01:00
Herman S.
71c5702ee8 [Build] Convert build system to raw cmake and remove premake layer 2026-03-04 17:37:36 +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.
337afcf318 [XMA] fix unsigned underflow when packet has no frames 2026-02-24 14:32:54 +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.
3e3aee1ef2 [App] Update title to show apu and remove vulkan incomplete warning 2026-02-17 23:50:40 +09:00
Herman S.
fade0cd889 [APU] Add ALSA apu on Linux 2026-02-17 23:46:16 +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
547226fc0b [XMA] Cleanup in XmaDecoder::WriteRegister
- Replaced manual for loop with C++20 countr_zero standard call
2025-12-23 23:28:13 +01:00
Gliniak
0af253e230 [XMA] Separate error status into status and set fields
It's separate bit that defines if error is present
2025-12-05 22:29:09 +01:00
Gliniak
4494e40c71 [XMA] Added multiple versions of XMA decoders
- Fake: No decoding
- Master: 1:1 from base version of Xenia
- Old: Master with improvements
- New: Completely new decoder with better stability (but not compability)

Co-authored-by: Herman S. <429230+has207@users.noreply.github.com>
2025-12-03 20:05:41 +01: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
Gliniak
4ebf8994de [XMA] Revert changes in old XMA decoder to state from master repository.
- If you have new issues with sound it is recommended to switch to new decoder.
2025-11-17 18:29:33 +01:00
Herman S.
707c79a82f [XMP] Ensure volume always set when driver created.
Fixes the issue of the volume starting at default and abruptly
adjusting to the game setting as it changes.
2025-10-29 09:50:07 +01:00
Gliniak
344e8538e0 [XMP] Make volume atomic, fixed issue with invalid SetVolume received from guest
- Replaced invalid log
2025-10-28 21:48:10 +01:00
Gliniak
a25bbed1c3 [XMP] Fixed issue with xmp_default_volume not being correctly applied
- Added menu to modify XMP volume and state
2025-10-28 19:38:51 +01:00
The-Little-Wolf
41b412fa76 [Xam/XMP App] - Clean up & improvements
- Clean up xmp app
- XMPGetTitlePlaylistBufferSize now returns proper errors
- Implement XMPGetDashInItState
- Add missing xnotifications
2025-09-27 09:35:49 +02:00
Margen67
fa8c19edbd [premake, xb] Moar cleanup 2025-08-22 06:22:07 -07:00
Margen67
25d6f8269a [premake] Cleanup 2025-07-27 02:46:43 -07:00
Margen67
3eef564ff8 [format] Require EOF newline 2025-07-19 14:42:21 -07:00
Margen67
4cb783bf22 Header cleanup 2025-07-19 14:42:21 -07:00
Gliniak
fe739208b6 [VFS] Rewrote STFS to use memory mapping
- Replaced old-style buffer, buffer_length with std::span
- Added STFS and SVOD specific Entry and File classes
- Other smaller improvements
2025-05-14 21:38:02 +02:00
Xphalnos
47f327e848 [Misc] Replaced const with constexpr where possible 2025-04-08 19:32:17 +02:00
Xphalnos
7479ccc292 [Misc] Fix Some Warnings on Clang Build with Windows + Adding constexpr 2025-03-27 17:52:18 +01:00
Xphalnos
5f918ef28d [Misc] Replaced const with constexpr where possible 2025-03-25 19:50:37 +01:00
Marco Rodolfi
f58fab1d2c [compiler] Misc changes to make this emulator properly compile under Linux with Clang 2025-01-19 21:37:29 +01:00
Gliniak
09be7e874a [All] Fixed multiple issues during build on Linux
- Added some fixes introduced by RodoMa92 in PR198

- Lack of AVX2 extension (should be done differently in the future)
- Disable deprecated-volatile warning
- Added missing override in posix EventInfo, ImGui notification class and XContent class
- Removed not used XAudio2.h include in XMP
- Fixed missing switch-case in XObject
- Added fugly template in native_list.h
- Fixed multiple smaller issues
2025-01-10 21:41:45 +01:00
Gliniak
7437c020d6 [Misc] Fixed some issues during compilation process on Linux 2025-01-07 22:54:16 +01:00
The-Little-Wolf
95df198d8a [Xbox] kXNotification Additions
- Discovered new unknown kXNotificationID use by XNotifyBroadcast together and wanted to record them before I forget them.
- Changed kXNotificationID  to kXNotification
- Added kXNotificationSystemPXLiveSystemUpdate
2025-01-02 18:19:21 +01:00
Gliniak
3318ab5d4c [3PP] Uplifted FMT version and adjusted messages 2024-12-12 20:28:11 +01:00