Commit Graph

49 Commits

Author SHA1 Message Date
Gliniak
fac2a89d0f Disallow offset to be set before header, header size fix, audio channels crashfix 2022-10-24 19:43:43 +02:00
chss95cs@gmail.com
8f7f7dc6ad fixed wine crash from use of NtSetEventPriorityBoost
add xe::clear_lowest_bit, use it in place of shift-andnot in some bit iteration code
make is_allocated_ and is_enabled_ volatile in xma_context
preallocate avpacket buffer in XMAContext::Setup, the reallocations of the buffer in ffmpeg were showing up on profiles
check is_enabled and is_allocated BEFORE locking an xmacontext. XMA worker was spending most of its time locking and unlocking contexts
Removed XeDMAC, dma:: namespace. It was a bad idea and I couldn't make it work in the end. Kept vastcpy and moved it to the memory namespace instead
Made the rest of global_critical_region's members static. They never needed an instance.
Removed ifdef'ed out code from ring_buffer.h
Added EventInfo struct to threading, added Event::Query to aid with implementing NtQueryEvent.
Removed vector from WaitMultiple, instead use a fixed array of 64 handles that we populate. WaitForMultipleObjects cannot handle more than 64 objects.
Remove XE_MSVC_OPTIMIZE_SMALL() use in x64_sequences, x64 backend is now always size optimized because of premake
Make global_critical_region_ static constexpr in shared_memory.h to get rid of wasteage of 8 bytes (empty class=1byte, +alignment for next member=8)
Move trace-related data to the tail of SharedMemory to keep more important data together
In IssueDraw build an array of fetch constant addresses/sizes, then pre-lock the global lock before doing requestrange for each instead of individually locking within requestrange for each of them
Consistent access specifier protected for pm4_command_processor_declare
Devirtualize WriteOneRegisterFromRing.
Move ExecutePacket and ExecutePrimaryBuffer to pm4_command_buffer_x
Remove many redundant header inclusions access xenia-gpu
Minor microoptimization of ExecutePacketType0

Add TextureCache::RequestTextures for batch invocation of LoadTexturesData

Add TextureCache::LoadTexturesData for reducing the number of times we release and reacquire the global lock.
Ideally you should hold the global lock for as little time as possible, but if you are constantly acquiring and releasing it you are actually more likely to have contention
Add already_locked param to ObjectTable::LookupObject to help with reducing lock acquire/release pairs
Add missing checks to XAudioRegisterRenderDriverClient_entry. this is unlikely to fix anything, it was just an easy thing to do
Add NtQueryEvent system call implementation. I don't actually know of any games that need it.
Instead of using std::vector + push_back in KeWaitForMultipleObjects and xeNtWaitForMultipleObjectsEx use a fixed size array of 64 and track the count. More than 64 objects is not permitted by the kernel. The repeated reallocations from push_back were appearing unusually high on the profiler, but were masked until now by waitformultipleobjects natural overhead
Pre-lock the global lock before looking up each handle for xeNtWaitForMultipleObjectsEx and KeWaitForMultipleObjects.
Pre-lock before looking up the signal and waiter in NtSignalAndWaitForSingleObjectEx
add missing checks to NtWaitForMultipleObjectsEx
Support pre-locking in XObject::GetNativeObject
2022-10-08 09:55:17 -07:00
chss95cs@gmail.com
08f7a28920 Alternative mutex 2022-08-14 08:59:11 -07:00
Gliniak
6c6c5ac14b Merge remote-tracking branch 'GliniakRepo/experimentals' into canary_experimental 2022-05-19 10:51:44 +02:00
Philpax
e901567193 Fix crash from null sample channel
Certain games, such as Forza Motorsport 3, submit XMA data with the
stereo flag set with a null second channel. This falls back to mono
conversion when the second channel is null, preventing a crash.
2022-05-19 10:22:41 +02:00
Gliniak
de03165995 Merge remote-tracking branch 'GliniakRepo/audioSkipHeaderInputOffset' into canary_pr 2022-05-19 10:16:41 +02:00
Gliniak
8e35a3d649 Invalidate input buffers if decoding fails
Should output be invalidated too?
2022-01-31 20:11:44 +01:00
Gliniak
c80ea14d9d Check if input_buffer exist
In some really specific cases there is a chance that
one of the buffers is valid, but its pointer is null
2022-01-31 20:10:14 +01:00
Pseudo-Kernel
372bdd3ec9 [APU] XMA: Fix audio loop handling.
Handles audio loop if loop_start < loop_end.
Need to handle additional cases like loop_start > loop_end.
2022-01-29 02:49:00 -06:00
Gliniak
f40607041b [APU] Skip audio header when there is no valid input
Thanks Cancerous1/Randprint for initial reseach in this topic
2021-10-18 08:50:51 +02:00
Triang3l
e720e0a540 [Code] Remove game names from code comments (most of at least) 2021-09-05 21:27:40 +03:00
Gliniak
313fb3e5a3 [XMA] GetFrameNumber: Return correct frame_idx at stream end 2021-06-05 08:54:22 -05:00
Triang3l
ca7036707b [APU] XMA: Instruction name comment typo correction 2021-06-05 16:43:49 +03:00
Triang3l
add65318c2 [APU] XMA: ConvertFrame always returns true 2021-06-05 16:27:40 +03:00
Triang3l
60b24b2d3a [APU] XMA: Vectorize 2-channel ConvertFrame 2021-06-05 16:10:41 +03:00
Triang3l
3c20a83972 [Base] Float clamping cleanup 2021-06-05 14:55:55 +03:00
Joel Linn
89a7c8f41f [APU] Add vectorized audio frame conversion 2021-06-05 14:08:16 +03:00
Gliniak
57ce647bb3 [APU/XMA] Prevent crash with invalid packet number 2021-05-07 16:59:17 -05:00
Joel Linn
b6e5719173 [APU] Fix compilation on Linux 2021-05-01 12:41:02 -05:00
Joel Linn
534e263b05 [APU] XMA: Cross-buffer split frames. 2021-05-01 12:41:02 -05:00
Joel Linn
6547fa1748 [APU] Rewrite XMA packet parser
Use new FFmpeg frame decoder
2021-05-01 12:41:02 -05:00
Joel Linn
3675c8eac8 [APU] Disable warnings in FFmpeg. 2021-05-01 12:41:02 -05:00
Joel Linn
d4cf474665 Replace references to libav. 2021-05-01 12:41:02 -05:00
Gliniak
d1f7ee3593 [Audio/XMA] Invalidate output buffer when there is no valid input buffer 2020-11-15 11:31:11 -06:00
gibbed
a48bb71c2f Overhaul logging. 2020-04-07 16:09:41 -05:00
Dr. Chat
bfc8ecbeaa [XMA] Check for invalid packet number in ValidFrameOffset 2017-12-26 20:58:31 -06:00
DrChat
1b038125a1 Fix Travis and the build 2017-12-23 17:49:37 -06:00
Dr. Chat
a093fdcef8 XMA: Add an idle "low-power" state for the decoder. 2017-01-28 20:58:23 -06:00
Ben Vanik
a556316ba2 Skip xma read when at the end of the stream. 2015-11-16 19:40:43 -08:00
Ben Vanik
4af6c41740 Moving profiling.h to base - UI could be separated for cleanliness. 2015-11-07 12:31:07 -08:00
Dr. Chat
c150552b9c Quick-kill processing the XMA context if there's no new data available. 2015-09-25 18:40:49 -05:00
Ben Vanik
790ce8aee1 Switch back to std:: muteces. mutices. mutexen. 2015-09-06 13:34:08 -07:00
Dr. Chat
8024e4fd20 XMA: We can only decode an entire frame and write it out at a time! Saving samples is bad. 2015-09-02 20:20:45 -05:00
Ben Vanik
e7b46afa9d Fixing build and removing old binary libav submodule. 2015-08-29 21:04:26 -07:00
Dr. Chat
50535b07c3 Change validity checks to assert statements. 2015-08-29 22:14:20 -05:00
Dr. Chat
6c83b35003 Partial frame support. 2015-08-29 21:42:06 -05:00
Dr. Chat
d8ed66c336 More improvements to the XMA decoder (and included some forgotten files) 2015-08-29 21:18:04 -05:00
Dr. Chat
0f9cd8cfb3 New WIP audio decoder 2015-08-29 21:16:57 -05:00
Ben Vanik
5e08889d93 More style cleanup. 2015-08-06 20:17:01 -07:00
Dr. Chat
766788be7b XMAContext abort instantly if libav failed mid-packet. 2015-07-27 18:24:04 -05:00
Ben Vanik
756d414386 Prep for split libraries. 2015-07-16 22:26:34 -07:00
Ben Vanik
ecd4af10c9 Fixing some clang warnings/errors. 2015-07-15 23:26:58 -07:00
Dr. Chat
da5868945e We aren't supposed to do this. 2015-07-10 23:26:01 -05:00
Dr. Chat
f6eb23d86f Don't select buffer 1 if it's NULL/unavailable 2015-07-10 23:15:15 -05:00
Ben Vanik
d7a5c74bf3 Formatting: force pointers to the left side. 2015-06-30 16:16:33 -07:00
Ben Vanik
fb1f4906d9 xb format --all (we are now format clean). Buildbot will yell at you. 2015-06-22 22:26:51 -07:00
gibbed
75ef95b1b8 More XMA decoder cleanup. 2015-06-22 19:31:02 -05:00
gibbed
2c319db116 More shuffling of XMA decoder code. 2015-06-21 06:31:24 -05:00
gibbed
021b5a3d17 Moved the XMA decoder out of AudioSystem and into its own world (plus minor code cleanup in the process). 2015-06-21 02:25:24 -05:00