diff options
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}; }; |