GNOME Bugzilla – Bug 740385
pulsesink does not recover from the pulseaudio server dying
Last modified: 2018-11-03 14:56:18 UTC
Steps to reproduce: 1. Start playback of an mp3 on a platform that uses pulsesink by default: GST_DEBUG=*:3 gst-launch-1.0 playbin uri=file:///music/my.mp3 audio-sink='pulsesink' 2. kill -9 `pidof pulseaudio` 3. Notice that playback stops and the following errors are observed: 0:00:40.970599079 20926 0xb1c2df80 WARN pulse pulsesink.c:1752:gst_pulseringbuffer_commit:<audio-sink> error: pa_stream_writable_size() failed: Connection terminated 0:00:41.311085079 20926 0x64f9a0 WARN pulse pulsesink.c:413:gst_pulsering_is_dead:<audio-sink> error: Disconnected: Connection terminated Expected results: 1. pulsesink tries to reconnect to the pulse server and recreate the pa_context.
What if the server is never restarted? Would the expected behavior include somewhat of a sane timeout for this situation?
Yes I think that's reasonable. I would say 3-5 seconds of trying to reconnect should be sufficient. For Ubuntu, pulseaudio gets respawned immediately (less than 1 second) via Upstart.
In terms of code, might be easier to have a number of retries, rather than something time-based.
Right now the app would receive the error message on the bus. Maybe we can do the following. Add new properties with the number-of-retries. If it is 0 we post the error, like now. If it is > 0, we post an warning message instead of the error and do the retries, for each retry we wait 1 second (or do we need another property here). When the final retry fails we post an error. If this sounds good, I'd go with a default of 3 for number-of-retries. This changes the current behavior, but I think it actually improves the case for the user.
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/issues/144.