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

Some live content causes BUFFER_READ_OUT_OF_BOUNDS in specific timeframes #5416

Closed
cristian-atehortua opened this issue Jul 14, 2023 · 7 comments
Labels
status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Milestone

Comments

@cristian-atehortua
Copy link
Contributor

Have you read the FAQ and checked for duplicate open issues?
Yes. It looks like is related to #3659 and #5251, however, these issues are closed now and we are still getting the same.

What version of Shaka Player are you using?
4.3.7

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

Can you reproduce the issue with the latest code from main?
Not tested, because since it happens in specific timeframes we need to put this in production.

Are you using the demo app or your own custom app?
Custom app.

If custom app, can you reproduce the issue using our demo app?
Not yet, I will provide the results when I test since it should happen at a specific time.

What browser and OS are you using?
It happens in every platform (Web in any OS, any SmartTV)

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

What are the manifest and license server URIs?

I will provide instructions by mail

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

{
  "drm": {
    "retryParameters": {
      "maxAttempts": 3,
      "baseDelay": 1000,
      "backoffFactor": 2,
      "fuzzFactor": 0.5,
      "timeout": 30000,
      "stallTimeout": 12000,
      "connectionTimeout": 17000
    },
    "servers": {},
    "clearKeys": {},
    "advanced": {},
    "delayLicenseRequestUntilPlayed": false,
    "logLicenseExchange": false,
    "updateExpirationTime": 1,
    "preferredKeySystems": [],
    "keySystemsMapping": {},
    "parseInbandPsshEnabled": false
  },
  "manifest": {
    "retryParameters": {
      "maxAttempts": 3,
      "baseDelay": 1000,
      "backoffFactor": 2,
      "fuzzFactor": 0.5,
      "timeout": 30000,
      "stallTimeout": 12000,
      "connectionTimeout": 17000
    },
    "availabilityWindowOverride": null,
    "disableAudio": false,
    "disableVideo": false,
    "disableText": false,
    "disableThumbnails": false,
    "defaultPresentationDelay": 0,
    "segmentRelativeVttTiming": false,
    "dash": {
      "clockSyncUri": "",
      "ignoreDrmInfo": false,
      "disableXlinkProcessing": false,
      "xlinkFailGracefully": false,
      "ignoreMinBufferTime": false,
      "autoCorrectDrift": true,
      "initialSegmentLimit": 1000,
      "ignoreSuggestedPresentationDelay": false,
      "ignoreEmptyAdaptationSet": false,
      "ignoreMaxSegmentDuration": false,
      "keySystemsByURI": {
        "urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b": "org.w3.clearkey",
        "urn:uuid:e2719d58-a985-b3c9-781a-b030af78d30e": "org.w3.clearkey",
        "urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed": "com.widevine.alpha",
        "urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95": "com.microsoft.playready",
        "urn:uuid:79f0049a-4098-8642-ab92-e65be0885f95": "com.microsoft.playready",
        "urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb": "com.adobe.primetime"
      },
      "sequenceMode": false
    },
    "hls": {
      "ignoreTextStreamFailures": false,
      "ignoreImageStreamFailures": false,
      "defaultAudioCodec": "mp4a.40.2",
      "defaultVideoCodec": "avc1.42E01E",
      "ignoreManifestProgramDateTime": false,
      "mediaPlaylistFullMimeType": "video/mp2t; codecs=\"avc1.42E01E, mp4a.40.2\"",
      "useSafariBehaviorForLive": true,
      "liveSegmentsDelay": 3
    }
  },
  "streaming": {
    "retryParameters": {
      "maxAttempts": 3,
      "baseDelay": 1000,
      "backoffFactor": 2,
      "fuzzFactor": 0.5,
      "timeout": 30000,
      "stallTimeout": 12000,
      "connectionTimeout": 17000
    },
    "rebufferingGoal": 2,
    "bufferingGoal": 30,
    "bufferBehind": 12,
    "ignoreTextStreamFailures": true,
    "alwaysStreamText": false,
    "startAtSegmentBoundary": false,
    "gapDetectionThreshold": 0.5,
    "durationBackoff": 1,
    "forceTransmux": false,
    "safeSeekOffset": 5,
    "stallEnabled": true,
    "stallThreshold": 1,
    "stallSkip": 0.1,
    "useNativeHlsOnSafari": true,
    "inaccurateManifestTolerance": 2,
    "lowLatencyMode": false,
    "autoLowLatencyMode": true,
    "forceHTTPS": false,
    "preferNativeHls": false,
    "updateIntervalSeconds": 1,
    "dispatchAllEmsgBoxes": false,
    "observeQualityChanges": false,
    "maxDisabledTime": 30,
    "parsePrftBox": false
  },
  "mediaSource": {
    "sourceBufferExtraFeatures": ""
  },
  "offline": {
    "usePersistentLicense": true,
    "numberOfParallelDownloads": 5
  },
  "abr": {
    "enabled": true,
    "useNetworkInformation": true,
    "defaultBandwidthEstimate": 1000000,
    "switchInterval": 8,
    "bandwidthUpgradeTarget": 0.85,
    "bandwidthDowngradeTarget": 0.95,
    "restrictions": {
      "minWidth": 0,
      "maxWidth": null,
      "minHeight": 0,
      "maxHeight": null,
      "minPixels": 0,
      "maxPixels": null,
      "minFrameRate": 0,
      "maxFrameRate": null,
      "minBandwidth": 0,
      "maxBandwidth": null
    },
    "advanced": {
      "minTotalBytes": 128000,
      "minBytes": 16000,
      "fastHalfLife": 2,
      "slowHalfLife": 5
    },
    "restrictToElementSize": false,
    "restrictToScreenSize": false,
    "ignoreDevicePixelRatio": false
  },
  "autoShowText": 3,
  "preferredAudioLanguage": "",
  "preferredTextLanguage": "",
  "preferredVariantRole": "",
  "preferredTextRole": "",
  "preferredAudioChannelCount": 2,
  "preferredVideoCodecs": [],
  "preferredAudioCodecs": [],
  "preferForcedSubs": false,
  "preferredDecodingAttributes": [],
  "restrictions": {
    "minWidth": 0,
    "maxWidth": null,
    "minHeight": 0,
    "maxHeight": null,
    "minPixels": 0,
    "maxPixels": null,
    "minFrameRate": 0,
    "maxFrameRate": null,
    "minBandwidth": 0,
    "maxBandwidth": null
  },
  "playRangeStart": 0,
  "playRangeEnd": null,
  "cmcd": {
    "enabled": false,
    "sessionId": "",
    "contentId": "",
    "useHeaders": false
  },
  "lcevc": {
    "enabled": false,
    "dynamicPerformanceScaling": true,
    "logLevel": 0,
    "drawLogo": false
  }
}

What did you do?

  1. Play the provided content
  2. Enable Closed caption
  3. Wait until specific Segment plays ()

What did you expect to happen?
Content should continue playback normally

What actually happened?

The 3000 - BUFFER_READ_OUT_OF_BOUNDS is thrown in some segments of this content.

Additional information
Something is happening with specific segments of this content. However, on players on other platforms, this error doesn't occur. The player is able to reproduce the segment normally.

This is the stack trace of the error:

index.js:1 Player reported warning Error: Shaka Error MEDIA.BUFFER_READ_OUT_OF_BOUNDS ()
    at new push../node_modules/shaka-player/dist/shaka-player.compiled.debug.js.shaka.util.Error (error.js:94:1)
    at push../node_modules/shaka-player/dist/shaka-player.compiled.debug.js.shaka.util.DataViewReader.outOfBounds_ (data_view_reader.js:267:1)
    at push../node_modules/shaka-player/dist/shaka-player.compiled.debug.js.shaka.util.DataViewReader.readUint16 (data_view_reader.js:100:1)
    at push../node_modules/shaka-player/dist/shaka-player.compiled.debug.js.shaka.cea.CeaDecoder.extract (cea_decoder.js:120:1)
    at push../node_modules/shaka-player/dist/shaka-player.compiled.debug.js.shaka.media.ClosedCaptionParser.parseFrom (closed_caption_parser.js:92:1)
    at push../node_modules/shaka-player/dist/shaka-player.compiled.debug.js.$jscomp.generator.Engine_.program_ (media_source_engine.js:669:1)
    at push../node_modules/shaka-player/dist/shaka-player.compiled.debug.js.$jscomp.generator.Engine_.nextStep_ (generator_engine.js:795:1)
    at push../node_modules/shaka-player/dist/shaka-player.compiled.debug.js.$jscomp.generator.Engine_.next_ (generator_engine.js:699:1)
    at push../node_modules/shaka-player/dist/shaka-player.compiled.debug.js.$jscomp.generator.Generator_.next (generator_engine.js:833:1)
    at execute_async_generator.js:72:1
    at new Promise (<anonymous>)
    at push../node_modules/shaka-player/dist/shaka-player.compiled.debug.js.$jscomp.asyncExecutePromiseGenerator (execute_async_generator.js:59:1)
    at push../node_modules/shaka-player/dist/shaka-player.compiled.debug.js.$jscomp.asyncExecutePromiseGeneratorProgram (execute_async_generator.js:116:1)
    at push../node_modules/shaka-player/dist/shaka-player.compiled.debug.js.shaka.media.MediaSourceEngine.appendBuffer (media_source_engine.js:589:1)
    at push../node_modules/shaka-player/dist/shaka-player.compiled.debug.js.$jscomp.generator.Engine_.program_ (streaming_engine.js:1785:1)
    at push../node_modules/shaka-player/dist/shaka-player.compiled.debug.js.$jscomp.generator.Engine_.nextStep_ (generator_engine.js:795:1)
    at push../node_modules/shaka-player/dist/shaka-player.compiled.debug.js.$jscomp.generator.Engine_.next_ (generator_engine.js:699:1)
    at push../node_modules/shaka-player/dist/shaka-player.compiled.debug.js.$jscomp.generator.Generator_.next (generator_engine.js:833:1)
    at b (execute_async_generator.js:52:1)
@avelad
Copy link
Member

avelad commented Aug 18, 2023

I think it's fixed with #5422, can you try again against the main branch? Thanks!

@avelad avelad added the status: waiting on response Waiting on a response from the reporter(s) of the issue label Aug 18, 2023
@github-actions
Copy link
Contributor

Closing due to inactivity. If this is still an issue for you or if you have further questions, the OP can ask shaka-bot to reopen it by including @shaka-bot reopen in a comment.

@github-actions github-actions bot removed the status: waiting on response Waiting on a response from the reporter(s) of the issue label Aug 25, 2023
@cristian-atehortua
Copy link
Contributor Author

@shaka-bot reopen

We are still getting this error in our content with Shaka v4.3.8

image

image

@shaka-bot shaka-bot reopened this Sep 11, 2023
@joeyparrish
Copy link
Member

v4.3.8 was released in July, and we have done 3 more releases from v4.3.x since then. The latest is v4.3.11. But there have been no changes to lib/cea/ or other relevant parts of your backtrace since v4.3.8.

Thanks for reopening.

Based on the stack trace and error code, it seems like the packet we're trying to decode ends after the first byte. If the packet is truncated for some reason, one could assume there's no useful info in it and we should ignore it (and maybe log a warning in debug mode) instead of throwing an error.

Are you willing to try a patch for us? I'm wondering if we can get away with changing this line of lib/media/closed_caption_parser.js:

        this.ceaDecoder_.extract(uint8ArrayData, captionPacket.pts);

Into this:

        try {
          this.ceaDecoder_.extract(uint8ArrayData, captionPacket.pts);
        } catch (error) {
          shaka.log.warning('CEA decoding error, ignoring packet!', error);
        }

If this warning coincides with missing captions during playback, we would have to dig more deeply and figure out whether the data we need is actually in the packet or not. If it is, there would be a bug in the parser, and if not, there would be a bug in your encoder. But if this suppression of the out-of-bounds error suffices, it would be a very simple fix.

@cristian-atehortua, what do you think? Could you try it out?

@cristian-atehortua
Copy link
Contributor Author

Hi @joeyparrish. Thanks for your answer, I mentioned V4.3.8 because that was the one that included #5422.

I will try what you mentioned

Thanks.

@avelad
Copy link
Member

avelad commented Sep 14, 2023

@cristian-atehortua do you have any news about the test? Thanks!

@avelad avelad added the status: waiting on response Waiting on a response from the reporter(s) of the issue label Sep 27, 2023
@shaka-bot
Copy link
Collaborator

Closing due to inactivity. If this is still an issue for you or if you have further questions, the OP can ask shaka-bot to reopen it by including @shaka-bot reopen in a comment.

@shaka-bot shaka-bot removed the status: waiting on response Waiting on a response from the reporter(s) of the issue label Oct 4, 2023
@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label Dec 3, 2023
@shaka-project shaka-project locked as resolved and limited conversation to collaborators Dec 3, 2023
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 type: bug Something isn't working correctly
Projects
None yet
Development

No branches or pull requests

4 participants