Re: [pulseaudio-discuss] Support for audio envelopes

2012-08-02 Thread Flavio Ceolin
Jaska Uimonen jaska.uimo...@helsinki.fi writes:

Hi Jaska,

 Hello,

 For some reason the company mail server is holding back the
 patches, doing some checking or what not... I sent the
 patches to the mailing list last Thursday. This happened
 to me once before, but I didn't remember to take it into
 account...

 Anyway if they are not appearing soon to the list, I will
 resend them from home.

 br,
 Jaska


Could you re-send the patches, i think your company blocked them.


 Quoting Flavio Ceolin flavio.ceo...@profusion.mobi:

 Hi folks,

 Tanu Kaskinen ta...@iki.fi writes:

 Hi Tanu,

 On Fri, 2012-07-20 at 17:32 -0300, Flavio Ceolin wrote:
 Tanu Kaskinen ta...@iki.fi writes:
  There were problems with the code. I don't remember what exactly was
  broken, though. But at least I didn't like the concurrency handling: I
  really dislike doing inter-thread communication by using shared
  variables. Instead, message passing should be used, in my opinion.

 I'll investigate how to solve it. Btw, do you think it's better start
 from the scratch or it's ok start from this code ?

 I really don't know. I'm not familiar enough with the code to know how
 much of it needs rewriting.

 I know that Jaska Uimonen has been working with volume envelopes too,
 and asked him yesterday about the status. He said he will post the code
 to the mailing list on Monday. I haven't seen the code, but if it's
 good, then it might be a good starting point too (Jaska said that it's
 lacking multichannel support, so work will be needed).


 It's really good to heard it.

  2) How an application should use this code, AFAIK this code is
 not being
 exported.
 
  What's your use case? If we are talking about sink volume ramping, I
  don't see the need for a client interface at all, because it should be
  done automatically by the server.

 Basically I want to set an envelope which apply a filter changing the
 sound balance and/or the volume, it's easier demonstrating an idea of an
 envelope:

 But what's the use case (user-visible feature) that you're interested
 in? My answer to the how an application should use this code depends
 on the use case.

 I want make possible an application associate an action with an audio
 effect. For example, a dialog pops up and you want to keep that sample
 pattern playing but you want to fade it out so its really quiet. So over
 2 seconds you fade it out. Another example would be you shift balance to
 the left or right according with the mobile phone (or whatever you want)
 position.

 Regards,
 Flavio Ceolin

 Trying to continue this matter, the idea of make this funcionality so
 generic is facilitating for other applications. I believe several
 applications (like media players) that use PA are implementing it's own
 basic effects as crossfading or fade-in/out for pause. I think make it
 easier is a goal.

 Other benefit of supporting it, is make possible the ducking[1] effect on
 audio streams, as we've discussed on irc, a good example for this is the
 sms case (when a sms comes the others samples should fade-out).

 Another point to have it is the sample cache. If the sample is already
 in the cache and the application should do fade-in/out or change the
 balance, the only way to do that is re-uploading the sample.

 So guys, what you think about, it worth to implement ? If not, what you
 think should be changed ? I'm open to discuss it.


 [1] http://en.wikipedia.org/wiki/Ducking


 Regards,
 Flavio Ceolin
 ___
 pulseaudio-discuss mailing list
 pulseaudio-discuss@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Regards,
Flavio Ceolin
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] Support for audio envelopes

2012-07-31 Thread Jaska Uimonen

Hello,

For some reason the company mail server is holding back the
patches, doing some checking or what not... I sent the
patches to the mailing list last Thursday. This happened
to me once before, but I didn't remember to take it into
account...

Anyway if they are not appearing soon to the list, I will
resend them from home.

br,
Jaska


Quoting Flavio Ceolin flavio.ceo...@profusion.mobi:


Hi folks,


Tanu Kaskinen ta...@iki.fi writes:

Hi Tanu,


On Fri, 2012-07-20 at 17:32 -0300, Flavio Ceolin wrote:

Tanu Kaskinen ta...@iki.fi writes:
 There were problems with the code. I don't remember what exactly was
 broken, though. But at least I didn't like the concurrency handling: I
 really dislike doing inter-thread communication by using shared
 variables. Instead, message passing should be used, in my opinion.

I'll investigate how to solve it. Btw, do you think it's better start
from the scratch or it's ok start from this code ?


I really don't know. I'm not familiar enough with the code to know how
much of it needs rewriting.

I know that Jaska Uimonen has been working with volume envelopes too,
and asked him yesterday about the status. He said he will post the code
to the mailing list on Monday. I haven't seen the code, but if it's
good, then it might be a good starting point too (Jaska said that it's
lacking multichannel support, so work will be needed).



It's really good to heard it.

 2) How an application should use this code, AFAIK this code is  
not being

exported.

 What's your use case? If we are talking about sink volume ramping, I
 don't see the need for a client interface at all, because it should be
 done automatically by the server.

Basically I want to set an envelope which apply a filter changing the
sound balance and/or the volume, it's easier demonstrating an idea of an
envelope:


But what's the use case (user-visible feature) that you're interested
in? My answer to the how an application should use this code depends
on the use case.


I want make possible an application associate an action with an audio
effect. For example, a dialog pops up and you want to keep that sample
pattern playing but you want to fade it out so its really quiet. So over
2 seconds you fade it out. Another example would be you shift balance to
the left or right according with the mobile phone (or whatever you want)
position.

Regards,
Flavio Ceolin


Trying to continue this matter, the idea of make this funcionality so
generic is facilitating for other applications. I believe several
applications (like media players) that use PA are implementing it's own
basic effects as crossfading or fade-in/out for pause. I think make it
easier is a goal.

Other benefit of supporting it, is make possible the ducking[1] effect on
audio streams, as we've discussed on irc, a good example for this is the
sms case (when a sms comes the others samples should fade-out).

Another point to have it is the sample cache. If the sample is already
in the cache and the application should do fade-in/out or change the
balance, the only way to do that is re-uploading the sample.

So guys, what you think about, it worth to implement ? If not, what you
think should be changed ? I'm open to discuss it.


[1] http://en.wikipedia.org/wiki/Ducking


Regards,
Flavio Ceolin
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss




___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] Support for audio envelopes

2012-07-31 Thread Flavio Ceolin
Jaska Uimonen jaska.uimo...@helsinki.fi writes:

Hi Jaska,

 Hello,

 For some reason the company mail server is holding back the
 patches, doing some checking or what not... I sent the
 patches to the mailing list last Thursday. This happened
 to me once before, but I didn't remember to take it into
 account...

 Anyway if they are not appearing soon to the list, I will
 resend them from home.

 br,
 Jaska


Thanks for update me, i'm waiting your patch so.

Regards,
Flavio Ceolin

 Quoting Flavio Ceolin flavio.ceo...@profusion.mobi:

 Hi folks,

 Tanu Kaskinen ta...@iki.fi writes:

 Hi Tanu,

 On Fri, 2012-07-20 at 17:32 -0300, Flavio Ceolin wrote:
 Tanu Kaskinen ta...@iki.fi writes:
  There were problems with the code. I don't remember what exactly was
  broken, though. But at least I didn't like the concurrency handling: I
  really dislike doing inter-thread communication by using shared
  variables. Instead, message passing should be used, in my opinion.

 I'll investigate how to solve it. Btw, do you think it's better start
 from the scratch or it's ok start from this code ?

 I really don't know. I'm not familiar enough with the code to know how
 much of it needs rewriting.

 I know that Jaska Uimonen has been working with volume envelopes too,
 and asked him yesterday about the status. He said he will post the code
 to the mailing list on Monday. I haven't seen the code, but if it's
 good, then it might be a good starting point too (Jaska said that it's
 lacking multichannel support, so work will be needed).


 It's really good to heard it.

  2) How an application should use this code, AFAIK this code is
 not being
 exported.
 
  What's your use case? If we are talking about sink volume ramping, I
  don't see the need for a client interface at all, because it should be
  done automatically by the server.

 Basically I want to set an envelope which apply a filter changing the
 sound balance and/or the volume, it's easier demonstrating an idea of an
 envelope:

 But what's the use case (user-visible feature) that you're interested
 in? My answer to the how an application should use this code depends
 on the use case.

 I want make possible an application associate an action with an audio
 effect. For example, a dialog pops up and you want to keep that sample
 pattern playing but you want to fade it out so its really quiet. So over
 2 seconds you fade it out. Another example would be you shift balance to
 the left or right according with the mobile phone (or whatever you want)
 position.

 Regards,
 Flavio Ceolin

 Trying to continue this matter, the idea of make this funcionality so
 generic is facilitating for other applications. I believe several
 applications (like media players) that use PA are implementing it's own
 basic effects as crossfading or fade-in/out for pause. I think make it
 easier is a goal.

 Other benefit of supporting it, is make possible the ducking[1] effect on
 audio streams, as we've discussed on irc, a good example for this is the
 sms case (when a sms comes the others samples should fade-out).

 Another point to have it is the sample cache. If the sample is already
 in the cache and the application should do fade-in/out or change the
 balance, the only way to do that is re-uploading the sample.

 So guys, what you think about, it worth to implement ? If not, what you
 think should be changed ? I'm open to discuss it.


 [1] http://en.wikipedia.org/wiki/Ducking


 Regards,
 Flavio Ceolin
 ___
 pulseaudio-discuss mailing list
 pulseaudio-discuss@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] Support for audio envelopes

2012-07-30 Thread Flavio Ceolin
Hi folks,

 Tanu Kaskinen ta...@iki.fi writes:

 Hi Tanu,

 On Fri, 2012-07-20 at 17:32 -0300, Flavio Ceolin wrote:
 Tanu Kaskinen ta...@iki.fi writes:
  There were problems with the code. I don't remember what exactly was
  broken, though. But at least I didn't like the concurrency handling: I
  really dislike doing inter-thread communication by using shared
  variables. Instead, message passing should be used, in my opinion.
 
 I'll investigate how to solve it. Btw, do you think it's better start
 from the scratch or it's ok start from this code ?

 I really don't know. I'm not familiar enough with the code to know how
 much of it needs rewriting.

 I know that Jaska Uimonen has been working with volume envelopes too,
 and asked him yesterday about the status. He said he will post the code
 to the mailing list on Monday. I haven't seen the code, but if it's
 good, then it might be a good starting point too (Jaska said that it's
 lacking multichannel support, so work will be needed).


 It's really good to heard it.

  2) How an application should use this code, AFAIK this code is not being
 exported.
 
  What's your use case? If we are talking about sink volume ramping, I
  don't see the need for a client interface at all, because it should be
  done automatically by the server.
 
 Basically I want to set an envelope which apply a filter changing the
 sound balance and/or the volume, it's easier demonstrating an idea of an
 envelope:

 But what's the use case (user-visible feature) that you're interested
 in? My answer to the how an application should use this code depends
 on the use case.

 I want make possible an application associate an action with an audio
 effect. For example, a dialog pops up and you want to keep that sample
 pattern playing but you want to fade it out so its really quiet. So over
 2 seconds you fade it out. Another example would be you shift balance to
 the left or right according with the mobile phone (or whatever you want)
 position.

 Regards,
 Flavio Ceolin

Trying to continue this matter, the idea of make this funcionality so
generic is facilitating for other applications. I believe several
applications (like media players) that use PA are implementing it's own
basic effects as crossfading or fade-in/out for pause. I think make it
easier is a goal.

Other benefit of supporting it, is make possible the ducking[1] effect on
audio streams, as we've discussed on irc, a good example for this is the
sms case (when a sms comes the others samples should fade-out).

Another point to have it is the sample cache. If the sample is already
in the cache and the application should do fade-in/out or change the
balance, the only way to do that is re-uploading the sample.

So guys, what you think about, it worth to implement ? If not, what you
think should be changed ? I'm open to discuss it.


[1] http://en.wikipedia.org/wiki/Ducking


Regards,
Flavio Ceolin
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] Support for audio envelopes

2012-07-21 Thread Tanu Kaskinen
On Fri, 2012-07-20 at 17:32 -0300, Flavio Ceolin wrote:
 Tanu Kaskinen ta...@iki.fi writes:
  There were problems with the code. I don't remember what exactly was
  broken, though. But at least I didn't like the concurrency handling: I
  really dislike doing inter-thread communication by using shared
  variables. Instead, message passing should be used, in my opinion.
 
 I'll investigate how to solve it. Btw, do you think it's better start
 from the scratch or it's ok start from this code ?

I really don't know. I'm not familiar enough with the code to know how
much of it needs rewriting.

I know that Jaska Uimonen has been working with volume envelopes too,
and asked him yesterday about the status. He said he will post the code
to the mailing list on Monday. I haven't seen the code, but if it's
good, then it might be a good starting point too (Jaska said that it's
lacking multichannel support, so work will be needed).

  2) How an application should use this code, AFAIK this code is not being
 exported.
 
  What's your use case? If we are talking about sink volume ramping, I
  don't see the need for a client interface at all, because it should be
  done automatically by the server.
 
 Basically I want to set an envelope which apply a filter changing the
 sound balance and/or the volume, it's easier demonstrating an idea of an
 envelope:

But what's the use case (user-visible feature) that you're interested
in? My answer to the how an application should use this code depends
on the use case.

-- 
Tanu

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] Support for audio envelopes

2012-07-20 Thread Tanu Kaskinen
On Thu, 2012-07-19 at 14:35 -0300, Flavio Ceolin wrote:
 Hi floks,
 
 I'm trying to implement support for audio envelopes on pulse audio and
 several doubts come to me. First i've checked that we already had
 support for it, but it was removed. So my first doubt is, there were
 problems with this code or it was removed just because no one was using ?

There were problems with the code. I don't remember what exactly was
broken, though. But at least I didn't like the concurrency handling: I
really dislike doing inter-thread communication by using shared
variables. Instead, message passing should be used, in my opinion.

 For purpose tests, i've re-applied the old code (doing just the necessary
 things to compile). So far so good, it was pretty easy. Now i've other
 questions:
 
 1) Should evenlopes be applied in source too, or just in the sink ?

Probably also in sources, but I think you don't need to care about
sources at this point. Once it's done for sinks, then we can copy it to
sources.

 2) How an application should use this code, AFAIK this code is not being
exported.

What's your use case? If we are talking about sink volume ramping, I
don't see the need for a client interface at all, because it should be
done automatically by the server.

 Besides these points, i would enjoy any kind of tip/idea related with
 this subject.

You'll need to keep rewinds in mind. That is, if a rewind affects the
envelope, you need to update the envelope state accordingly.

-- 
Tanu

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] Support for audio envelopes

2012-07-20 Thread Flavio Ceolin
Tanu Kaskinen ta...@iki.fi writes:

Hi Tanu,

First of all, thanks for the answer.

 On Thu, 2012-07-19 at 14:35 -0300, Flavio Ceolin wrote:
 Hi floks,
 
 I'm trying to implement support for audio envelopes on pulse audio and
 several doubts come to me. First i've checked that we already had
 support for it, but it was removed. So my first doubt is, there were
 problems with this code or it was removed just because no one was using ?

 There were problems with the code. I don't remember what exactly was
 broken, though. But at least I didn't like the concurrency handling: I
 really dislike doing inter-thread communication by using shared
 variables. Instead, message passing should be used, in my opinion.

I'll investigate how to solve it. Btw, do you think it's better start
from the scratch or it's ok start from this code ?


 For purpose tests, i've re-applied the old code (doing just the necessary
 things to compile). So far so good, it was pretty easy. Now i've other
 questions:
 
 1) Should evenlopes be applied in source too, or just in the sink ?

 Probably also in sources, but I think you don't need to care about
 sources at this point. Once it's done for sinks, then we can copy it to
 sources.

Ok, I agree with you.

 2) How an application should use this code, AFAIK this code is not being
exported.

 What's your use case? If we are talking about sink volume ramping, I
 don't see the need for a client interface at all, because it should be
 done automatically by the server.

Basically I want to set an envelope which apply a filter changing the
sound balance and/or the volume, it's easier demonstrating an idea of an
envelope:

envelope {
  gain: 1.0;   /* gain or volume - total multiplier of envelope 1.0 
(full volume) */
  type: LINEAR;/* or any ohter algorithm, for example SPLINE */
  /* point = x (time) y (balance) */
  /* if stereo position values ate 0.0 - 1.0 with 0.5 == center, 0.0 == 
left, 1.0 == right */
  point: 0   0.50; // middle
  point: 4   0.70; // right-ish
  point: 8   0.30; // left-ish
  point: 12  0.60; // a little right
  point: 16  0.40; // a little left
  point: 20  0.55; // very little right
  point: 24  0.45; // very little left
  point: 28  0.50; // back to middle
}


 Besides these points, i would enjoy any kind of tip/idea related with
 this subject.

 You'll need to keep rewinds in mind. That is, if a rewind affects the
 envelope, you need to update the envelope state accordingly.

I'll keep it in mind.


Regards,
Flavio Ceolin
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss