I'm running into a strange issue with a new flow graph [1] I'm working on
that uses a custom C++ block [2] that I built. The block takes input
samples, performs some DSP, and outputs modified samples at the same sample
rate.

When the flowgraph has a single instance of my custom block enabled, it
works fine. But when I enable a second instance of the block in a separate
second usage, (think stereo sound, one per sink channel) it acts very
unexpectedly - output samples are wildly inaccurate and distorted.

My perception is that the two instances of the same block seem to be
sharing some part of their memory namespace and as they modify/store
variables they are doing so in some sort of shared namespace or memory
segment.

Is it possible for two blocks to corrupt each other's memory? I can't think
of any other explanation for the two streams working fine individually, but
when both are enabled at the same time the output is garbled. I've tried
all sorts of things like tying them to the same source block, removing the
upsampling/downsampling, adding a delay to one, etc. with no luck.


[1] "Flowgraph with two parallel streams both using the custom block
pq_rails":
https://github.com/regulatre/gr-powerquality/blob/master/examples/streamer.grc

[2] "pq_rails (Custom block) source code":
https://github.com/regulatre/gr-powerquality/blob/master/lib/pq_rails_impl.cc
_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Reply via email to