After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 653601 - audiodelay: new element in audiofx providing an audio delay line
audiodelay: new element in audiofx providing an audio delay line
Status: RESOLVED WONTFIX
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other All
: Normal enhancement
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-06-28 22:16 UTC by Leo Singer
Modified: 2014-02-27 21:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed patch for gst-plugins-good (12.50 KB, application/octet-stream)
2011-06-28 22:16 UTC, Leo Singer
  Details
proposed patch for gst-plugins-good (12.86 KB, patch)
2011-07-01 21:11 UTC, Leo Singer
none Details | Review
proposed patch for gst-plugins-good (12.81 KB, patch)
2011-07-02 00:44 UTC, Leo Singer
none Details | Review
proposed patch for gst-plugins-bad (13.54 KB, patch)
2011-07-14 17:05 UTC, Leo Singer
needs-work Details | Review

Description Leo Singer 2011-06-28 22:16:39 UTC
Created attachment 190894 [details]
proposed patch for gst-plugins-good

This patch proposes adding a new element to audiofx.  The new element is called "audiodelay."  It delays an audio signal by a specified number of samples by emitting a gap buffer.
Comment 1 Stefan Sauer (gstreamer, gtkdoc dev) 2011-07-01 17:51:29 UTC
Could we call this audiogap or something like it. A delay is usually a delays line like in audioecho. It would also e great to mention in the doc-blob when one would eg. want to use it.

Regarding the patch, I think it relies on the BUFFER_OFFSET fields beeing set in the received buffers.
guint64 len = GST_BUFFER_OFFSET_END (buf) - GST_BUFFER_OFFSET (buf);
Comment 2 Stefan Sauer (gstreamer, gtkdoc dev) 2011-07-01 18:07:58 UTC
There is also bug 641024, that talks about a delay element.
Comment 3 Leo Singer 2011-07-01 20:45:19 UTC
This element is a little different from the one in bug 641024, because the incoming and outgoing streams are intended to conform to the same segment -- hence, the initial gap in addition to the timestamp remapping.  This is intended to make it possible to send one stream and its delayed counterpart into an adder.

I could add a boolean property (true by default) to turn on or off the initial gap buffer, thus optionally providing the behavior of bug 641024.

I agree that this is more properly thought of as a timestamp shift; the "delay line" part would really be any queue that followed this element.  I still prefer the name "audiodelay" because in a pipeline where this element is used it will have the effect of causing the non-silence part of the signal to be played back at a later time.  How about "audiotimestampshift" or "audiotimestampoffset" as alternative names?.
Comment 4 Leo Singer 2011-07-01 20:46:50 UTC
(In reply to comment #1)
> Could we call this audiogap or something like it. A delay is usually a delays
> line like in audioecho. It would also e great to mention in the doc-blob when
> one would eg. want to use it.
> 
> Regarding the patch, I think it relies on the BUFFER_OFFSET fields beeing set
> in the received buffers.
> guint64 len = GST_BUFFER_OFFSET_END (buf) - GST_BUFFER_OFFSET (buf);

Oops.  I'll fix that.
Comment 5 Stefan Sauer (gstreamer, gtkdoc dev) 2011-07-01 20:50:35 UTC
One reason I was suggestion a different name is that I would suggest it with an audio-effect and that would have modulatable delaytime and feedback ratio and ...
I assume your elements is needed to do av-sync correction. I'd say it would be good to have a av-sync-correction element that works for both audio and video.
Comment 6 Leo Singer 2011-07-01 21:09:59 UTC
(In reply to comment #5)
> One reason I was suggestion a different name is that I would suggest it with an
> audio-effect and that would have modulatable delaytime and feedback ratio and

I see.  You have something like <http://en.wikipedia.org/wiki/File:Ibanez_de7.jpg> in mind.

> I assume your elements is needed to do av-sync correction. I'd say it would be
> good to have a av-sync-correction element that works for both audio and video.

My application actually involves literally a sample delay, what would be a z^-N in a signal flow diagram or a transfer function. I have to send a signal through an audiofirfilter, then delay it, then add it to another signal.  This saves having to pad the FIR filter coefficients with a whole bunch of zeros.
Comment 7 Leo Singer 2011-07-01 21:11:56 UTC
Created attachment 191120 [details] [review]
proposed patch for gst-plugins-good

Adds information about use cases to doc-blob.  Also, no longer relies on the sink pad's signal having valid offsets.
Comment 8 Stefan Sauer (gstreamer, gtkdoc dev) 2011-07-01 21:59:51 UTC
So its the same as the existing audioecho effect with intensity=100% and feedback=0%, but a lot more efficient.

Regarding your doc-blob change, please don't suggest the element to be used for creating an echo effect. One can only achieve that by mixing the original signal in and should just use audioecho then directly.

I don't know what other think, but I would like this not to be classified as an effect. Just imagine someone doing a gstreamer audio effect rack. If one plugs this elements as an insert effect one would not really hear a differences before and after.

Aren't the audiofilters properly answering the LATENCY query?
Comment 9 Leo Singer 2011-07-02 00:43:43 UTC
(In reply to comment #8)
> So its the same as the existing audioecho effect with intensity=100% and
> feedback=0%, but a lot more efficient.

I don't think this proposed element is the same.  It is supposed to output a delayed copy of the input.

When intensity=100% and feedback=0%, doesn't audioecho output the sum of the input and a delayed copy of itself?

> Regarding your doc-blob change, please don't suggest the element to be used for
> creating an echo effect. One can only achieve that by mixing the original
> signal in and should just use audioecho then directly.

Fixed in new patch.

> I don't know what other think, but I would like this not to be classified as an
> effect. Just imagine someone doing a gstreamer audio effect rack. If one plugs
> this elements as an insert effect one would not really hear a differences
> before and after.

Should I put this element in a standalone plugin of the same name?
Comment 10 Leo Singer 2011-07-02 00:44:31 UTC
Created attachment 191134 [details] [review]
proposed patch for gst-plugins-good

doc-blob no longer mentions echo effect
Comment 11 Stefan Sauer (gstreamer, gtkdoc dev) 2011-07-02 00:57:25 UTC
(In reply to comment #9)
> (In reply to comment #8)
> > So its the same as the existing audioecho effect with intensity=100% and
> > feedback=0%, but a lot more efficient.
> 
> I don't think this proposed element is the same.  It is supposed to output a
> delayed copy of the input.
> 
> When intensity=100% and feedback=0%, doesn't audioecho output the sum of the
> input and a delayed copy of itself?

Right, need to check how it works in audioecho. In the audiodelay element I have in gst-buzztard I have a drywet control:

beats-per-minute    : the number of beats per minute the top level pipeline uses
                      flags: readable, writable
                      Unsigned Long. Range: 1 - 18446744073709551615 Default: 120 Current: 120
drywet              : Intensity of effect (0 none -> 100 full)
                      flags: readable, writable, controllable
                      Unsigned Integer. Range: 0 - 100 Default: 50 Current: 50
delaytime           : Time difference between two echos as milliseconds
                      flags: readable, writable, controllable
                      Unsigned Integer. Range: 1 - 1000 Default: 100 Current: 100
feedback            : Echo feedback in percent
                      flags: readable, writable, controllable
                      Unsigned Integer. Range: 0 - 99 Default: 50 Current: 50



> 
> > Regarding your doc-blob change, please don't suggest the element to be used for
> > creating an echo effect. One can only achieve that by mixing the original
> > signal in and should just use audioecho then directly.
> 
> Fixed in new patch.
> 
> > I don't know what other think, but I would like this not to be classified as an
> > effect. Just imagine someone doing a gstreamer audio effect rack. If one plugs
> > this elements as an insert effect one would not really hear a differences
> > before and after.
> 
> Should I put this element in a standalone plugin of the same name?

Maybe, at least change the classification. "Filter/Effect/Audio" hints that it is an effect. I would like to see what Thiago (bug 641024) and others think. Having a generic way to delays streams sounds  nicer. 

I also checked and the audiofiter elements do handle the latency query. Maybe the issue you have is that adder does not care about timestamps and latency. It just mixes samples as they come.
Comment 12 Leo Singer 2011-07-13 00:22:21 UTC
(In reply to comment #11)
> (In reply to comment #9)
> > (In reply to comment #8)
> > Should I put this element in a standalone plugin of the same name?
> 
> Maybe, at least change the classification. "Filter/Effect/Audio" hints that it
> is an effect. I would like to see what Thiago (bug 641024) and others think.
> Having a generic way to delays streams sounds  nicer. 

At this time, should I prepare a new patch with a standalone plugin, or should I wait further?

> I also checked and the audiofiter elements do handle the latency query. Maybe
> the issue you have is that adder does not care about timestamps and latency. It
> just mixes samples as they come.

Indeed.
Comment 13 Leo Singer 2011-07-14 17:05:04 UTC
Created attachment 191988 [details] [review]
proposed patch for gst-plugins-bad

Patch moved from gst-plugins-good to gst-plugins-bad.
Comment 14 Sebastian Dröge (slomo) 2013-08-21 18:55:34 UTC
Comment on attachment 191988 [details] [review]
proposed patch for gst-plugins-bad

This needs to be updated to 1.0, and then can be added to the audiofxbad plugin as a new element.

The samples property should be called delay, and should be in nanoseconds for consistency.

Sorry for not reviewing this patch earlier :(
Comment 15 Sebastian Dröge (slomo) 2013-12-20 14:54:05 UTC
Any plans to update this patch? A simple delay line can also be implemented with the audioecho element btw
Comment 16 Leo Singer 2013-12-20 16:01:45 UTC
(In reply to comment #15)
> Any plans to update this patch?

No, I'm afraid not. Sorry.
Comment 17 Tim-Philipp Müller 2013-12-20 21:22:00 UTC
There's also the offset property on pads now in 1.x fwiw.
Comment 18 Stefan Sauer (gstreamer, gtkdoc dev) 2014-02-27 21:08:26 UTC
Lets close this then.