From 73b37886c10f771abe05b57f53d8a570ee80b178 Mon Sep 17 00:00:00 2001 From: David Marcec Date: Sat, 13 Jul 2019 01:22:08 +1000 Subject: "AudioRenderer" thread should have a unique name Creating multiple "AudioRenderer" threads cause the previous thread to be overwritten. The thread will name be renamed to AudioRenderer-InstanceX, where X is the current instance number. --- src/audio_core/audio_renderer.cpp | 5 +++-- src/audio_core/audio_renderer.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src/audio_core') diff --git a/src/audio_core/audio_renderer.cpp b/src/audio_core/audio_renderer.cpp index 4882a6cd8..969d8f2a5 100644 --- a/src/audio_core/audio_renderer.cpp +++ b/src/audio_core/audio_renderer.cpp @@ -73,13 +73,14 @@ private: EffectInStatus info{}; }; AudioRenderer::AudioRenderer(Core::Timing::CoreTiming& core_timing, AudioRendererParameter params, - Kernel::SharedPtr buffer_event) + Kernel::SharedPtr buffer_event, + const std::size_t instance_number) : worker_params{params}, buffer_event{buffer_event}, voices(params.voice_count), effects(params.effect_count) { audio_out = std::make_unique(); stream = audio_out->OpenStream(core_timing, STREAM_SAMPLE_RATE, STREAM_NUM_CHANNELS, - "AudioRenderer", [=]() { buffer_event->Signal(); }); + fmt::format("AudioRenderer-Instance{}", instance_number), [=]() { buffer_event->Signal(); }); audio_out->StartStream(stream); QueueMixedBuffer(0); diff --git a/src/audio_core/audio_renderer.h b/src/audio_core/audio_renderer.h index b2e5d336c..1bdf709e5 100644 --- a/src/audio_core/audio_renderer.h +++ b/src/audio_core/audio_renderer.h @@ -215,7 +215,7 @@ static_assert(sizeof(UpdateDataHeader) == 0x40, "UpdateDataHeader has wrong size class AudioRenderer { public: AudioRenderer(Core::Timing::CoreTiming& core_timing, AudioRendererParameter params, - Kernel::SharedPtr buffer_event); + Kernel::SharedPtr buffer_event, const std::size_t instance_number); ~AudioRenderer(); std::vector UpdateAudioRenderer(const std::vector& input_params); -- cgit v1.2.3 From 31fe859fe5f959dc261db3a278deea8204905f97 Mon Sep 17 00:00:00 2001 From: David Marcec Date: Sat, 13 Jul 2019 01:35:40 +1000 Subject: Addressed issues --- src/audio_core/audio_renderer.cpp | 2 +- src/audio_core/audio_renderer.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/audio_core') diff --git a/src/audio_core/audio_renderer.cpp b/src/audio_core/audio_renderer.cpp index 969d8f2a5..415b06171 100644 --- a/src/audio_core/audio_renderer.cpp +++ b/src/audio_core/audio_renderer.cpp @@ -74,7 +74,7 @@ private: }; AudioRenderer::AudioRenderer(Core::Timing::CoreTiming& core_timing, AudioRendererParameter params, Kernel::SharedPtr buffer_event, - const std::size_t instance_number) + std::size_t instance_number) : worker_params{params}, buffer_event{buffer_event}, voices(params.voice_count), effects(params.effect_count) { diff --git a/src/audio_core/audio_renderer.h b/src/audio_core/audio_renderer.h index 1bdf709e5..4ef1875ff 100644 --- a/src/audio_core/audio_renderer.h +++ b/src/audio_core/audio_renderer.h @@ -215,7 +215,7 @@ static_assert(sizeof(UpdateDataHeader) == 0x40, "UpdateDataHeader has wrong size class AudioRenderer { public: AudioRenderer(Core::Timing::CoreTiming& core_timing, AudioRendererParameter params, - Kernel::SharedPtr buffer_event, const std::size_t instance_number); + Kernel::SharedPtr buffer_event, std::size_t instance_number); ~AudioRenderer(); std::vector UpdateAudioRenderer(const std::vector& input_params); -- cgit v1.2.3 From ea5602b959ebb8b73d5ba1540854fb1165781bf1 Mon Sep 17 00:00:00 2001 From: David Marcec Date: Sat, 13 Jul 2019 01:49:32 +1000 Subject: Clang format --- src/audio_core/audio_renderer.cpp | 3 ++- src/audio_core/audio_renderer.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src/audio_core') diff --git a/src/audio_core/audio_renderer.cpp b/src/audio_core/audio_renderer.cpp index 415b06171..da50a0bbc 100644 --- a/src/audio_core/audio_renderer.cpp +++ b/src/audio_core/audio_renderer.cpp @@ -80,7 +80,8 @@ AudioRenderer::AudioRenderer(Core::Timing::CoreTiming& core_timing, AudioRendere audio_out = std::make_unique(); stream = audio_out->OpenStream(core_timing, STREAM_SAMPLE_RATE, STREAM_NUM_CHANNELS, - fmt::format("AudioRenderer-Instance{}", instance_number), [=]() { buffer_event->Signal(); }); + fmt::format("AudioRenderer-Instance{}", instance_number), + [=]() { buffer_event->Signal(); }); audio_out->StartStream(stream); QueueMixedBuffer(0); diff --git a/src/audio_core/audio_renderer.h b/src/audio_core/audio_renderer.h index 4ef1875ff..45afbe759 100644 --- a/src/audio_core/audio_renderer.h +++ b/src/audio_core/audio_renderer.h @@ -215,7 +215,8 @@ static_assert(sizeof(UpdateDataHeader) == 0x40, "UpdateDataHeader has wrong size class AudioRenderer { public: AudioRenderer(Core::Timing::CoreTiming& core_timing, AudioRendererParameter params, - Kernel::SharedPtr buffer_event, std::size_t instance_number); + Kernel::SharedPtr buffer_event, + std::size_t instance_number); ~AudioRenderer(); std::vector UpdateAudioRenderer(const std::vector& input_params); -- cgit v1.2.3