Thanks Colin for your suggestions, that give me some good directions to start with.<br><br>I tried to modify existing module "module-cork-music-on-phone" , I have few queries:<br>1. I am now able to Cork(Pause) the "event" stream while a new "phone" stream arrives. but instead my requirement is to to permanently STOP the "event" stream <br>
instead of Corking while "phone" call stream exists? Is there any event/api I can use to achieve this? <br><br>(Currently I am corking the stream using pa_sink_input_send_event(ignore, PA_STREAM_EVENT_REQUEST_CORK, NULL) API )<br>
<br>2. I just need to give a try to play sample cache (beep) first in the same module (module-cork-music-on-phone) <br> {Just Playback no role supression initially at this stage} for that: <br> - How to init the module so that it would load the suppression_sound (if present) into the sample cache<br>
- Where (Location) to copy the sound (beep) .wav file ?<br> - How to Play the .wav from the module?<br><br>Thanks in advance.<br><br>Best Regards,<br>Himanshu Chug<br><br><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
'Twas brillig, and Himanshu Chug at 02/06/11 14:29 did gyre and gimble:<br>
> Thanks Colin. got your point here.<br>
> Now similar to music cork over phone, I need to cork the stream with<br>
> role="event" when another stream with role="phone" becomes active.<br>
> (here event can be sms alert etc) , Do I need to write any new module<br>
> for this? or this can be achieved some how, any pointers can be helpful?<br>
<br>
Initially I'd suggest that you could modify cork-music-on-phone to be<br>
more generic (I've a funny feeling I've suggested this to someone before<br>
too), perhaps renaming it to module-auto-cork or something suitably<br>
generic. Then make it configurable which streams to cork and on which<br>
triggers. e.g.<br>
<br>
load-module module-auto-cork trigger_roles=phone,event<br>
cork_roles=music,video<br>
<br>
The defaults being "phone" for trigger_roles and "music,video" for<br>
cork_roles.<br>
<br>
But...<br>
<br>
> I need to Play a Beep kind of sound when an "event" stream (say sms)<br>
> came during active "phone" call stream and cork the actual "event"<br>
> (sms tone) stream.<br>
><br>
> So there are two requirements now:<br>
> 1. Cork the "event" stream during active "phone" stream.<br>
> 2. Mixing the "phone" stream with new Beep stream.<br>
<br>
OK, so now this gets a little more complicated. Ultimately you want to<br>
change the event sound to something else... I think this specifically<br>
requires a more specialised module.<br>
<br>
Something that, when it finds an event stream while a phone stream is<br>
active, actually plays a different, (much more subtle and unobtrusive)<br>
sound (perhaps a sample in the sound sample cache?) instead.<br>
<br>
I think this in particular is more specialise and thus has to be handled<br>
before the module-auto-cork got it's hands on it.<br>
<br>
For that reason, I'd suggest a module-event-suppress module, that works<br>
in the following way:<br>
<br>
load-module module-role-suppress suppress_roles="event"<br>
suppression_sound=/path/to/sound.wav<br>
<br>
This module would work pretty much like I describe above. On init, it<br>
would load the suppression_sound (if present) into the sample cache and<br>
then suppress any event sounds and instead play the sample cache.<br>
<br>
I think this would work pretty well.<br>
<br>
</blockquote></div><br><br><div class="gmail_quote">On Thu, Jun 2, 2011 at 7:17 PM, Himanshu Chug <span dir="ltr"><<a href="mailto:himanshu.chug@gmail.com">himanshu.chug@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Adding to my question: <br><br>+ I need to Play a Beep kind of sound when an "event" stream (say sms) came during active "phone" call stream and cork the actual "event" (sms tone) stream.<br>
<br>
So there are two requirements now:<br>1. Cork the "event" stream during active "phone" stream.<br>2. Mixing the "phone" stream with new Beep stream.<br><br>Thanks,<br><font color="#888888">Himanshu</font><div>
<div></div><div class="h5"><br><br><br><div class="gmail_quote">
On Thu, Jun 2, 2011 at 5:59 PM, Himanshu Chug <span dir="ltr"><<a href="mailto:himanshu.chug@gmail.com" target="_blank">himanshu.chug@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Thanks Colin. got your point here.<br>Now similar to music cork over phone, I need to cork the stream with role="event" when another stream with role="phone" becomes active.<br>(here event can be sms alert etc) , Do I need to write any new module for this? or this can be achieved some how, any pointers can be helpful? <br>
<br>Best Regards,<br><font color="#888888">Himanshu</font><div><div></div><div><br><br><div class="gmail_quote">
On Wed, Jun 1, 2011 at 2:03 PM, Colin Guthrie <span dir="ltr"><<a href="mailto:gmane@colin.guthr.ie" target="_blank">gmane@colin.guthr.ie</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
'Twas brillig, and Himanshu Chug at 01/06/11 07:27 did gyre and gimble:<br>
<div>> Thanks for the quick reply Amanda, actually I need to understand this in<br>
> some more details ,<br>
> since I am new to pulseaudio please forgive if I ask something with not<br>
> much sense<br>
> 1. What this module do? and how PA modules can be loaded?<br>
<br>
</div>It more or less does as Amanda suggests. It corks/pauses the music<br>
streams when a phone stream is active on the same sink.<br>
<br>
In order to "cork" the application must handle cork requests from PA<br>
(thus allowing the app to properly pause itself). Just in case the app<br>
does not handle the cork, PA will mute the stream also. When the phone<br>
stream disappears, the stream is unmuted and the uncork request is sent.<br>
It's up to the music app to handle this gracefully.<br>
<br>
Modules are loaded typically by the <a href="http://default.pa" target="_blank">default.pa</a> script that is processed<br>
on startup. module-cork-music-on-phone is part of the <a href="http://default.pa" target="_blank">default.pa</a> we ship.<br>
<div><br>
> 2. How and When the module "module-cork-music-on-phone" comes to<br>
> picture or gets loaded? What condition triggers to load this module?<br>
<br>
</div>It's listens for new streams and when it find both two streams tagged<br>
with phone and a music respectively, it will cork/pause the music one.<br>
<div><br>
> 3. I am setting the role through music application.<br>
<br>
</div>Yeah, if you set it explicitly that's best but PA also tries to parse<br>
the .desktop file shipped with apps to try and augment the properties if<br>
possible. This is why, e.g. we know that lastfm-player (which uses alsa)<br>
is a "Music" app.<br>
<br>
HTHs<br>
<br>
Col<br>
<br>
<br>
<br>
--<br>
<br>
Colin Guthrie<br>
gmane(at)<a href="http://colin.guthr.ie" target="_blank">colin.guthr.ie</a><br>
<a href="http://colin.guthr.ie/" target="_blank">http://colin.guthr.ie/</a><br>
<br>
Day Job:<br>
Tribalogic Limited [<a href="http://www.tribalogic.net/" target="_blank">http://www.tribalogic.net/</a>]<br>
Open Source:<br>
Mageia Contributor [<a href="http://www.mageia.org/" target="_blank">http://www.mageia.org/</a>]<br>
PulseAudio Hacker [<a href="http://www.pulseaudio.org/" target="_blank">http://www.pulseaudio.org/</a>]<br>
Trac Hacker [<a href="http://trac.edgewall.org/" target="_blank">http://trac.edgewall.org/</a>]<br>
<div><div></div><div><br>
_______________________________________________<br>
pulseaudio-discuss mailing list<br>
<a href="mailto:pulseaudio-discuss@lists.freedesktop.org" target="_blank">pulseaudio-discuss@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss" target="_blank">http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss</a><br>
</div></div></blockquote></div><br>
</div></div></blockquote></div><br>
</div></div></blockquote></div><br>