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

Chromecast WebM decode failures #1065

Closed
theodab opened this issue Oct 12, 2017 · 12 comments
Closed

Chromecast WebM decode failures #1065

theodab opened this issue Oct 12, 2017 · 12 comments
Assignees
Labels
status: archived Archived and locked; will not be updated

Comments

@theodab
Copy link
Collaborator

theodab commented Oct 12, 2017

I was testing an issue on the Chromecast, seeking back and forth on v2.2.2-debug, and I got a crash. Like, not just of the app, the entire Chromecast crashed and rebooted.
When it did, Shaka Player didn't handle the error well. The console spewed out a bunch of stack traces like:
Uncaught exception in event handler TypeError: Cannot read property 'severity' of undefined at Object.shakaDemo.onError_ (main.js:555) at shaka.util.FakeEventTarget.shakaDemo.onErrorEvent_ (main.js:538) at shaka.util.FakeEventTarget.dispatchEvent (fake_event_target.js:117) at shaka.cast.CastProxy.onRemoteEvent_ (cast_proxy.js:566) at shaka.cast.CastSender.onMessageReceived_ (cast_sender.js:567) at chrome-extension://pkedcjkdefgpdelpbcmbmeomcjbeemfm/cast_sender.js:90 at x (chrome-extension://pkedcjkdefgpdelpbcmbmeomcjbeemfm/cast_sender.js:52) at Wb (chrome-extension://pkedcjkdefgpdelpbcmbmeomcjbeemfm/cast_sender.js:90) at V.onMessage (chrome-extension://pkedcjkdefgpdelpbcmbmeomcjbeemfm/cast_sender.js:89) at O.h (chrome-extension://pkedcjkdefgpdelpbcmbmeomcjbeemfm/cast_sender.js:62)
Which means that the error handling code, ironically enough, had an error trying to handle the error.

Specifically, when it tried to retrieve the error from event.detail, event.detail was undefined, so it tried to get the severity of undefined. It was a player event, but because the event wasn't handled correctly any other detail has been lost.

I don't know yet if something like this happens every time the Chromecast crashes, or if this was a special result of whatever caused this crash. If it's the former, we'll want to make sure the cast sender can handle Chromecast crashes more gracefully. If it's the latter, I'll have to see if I can reliably reproduce this or what.

@theodab theodab added the type: bug Something isn't working correctly label Oct 12, 2017
@theodab theodab self-assigned this Oct 12, 2017
@joeyparrish joeyparrish added this to the v2.3.0 milestone Oct 16, 2017
@theodab
Copy link
Collaborator Author

theodab commented Oct 17, 2017

In Shaka Player v2.2.3, I wasn't able to reproduce this on a 2nd generation Chromecast with cast firmware v1.27.96538, but could on an Ultra with cast firmware v1.22.74257. Thus the underlying cause of the crash might have been fixed in a firmware update, or it could be a new thing in the Ultra. I'll need to find an Ultra with up-to-date firmware to be sure.

shaka-bot pushed a commit that referenced this issue Oct 18, 2017
Beforehand, we stripped out all objects variables in events when
serializing. This was intended to remove complicated DOM objects, and
prevent the error messages from containing large amounts of unnecessary
information. However, this also caused the cast receiver to strip away
the detail variable in error events, thus removing all useful
information from the error event.
This adds a special exception to serialize for the contents of the
'detail' variable.

Issue #1065

Change-Id: Ie291e317cc6e856af20af5df57ecf3b5c81ec8bd
@joeyparrish joeyparrish added type: external An issue with an external dependency; not our issue; sometimes kept open for tracking and removed type: bug Something isn't working correctly labels Oct 18, 2017
@joeyparrish joeyparrish removed this from the v2.3.0 milestone Oct 18, 2017
@joeyparrish
Copy link
Member

Looks like this was a Chromecast firmware bug which has since been fixed. Current firmwares do not exhibit this problem.

joeyparrish pushed a commit that referenced this issue Oct 23, 2017
Beforehand, we stripped out all objects variables in events when
serializing. This was intended to remove complicated DOM objects, and
prevent the error messages from containing large amounts of unnecessary
information. However, this also caused the cast receiver to strip away
the detail variable in error events, thus removing all useful
information from the error event.
This adds a special exception to serialize for the contents of the
'detail' variable.

Issue #1065

Change-Id: Ie291e317cc6e856af20af5df57ecf3b5c81ec8bd
@joeyparrish
Copy link
Member

The error-handling change has been cherry-picked to v2.2.4.

@theodab
Copy link
Collaborator Author

theodab commented Oct 30, 2017

Testing this on our shiny new Chromecast Ultra with up-to-date firmware, I am not seeing this exact crash anymore. However, I am seeing a new (?) bug with the same repro steps.

After seeking back and forward for a minute or two, I get a 3015 (MEDIA_SOURCE_OPERATION_THREW) error, a 3016 (VIDEO_ERROR) error, and a 3014 (MEDIA_SOURCE_OPERATION_FAILED) error. The exact order tends to vary, and here's an example of the error objects (these were generated using the debug cast receiver, but the crash happens with the compiled one too):

category: 3 code: 3016 data: Array(3) 0: 3 1: null 2: "PIPELINE_ERROR_DECODE" length: 3 __proto__: Array(0) handled: false message: "Shaka Error MEDIA.VIDEO_ERROR (3,,PIPELINE_ERROR_DECODE)" severity: 2 stack: "Error: Shaka Error MEDIA.VIDEO_ERROR (3,,PIPELINE_ERROR_DECODE)↵ at new shaka.util.Error (https://casttest-dot-shaka-player-demo.appspot.com/lib/util/error.js:72:13)↵ at shaka.Player.onVideoError_ (https://casttest-dot-shaka-player-demo.appspot.com/lib/player.js:2766:17)" __proto__: Object

category: 3 code: 3015 data: Array(1) 0: stack: "Error: Failed to execute 'appendBuffer' on 'SourceBuffer': The HTMLMediaElement.error attribute is not null.↵ at shaka.media.MediaSourceEngine.append_ (https://casttest-dot-shaka-player-demo.appspot.com/lib/media/media_source_engine.js:575:36)↵ at shaka.media.MediaSourceEngine.enqueueOperation_ (https://casttest-dot-shaka-player-demo.appspot.com/lib/media/media_source_engine.js:734:17)↵ at shaka.media.MediaSourceEngine.appendBuffer (https://casttest-dot-shaka-player-demo.appspot.com/lib/media/media_source_engine.js:397:15)↵ at shaka.media.StreamingEngine.<anonymous> (https://casttest-dot-shaka-player-demo.appspot.com/lib/media/streaming_engine.js:1565:52)↵ at <anonymous>" __proto__: Object length: 1 __proto__: Array(0) handled: false message: "Shaka Error MEDIA.MEDIA_SOURCE_OPERATION_THREW (InvalidStateError: Failed to execute 'appendBuffer' on 'SourceBuffer': The HTMLMediaElement.error attribute is not null.)" severity: 2 stack: "Error: Shaka Error MEDIA.MEDIA_SOURCE_OPERATION_THREW (InvalidStateError: Failed to execute 'appendBuffer' on 'SourceBuffer': The HTMLMediaElement.error attribute is not null.)↵ at new shaka.util.Error (https://casttest-dot-shaka-player-demo.appspot.com/lib/util/error.js:72:13)↵ at shaka.media.MediaSourceEngine.enqueueOperation_ (https://casttest-dot-shaka-player-demo.appspot.com/lib/media/media_source_engine.js:743:28)↵ at shaka.media.MediaSourceEngine.appendBuffer (https://casttest-dot-shaka-player-demo.appspot.com/lib/media/media_source_engine.js:397:15)↵ at shaka.media.StreamingEngine.<anonymous> (https://casttest-dot-shaka-player-demo.appspot.com/lib/media/streaming_engine.js:1565:52)↵ at <anonymous>" __proto__: Object

category: 3 code: 3014 data: Array(1) 0: 3 length: 1 __proto__: Array(0) handled: false message : "Shaka Error MEDIA.MEDIA_SOURCE_OPERATION_FAILED (3)" severity: 2 stack: "Error: Shaka Error MEDIA.MEDIA_SOURCE_OPERATION_FAILED (3)↵ at new shaka.util.Error (https://casttest-dot-shaka-player-demo.appspot.com/lib/util/error.js:72:13)↵ at shaka.media.MediaSourceEngine.onError_ (https://casttest-dot-shaka-player-demo.appspot.com/lib/media/media_source_engine.js:686:22)" __proto__: Object

Just looking at the codes and stack traces, it looks like the 3016 error is the "real" error, and the other two are just MediaSource reacting to that failure and refusing to go on.

It's hard to say if this is the same error as before, and now it just doesn't crash the app, or if this is a separate error that happens to have the same repro steps, but I'm going to re-open this issue for now.

@theodab theodab reopened this Oct 30, 2017
@joeyparrish joeyparrish added needs triage and removed type: external An issue with an external dependency; not our issue; sometimes kept open for tracking labels Oct 30, 2017
@joeyparrish
Copy link
Member

Looks like a decode failure. What content is this?

@theodab
Copy link
Collaborator Author

theodab commented Oct 30, 2017

I was playing Sintel 4k (multicodec).
I just tried out some other manifests.
Manifests I reproduced it on: Sintel 4k (WebM only), Tears of Steel (multicodec, TTML)
Manifests I didn't reproduce it on (after a few minutes of testing, which admittedly isn't foolproof): Sintel 4k (MP4 only), Angel One (HLS, MP4, multilingual), Tears of Steel
The common factor seems to be WebM.

@joeyparrish joeyparrish changed the title Mysterious Chromecast crash Chromecast WebM decode failures Oct 30, 2017
@joeyparrish
Copy link
Member

I've renamed the issue to reflect that, and tagged it back to "needs triage" until we have determined what the bug is and whether or not it should be filed against Chromecast.

@theodab
Copy link
Collaborator Author

theodab commented Jan 8, 2018

I swear every time I look into this, the symptoms have changed completely... or, seeking back and forth repeatedly is good at revealing bugs, whatever.
I've been trying to reproduce this again, now that (another) fix for #1061 has landed.
I'm now getting and issue where, upon seeking, the receiver begins buffering and keeps going for a while. Sometimes this causes the chromecast to reboot, sometimes the app just closes. One time, the video started flickering, buffered for about ten minutes, then played for about 3 seconds and then the chromecast crashed. The symptoms are varied, anyway.
The buffering animation eventually freezes, and the device inspector's network activity tab nearly stops updating altogether. So something in the receiver is hitting an infinite loop, or freezing, or whatever. It looks like every time this happens, there's an in-progress network request that is taking abnormally long to complete (or, perhaps, a network request that ended in a reasonable time, but the device inspector stopped receiving updates before it finished).

@joeyparrish
Copy link
Member

Closing due to inactivity. We can reopen if we see it again.

@samaduttan
Copy link

samaduttan commented Apr 4, 2018

The shaka-player("version": "2.3.0") playback getting halted after played for some time.Am getting the failure as PIPELINE_ERROR_DECODE.Attached the error screen shot.

put up below mpd file
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011 DASH-MPD.xsd" xmlns:cenc="urn:mpeg:cenc:2013" profiles="urn:mpeg:dash:profile:isoff-live:2011" minBufferTime="PT5S" type="dynamic" publishTime="2018-04-04T19:28:22Z" availabilityStartTime="2018-04-04T18:22:33Z" minimumUpdatePeriod="PT5S" timeShiftBufferDepth="PT26S" suggestedPresentationDelay="PT15S"> <Period id="0" start="PT0S"> <AdaptationSet id="0" contentType="audio" segmentAlignment="true"> <Representation id="0" bandwidth="191162" codecs="mp4a.40.2" mimeType="audio/mp4" audioSamplingRate="48000"> <AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/> <SegmentTemplate timescale="90000" initialization="audio_first.mp4" media="audio_first_$Number$.m4s" startNumber="720"> <SegmentTimeline> <S t="352360650" d="451200" r="1"/> <S t="353263050" d="449280"/> <S t="353712330" d="451200"/> <S t="354163530" d="449280"/> <S t="354612810" d="451200" r="1"/> </SegmentTimeline> </SegmentTemplate> </Representation> </AdaptationSet> <AdaptationSet id="1" contentType="video" width="1280" height="720" frameRate="90000/1501" segmentAlignment="true" par="16:9"> <Representation id="1" bandwidth="3005054" codecs="avc3.64002a" mimeType="video/mp4" sar="1:1"> <SegmentTemplate timescale="90000" initialization="video_first.mp4" media="video_first_$Number$.m4s" startNumber="720"> <SegmentTimeline> <S t="352362991" d="450450" r="6"/> </SegmentTimeline> </SegmentTemplate> </Representation> </AdaptationSet> </Period> </MPD>

@samaduttan
Copy link

samaduttan commented Apr 4, 2018

capture

@joeyparrish
Copy link
Member

@samaduttan, this issue is about WebM decode, and your content is MP4. So what you are experiencing is unrelated to this issue. In future, please file a new issue, and use the issue template to provide all the information we need to look into your report.

A decode error like the one in your screenshot means that the platform (Chromecast hardware decoder in this case) was unable decode the content. Please double-check that your content is correctly encoded. If it is, please file a bug on Chromecast about this. If you need help filing a bug on Chromecast, we can help you (in a new issue).

Thanks!

@shaka-project shaka-project locked as resolved and limited conversation to collaborators Apr 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: archived Archived and locked; will not be updated
Projects
None yet
Development

No branches or pull requests

3 participants