RDKEMW-21923 : [LLAMA /Cello]Observed the message "Sorry, fast forward isn't available for this programme followed by techanical fault error" while performing fast scrubbing by long-pressing the Right and Left navigation keys. - #216
Open
rekhap2kandhavelan wants to merge 3 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to reduce race-condition fallout during rapid scrubbing by adding a recovery path when the GStreamer pipeline appears “wedged” around PAUSED state transitions.
Changes:
- Add a fallback in
validateStateWithMsTimeout()to force a pipeline reset viaGST_STATE_NULLwhen the pipeline appears stuck in a PAUSED/PAUSED state.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+3475
to
+3482
| if (gst_current == GST_STATE_PAUSED && gst_pending == GST_STATE_PAUSED) | ||
|
|
||
| { | ||
| // Pipeline wedged in PAUSED->PAUSED transition Force state reset by going through NULL state | ||
| MW_LOG_INFO("validateStateWithMsTimeout: PAUSED->PAUSED wedged, forcing reset"); | ||
| SetStateWithWarnings(privatePlayer->gstPrivateContext->pipeline, GST_STATE_NULL); | ||
| SetStateWithWarnings(privatePlayer->gstPrivateContext->pipeline, GST_STATE_PAUSED); | ||
| } |
Comment on lines
+3478
to
+3482
| // Pipeline wedged in PAUSED->PAUSED transition Force state reset by going through NULL state | ||
| MW_LOG_INFO("validateStateWithMsTimeout: PAUSED->PAUSED wedged, forcing reset"); | ||
| SetStateWithWarnings(privatePlayer->gstPrivateContext->pipeline, GST_STATE_NULL); | ||
| SetStateWithWarnings(privatePlayer->gstPrivateContext->pipeline, GST_STATE_PAUSED); | ||
| } |
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Suppressed comments (3)
InterfacePlayerRDK.cpp:3456
gst_currentandgst_pendingare read in the loop condition and in logs but are never initialized before the firstgst_element_get_state()call. Ifgst_element_get_state()doesn’t write these outputs (e.g., in some failure paths or in unit tests where the mock only returns a value), this becomes undefined behavior and can cause flaky results.
GstState gst_pending;
float timeout = 100.0;
InterfacePlayerPriv* privatePlayer = pInterfacePlayerRDK->GetPrivatePlayer();
gint gstGetStateCnt = GST_ELEMENT_GET_STATE_RETRY_CNT_MAX;
GstStateChangeReturn ret = GST_STATE_CHANGE_FAILURE;
InterfacePlayerRDK.cpp:3479
- This introduces a new failure path (returning
GST_STATE_VOID_PENDINGas an error sentinel) whengst_element_get_state()reportsGST_STATE_CHANGE_ASYNCwith PAUSED/PAUSED. There doesn’t appear to be a unit test covering this wedged-state detection viaInterfacePlayerRDK::Pause()(existing Pause tests only cover SUCCESS/FAILURE paths). Adding a test will help prevent regressions and confirm AAMP recovery behavior.
if (ret == GST_STATE_CHANGE_ASYNC && gst_current == GST_STATE_PAUSED && gst_pending == GST_STATE_PAUSED)
{
MW_LOG_WARN("validateStateWithMsTimeout: PAUSED->PAUSED wedged detected, returning error to let AAMP recover");
return GST_STATE_VOID_PENDING;
}
InterfacePlayerRDK.cpp:3477
- The warning string has a grammatical issue: “wedged detected” is awkward; consider “wedge detected” or “wedged state detected” to make logs clearer for triage.
MW_LOG_WARN("validateStateWithMsTimeout: PAUSED->PAUSED wedged detected, returning error to let AAMP recover");
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Suppressed comments (2)
InterfacePlayerRDK.cpp:517
- The new non-blocking gst_element_get_state() call in ConfigurePipeline adds an extra pipeline state query before the existing SetStateWithWarnings() call (which itself calls gst_element_get_state()). Several gmock unit tests currently expect only one gst_element_get_state(&gst_element_pipeline, ...) during ConfigurePipeline (e.g., test/utests/tests/GstPlayer/PauseOnPlaybackTests.cpp:126-130), so this change will cause test failures unless expectations are updated (e.g., Times(2)/WillRepeatedly or an additional WillOnce for the new call).
GstState cur = GST_STATE_NULL, pend = GST_STATE_NULL;
gst_element_get_state(interfacePlayerPriv->gstPrivateContext->pipeline,
&cur, &pend, 0 /* non-blocking */);
if (cur == GST_STATE_PAUSED && pend == GST_STATE_PAUSED)
{
InterfacePlayerRDK.cpp:3508
- validateStateWithMsTimeout() always logs MW_LOG_ERR("... FAILURE") before checking for the newly-handled ASYNC wedge cases; this will still emit an error log even when you intentionally return GST_STATE_VOID_PENDING to trigger recovery. If this error log feeds user-facing "technical fault" reporting/telemetry, it undermines the goal of treating these cases as recoverable timeouts.
MW_LOG_ERR("validateStateWithMsTimeout - PIPELINE gst_element_get_state - FAILURE : State = %d, Pending = %d",
gst_current, gst_pending);
if (ret == GST_STATE_CHANGE_ASYNC && gst_current == GST_STATE_PAUSED && gst_pending == GST_STATE_PAUSED)
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.
Handling race conditions