[PATCH] echo-cancel: don't set latency range if the device doesn't support dynamic latency

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

 



pa_sink/source_set_latency_range() has an assertion that is triggered
when setting the latency range on a fixed latency device.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=102020
---
 src/modules/echo-cancel/module-echo-cancel.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/modules/echo-cancel/module-echo-cancel.c b/src/modules/echo-cancel/module-echo-cancel.c
index a1eeaceea..b28d60a60 100644
--- a/src/modules/echo-cancel/module-echo-cancel.c
+++ b/src/modules/echo-cancel/module-echo-cancel.c
@@ -2054,11 +2054,13 @@ int pa__init(pa_module*m) {
 
     /* We don't want to deal with too many chunks at a time */
     blocksize_usec = pa_bytes_to_usec(u->source_blocksize, &u->source->sample_spec);
-    pa_source_set_latency_range(u->source, blocksize_usec, blocksize_usec * MAX_LATENCY_BLOCKS);
+    if (u->source->flags & PA_SOURCE_DYNAMIC_LATENCY)
+        pa_source_set_latency_range(u->source, blocksize_usec, blocksize_usec * MAX_LATENCY_BLOCKS);
     pa_source_output_set_requested_latency(u->source_output, blocksize_usec * MAX_LATENCY_BLOCKS);
 
     blocksize_usec = pa_bytes_to_usec(u->sink_blocksize, &u->sink->sample_spec);
-    pa_sink_set_latency_range(u->sink, blocksize_usec, blocksize_usec * MAX_LATENCY_BLOCKS);
+    if (u->sink->flags & PA_SINK_DYNAMIC_LATENCY)
+        pa_sink_set_latency_range(u->sink, blocksize_usec, blocksize_usec * MAX_LATENCY_BLOCKS);
     pa_sink_input_set_requested_latency(u->sink_input, blocksize_usec * MAX_LATENCY_BLOCKS);
 
     /* The order here is important. The input/output must be put first,
-- 
2.13.2



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

  Powered by Linux