shaka-player icon indicating copy to clipboard operation
shaka-player copied to clipboard

Player stuck at state `src-equals` when loading mp3 in bad network condition, and won't be able to execute `unload`

Open xilin opened this issue 9 months ago • 0 comments

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

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

Not related to FairPlay.

What version of Shaka Player are you using?

4.8.5

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? My own custom app

If custom app, can you reproduce the issue using our demo app? Haven't been able to run the demo app yet.

What browser and OS are you using? MacOS Sonoma 14.4.1 Google Chrome

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

What are the manifest and license server URIs?

Not able to share

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

default

What did you do?

  • Call player.load(url, 0) with url to be like https://www.xyz.com/test.mp3
  • In a super bad network condition with high latency and slow speed
  • Wait about 2 mins, player stuck at src-equals state and cannot execute unload command

What did you expect to happen?

  • Player should be able to execute unload or reset state automatically when timeout like 30s

What actually happened?

Here is the log we got in test:

# called load
2024-05-15_22:51:37.55051-0700 Event: loading {"timeStamp":1388674.5,"type":"loading","g":false}"
2024-05-15_22:51:37.55125-0700 playback state changed: src-equals"
2024-05-15_22:51:37.55131-0700 Event: buffering {"buffering":true,"timeStamp":1388675.5,"type":"buffering","g":false}"
2024-05-15_22:51:37.55205-0700 Event: streaming {"timeStamp":1388676,"type":"streaming","g":false}"

# HTML media element loadstart event
2024-05-15_22:51:37.55399-0700 Event: loadstart {"isTrusted":true,"type":"loadstart"}"

2024-05-15_22:51:40.78014-0700 playback stalled {"isTrusted":true,"type":"stalled"}"

# called unload
2024-05-15_22:52:29.87311-0700 Starting unload

# checked state, still `src-equals`
2024-05-15_22:53:23.85132-0700 playbackState:src-equals

It seems player runs srcEqualsInner_, but this promise just neither resolved or rejected, so the mutex lock was always hold by srcEqualsInner_ https://github.com/shaka-project/shaka-player/blob/v4.8.5/lib/player.js#L1531 , and when unload or new load is called, none of them can get the lock to move on.

Are you planning send a PR to fix it? Not yet, seek for help to see if there is a good way to fix it

xilin avatar May 23 '24 16:05 xilin