shaka-project / shaka-player

JavaScript player library / DASH & HLS client / MSE-EME player
Apache License 2.0
7.19k stars 1.34k forks source link

[ViacomCBS] Samsung fatal stall on preroll to first content period. #2620

Closed dsparacio closed 4 years ago

dsparacio commented 4 years ago

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

What version of Shaka Player are you using? Tested in Shaka 2.5.12, 2.5.11, 2.5.5 and 2.5.1 - Same results on all

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 raw simple setup. Page urls included in support email with content and la urls.

If custom app, can you reproduce the issue using our demo app? yes

What browser and OS are you using? This issue is only being reported and reproduced by our team for SOME Samsung Tizen based Smart TV mainly years 2017 and 2018. 2019 and 2020 year seems unaffected. Some 2017 and 2018 are also working as expected!!

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

* 2017 UN50MU6070 Fails 100% * 2018 UN55NU710D Fails 100% * 2018 UN32N5300AF PASSES * 2018 UN49NU8000 PASSES **What are the manifest and license server URIs?** Sent over on shaka-player-issues@google.com **What did you do?** * Play from 0 start time and let preroll finish, on the first transition to a content period player stalls. * When a samsung model year has the issue, it happens 100% * Does not happen with the exact same encode of the stream that is not passed though DAI. * Does not happen with the exact same encode pass to DAI but no DRM. * In logs. DRM keysystem, when we fail, both seem to init fine. I tested WV and PR here. * Non zero test are interesting. * If you skip the pre-roll and start past that second in stream... all mid-roll DAI period transition thereafter works as expected. * Stream is fine on all TVs we tested. * Dash.js does play the same DAI/DRM steam without issue on all the tested devices. * Shaka is much better overall quality of experience so it is preferred on Samsung I am also including logs in the support email with content. These logs will be from both fail and pass captures in a few different versions of Shaka mentioned above. **What did you expect to happen?** The first content period initializes and plays out. **What actually happened?** The content period fails to init and play properly.
dsparacio commented 4 years ago

We tested 2.5.14 on this 2017 Samsung and get the same negative results.

This model UN50MU6070 , Samsung classifies it as a premium tier 2017 model, but it is the only model in our fleet that we must add "use strict" in the JS code for let and const etc. It is the only TV that would exhibit a slightly different result than the rest of our TVs, both before your Tizen fixes and after, which is shown in this image:

20200724_112920

Most the failing TV before you issued your fixes, would just freeze on last frame of the Advert, no rendering issues displayed.

Another interesting point (We need to confirm but I believe it is same on Samsung as it is for sure on XBOX)
If you leave the player alone after this issue, and wait long enough. It seems that currentTime is marching on and we reach a mid roll and it PLAYS properly. Then, when we get back to encrypted content, same green decode issue.

By the way, This is also the exact same result we get on XBOX all the time for all versions.
The first frame of content is displayed, but not decoded correctly etc. I will add all the xbox info in a new ticket that I am putting together now.

Log from the Samsung model mentioned above. We are going to spread out the Samsung testing to see if it is ONLY this TV. We just need to coordinate across other teams to do this and will take a bit of time.

cvp.min.js:2 cv-player; Ver. 0.11.0  2020 Jul 28 11:21:17 PM UTC
cvp.min.js:2 [wfh]  00:00:00:022 >  Model prepared
cvp.min.js:2 [wfh]  00:00:00:060 >  Player DOM created.
cvp.min.js:2 [wfh]  00:00:00:065 >  Timer mediator registered
cvp.min.js:2 [wfh]  00:00:00:067 >  PrepView: Skipping UI creation.
cvp.min.js:2 [wfh]  00:00:00:076 >  View prepared
cvp.min.js:2 [wfh]  00:00:00:080 >  Plugins Prepared
cvp.min.js:2 [wfh]  00:00:01:262 >  Html5VideoSurface created
cvp.min.js:2 [wfh]  00:00:01:614 >  Loading shaka external library version: 2.5.14
cvp.min.js:2 [wfh]  00:00:01:618 >  ShakaAdapter created
indexed_db.js:36 IndexedDB.install
input_event.js:35 InputEvent.install
mathround.js:41 mathRound.install
mediasource.js:36 MediaSource.install
video_play_promise.js:35 VideoPlayPromise.install
vttcue.js:36 Using native VTTCue.
index.js:52 EmeEncryptionSchemePolyfill: Waiting to detect encryptionScheme support.
index.js:241 McEncryptionSchemePolyfill: MediaCapabilities not found
cvp.min.js:2 [wfh]  00:00:01:639 >  Shaka version: v2.5.14-debug
player.js:833 Starting attach...
player.js:1031 Starting load of https://dai.google.com/ondemand/dash/content/2497752/vid/dPq7tu1k_gHJVhTSV3…VW76YdW2ss3x/DLS/streams/61d2a4f6-2ad0-4299-ac72-e321e8a02d29/manifest.mpd...
player.js:2183 Found variant with audio and video content, so filtering out audio-only content in all periods.
index.js:96 EmeEncryptionSchemePolyfill: No native encryptionScheme support found. Patching encryptionScheme support.
drm_engine.js:943 Created MediaKeys object for key system com.microsoft.playready
stream_utils.js:98 codecs avc1-mp4a avg bandwidth 2254462.4166666665
player.js:4443 onChooseStreams_ Object {startTime: 0, textStreams: Array[0], variants: Array[6]}
player.js:4482 Choosing new streams after period changed
streaming_engine.js:461 init: completed initial Stream setup
60drm_engine.js:626 Ignoring duplicate init data.
player.js:1792 No preferred audio language set.  We will choose an arbitrary language initially
60drm_engine.js:626 Ignoring duplicate init data.
cvp.min.js:2 [wfh]  00:00:03:285 >  Quality Info:  Object {mode: "auto", quality: null, qualities: Array[6]}
streaming_engine.js:1615 (audio:1) looking up segment: presentationTime=0 currentPeriod.startTime=0
streaming_engine.js:1615 (video:3) looking up segment: presentationTime=0 currentPeriod.startTime=0
60drm_engine.js:626 Ignoring duplicate init data.
drm_engine.js:1360 PlayReady request is already unwrapped.
streaming_engine.js:2160 (audio:1) startup complete
streaming_engine.js:1150 (all) setting up Period 0
streaming_engine.js:1144 (all) Period 0 is being or has been set up
streaming_engine.js:1150 (all) setting up Period 1
streaming_engine.js:1150 (all) setting up Period 2
streaming_engine.js:1150 (all) setting up Period 3
streaming_engine.js:1150 (all) setting up Period 4
streaming_engine.js:1150 (all) setting up Period 5
streaming_engine.js:1150 (all) setting up Period 6
streaming_engine.js:1150 (all) setting up Period 7
streaming_engine.js:1150 (all) setting up Period 8
streaming_engine.js:1150 (all) setting up Period 9
streaming_engine.js:1150 (all) setting up Period 10
streaming_engine.js:1150 (all) setting up Period 11
streaming_engine.js:1150 (all) setting up Period 12
streaming_engine.js:1150 (all) setting up Period 13
streaming_engine.js:1150 (all) setting up Period 14
streaming_engine.js:1150 (all) setting up Period 15
streaming_engine.js:1150 (all) setting up Period 16
streaming_engine.js:1150 (all) setting up Period 17
streaming_engine.js:1150 (all) setting up Period 18
streaming_engine.js:1150 (all) setting up Period 19
streaming_engine.js:1150 (all) setting up Period 20
streaming_engine.js:1150 (all) setting up Period 21
streaming_engine.js:1150 (all) setting up Period 22
streaming_engine.js:1150 (all) setting up Period 23
streaming_engine.js:1150 (all) setting up Period 24
streaming_engine.js:1150 (all) setting up Period 25
streaming_engine.js:1150 (all) setting up Period 26
streaming_engine.js:1150 (all) setting up Period 27
streaming_engine.js:1150 (all) setting up Period 28
streaming_engine.js:1150 (all) setting up Period 29
streaming_engine.js:1218 (all) Stream 1 is being or has been set up
streaming_engine.js:1218 (all) Stream 3 is being or has been set up
player.js:4588 canSwitch_
simple_abr_manager.js:254 Calling switch_(), bandwidth=2841 kbps
player.js:4652 switch_
streaming_engine.js:807 switch: switching to Stream (video:4)
streaming_engine.js:1615 (video:4) looking up segment: presentationTime=5.005 currentPeriod.startTime=0
streaming_engine.js:790 switch: Stream (audio:1) already active
streaming_engine.js:1615 (video:4) looking up segment: presentationTime=10.01 currentPeriod.startTime=0
cvp.min.js:2 [wfh]  00:00:05:269 >  metadata received - id: urn:google:dai:2018 msg google_4427488288096268164
streaming_engine.js:1435 (audio:1) need Period 1 presentationTime=0.76 timeNeeded=30.016 currentPeriodIndex=0
streaming_engine.js:2240 (audio:1) not all MediaStates need Period 1
streaming_engine.js:1435 (video:4) need Period 1 presentationTime=5.48 timeNeeded=30.071 currentPeriodIndex=0
streaming_engine.js:2255 (video:4) all need Period 1
streaming_engine.js:1144 (all) Period 1 is being or has been set up
player.js:4443 onChooseStreams_ Object {startTime: 30.071, textStreams: Array[1], variants: Array[6]}
player.js:4482 Choosing new streams after period changed
streaming_engine.js:807 switch: switching to Stream (audio:21)
streaming_engine.js:807 switch: switching to Stream (video:19)
player.js:4588 canSwitch_
cvp.min.js:2 [wfh]  00:00:12:792 >  metadata received - id: urn:google:dai:2018 msg google_2630202043314982722
streaming_engine.js:1615 (audio:21) looking up segment: presentationTime=30.016 currentPeriod.startTime=30.071
streaming_engine.js:1615 (video:19) looking up segment: presentationTime=30.071 currentPeriod.startTime=30.071
cvp.min.js:2 [wfh]  00:00:19:831 >  metadata received - id: urn:google:dai:2018 msg google_7062123705125723286
simple_abr_manager.js:254 Calling switch_(), bandwidth=18865 kbps
player.js:4652 switch_
streaming_engine.js:790 switch: Stream (video:19) already active
streaming_engine.js:790 switch: Stream (audio:21) already active
cvp.min.js:2 [wfh]  00:00:27:591 >  metadata received - id: urn:google:dai:2018 msg google_0088992214810277424
simple_abr_manager.js:254 Calling switch_(), bandwidth=26582 kbps
player.js:4652 switch_
streaming_engine.js:790 switch: Stream (video:19) already active
streaming_engine.js:790 switch: Stream (audio:21) already active
cvp.min.js:2 [wfh]  00:00:34:101 >  metadata received - id: urn:google:dai:2018 msg google_5115618755624134587
gap_jumping_controller.js:246 Jumping forward 0.46799999999999997 seconds because of gap starting at 30.015 and ending at 30.071
streaming_engine.js:964 (all): seeked: buffered seek: presentationTime=30.071
60drm_engine.js:626 Ignoring duplicate init data.
streaming_engine.js:730 Assertion failed: switch: expected mediaState to existshaka.media.StreamingEngine.switchInternal_ @ streaming_engine.js:730shaka.media.StreamingEngine.switchTextStream @ streaming_engine.js:691shaka.Player.switchTextStream_ @ player.js:4085shaka.Player.selectTextTrack @ player.js:3013Object.defineProperty.set @ cvp.min.js:2A.updateTextTracks @ cvp.min.js:2A.onTracksChanged @ cvp.min.js:2shaka.util.FakeEventTarget.dispatchEvent @ fake_event_target.js:120(anonymous function) @ player.js:5050$jscomp.generator.Engine_.nextStep_ @ generator_engine] :795$jscomp.generator.Engine_.next_ @ generator_engine] :699next @ generator_engine] :833b @ execute_async_generator] :48
simple_abr_manager.js:254 Calling switch_(), bandwidth=28317 kbps
player.js:4652 switch_
streaming_engine.js:790 switch: Stream (video:19) already active
streaming_engine.js:790 switch: Stream (audio:21) already active
simple_abr_manager.js:254 Calling switch_(), bandwidth=25216 kbps
player.js:4652 switch_
streaming_engine.js:790 switch: Stream (video:19) already active
streaming_engine.js:790 switch: Stream (audio:21) already active
simple_abr_manager.js:254 Calling switch_(), bandwidth=20040 kbps
player.js:4652 switch_
streaming_engine.js:790 switch: Stream (video:19) already active
streaming_engine.js:790 switch: Stream (audio:21) already active
simple_abr_manager.js:254 Calling switch_(), bandwidth=20931 kbps
player.js:4652 switch_
streaming_engine.js:790 switch: Stream (video:19) already active
streaming_engine.js:790 switch: Stream (audio:21) already active
simple_abr_manager.js:254 Calling switch_(), bandwidth=22566 kbps
player.js:4652 switch_
streaming_engine.js:790 switch: Stream (video:19) already active
streaming_engine.js:790 switch: Stream (audio:21) already active
joeyparrish commented 4 years ago

The garbled content with big green blocks appears to be a decryption or decode issue. I don't believe it has any relation to the stall we were working on in this issue, so I would prefer not to reopen this one. But I think I have a lead on that, and will respond on #2759 with details.

dsparacio commented 4 years ago

@joeyparrish Thank you, totally agree on not reopening this, just read the other comment for XBOX.