Bug 99361

Summary: when unloading module-suspend-on-idle, sinks don't resume
Product: PulseAudio Reporter: wim.taymans <wim.taymans>
Component: modulesAssignee: pulseaudio-bugs
Status: RESOLVED FIXED QA Contact: pulseaudio-bugs
Severity: normal    
Priority: medium CC: lennart
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: proposed patch
proposed patch

Description wim.taymans@gmail.com 2017-01-11 11:57:03 UTC
Created attachment 128890 [details] [review]
proposed patch

When unloading the module-suspend-on-idle, the sinks/sources that were suspended are not resumed anymore. This causes playback/record to not work anymore after the unload.

The proposed patch is to manually resume all devices when unloading the module.
Comment 1 Tanu Kaskinen 2017-01-12 02:22:33 UTC
The patch resumes all devices even if they are already running, which results in some unwanted log messages (see the code in resume()).

Also, a couple of formatting accidents: too small indentation and space between a function's name and its argument list.

Otherwise a nice fix, though!
Comment 2 Arun Raghavan 2017-01-12 04:44:03 UTC
We could make resume conditional on the sink/source current state.
Comment 3 wim.taymans@gmail.com 2017-01-13 09:50:17 UTC
Created attachment 128926 [details] [review]
proposed patch
Comment 4 wim.taymans@gmail.com 2017-01-13 09:51:59 UTC
I added an improved patch:
 - correct indendation
 - only resume suspended sinks/sources
 - don't reset the timer if we're going to destroy it later anyway
 - improved log message
Comment 5 Tanu Kaskinen 2017-01-20 10:05:25 UTC
Thanks! Applied.

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.