aboutsummaryrefslogtreecommitdiff
path: root/src/audio_core/sink/sink_stream.cpp
diff options
context:
space:
mode:
authorTakoroka <137927095+Takoroka@users.noreply.github.com>2026-10-27 22:28:10 -0400
committerTakoroka <137927095+Takoroka@users.noreply.github.com>2026-10-27 22:28:10 -0400
commit81eaf7ccbf07bfc73553d8e752a256aa3719bcb9 (patch)
treef29f826c747c092d29b33d25cfe26e0b1d576929 /src/audio_core/sink/sink_stream.cpp
parent51207c73c889dbdc4a586a5da23314f6d33e4eb9 (diff)
Switch 2: back GPU-only regions, pace presents, interleaved split methods
- gpu 214 creates GPU-only memory the graphics server backs itself (title 4 renders everything into six 300 MB regions at 0x81_0000_0000). Back each with application-pool pages mapped into the alias code region and map that for the GPU. This is what made title 4's frames appear. - vi2 229 waits (bounded) for the presented frame's GPU fence: the reply reports every buffer free, so without this the game laps Eden's GPU thread and rewrites command memory it has not read yet. - Split methods: keep several parked methods keyed by resume address (NVN interleaves command buffers) and drop them when the submission ends. - hid 214 (per-frame vibration send) answered quietly. - Debug aids: EDEN_NX2_WINDOW_TRACE / EDEN_NX2_RT_TRACE (render targets, clears, textures), EDEN_NX2_AUDIO_LEVEL (output peak), EDEN_NX2_PB_DUMP (command list for offline replay), parsed-entry change check.
Diffstat (limited to 'src/audio_core/sink/sink_stream.cpp')
-rw-r--r--src/audio_core/sink/sink_stream.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/audio_core/sink/sink_stream.cpp b/src/audio_core/sink/sink_stream.cpp
index c70020e9da..9dfd3bf747 100644
--- a/src/audio_core/sink/sink_stream.cpp
+++ b/src/audio_core/sink/sink_stream.cpp
@@ -4,8 +4,10 @@
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
+#include <algorithm>
#include <array>
#include <atomic>
+#include <cstdlib>
#include <memory>
#include <span>
#include <vector>
@@ -213,6 +215,19 @@ void SinkStream::ProcessAudioOutAndRender(std::span<s16> output_buffer, std::siz
std::memcpy(last_frame.data(), &output_buffer[(frames_written - 1) * frame_size], frame_size_bytes);
+ // EDEN_NX2_AUDIO_LEVEL: log the output peak about every two seconds (is a game audible?).
+ if (static const bool meter = std::getenv("EDEN_NX2_AUDIO_LEVEL") != nullptr; meter) {
+ for (size_t i = 0; i < num_frames * frame_size; ++i) {
+ level_peak = std::max<s32>(level_peak, std::abs(static_cast<s32>(output_buffer[i])));
+ }
+ level_frames += num_frames;
+ if (level_frames >= TargetSampleRate * 2) {
+ LOG_INFO(Audio, "Audio output peak over {} frames: {} of 32767", level_frames, level_peak);
+ level_frames = 0;
+ level_peak = 0;
+ }
+ }
+
{
std::scoped_lock lk{sample_count_lock};
last_sample_count_update_time = system.CoreTiming().GetGlobalTimeNs();