Code Monkey home page Code Monkey logo

yadaw's Issues

Rare potential crash on starting audio engine with AudioGraph backend

Description / Reproduce

On rare circumstances, starting the audio engine with AudioGraph backend (which is the only backend YADAW uses on Windows) will crash the program.

Log / Stack trace

Though the actual crash is rare, we can locate this problem on every startup with Dr. Memory. The following log is from result.txt generated after one session:

Error #1: UNADDRESSABLE ACCESS beyond heap bounds: reading 0x000001cb9ec9b240-0x000001cb9ec9b244 4 byte(s)
# 0 replace_memmove                                                            [D:\a\drmemory\drmemory\drmemory\replace.c:757]
# 1 YADAW::Audio::Backend::processInputs                                       [C:\Users\xris1658\Project\YADAW\src\audio\backend\AudioGraphBusConfiguration.cpp:134]
# 2 std::_Iterator_base12::_Adopt                                              [C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\xmemory:1287]
# 3 std::_Vector_iterator<>::_Unwrapped                                        [C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\vector:341]
# 4 ```YADAW::Controller::AudioEngine::process'::`2'::<lambda_1>::operator()'::`2'::<lambda_1>::operator()'::`2'::<lambda_1>::operator() [C:\Users\xris1658\Project\YADAW\src\controller\AudioEngineController.cpp:130]
# 5 std::vector<>::begin                                                       [C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\vector:1804]
# 6 std::for_each<>                                                            [C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\algorithm:284]
# 7 ``YADAW::Controller::AudioEngine::process'::`2'::<lambda_1>::operator()'::`2'::<lambda_1>::operator() [C:\Users\xris1658\Project\YADAW\src\controller\AudioEngineController.cpp:127]
# 8 std::_For_each_ivdep<>                                                     [C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\execution:1165]
# 9 std::_Static_partitioned_for_each2<>::_Process_chunk                       [C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\execution:1182]
#10 std::_Run_available_chunked_work<>                                         [C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\execution:222]
#11 std::_Run_chunked_parallel_work<>                                          [C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\execution:232]
#12 std::for_each<>                                                            [C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\execution:1212]
#13 `YADAW::Controller::AudioEngine::process'::`2'::<lambda_1>::operator()     [C:\Users\xris1658\Project\YADAW\src\controller\AudioEngineController.cpp:124]
#14 std::for_each<>                                                            [C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\algorithm:284]
#15 YADAW::Controller::AudioEngine::process                                    [C:\Users\xris1658\Project\YADAW\src\controller\AudioEngineController.cpp:120]
#16 YADAW::Controller::audioGraphCallback                                      [C:\Users\xris1658\Project\YADAW\src\controller\AudioGraphBackendController.cpp:147]
#17 winrt::impl::delegate<>::Invoke                                            [C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt\winrt\Windows.Foundation.h:895]
#18 Windows.Media.Audio.dll!DllGetClassObject                                 +0x3a12c  (0x00007ffdb5fcc7fd <Windows.Media.Audio.dll+0x4c7fd>)
#19 Windows.Media.Audio.dll!?                                                 +0x0      (0x00007ffdb5f82ad5 <Windows.Media.Audio.dll+0x2ad5>)
Note: @0:00:20.197 in thread 7268
Note: refers to 0 byte(s) beyond last valid byte in prior malloc
Note: prev lower malloc:  0x000001cb9ec9b240-0x000001cb9ec9b240
Note: allocated here:
Note: # 0 replace_malloc                                 [D:\a\drmemory\drmemory\common\alloc_replace.c:2580]
Note: # 1 MFPlat.DLL!MFCreatePropertiesFromMediaType    +0x1e9e   (0x00007ffe1edbb62f <MFPlat.DLL+0x11b62f>)
Note: # 2 MFPlat.DLL!MFCreatePropertiesFromMediaType    +0x2219   (0x00007ffe1edbb9aa <MFPlat.DLL+0x11b9aa>)
Note: # 3 MFPlat.DLL!MFCreatePropertiesFromMediaType    +0x2219   (0x00007ffe1edbb9aa <MFPlat.DLL+0x11b9aa>)
Note: # 4 MFPlat.DLL!MFCreatePropertiesFromMediaType    +0x2edb   (0x00007ffe1edbc66c <MFPlat.DLL+0x11c66c>)
Note: # 5 MFPlat.DLL!MFCreatePropertiesFromMediaType    +0x2edb   (0x00007ffe1edbc66c <MFPlat.DLL+0x11c66c>)
Note: # 6 MFPlat.DLL!MFCreatePropertiesFromMediaType    +0xaa1    (0x00007ffe1edba232 <MFPlat.DLL+0x11a232>)
Note: # 7 MFPlat.DLL!MFCreatePropertiesFromMediaType    +0x2dce   (0x00007ffe1edbc55f <MFPlat.DLL+0x11c55f>)
Note: # 8 WinTypes.dll!RoCreateNonAgilePropertySet      +0x5d15   (0x00007ffe21340b46 <WinTypes.dll+0x20b46>)
Note: # 9 MFPlat.DLL!MFCreateVideoMediaType             +0xd8     (0x00007ffe1ecb1359 <MFPlat.DLL+0x11359>)
Note: #10 MFPlat.DLL!MFAverageTimePerFrameToFrameRate   +0x516    (0x00007ffe1ecdb237 <MFPlat.DLL+0x3b237>)
Note: #11 MFPlat.DLL!MFCreateMemoryBuffer               +0x55     (0x00007ffe1ecc29c6 <MFPlat.DLL+0x229c6>)
Note: instruction: mov    (%rcx) -> %ecx

Note that "previous lower malloc" in MFCreatePropertiesFromMediaType allocated 0 bytes, which is weird giving that it seems allocating audio buffers we'd like to read in the callback.

Crashes on unloading Zebra2 / Zebralette

Zebra2 and Zebralette are synthesizers by u-he.

Reproduce

  • Checkout the latest commit from branch test-zebra
  • Load Zebra2 or Zebralette with the main app or VST3Test
  • Unload the plugin

Error message

Exception 0xc0000005 encountered at address 0x7ff85cfcfe78: Access violation reading location 0xffffffffffffffff

Stack trace

Module Name Address
Zebra2(x64).vst3 0x00007ff85cfcfe78
Zebra2(x64).vst3 0x00007ff85cfc402a
Zebra2(x64).vst3 0x00007ff85cfc3ea4
Zebra2(x64).vst3 0x00007ff85cfc3775
VST3Test.exe releasePointer<Steinberg::Vst::IComponent>(Steinberg::Vst::IComponent *) VST3Helper.hpp:27
VST3Test.exe YADAW::Audio::Plugin::VST3Plugin::destroyPlugin() VST3Plugin.cpp:138
VST3Test.exe YADAW::Audio::Plugin::VST3Plugin::~VST3Plugin() VST3Plugin.cpp:159
VST3Test.exe main(int, char **) main.cpp:459
VST3Test.exe invoke_main() 0x00007ff6ab62a839
VST3Test.exe __scrt_common_main_seh() 0x00007ff6ab62a78e
VST3Test.exe __scrt_common_main() 0x00007ff6ab62a64e
VST3Test.exe mainCRTStartup(void *) 0x00007ff6ab62a8ae
kernel32.dll 0x00007ff8d3e47344
ntdll.dll 0x00007ff8d5de26b1

More details

  • This issue is introduced in commit 634053e. To test this commit (and its previous commit, 7819597), we need some little changes to the code (which I've finished in the test-zebra branch).
  • At first I evaded this issue by committing 941119b. Since the call to IAudioProcessor::release is removed, we might encounter memory leaks or other runtime errors. For comparison, Musec WILL call that release without crashing.
    • Further test on Linux indicates that this solution is problematic (see reply below).

关于您的daw中vst宿主机的实现相关

我正在做快速音频流处理相关的私人工具,需要接入vst3插件
但是我实在是搞不懂vst3 SDK中的示例代码
所以想获得下大佬的帮助
如何在一个qt6 项目中搭建一个基础的音频系统流程来挂载多个vst3插件呢?
我能找到的教程都是如何制作一个vst插件而不是宿主

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.