Fix tune time stuck: serialize Pause() state changes and add recovery for failed async transitions#1465
Draft
Copilot wants to merge 4 commits into
Draft
Conversation
…ization in Pause() Agent-Logs-Url: https://github.com/rdkcentral/aamp/sessions/1efbe83f-b635-4efb-bf93-992574859a04 Co-authored-by: rekhap2kandhavelan <217911244+rekhap2kandhavelan@users.noreply.github.com>
Agent-Logs-Url: https://github.com/rdkcentral/aamp/sessions/1efbe83f-b635-4efb-bf93-992574859a04 Co-authored-by: rekhap2kandhavelan <217911244+rekhap2kandhavelan@users.noreply.github.com>
Agent-Logs-Url: https://github.com/rdkcentral/aamp/sessions/1efbe83f-b635-4efb-bf93-992574859a04 Co-authored-by: rekhap2kandhavelan <217911244+rekhap2kandhavelan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix tune time stuck issue with recovery logic and serialization
Fix tune time stuck: serialize Pause() state changes and add recovery for failed async transitions
May 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two race conditions in
InterfacePlayerRDK::Pause()cause the player to get stuck during tune when rapid PLAY→PAUSE→PLAY sequences (within ~400ms) confuse GStreamer's state machine, or when an async pipeline transition stalls indefinitely.Changes
Serialize state change requests (
InterfacePlayerRDK::Pause())Before issuing any new PLAY/PAUSE state change, block on
gst_element_get_statewith a 500ms timeout. This drains any in-flight PAUSED→PLAYING async transition before the next contradictory request is sent — preventing GStreamer from receiving back-to-back conflicting state changes.Recovery logic after
validateStateWithMsTimeoutfailure (InterfacePlayerRDK::Pause())Previously, a timed-out async state transition only logged an error, leaving the pipeline stuck. Now:
SetStateWithWarningsASYNC), re-validate withvalidateStateWithMsTimeoutMESSAGE_ERRORto the application viabusMessageCallbackA local lambda eliminates the duplicated error-reporting code across the two failure branches.
Test updates (
InterfacePlayerFunctionTests.cpp)Pause_Success— fixed mock to set the current-state output parameter viaSetArgPointee<1>(GST_STATE_PAUSED)sovalidateStateWithMsTimeoutsucceeds without triggering the new retry path.Pause_SerializesStateChange_WaitsForPendingAsync— new: serialization check detects in-flight async and waits before proceeding.Pause_AsyncStateChange_ValidationFails_RecoverySuccess— new: retry resolves the stuck transition; no error is reported.Pause_AsyncStateChange_ValidationFails_ErrorReported— new: both initial and retry validations fail;busMessageCallbackreceivesMESSAGE_ERROR.Original prompt
This pull request was created from Copilot chat.