Merge lp:~yuningdodo/unity-control-center/unity-control-center.lp1396464-prevent-update-sink-input-in-parallel into lp:unity-control-center
Status: | Merged |
---|---|
Approved by: | Sebastien Bacher |
Approved revision: | 12805 |
Merged at revision: | 12817 |
Proposed branch: | lp:~yuningdodo/unity-control-center/unity-control-center.lp1396464-prevent-update-sink-input-in-parallel |
Merge into: | lp:unity-control-center |
Diff against target: |
19 lines (+1/-1) 1 file modified
panels/sound/gvc-channel-bar.c (+1/-1) |
To merge this branch: | bzr merge lp:~yuningdodo/unity-control-center/unity-control-center.lp1396464-prevent-update-sink-input-in-parallel |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
David Henningsson (community) | Approve | ||
Unity Control Center development team | Pending | ||
Review via email: mp+245927@code.launchpad.net |
Commit message
Trigger the "value-changed" signal outside set_is_muted() when necessary.
Description of the change
This patch is for bug #1396464, with a further debugging I found it's a race condition issue.
in the function req_update_
1. the mixer is changed to state 1, S1, in req_update_
2. the mixer is changed to state 2, S2, in req_update_
3. _pa_context_
4. _pa_context_
In step 3 the sink is updated with the out-of-date state S1, and this causes the mixer to be changed to S1 again, so another async query is performed in req_update_
To fix this issue we should cancel any previous query in req_update_
BTW, in the same source file there are functions with similar logic:
req_update_
req_update_
req_update_card()
req_update_
req_update_
req_update_
req_update_
Not sure if we should apply similar checking for them.
Cool, indeed this looks more reasonable to be the root cause.
But a question here - is it possible that the following can happen, at least in theory: sink_info( sink 1) sink_info( sink 2)
1) req_update_
2) req_update_
3) update_sink(sink 1)
4) update_sink(sink 2)
In this case, if it can happen, you would actually want them both to run in parallel.
Also, maybe upstream Gnome should be involved in this conversation. Not sure if they would like to break the loop using your suggestion, or rather break the loop at point 3) i e, if the change of mixer is initiated by a callback from PA, that should just update the GUI, not set the PA sink volume again to what it just received. Does that make sense?