[PATCH 01/10] loopback: Do not detect underruns during initial latency adjustments

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

 



Currently module-loopback detects underruns even if sink_input_pop_cb()
was not yet called twice and initial latency adjustments are active.
This leads to unnecessary rewind requests.

This patch delays detecting underruns until the initial adjustments
are done.
---
 src/modules/module-loopback.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/modules/module-loopback.c b/src/modules/module-loopback.c
index 31702e32..32780380 100644
--- a/src/modules/module-loopback.c
+++ b/src/modules/module-loopback.c
@@ -906,7 +906,8 @@ static int sink_input_process_msg_cb(pa_msgobject *obj, int code, void *data, in
              * right-away */
             if (u->sink_input->sink->thread_info.state != PA_SINK_SUSPENDED &&
                 u->sink_input->thread_info.underrun_for > 0 &&
-                pa_memblockq_is_readable(u->memblockq)) {
+                pa_memblockq_is_readable(u->memblockq) &&
+                u->output_thread_info.pop_called) {
 
                 pa_asyncmsgq_post(pa_thread_mq_get()->outq, PA_MSGOBJECT(u->msg), LOOPBACK_MESSAGE_UNDERRUN, NULL, 0, NULL, NULL);
                 /* If called from within the pop callback skip the rewind */
-- 
2.14.1



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

  Powered by Linux