I built a very basic plugin - a stereo passthrough
with no processing at all
for (int channel = 0; channel < totalNumInputChannels; ++channel)
{
auto* channelData = buffer.getWritePointer (channel);
// ..do something to the data...
}
It crashes Unity on play.
I’m building a VST3 in the same project. That’s working fine.
Any thoughts?
chrash log:
Unity Editor [version: Unity 2017.3.1f1_fc1d3344e6ea]
audioplugin_u_stereo.dll caused an Access Violation (0xc0000005)
in module audioplugin_u_stereo.dll at 0033:483739c2.
Error occurred at 2018-11-08_115904.
C:\Program Files\Unity\Editor\Unity.exe, run by garry.
76% memory in use.
16269 MB physical memory [3843 MB free].
30093 MB paging file [7475 MB free].
134217728 MB user address space [134211366 MB free].
Write to location 00000000 caused an access violation.
BTW, a Unity Plugin I built with the ‘experimental’ version from the development branch (commit b3a1d56ebace79e9d3b3d0ac6e6d21b978a14e1f) works fine
ed95
November 8, 2018, 12:19pm
2
Can you attach the debugger and see where it is actually crashing?
line 258 \modules\juce_audio_basics\buffers\juce_AudioDataConverters.h
Exception thrown at 0x00007FFF3B169C19 (audioplugin_u_stereo.dll) in Unity.exe: 0xC0000005: Access violation writing location 0x0000000000000000.
ed95
November 8, 2018, 12:53pm
4
Can you reproduce it with one of the plug-in example projects or the audio plug-in template project?
i built the ‘Gain audio Plugin’ @ed95 and that worked in unity!
ed95
November 8, 2018, 2:00pm
6
OK, sounds like it might be an issue with your plug-in code then. Posting some of the relevant parts here or trying to reproduce it with a stripped down example would help to track it down.
I didn’t change any code - I just created a new audio plugin and with no changes built from that.
Edit: I can confirm this again. Building a new audio plugin from the template crashes Unity.
ed95
November 8, 2018, 2:12pm
8
What platform are you on? I can’t reproduce this on macOS 10.14.
Are you using the latest tip of develop? I pushed a fix for some assertions that were being hit in Unity here earlier which may have something to do with the issues you’re seeing.
Windows 10
I’m using the 5.4 release.
I’ll build get the development release and see.
thanks for you thoughts so far.
Hi @ed95
the same outcome is reproduced!
I pulled your latest commit on the develop branch (cda5c144f4b595b0c04b38aec1f786abde9c9d10)
built the x64 Projucer in …\extras\Projucer\Builds\VisualStudio2017
ran the projucer.exe …\extras\Projucer\Builds\VisualStudio2017\x64\Release\App
set the Global Modules path …\modules (in the tip of the develop branch)
start a new projucer and select the ‘audio plugin’ template,
name it, check that Visual Studio 17 is my target platform and the modules dir is correct
create the project
in the settings for the project, I select ‘Unity’ as the plugin format and ‘{2,2}’ as the channel configuration
select save and open the VS2017 project
Build the x64 release
Copy the *.dll and *.cs from …\Builds\VisualStudio2017\x64\Release\Unity Plugin to my Unity project …\Assets\Plugins
launch my unity project, add the plugin to a mixer, and press play.
unluckily, Unity crashes.
Hi @ed95
it is setting the channel configuration that is ‘causing’ the problem.
If I create a template project without setting the channel configuration it builds as expected.
ed95
November 8, 2018, 4:00pm
12
I’ll push a fix to the develop branch shortly. It’ll make its way onto the master branch sometime in the next week or so when we do a bugfix release.
1 Like
Thanks @ed95 , I can confirm this works.
[if you saw the unedited message, the multiple issue was my lack of a comma between the configs ]