[LAD] ambix vs JUCE, segfault

Tito Latini tito.01beta at gmail.com
Mon Apr 13 14:13:20 UTC 2015


On Sun, Apr 12, 2015 at 07:29:41PM -0700, Fernando Lopez-Lezcano wrote:
> Anyone out there using ambix on Linux?
> 
> I'm seeing various instabilities, for example trying out the converter 
> standalone I get a segfault when connecting output ports, and it looks 
> like the Jack JUCE component is doing some unaligned memory copies.
> 
> Any hint on how to fix this?
> 
> I get Ardour crashes if I try to use the converter LV2 plugin as well.
> 
> See below for a trace of the standalone binary...
> Thanks for any help!
> -- Fernando
> [...]

I have compiled the git-version and tested with the converter standalone.

The attached patch should fix this problem.
-------------- next part --------------
diff --git a/ambix_converter/Source/PluginProcessor.cpp b/ambix_converter/Source/PluginProcessor.cpp
index de0c471..7170db0 100644
--- a/ambix_converter/Source/PluginProcessor.cpp
+++ b/ambix_converter/Source/PluginProcessor.cpp
@@ -511,27 +511,12 @@ void Ambix_converterAudioProcessor::processBlock (AudioSampleBuffer& buffer, Mid
         ACNtoLM(i, l, m);
         
         
-        int _in_ch_seq = in_ch_seq[i];
-        int _out_ch_seq = out_ch_seq[i];
-        
-        if (in_2d)
-        {
-            _in_ch_seq = in_2d_ch_seq[ACN3DtoACN2D(i)];
-            if (_in_ch_seq > getNumInputChannels())
-                _in_ch_seq = -1;
-        }
-        
-        if (out_2d)
-        {
-            _out_ch_seq = out_2d_ch_seq[ACN3DtoACN2D(i)];
-            if (_out_ch_seq > getNumOutputChannels())
-                _out_ch_seq = -1;
-        }
-        
+        int _in_ch_seq = in_2d ? in_2d_ch_seq[ACN3DtoACN2D(i)] : in_ch_seq[i];
+        int _out_ch_seq = out_2d ? out_2d_ch_seq[ACN3DtoACN2D(i)] : out_ch_seq[i];
         
         // std::cout << "InputCh: " << i << " IN_CHANNEL: " << _in_ch_seq << " OUT_CHANNEL: " << _out_ch_seq << std::endl;
         
-        if (_in_ch_seq != -1 && _out_ch_seq != -1 && _in_ch_seq < getNumInputChannels())
+        if (_in_ch_seq < getNumInputChannels() && _out_ch_seq < getNumOutputChannels())
         {
             // copy input channels to output channels!
             output_buffer.copyFrom(_out_ch_seq, 0, buffer, _in_ch_seq, 0, NumSamples);


More information about the Linux-audio-dev mailing list