diff options
| -rw-r--r-- | src/audio_core/renderer/command/command_processing_time_estimator.cpp | 4 | ||||
| -rw-r--r-- | src/audio_core/renderer/system.cpp | 10 |
2 files changed, 8 insertions, 6 deletions
diff --git a/src/audio_core/renderer/command/command_processing_time_estimator.cpp b/src/audio_core/renderer/command/command_processing_time_estimator.cpp index a48a016b1..0f7aff1b4 100644 --- a/src/audio_core/renderer/command/command_processing_time_estimator.cpp +++ b/src/audio_core/renderer/command/command_processing_time_estimator.cpp | |||
| @@ -27,12 +27,12 @@ u32 CommandProcessingTimeEstimatorVersion1::Estimate( | |||
| 27 | 27 | ||
| 28 | u32 CommandProcessingTimeEstimatorVersion1::Estimate( | 28 | u32 CommandProcessingTimeEstimatorVersion1::Estimate( |
| 29 | const AdpcmDataSourceVersion1Command& command) const { | 29 | const AdpcmDataSourceVersion1Command& command) const { |
| 30 | return static_cast<u32>(command.pitch * 0.25f * 1.2f); | 30 | return static_cast<u32>(command.pitch * 0.46f * 1.2f); |
| 31 | } | 31 | } |
| 32 | 32 | ||
| 33 | u32 CommandProcessingTimeEstimatorVersion1::Estimate( | 33 | u32 CommandProcessingTimeEstimatorVersion1::Estimate( |
| 34 | const AdpcmDataSourceVersion2Command& command) const { | 34 | const AdpcmDataSourceVersion2Command& command) const { |
| 35 | return static_cast<u32>(command.pitch * 0.25f * 1.2f); | 35 | return static_cast<u32>(command.pitch * 0.46f * 1.2f); |
| 36 | } | 36 | } |
| 37 | 37 | ||
| 38 | u32 CommandProcessingTimeEstimatorVersion1::Estimate( | 38 | u32 CommandProcessingTimeEstimatorVersion1::Estimate( |
diff --git a/src/audio_core/renderer/system.cpp b/src/audio_core/renderer/system.cpp index d29754634..31f92087c 100644 --- a/src/audio_core/renderer/system.cpp +++ b/src/audio_core/renderer/system.cpp | |||
| @@ -684,11 +684,11 @@ u64 System::GenerateCommand(std::span<u8> in_command_buffer, | |||
| 684 | sink_context, splitter_context, perf_manager}; | 684 | sink_context, splitter_context, perf_manager}; |
| 685 | 685 | ||
| 686 | voice_context.SortInfo(); | 686 | voice_context.SortInfo(); |
| 687 | command_generator.GenerateVoiceCommands(); | ||
| 687 | 688 | ||
| 688 | const auto start_estimated_time{drop_voice_param * | 689 | const auto start_estimated_time{drop_voice_param * |
| 689 | static_cast<f32>(command_buffer.estimated_process_time)}; | 690 | static_cast<f32>(command_buffer.estimated_process_time)}; |
| 690 | 691 | ||
| 691 | command_generator.GenerateVoiceCommands(); | ||
| 692 | command_generator.GenerateSubMixCommands(); | 692 | command_generator.GenerateSubMixCommands(); |
| 693 | command_generator.GenerateFinalMixCommands(); | 693 | command_generator.GenerateFinalMixCommands(); |
| 694 | command_generator.GenerateSinkCommands(); | 694 | command_generator.GenerateSinkCommands(); |
| @@ -708,11 +708,13 @@ u64 System::GenerateCommand(std::span<u8> in_command_buffer, | |||
| 708 | 708 | ||
| 709 | const auto end_estimated_time{drop_voice_param * | 709 | const auto end_estimated_time{drop_voice_param * |
| 710 | static_cast<f32>(command_buffer.estimated_process_time)}; | 710 | static_cast<f32>(command_buffer.estimated_process_time)}; |
| 711 | |||
| 712 | const auto dsp_time_limit{((time_limit_percent / 100.0f) * 2'880'000.0f) * | ||
| 713 | (static_cast<f32>(render_time_limit_percent) / 100.0f)}; | ||
| 714 | |||
| 711 | const auto estimated_time{start_estimated_time - end_estimated_time}; | 715 | const auto estimated_time{start_estimated_time - end_estimated_time}; |
| 712 | 716 | ||
| 713 | const auto time_limit{static_cast<u32>( | 717 | const auto time_limit{static_cast<u32>(std::max(dsp_time_limit + estimated_time, 0.0f))}; |
| 714 | estimated_time + (((time_limit_percent / 100.0f) * 2'880'000.0) * | ||
| 715 | (static_cast<f32>(render_time_limit_percent) / 100.0f)))}; | ||
| 716 | num_voices_dropped = | 718 | num_voices_dropped = |
| 717 | DropVoices(command_buffer, static_cast<u32>(start_estimated_time), time_limit); | 719 | DropVoices(command_buffer, static_cast<u32>(start_estimated_time), time_limit); |
| 718 | } | 720 | } |