Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small MediaSource.remove() intervals causing crashes on Cast platforms. #6240

Closed
JulianDomingo opened this issue Feb 9, 2024 · 1 comment · Fixed by #6242
Closed

Small MediaSource.remove() intervals causing crashes on Cast platforms. #6240

JulianDomingo opened this issue Feb 9, 2024 · 1 comment · Fixed by #6242
Assignees
Labels
platform: Cast Issues affecting Cast devices priority: P1 Big impact or workaround impractical; resolve before feature release status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Milestone

Comments

@JulianDomingo
Copy link
Collaborator

Have you read the FAQ and checked for duplicate open issues?
Yes

If the problem is related to FairPlay, have you read the tutorial?

N/A

What version of Shaka Player are you using?

v4.7.x

Can you reproduce the issue with our latest release version?
Yes

Can you reproduce the issue with the latest code from main?
Yes

Are you using the demo app or your own custom app?
Custom app (PlutoTV)

If custom app, can you reproduce the issue using our demo app?
N/A (cast-related)

What browser and OS are you using?
Chrome / Cast

For embedded devices (smart TVs, etc.), what model and firmware version are you using?
Chromecast Ultra

What are the manifest and license server URIs?

N/A (Load any VOD or live stream on the PlutoTV production app).

What configuration are you using? What is the output of player.getConfiguration()?

Default shaka config.

What did you do?

  1. Open PlutoTV app, cast any live or VOD stream.

What did you expect to happen?

  1. Open PlutoTV app, cast any live or VOD stream.
  2. Shaka should continue to play the media.

What actually happened?

  1. Open PlutoTV app, cast any live or VOD stream.
  2. Observe an app crash after 20-40 minutes of playback.

The issue is very similar to #2982. However, the eviction goal is still very small, as Shaka will attempt evictions for intervals as small as 0.01:

const overflow = bufferedBehind - bufferBehind;
// See: https://github.com/shaka-project/shaka-player/issues/2982
if (overflow <= 0.01) {
shaka.log.v2(logPrefix,
'buffer behind okay:',
'presentationTime=' + presentationTime,
'bufferedBehind=' + bufferedBehind,
'bufferBehind=' + bufferBehind,
'underflow=' + Math.abs(overflow));
return;
}

We've observed this is problematic for Cast platforms, as overflow durations like 0.01084400000002006 are failing downstream checks in the cast MSE implementation:

[FATAL:source_buffer_stream.cc] Check failed: IsRangeListSorted(ranges_).

It seems reasonable to make the StreamingEngine's eviction goal configurable, and also to set a higher default minimum interval; it doesn't make sense to spend the effort to remove durations of approx. 0.01 seconds.

The crashes stopped even by increasing this minimum from 0.01 => 0.10, so the PR will provide a default value of 0.10.

@JulianDomingo JulianDomingo added the type: bug Something isn't working correctly label Feb 9, 2024
@JulianDomingo JulianDomingo self-assigned this Feb 9, 2024
@shaka-bot shaka-bot added this to the v5.0 milestone Feb 9, 2024
@joeyparrish
Copy link
Member

I say increase it to 1.0. There's not much point in evicting 100ms of content.

@joeyparrish joeyparrish added priority: P1 Big impact or workaround impractical; resolve before feature release platform: Cast Issues affecting Cast devices labels Feb 9, 2024
joeyparrish pushed a commit that referenced this issue Feb 12, 2024
)

Increases the default required removal duration from `0.01` => `1.0`.

Closes #6240.
joeyparrish pushed a commit that referenced this issue Feb 17, 2024
Partial cherry-pick of #6242

Increases the default required removal duration from `0.01` => `1.0`.

Closes #6240
joeyparrish pushed a commit that referenced this issue Feb 20, 2024
Partial cherry-pick of #6242

Increases the default required removal duration from `0.01` => `1.0`.

Closes #6240
joeyparrish pushed a commit that referenced this issue Feb 20, 2024
Partial cherry-pick of #6242

Increases the default required removal duration from `0.01` => `1.0`.

Closes #6240
@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label Apr 12, 2024
@shaka-project shaka-project locked as resolved and limited conversation to collaborators Apr 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
platform: Cast Issues affecting Cast devices priority: P1 Big impact or workaround impractical; resolve before feature release status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants