[PATCH] rtp-send: Don't inhibit suspending when connected to a monitor source

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2014-02-18 at 12:00 +0200, Tanu Kaskinen wrote:
> The flag was originally set unconditionally, but it was removed in
> 298ffffd1a3cf5ac4fbfe9cf793a5eb59162f892, because the flag broke the
> use case where a normal source (e.g. a microphone) was used. The flag
> makes sense only with monitor sources, which should get suspended when
> nothing is playing to the monitored sink to avoid consuming bandwidth
> for sending silence.

I believe this commit message isn't entirely accurate about the
motivation for 298ffffd. Based on a recent discussion with Ben, the use
case that broke was actually one where a monitor source was used (Ben,
correct me if I'm wrong). So the situation is that some people want
rtp-send to produce silence when nothing is playing to a sink that is
being monitored, and some people want the RTP stream to pause. I think
the right thing to do is to by default set the DONT_INHIBIT_AUTO_SUSPEND
flag when capturing from a monitor source and leave it unset otherwise,
but allow the user to override this policy with a module argument.

I'll make a patch that adds an "allow_suspend_on_idle" argument to
module-rtp-send.

> ---
>  src/modules/rtp/module-rtp-send.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/src/modules/rtp/module-rtp-send.c b/src/modules/rtp/module-rtp-send.c
> index 581e6be..eb31ed1 100644
> --- a/src/modules/rtp/module-rtp-send.c
> +++ b/src/modules/rtp/module-rtp-send.c
> @@ -378,6 +378,9 @@ int pa__init(pa_module*m) {
>      pa_source_output_new_data_set_sample_spec(&data, &ss);
>      pa_source_output_new_data_set_channel_map(&data, &cm);
>  
> +    if (s->monitor_of)
> +        data.flags = PA_SOURCE_OUTPUT_DONT_INHIBIT_AUTO_SUSPEND;
> +
>      pa_source_output_new(&o, m->core, &data);
>      pa_source_output_new_data_done(&data);

-- 
Tanu



[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux