Bug 66855 - module-tunnel screws up latency calculation on suspend
Summary: module-tunnel screws up latency calculation on suspend
Status: RESOLVED FIXED
Alias: None
Product: PulseAudio
Classification: Unclassified
Component: modules (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: pulseaudio-bugs
QA Contact: pulseaudio-bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-12 12:57 UTC by Pierre Ossman
Modified: 2013-07-14 10:45 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Pierre Ossman 2013-07-12 12:57:25 UTC
The tunnel modules are not suspending the smoother for latency calculation at the appropriate times, causing it to accumulate bad data and eventually royally screwing up the calculations.

I'll hopefully have a patch in a bit.
Comment 1 Pierre Ossman 2013-07-12 14:39:07 UTC
Very silly bug. The worker threads in module-tunnel looked at the wrong state variable. Fix:

Index: src/modules/module-tunnel.c
===================================================================
--- src/modules/module-tunnel.c	(revision 27672)
+++ src/modules/module-tunnel.c	(revision 27674)
@@ -502,9 +502,9 @@
             /* First, change the state, because otherwise pa_sink_render() would fail */
             if ((r = pa_sink_process_msg(o, code, data, offset, chunk)) >= 0) {
 
-                stream_cork_within_thread(u, u->sink->state == PA_SINK_SUSPENDED);
+                stream_cork_within_thread(u, u->sink->thread_info.state == PA_SINK_SUSPENDED);
 
-                if (PA_SINK_IS_OPENED(u->sink->state))
+                if (PA_SINK_IS_OPENED(u->sink->thread_info.state))
                     send_data(u);
             }
 
@@ -613,7 +613,7 @@
             int r;
 
             if ((r = pa_source_process_msg(o, code, data, offset, chunk)) >= 0)
-                stream_cork_within_thread(u, u->source->state == PA_SOURCE_SUSPENDED);
+                stream_cork_within_thread(u, u->source->thread_info.state == PA_SOURCE_SUSPENDED);
 
             return r;
         }


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.