dynamic controlled chain of volume elements

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

dynamic controlled chain of volume elements

Maik Scholz
Hi,

I like to attenuate an audio stream by a summary of different volume values (e.g. base gain, current volume, fade-in ramp, ...).

This would be possible using a chains of volume elements ...
=>volume[base gain]=>volume[current volume]=>volume[fade-in-ramp]=>audiomixer
... but I expect this is not the optimum for the CPU utilization. Isn't it?

I did some tests with the gst-control-source concept.
I implemented a helper class with a property for each volume type.
On change, the result of all types set to the src-pad volume of the audiomixer.
Unfortunately, this does not work because my helper class can't support the controller.

Is there a alternative for this use-case?

Maik
Reply | Threaded
Open this post in threaded view
|

Re: dynamic controlled chain of volume elements

Sebastian Dröge-3
On Mi, 2016-06-29 at 04:05 -0700, Maik Scholz wrote:

> Hi,
>
> I like to attenuate an audio stream by a summary of different volume
> values
> (e.g. base gain, current volume, fade-in ramp, ...).
>
> This would be possible using a chains of volume elements ...
> =>volume[base gain]=>volume[current
> volume]=>volume[fade-in-ramp]=>audiomixer
> ... but I expect this is not the optimum for the CPU utilization.
> Isn't it?
>
> I did some tests with the gst-control-source concept.
> I implemented a helper class with a property for each volume type. 
> On change, the result of all types set to the src-pad volume of the
> audiomixer.
> Unfortunately, this does not work because my helper class can't
> support the
> controller.
>
> Is there a alternative for this use-case?
Why can't your helper class not support the controller API? It would
seem to be just another GstControlSource on which you can set your N
properties and which would then generate a single volume value from
that. Or am I misunderstanding what you try to achieve?

--
Sebastian Dröge, Centricular Ltd · http://www.centricular.com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (968 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: dynamic controlled chain of volume elements

Maik Scholz
Hi,

I checked "doc/design/part-controller.txt".
     Element view
     ~~~~~~~~~~~~
     Elements don't need to do much. They need to:
     - mark object properties that can be changed while processing with
       GST_PARAM_CONTROLLABLE
     - call gst_object_sync_values (self, timestamp) in the processing function
       before accessing the parameters.

>Why can't your helper class not support the controller API?

... so i have to call gst_object_sync_values from my helper class whenever volume element needs the actual volume.

>It would seem to be just another GstControlSource on which you can set your N
>properties and which would then generate a single volume value from that. Or am I misunderstanding what you try to achieve?

Do you mean, my "helper class" should be a GstControlSource itself?
I will check that way.

Thanks a lot

Maik
Reply | Threaded
Open this post in threaded view
|

Re: dynamic controlled chain of volume elements

Sebastian Dröge-3
On Do, 2016-06-30 at 01:45 -0700, Maik Scholz wrote:

> > Why can't your helper class not support the controller API?
>
> ... so i have to call gst_object_sync_values from my helper class
> whenever volume element needs the actual volume. 

The volume element is calling that itself whenever needed, i.e. when a
controlled property is used and it needs new values. That will then go
through the control binding and control source so a new value for the
property is known.

> > It would seem to be just another GstControlSource on which you can
> > set your
> N
> > properties and which would then generate a single volume value from
> > that.
> Or am I misunderstanding what you try to achieve? 
>
> Do you mean, my "helper class" should be a GstControlSource itself?
> I will check that way.

Yes, and you bind that one to the volume property then so that the
volume element asks your control source about the property value at any
time.

--
Sebastian Dröge, Centricular Ltd · http://www.centricular.com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (968 bytes) Download Attachment