Opened 4 years ago

Closed 3 years ago

#1058 closed Bug Report (fixed)

ingen: bypassing instruments doesn't clear the last audio buffer

Reported by: falkTX Owned by: David Robillard
Priority: major Component: Ingen
Keywords: instruments, bypass, audio, buffer Cc:


Ingen bypass feature is not working correctly for lv2 instruments/generators.

On effects the audio output is bypassed by copying the inputs, but on instruments or generators toggling "bypass" will make the output sound the previous audio buffer. I guess ingen is simply doing bypass if the plugin has inputs (which makes sense), but forgets to clear plugins with only audio outputs.

The plugin I'm using to test this with is CAPS CEO.

Change History (4)

comment:1 Changed 4 years ago by falkTX

Not sure why you're not able to reproduce this, but I went for a fix anyway.

Here's a patch:

Index: src/server/BlockImpl.cpp
--- src/server/BlockImpl.cpp	(revision 5689)
+++ src/server/BlockImpl.cpp	(working copy)
@@ -192,9 +192,15 @@
 			for (uint32_t i = 0;; ++i) {
 				PortImpl* in = nth_port_by_type(i, true, t);
 				PortImpl* out;
-				if (in && (out = nth_port_by_type(i, false, t))) {
-					for (uint32_t v = 0; v < _polyphony; ++v) {
-						out->buffer(v)->copy(context, in->buffer(v).get());
+				if (out = nth_port_by_type(i, false, t)) {
+					if (in) {
+						for (uint32_t v = 0; v < _polyphony; ++v) {
+							out->buffer(v)->copy(context, in->buffer(v).get());
+						}
+					} else {
+						for (uint32_t v = 0; v < _polyphony; ++v) {
+							out->buffer(v)->clear();
+						}
 				} else {

comment:2 Changed 3 years ago by David Robillard

Resolution: fixed
Status: newclosed

Fixed in r5695

comment:3 Changed 3 years ago by falkTX

Resolution: fixed
Status: closedreopened

this bug is not completely fixed yet. on certain connection types ingen still produces noise (last buffer repeated) instead of the proper bypass (copying buffers).

imagine a plugin with 1 input + 1 output. connect the output to anywhere so you can hear it. connect 2 ports to its input, providing some sound. when you disable the plugin you can hear the 'noise'.

comment:4 Changed 3 years ago by David Robillard

Resolution: fixed
Status: reopenedclosed

Ah, the input ports weren't mixed down in the bypass case, so if mixing was required, the input was still junk.

Fixed in r5804.

Note: See TracTickets for help on using tickets.