hvcc
hvcc copied to clipboard
"Input message queue is full" Assertion failure in Unity
I'm having mixed results building my patch for Unity using the same .pd files that produced working .dll's on the enzienaudio.com website generator. On my end the python script seems to complete with no errors. I can take the resulting files and use the jdk to produce an Android AudioLib.so that builds and works correctly in Unity and built on my Android device.
I'm running into issue with the Win64 and iOS plugins though. Building the visual studio project completes with no errors, but in the Unity editor, I receive the following error when trying to run with the resulting AudioLib.dll:
`Microsoft Visual C++ Runtime Library Assertion failed! Program: ...layer.010.unity.win.x64\Hv AccoPlayer AudioLib.dll File: d: heavy builds \accordata \ unity\ sour... \ heavycontext.cpp Line: 133 Expression: false && -::sendMessageToReceiver - The input message queue is full and cannot accept more messages until they have been processed. Try increasing the inQueueKb size in the new with_options(l constructor.'
Since I had success with the Android build I also tried my luck with OSX, but when using the Xcode built bundle Unity crashes with a similar error:
Process: Accordata [12836] Path: /Users/USER/Desktop/Accordata.app/Contents/MacOS/Accordata Identifier: com.Company.ProductName Version: 1.0 (0) Code Type: X86-64 (Native) Parent Process: ??? [1] Responsible: Accordata [12836] User ID: 524
Date/Time: 2018-09-06 23:40:35.891 -0700 OS Version: Mac OS X 10.13.6 (17G65) Report Version: 12 Anonymous UUID: 5493484B-7E15-24B4-A0D2-220CD4E1DDC3
Time Awake Since Boot: 40000 seconds
System Integrity Protection: disabled
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Exception Note: EXC_CORPSE_NOTIFY
Application Specific Information: Assertion failed: (false && "::sendMessageToReceiver - The input message queue is full and cannot accept more messages until they " "have been processed. Try increasing the inQueueKb size in the new_with_options() constructor."), function sendMessageToReceiver, file /Users/user912434/Downloads/AccoplayerV10_buildFiles/unity/source/heavy/HeavyContext.cpp, line 133.
I have tried with a less complex test patch, and there it was working correctly in Unity and built for both Android and Win64. It would suggest there is something wrong with my source patch, but the same patch worked correctly when it was built on enzienaudio.com.
My .pd source files are located here: https://github.com/moshang/Accordata/tree/master/Assets/Plugins/AccoPlayer_Source The project on on Github runs correctly, by the way, since I'm still using the Win64 AudioLib.dll created on by your website. With those files I'm good to go on Android and Win64, but I'm stuck making updates to the PD project and I don't have a working OSX/iOS solution.
Have you tried following the indications in the error message?
Try increasing the inQueueKb size in the new_with_options() constructor.")
If you go to the generated files, you will find: source/unity/Hv_xxx_AudioLib.cs
, where xxxx
is the name of your patch.
In there you will find a line like:
public Hv_xxxx_Context(double sampleRate, int poolKb=10, int inQueueKb=2, int outQueueKb=2) {
There, try increasing the default value for inQueueKb
. If this works, you can change the default behaviour of hvcc
by editing hvcc.py
, either changing the heuristic or setting static values:
# generate patch heuristics to ensure enough memory allocated for the patch
"memoryPoolSizesKb": {
"internal": 10, # TODO(joe): should this increase if there are a lot of internal connections?
"inputQueue": max(2, int(len(in_parameter_list) + len(in_event_list) / 4)),
"outputQueue": max(2, int(len(out_parameter_list) + len(out_event_list) / 4)),
}
Sweet success! Raising the inQueueKb
from the default (in my case) 5 to 7 got rid off the crashes. For future use, I've updated the line in hvcc.py
to:
"inputQueue": max(7, int(len(in_parameter_list) + len(in_event_list) / 4)),
I still had an issue where the audio would crackle severely inside the Unity editor, but would sound fine when built. I resolved this by going to Project Settings/Audio
in Unity and changing the System Sample Rate
setting to 44100
and DSP Buffer Size
to Best Performance
.
My patch is now confirmed working in Win X64, Android, and iOS. Heavy rocks!
Thanks for the help!