question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Long playback stall after failed to get next segment reference

See original GitHub issue

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

What version of Shaka Player are you using? 3.0.6

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

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

Are you using the demo app or your own custom app? Demo app

If custom app, can you reproduce the issue using our demo app? N/A

What browser and OS are you using? Chrome 87.0.4280.88, Windows 10

For embedded devices (smart TVs, etc.), what model and firmware version are you using? N/A

What are the manifest and license server URIs?

N/A

What did you do?

Start playback

What did you expect to happen? Playback smoothly

What actually happened?

Sometimes when streaming_engine failed to get next segment reference, streaming_engine would fail to advance to next segment forever unless there was an interruption (eg. bitrate change)

The following is the log when this issue happed:

simple_abr_manager.js:279 Calling switch_(), bandwidth=4845 kbps
player.js:4829 switch_
streaming_engine.js:431 switch: switching to Stream (video:4)
streaming_engine.js:414 switch: Stream (audio:10) already active
streaming_engine.js:1104 (video:4) cannot find segment endTime: 49700.617633999995
dash_parser.js:1040 Updating manifest...
(Updating manifest... continues forever)

The error is located at getSegmentReferenceNeeded_ of streaming_engine When mediaState.lastSegmentReference exists and mediaState.segmentIterator is null, a new segmentIterator will be created by segmentIndex.getIteratorForTime: https://github.com/google/shaka-player/blob/master/lib/media/streaming_engine.js#L1100 In getIteratorForTime of segment_index, no index could be found unfortunately A new SegmentIterator is created with index = -1

After that, the query of next segment iterator (https://github.com/google/shaka-player/blob/master/lib/media/streaming_engine.js#L1101) makes currentPosition_ of SegmentIterator increment from -1 to 0 (https://github.com/google/shaka-player/blob/master/lib/media/segment_index.js#L517) A null segment reference is returned from mediaState.segmentIterator.next().value and a warning is fired: https://github.com/google/shaka-player/blob/master/lib/media/streaming_engine.js#L1103

In the next update, getSegmentReferenceNeeded_ is called again This time mediaState.segmentIterator is no longer null and mediaState.segmentIterator.current() is returned. (which is null) getSegmentReferenceNeeded_ will then always return null segment reference, unless mediaState.segmentIterator is set to null and segmentIndex.getIteratorForTime is called again

To workaround, we have inserted mediaState.segmentIterator = null after line: https://github.com/google/shaka-player/blob/master/lib/media/streaming_engine.js#L1103 https://github.com/google/shaka-player/blob/master/lib/media/streaming_engine.js#L1135 but not sure if it is the proper fix

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
percytse-harmoniccommented, Jan 14, 2021

Tried v3.0.7 and latest master branch (v3.1.0-pre), long playback stall is still reproducible. I have sent the manifest URI to shaka-player-issues@google.com.

1reaction
Ljugobosscommented, May 7, 2021

I believe that we’ve run into this issue as well. It’s reproducable for us in v3.0.6, v3.0.10 and v3.1.0.

We’re able to reproduce it by jumping a small gap when close to live, or by swaping bitrates while playing the stream live, simularly as described in https://github.com/google/shaka-player/issues/3082#issuecomment-781964165

Can this issue be reopened? @TheModMaker

Edit: This seems to only happen in a live stream and being close to the the live edge. The closer you are to the live edge, the easier it is to reproduce

Read more comments on GitHub >

github_iconTop Results From Across the Web

Player stalls when seeking on LIVE edge · Issue #3393 - GitHub
I guess this happens because a click jumps to live edge, but streaming.bufferingGoal defaults to 10 seconds, which means shaka wants to ...
Read more >
Part 3: How to compete with broadcast latency using current ...
With 1 and 2 second segments, this is usually fine and allows for under 10 second latency if the player doesn't buffer more...
Read more >
Measuring and Optimizing HLS Performance - WWDC18
HTTP Live Streaming (HLS) is used to stream live and on-demand content to global audiences. Discover how to adjust and tune stream...
Read more >
Source: lib/media/streaming_engine.js - Shaka Player Demo
// move to next segment after appending the current segment. mediaState.lastSegmentReference = reference;; const ...
Read more >
Media Source Extensions™ - W3C
A position in a media segment where decoding and continuous playback can ... use this status code to terminate playback with a decode...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found