/* We need to resume the audio device here even for
* PA_SINK_INPUT_START_CORKED, since we need the device parameters
- * to be fully available while the stream is set up. */
+ * to be fully available while the stream is set up. In that case,
+ * make sure we close the sink again after the timeout interval. */
- if ((d = pa_hashmap_get(u->device_infos, data->sink)))
+ if ((d = pa_hashmap_get(u->device_infos, data->sink))) {
resume(d);
+ if (d->sink && pa_sink_check_suspend(d->sink) <= 0)
+ restart(d);
+ }
If a stream is started corked and remains corked, the sink/source
remained idle without being properly suspended. This patch fixes
that issue.
BugLink: https:/ /bugs.launchpad .net/bugs/ 1284415 module- suspend- on-idle. c | 13 ++++++++++---
Tested-by: Ricardo Salveti <email address hidden>
Signed-off-by: David Henningsson <email address hidden>
---
src/modules/
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/src/modules/ module- suspend- on-idle. c b/src/modules/ module- suspend- on-idle. c module- suspend- on-idle. c module- suspend- on-idle. c fixate_ hook_cb( pa_core *c, pa_sink_input_new_
index 0585e51..a4f90e0 100644
--- a/src/modules/
+++ b/src/modules/
@@ -141,10 +141,14 @@ static pa_hook_result_t sink_input_
/* We need to resume the audio device here even for INPUT_START_ CORKED, since we need the device parameters
* PA_SINK_
- * to be fully available while the stream is set up. */
+ * to be fully available while the stream is set up. In that case,
+ * make sure we close the sink again after the timeout interval. */
- if ((d = pa_hashmap_ get(u-> device_ infos, data->sink))) get(u-> device_ infos, data->sink))) { check_suspend( d->sink) <= 0)
+ if ((d = pa_hashmap_
resume(d);
+ if (d->sink && pa_sink_
+ restart(d);
+ }
return PA_HOOK_OK; output_ fixate_ hook_cb( pa_core *c, pa_source_outpu get(u-> device_ infos, data->source);
}
@@ -161,8 +165,11 @@ static pa_hook_result_t source_
else
d = pa_hashmap_
- if (d) check_suspend( d->source) <= 0)
+ if (d) {
resume(d);
+ if (d->source && pa_source_
+ restart(d);
+ }
return PA_HOOK_OK;
}
--
1.7.9.5