Here are the last two patches that are required for fixing https://bugs.freedesktop.org/show_bug.cgi?id=104761 Changes in v3: - I simplified the variable assignments in sink/source_set_state() after a failed resume. - I reduced the "!state_changed && !suspend_cause_changed" checks after a failed to just "!suspend_cause_changed", because state_changed is always false. I added a comment related to this too. There are no changes in the second patch. Tanu Kaskinen (2): pass pa_suspend_cause_t to set_state_in_io_thread() callbacks fix a call to pa_sink_suspend() from an incorrect thread src/modules/alsa/alsa-sink.c | 99 ++++++++++++++++++++----- src/modules/alsa/alsa-source.c | 99 ++++++++++++++++++++----- src/modules/bluetooth/module-bluez4-device.c | 4 +- src/modules/bluetooth/module-bluez5-device.c | 4 +- src/modules/echo-cancel/module-echo-cancel.c | 2 +- src/modules/module-combine-sink.c | 7 +- src/modules/module-equalizer-sink.c | 2 +- src/modules/module-esound-sink.c | 7 +- src/modules/module-ladspa-sink.c | 2 +- src/modules/module-null-sink.c | 2 +- src/modules/module-null-source.c | 2 +- src/modules/module-pipe-sink.c | 2 +- src/modules/module-remap-sink.c | 2 +- src/modules/module-sine-source.c | 2 +- src/modules/module-solaris.c | 14 +++- src/modules/module-tunnel-sink-new.c | 7 +- src/modules/module-tunnel-source-new.c | 7 +- src/modules/module-virtual-sink.c | 2 +- src/modules/module-virtual-surround-sink.c | 2 +- src/modules/oss/module-oss.c | 14 +++- src/modules/raop/raop-sink.c | 7 +- src/pulsecore/sink.c | 107 +++++++++++---------------- src/pulsecore/sink.h | 9 +-- src/pulsecore/source.c | 107 +++++++++++---------------- src/pulsecore/source.h | 9 +-- 25 files changed, 322 insertions(+), 199 deletions(-) -- 2.16.2