[pulseaudio-discuss] [RFC] When maxlength and adjust_latency are set, do not allow higher latencies

Tanu Kaskinen tanu.kaskinen at linux.intel.com
Mon Jun 24 09:00:18 PDT 2013


On Wed, 2013-06-12 at 16:28 +0200, David Henningsson wrote:
> @@ -351,6 +353,12 @@ static void increase_watermark(struct userdata *u) {
>      new_min_latency = PA_MIN(old_min_latency * 2, old_min_latency + TSCHED_WATERMARK_INC_STEP_USEC);
>      new_min_latency = PA_MIN(new_min_latency, u->sink->thread_info.max_latency);
>  
> +    PA_HASHMAP_FOREACH(i, u->sink->thread_info.inputs, state) {
> +        pa_log_debug("Sink input latency: %0.2f ms", (double) i->thread_info.max_sink_latency / PA_USEC_PER_MSEC);
> +        if (i->thread_info.max_sink_latency > 0)
> +            new_min_latency = PA_MIN(new_min_latency, i->thread_info.max_sink_latency);
> +    }
> +
>      if (old_min_latency != new_min_latency) {
>          pa_log_info("Increasing minimal latency to %0.2f ms",
>                      (double) new_min_latency / PA_USEC_PER_MSEC);

Forgot to comment about this: when a new low-latency stream is added,
the sink's minimal latency may actually go down, in which case the log
message "increasing minimal latency" is incorrect. I think the way to
fix this would be to adjust the latency range immediately when new
streams are added.

-- 
Tanu



More information about the pulseaudio-discuss mailing list