diff options
author | Kelebek1 <eeeedddccc@hotmail.co.uk> | 2023-08-31 16:09:15 +0200 |
---|---|---|
committer | Liam <byteslice@airmail.cc> | 2023-09-16 17:56:25 +0200 |
commit | 67e2d5c28b8423c4f3f1d5b00f87325684158a6f (patch) | |
tree | e419a2bb6c064ddc69a49046705b6187772fee48 /src/audio_core/adsp/apps/audio_renderer/audio_renderer.h | |
parent | Merge pull request #11519 from german77/system-policy (diff) | |
download | yuzu-67e2d5c28b8423c4f3f1d5b00f87325684158a6f.tar yuzu-67e2d5c28b8423c4f3f1d5b00f87325684158a6f.tar.gz yuzu-67e2d5c28b8423c4f3f1d5b00f87325684158a6f.tar.bz2 yuzu-67e2d5c28b8423c4f3f1d5b00f87325684158a6f.tar.lz yuzu-67e2d5c28b8423c4f3f1d5b00f87325684158a6f.tar.xz yuzu-67e2d5c28b8423c4f3f1d5b00f87325684158a6f.tar.zst yuzu-67e2d5c28b8423c4f3f1d5b00f87325684158a6f.zip |
Diffstat (limited to 'src/audio_core/adsp/apps/audio_renderer/audio_renderer.h')
-rw-r--r-- | src/audio_core/adsp/apps/audio_renderer/audio_renderer.h | 45 |
1 files changed, 19 insertions, 26 deletions
diff --git a/src/audio_core/adsp/apps/audio_renderer/audio_renderer.h b/src/audio_core/adsp/apps/audio_renderer/audio_renderer.h index 3f5b7dca2..85874d88a 100644 --- a/src/audio_core/adsp/apps/audio_renderer/audio_renderer.h +++ b/src/audio_core/adsp/apps/audio_renderer/audio_renderer.h @@ -17,13 +17,6 @@ namespace Core { class System; -namespace Timing { -struct EventType; -} -namespace Memory { -class Memory; -} -class System; } // namespace Core namespace AudioCore { @@ -34,19 +27,19 @@ class Sink; namespace ADSP::AudioRenderer { enum Message : u32 { - Invalid = 0x00, - MapUnmap_Map = 0x01, - MapUnmap_MapResponse = 0x02, - MapUnmap_Unmap = 0x03, - MapUnmap_UnmapResponse = 0x04, - MapUnmap_InvalidateCache = 0x05, - MapUnmap_InvalidateCacheResponse = 0x06, - MapUnmap_Shutdown = 0x07, - MapUnmap_ShutdownResponse = 0x08, - InitializeOK = 0x16, - RenderResponse = 0x20, - Render = 0x2A, - Shutdown = 0x34, + Invalid = 0, + MapUnmap_Map = 1, + MapUnmap_MapResponse = 2, + MapUnmap_Unmap = 3, + MapUnmap_UnmapResponse = 4, + MapUnmap_InvalidateCache = 5, + MapUnmap_InvalidateCacheResponse = 6, + MapUnmap_Shutdown = 7, + MapUnmap_ShutdownResponse = 8, + InitializeOK = 22, + RenderResponse = 32, + Render = 42, + Shutdown = 52, }; /** @@ -54,7 +47,7 @@ enum Message : u32 { */ class AudioRenderer { public: - explicit AudioRenderer(Core::System& system, Core::Memory::Memory& memory, Sink::Sink& sink); + explicit AudioRenderer(Core::System& system, Sink::Sink& sink); ~AudioRenderer(); /** @@ -72,8 +65,8 @@ public: void Signal(); void Wait(); - void Send(Direction dir, MailboxMessage message); - MailboxMessage Receive(Direction dir, bool block = true); + void Send(Direction dir, u32 message); + u32 Receive(Direction dir); void SetCommandBuffer(s32 session_id, CpuAddr buffer, u64 size, u64 time_limit, u64 applet_resource_user_id, bool reset) noexcept; @@ -94,9 +87,7 @@ private: /// Core system Core::System& system; - /// Memory - Core::Memory::Memory& memory; - /// The output sink the AudioRenderer will use + /// The output sink the AudioRenderer will send samples to Sink::Sink& sink; /// The active mailbox Mailbox mailbox; @@ -104,11 +95,13 @@ private: std::jthread main_thread{}; /// The current state std::atomic<bool> running{}; + /// Shared memory of input command buffers, set by host, read by DSP std::array<CommandBuffer, MaxRendererSessions> command_buffers{}; /// The command lists to process std::array<CommandListProcessor, MaxRendererSessions> command_list_processors{}; /// The streams which will receive the processed samples std::array<Sink::SinkStream*, MaxRendererSessions> streams{}; + /// CPU Tick when the DSP was signalled to process, uses time rather than tick u64 signalled_tick{0}; }; |