LogicX: Sine Wave on F0, Left Channel

DSP, Plug-in and Host development discussion.
User avatar
syntonica
KVRist
424 posts since 25 Sep, 2014 from Specific Northwest

Post Mon Apr 23, 2018 6:12 pm

I'm experiencing the weirdest bug and hopefully, one of you cognoscenti can point me in the right direction.

When Logic first loads my plug-in, any notes played will also include a booming sine wave on F0, just on the left channel. If I arm the track for record, the issue goes away. :? :shrug:

After staring at it in the debugger for a good couple of hours, it's not my note, it's not my plug-in. It's actually Logic generating the sound. The issue started with the latest version of Logic (10.4) and I can find no reason why I'm being singled out here. :idiot: I'm using the Symbiosis wrapper to create the AU, but other plugins that use it don't experience the issue.

I'm assuming that I probably have a setting wrong somewhere, but I have gone over each and every VST method I've overridden and triple-checked them. Question is, why would Logic try and play along? Fishing for clues here--here's my quarter. :hail:

(Sorry for all the emoticons, I'm trying to distract my brain so the answer might bubble up.)

stratum
KVRAF
1842 posts since 29 May, 2012

Re: LogicX: Sine Wave on F0, Left Channel

Post Tue Apr 24, 2018 4:57 am

~stratum~

mystran
KVRAF
4981 posts since 12 Feb, 2006 from Helsinki, Finland

Re: LogicX: Sine Wave on F0, Left Channel

Post Tue Apr 24, 2018 8:10 am

stratum wrote:Maybe run this? http://macappstore.org/valgrind/
Valgrind is great if you have a system where it's actually useable. Unfortunately at least on my MBP the Intel GL driver triggers errors from memcheck on pretty much everything it does.

Judging by the errors, the driver is doing MMIO that valgrind doesn't understand. Sometimes you get enough of these that valgrind just says "too many errors, go fix your program" and dies.

edit: in theory you can write suppression files.. but in practice valgrind also seems to have trouble figuring out the stack traces for some of these errors, which makes it problematic to suppress them :P
If you'd like Signaldust to return, please ask Katinka Tuisku to resign.

stratum
KVRAF
1842 posts since 29 May, 2012

Re: LogicX: Sine Wave on F0, Left Channel

Post Tue Apr 24, 2018 9:02 am

Another alternative is gcc command line options -fsanitize=address and -fsanitize=thread

Unfortunately using these require all related code to be compiled with the same flags. For that reason they were unusable for me.

(If these turn out to be Mac incompatible also I wouldn't be surprized since I don't use a Mac.)
~stratum~

User avatar
syntonica
KVRist
424 posts since 25 Sep, 2014 from Specific Northwest

Re: LogicX: Sine Wave on F0, Left Channel

Post Tue Apr 24, 2018 9:45 am

stratum wrote:Maybe run this? http://macappstore.org/valgrind/
I'm not sure why I'd install this when Xcode comes with quite good profiling tools already. Also, I'm not sure how this will help me figure out why Logic's behavior is incorrect or my plugin is signaling to Logic to behave incorrectly.

stratum
KVRAF
1842 posts since 29 May, 2012

Re: LogicX: Sine Wave on F0, Left Channel

Post Tue Apr 24, 2018 9:57 am

syntonica wrote:
stratum wrote:Maybe run this? http://macappstore.org/valgrind/
I'm not sure why I'd install this when Xcode comes with quite good profiling tools already. Also, I'm not sure how this will help me figure out why Logic's behavior is incorrect or my plugin is signaling to Logic to behave incorrectly.
I don't use Xcode so I'm not aware of its capabilities.
As for the weird Logic behavior, since it's truely weird it might have been caused by a memory or threading bug in your plugin. While unlikely, it's strange enough to consider getting a little paranoid about such things.
~stratum~

User avatar
syntonica
KVRist
424 posts since 25 Sep, 2014 from Specific Northwest

Re: LogicX: Sine Wave on F0, Left Channel

Post Tue Apr 24, 2018 1:15 pm

I'm not currently using any threading--I just have the audio thread and the GUI thread supplied by the host.

Problem is, I can look at values all day long, but I'm not going to see what's missing. I was hopeful that somebody could say, Oh, did you declare X that tells the host Y? It's strange that arming the track corrects the issue. What I'm wondering is if Symbiosis is making the proper declarations about my plugins abilities, but it doesn't bother with the VST isSynth() call at all and I've just cracked open the AU2 SDK, so I'm not familiar with what it wants in this regard.

Symbiosis (AU-based VST host) is starting to get a bit long in the tooth. For example, it automatically assumes 32-bit = Carbon window and 64-bit = Cocoa window. My window is all Cocoa with provisional code to attach to a Carbon parent based on the type of parent class passed down. I've had to do a couple more hacks, but the code is touchy, with lots of #defines intermixed with asserts. It's hard to remove/change something without accidentally breaking something else.

I'd like to maybe do VST and AU wrappers and just make my code plain C calls to just plug in where it's needed, but that's once I understand how AUs work. (This would probably even simplify the Windows side of things, too.) The AU SDK is not exactly forthcoming or complex enough. For example, their note management is similar to mine, but very naive--I have to track multiple envelopes per note. I'd have to do a full override. And I'm still looking for where I pass it my GUI window. (AUs nicely expect the window passed to them rather than trying to make do with what the host passes.)

stratum
KVRAF
1842 posts since 29 May, 2012

Re: LogicX: Sine Wave on F0, Left Channel

Post Wed Apr 25, 2018 2:14 pm

syntonica wrote:... but that's once I understand how AUs work.
Once upon a time I used to try to understand MFC. Eventually I even did. But nowadays I use Qt.
~stratum~

User avatar
luzifer
KVRer
23 posts since 18 Apr, 2018 from Berlin

Re: LogicX: Sine Wave on F0, Left Channel

Post Wed Apr 25, 2018 2:22 pm

Could it be as simple as "you have to clear the buffers before generating your own samples"?

User avatar
syntonica
KVRist
424 posts since 25 Sep, 2014 from Specific Northwest

Re: LogicX: Sine Wave on F0, Left Channel

Post Wed Apr 25, 2018 3:33 pm

luzifer wrote:Could it be as simple as "you have to clear the buffers before generating your own samples"?
I completely replace the buffers, so it's definitely Logic doing it. Besides, unclear buffers don't give you a sine wave plus I don't have the issue anywhere else, Mac or PC.

I even thought about maybe the latest Logic wants code signing, but that wasn't the case, I don't think. My little test by removing the signature from a plugin didn't prevent it from being scanned and working properly.

I've also checked the Info.plist for anomalies and can find none... This is driving me nuts.

User avatar
syntonica
KVRist
424 posts since 25 Sep, 2014 from Specific Northwest

Re: LogicX: Sine Wave on F0, Left Channel

Post Thu Apr 26, 2018 12:43 am

Poking through the console logs, Logic is complaining about using the CFM and how deprecated it is, so I'm not going to waste anymore time on trying to resurrect Symbiosis. It's too rooted in Carbon and to rewrite it, if have to learn AU anyways, so I'm just going to do a native AU version if I can ever figure out where to feed it my GUI.

Return to “DSP and Plug-in Development”