<p><br>
><br>
> Hi ,<br>
><br>
> I am trying to add a new function "pa_context_set_sink_input_paused" to the pulseaudio introspect.c file. I was able to able and successfully compile pulseaudio too..<br>
><br>
> gcc pa_listclients_pause.c -o pa_listclients_pause -L /home/sathish/Desktop/pulseaudio-4.0/build/src/.libs/ -lpulse<br>
><br>
> /tmp/ccueP47b.o: In function `pa_get_devicelist':<br>
><br>
> pa_listclients_pause.c.text+0x6cb): undefined reference to `pa_context_set_sink_input_paused'<br>
><br>
> collect2: error: ld returned 1 exit status<br>
><br>
> But when I try to run a program using this new function, it returns me "undefined reference".<br>
><br>
> I tried to run the nm command and check whether the new function is present in libpulse.so<br>
><br>
> The function returns me it has found it..<br>
><br>
> nm -A *.so | grep "pa_context_set_sink_input_paused"<br>
><br>
> libpulse.so:0001d4a0 t pa_context_set_sink_input_paused<br>
><br>
> I am not able to comprehend what is happening. Can you help me with this ??<br>
><br>
> Thanks,<br>
><br>
> Sathish<br>
><br>
> <br>
><br>
> From: Sathishkumar Sivagurunathan <br>
> Sent: Thursday, December 19, 2013 2:24 PM<br>
> To: 'sathishkumar sivagurunathan'<br>
> Subject: RE: Re: [pulseaudio-discuss] Pause a audio stream<br>
><br>
> <br>
><br>
> Hi Tanu,<br>
><br>
> <br>
><br>
> Thanks for the reply and advice,<br>
><br>
> <br>
><br>
> 1) My current aim is just short term. Hence I would just like to have pause implemented through the introspect.h as a first step.<br>
><br>
> <br>
><br>
> In accordance with my previous mail, I had made the changes to the necessary files and compiled using the "make". But somehow when I run my c program which calls the function “pa_context_request_sink_input_cork()”, it seems to not pick up the new function defined in introspect.c. It returns a undefined reference error..<br>
><br>
> <br>
><br>
> The command I used for compiling the program I am using to call the cork functionality points lpulse library.<br>
><br>
> <br>
><br>
> Is there something other than "make" I should be looking at ??<br>
><br>
> <br>
><br>
> The compilation of PulseAudio with the changes was successful without any errors..<br>
><br>
> <br>
><br>
> 2) But if you can help me understand this client - server concept, I will try to take as the next step. My doubts in this are pretty elementary but it will help me a lot if you can clear them.<br>
><br>
> <br>
><br>
> a) "Murphy is an external policy manager, but it will also have a dedicated module in PulseAudio."<br>
><br>
> <br>
><br>
> The one I am working on is similar to Murphy. When you say, we will have a dedicated module, should this module be like the other modules like "module-role-cork" ??<br>
><br>
> <br>
><br>
> b) "Instead, the Murphy module in PulseAudio will be a client to Murphy, using Murphy's APIs, so the client-server relationship is the other way around than in your setup."<br>
><br>
> <br>
><br>
> Now, Murphy module in PulseAudio is client, Murphy is the server. How will the murphy api's in the client will be called. Will it be through the "load-module" functionality currently available with pactl, loaded by pulseaudio at daemon start up or like a C function call..<br>
><br>
> <br>
><br>
> In short, it would be great if you can help understand how the communication between these three thing takes place ??<br>
><br>
> <br>
><br>
> Murphy --> Murphy module in PulseAudio () --> PulseAudio..<br>
><br>
> <br>
><br>
> Thanks,<br>
><br>
> Sathish<br>
><br>
> <br>
><br>
> From: sathishkumar sivagurunathan [mailto:<a href="mailto:sathish1000@gmail.com">sathish1000@gmail.com</a>] <br>
> Sent: Thursday, December 19, 2013 12:19 PM<br>
> To: Sathishkumar Sivagurunathan<br>
> Subject: Fwd: Re: [pulseaudio-discuss] Pause a audio stream<br>
><br>
> <br>
><br>
> ---------- Forwarded message ----------<br>
> From: "Tanu Kaskinen" <<a href="mailto:tanu.kaskinen@linux.intel.com">tanu.kaskinen@linux.intel.com</a>><br>
> Date: Dec 16, 2013 4:18 PM<br>
> Subject: Re: [pulseaudio-discuss] Pause a audio stream<br>
> To: "sathishkumar sivagurunathan" <<a href="mailto:sathish1000@gmail.com">sathish1000@gmail.com</a>><br>
> Cc: <<a href="mailto:pulseaudio-discuss@lists.freedesktop.org">pulseaudio-discuss@lists.freedesktop.org</a>><br>
><br>
> On Sat, 2013-12-14 at 14:25 +0530, sathishkumar sivagurunathan wrote:<br>
> > Thanks Tanu for the reply,<br>
> ><br>
> > I have been trying to some simple analysis for the past on this question<br>
> > below I raised before you last time..<br>
> ><br>
> > 1) I have a routing policy manager which would like to cork/pause a<br>
> > stream. No priority is involved in this usecase. Is it this possible with<br>
> > Pulse Audio.<br>
> ><br>
> > Only the application that created the stream can cork it. External<br>
> > policy managers can't do that. This may change in the future, but don't<br>
> > count on that. If you want to implement a policy for corking streams,<br>
> > you have to do that in a PulseAudio module.<br>
> ><br>
> > Tanu, I understand that it is possible only by the application to cork the<br>
> > stream. I really tried using the "module-role-cork" module.<br>
> > But I couldn't fit it into my need for having called from my policy<br>
> > manager..<br>
> ><br>
> > Hence, I was trying to go through the code if something different can be<br>
> > done. I had presented my analysis to you. Glad to hear your comments on<br>
> > it..<br>
> ><br>
> > My idea is (though my analysis might not be perfect) :-<br>
> ><br>
> > 1) I looked at the available C API's that are available in Instrospect.c.<br>
> > It houses the C API's to be called for muting, changing volume etc.<br>
> > Is it possible to add a function to this Introspect.c for pause<br>
> > functionality.<br>
> ><br>
> > 2) I also saw that C API's in Introspect.c like called functions in<br>
> > protocol-native.c to execute the functionality.<br>
> > Example:- *pa_context_set_sink_mute_by_index* function in Introspect.c<br>
> > calls *command_set_mute *in protocol-native.c.<br>
> ><br>
> > 3) Hence is it possible to write a new function for pause say "<br>
> > *pa_context_set_sink_input_pause*" in Introspect.c and call "<br>
> > *command_set_pause*" in protocol-native.c.<br>
><br>
> About the function naming: "pause" isn't a good term, because we already<br>
> use the term "cork" that means the same thing. Also,<br>
> "set_sink_input_cork" isn't good, because you only send a request to the<br>
> client, you don't set the cork state directly. Perhaps<br>
> "pa_context_request_sink_input_cork()" would be good?<br>
><br>
> > 4) This new function "*command_set_pause*" in protocol-native.c calls<br>
> > into "*pa_sink_input_send_event"<br>
> > *in sink-input.c and henceforth the event is relayed to the application for<br>
> > pausing.<br>
> ><br>
> > 5) Indeed I am just trying to use the same chain of command followed by "<br>
> > *module-role-cork*" module to relay command which is<br>
> > * module-role-cork* -> *pa_sink_input_send_event* in sink-input.c -><br>
> > *sink_input_send_event_cb* in protocol-native.c -> Application --> which<br>
> > instructs to pause.<br>
> ><br>
> > 6) I am just to come from the Introspect.c side..<br>
> > *pa_context_set_sink_input_pause *in Introspect.c -> *command_set_pause<br>
> > *in protocol-native.c -> *pa_sink_input_send_event* in sink-input.c -><br>
> > *sink_input_send_event_cb* in protocol-native.c -> Application --> which<br>
> > instructs to pause.<br>
> ><br>
> > My questions are:-<br>
> ><br>
> > Is this feasible.. I am asking this because i trying to connect as a client<br>
> > and do it. And you had mentioned that client would be allowed to do such a<br>
> > thing..<br>
><br>
> It's feasible. I don't know if it's a good idea, though. I think it's<br>
> asking for trouble to do audio policy enforcement relying only on an<br>
> external component, because there will always be able things that you<br>
> can't control from outside the server, things like the initial routing<br>
> and volume of a new stream.<br>
><br>
> I'm working myself on bringing Murphy support to PulseAudio. Murphy is<br>
> an external policy manager, but it will also have a dedicated module in<br>
> PulseAudio. I will need to handle corking policy too, but I don't know<br>
> yet the details about how that will be handled (I've been working on<br>
> routing policy so far). I'm pretty sure it will not be handled via the<br>
> introspect.h API, however. Murphy won't use PulseAudio's client API, as<br>
> far as I know. Instead, the Murphy module in PulseAudio will be a client<br>
> to Murphy, using Murphy's APIs, so the client-server relationship is the<br>
> other way around than in your setup.<br>
><br>
> If you send patches for adding pa_context_request_sink_input_cork()<br>
> anyway, I won't reject those. While I think you're likely to regret the<br>
> decision to use an external policy manager that only uses the client<br>
> API, I don't have proof that it won't be good enough for your purposes,<br>
> so I shouldn't block this feature.<br>
><br>
> --<br>
> Tanu<br>
></p>