pipewiresink: fail when repeat resume/pause
-
PipeWire version (
pipewire --version
): sh-3.2# pipewire --version pipewire Compiled with libpipewire 0.3.47 Linked with libpipewire 0.3.47 -
Distribution and distribution version (
PRETTY_NAME
from/etc/os-release
): sh-3.2# cat /etc/os-release ID=poky-agl NAME="Automotive Grade Linux" VERSION="15.0.0 (octopus)" VERSION_ID=15.0.0 PRETTY_NAME="Automotive Grade Linux 15.0.0 (octopus)" DISTRO_CODENAME="octopus" -
Desktop Environment:
-
Kernel version (
uname -r
): sh-3.2# uname -r 5.15.94
Description of Problem:
"When utilizing gstreamer pipewiresink for video playback, if you continuously toggle between pause and resume operations, there's a certain likelihood that the resume operation may not succeed. The primary cause of this failure is that during the pause operation, the audio data doesn't trigger the preroll (gst_base_sink_wait_preroll) promptly, leading to the src pad of the aqueue being paused due to flushing. Consequently, when the pipeline attempts to resume (i.e., set state to playing), it displays the message: gst_element_set_state_func: element was busy with async state change.", and no one resume audio flow to trigger reproll.
and when i remove following , seem everything is ok
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
/* uncork and start play */
pw_thread_loop_lock (this->core->loop);
pw_stream_set_active(this->stream, true);
pw_thread_loop_unlock (this->core->loop);
gst_buffer_pool_set_flushing(GST_BUFFER_POOL_CAST(this->pool), FALSE);
break;
case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
/* stop play ASAP by corking */
pw_thread_loop_lock (this->core->loop);
pw_stream_set_active(this->stream, false);
pw_thread_loop_unlock (this->core->loop);
gst_buffer_pool_set_flushing(GST_BUFFER_POOL_CAST(this->pool), TRUE);
break;
How Reproducible:
Steps to Reproduce:
Actual Results:
Expected Results:
Additional Info (as attachments):
-
pw-dump > pw-dump.log
: