Skip to content

[Tizen 2020] Some live streams fail to play after previous playback #1700

@TomaszKowalik

Description

@TomaszKowalik

That behavior was observed only on Tizen 2020, and only for few live channels so far. I cant find anything peculiar in their mainfests. When I try to play such a stream as the very first stream after starting the app, it plays fine. However, if I play any other stream first and then try one of these streams, I get either a BUFFER_APPEND_ERROR or MEDIA_ERR_DECODE (it seems random which one occurs). On consecutive attempts, it might randomly start playing fine, but in most cases, it fails.
I tried setting the reuseMediaKeys: false option, but that didn't fix the issue.
Happening for both PR and WV. On native player issue is not observed.
Disposing the player after previous playback and recreating it again seems to be fixing the issue, but its rather too heavy workaround for such usecase
Rx version: 4.3.0-dev.2025012900

We're also using the following settings:

onKeyOutputRestricted: "fallback"
onKeyInternalError: "fallback"
disableMediaKeysAttachmentLock: true
closeSessionsOnStop: true

For buffer settings on Tizen we are almost always using:

 maxBufferAhead: Infinity,
 wantedBufferAhead: 20,
 maxBufferBehind: Infinity,

Changing these values didnt fixed the issue

And:

baseBandwidth: 2500000
enableFastSwitching: false
onCodecSwitch: "reload"

Perhaps there is some other option we can check ?

I have gathered the logs:

API: Initializing MediaSource mode in the main thread
Locking `contentLock` to clean-up the current content.
DRM: Clearing-up DRM session.
API: current media element state tick event init position 0 seeking 0 internalSeek false rebuffering false freezing false ended false paused true playbackRate 1 readyState 0 pendingPosition undefined
API: playerStateChange event LOADING
DRM: closing all current sessions.
DRM-LSS: Closing all current MediaKeySessions 0
API: DRM session cleaned-up with success!
Unlocking `contentLock`. Next content can begin.
Init: Creating ContentDecryptor
DRM: Starting ContentDecryptor logic.
DRM: Searching for compatible MediaKeySystemAccess
DRM: Request keysystem access com.widevine.alpha,1 of 1
DRM: Found cached compatible keySystem
DRM: Reusing already created MediaKeys
DRM: Waiting for attachment.
Init: Creating MediaSource
MTCI: Attaching MediaSource URL to the media element
Init: MediaSource opened
DRM: disabling MediaKeys attachment lock. Ready for content
DRM: Attaching current MediaKeys
DRM: Right MediaKeys already set
DRM: The MediaKeys already has a server certificate, skipping...
DASH: WASM MPD Parser not initialized. Running JS one.
DASH Parser: merging "switchable" AdaptationSets 3 2
MF: Manifest parsed in 47.19999999997526ms
Init: Calculating initial time
Init: clock offset found for a live content, checking if we can start close to it
Init: 1747124131.2960334 defined as the live time, applying a live gap of 10
Init: Initial time calculated: 1747124121.2960334
HTD: Creating HTMLTextDisplayer
API: current media element state tick event manual position 0 seeking 0 internalSeek false rebuffering false freezing false ended false paused true playbackRate 1 readyState 0 pendingPosition 1747124121.2960334
API: current playback timeline:

^0 
manual
Init: Resume playback speed 1
Init: Updating duration 4294967296
Stream: Creating new Stream for video 0
Stream: Creating new Stream for audio 0
Stream: Creating new Stream for text 0
Stream: Updating audio adaptation A: 1 P: 0
SB: Adding native SegmentSink with codec audio/mp4;codecs="mp4a.40.2"
AVSB: calling `mediaSource.addSourceBuffer` audio/mp4;codecs="mp4a.40.2"
Stream: Updating video adaptation A: 2 P: 0
SB: Adding native SegmentSink with codec video/mp4;codecs="avc1.4D400D"
AVSB: calling `mediaSource.addSourceBuffer` video/mp4;codecs="avc1.4D400D"
Stream: Set no text Adaptation. P: 0
ABR: Creating new BandwidthEstimator for  audio
Stream: changing representation audio audio_157457_eng=157200 157200
Stream: Creating RepresentationStream audio 157200
DRM: processing init data audio 157200 1b9f0ea294bc41109f0ba8eda9b2e78b
SQ: Media segments now need to be requested. Starting queue. audio 6
SF: Beginning request audio P: 1 A: 1 R: audio_157457_eng=157200 S: 1747124119.7725-1.92
SF: Beginning request audio P: 1 A: 1 R: audio_157457_eng=157200 S: init
ABR: Creating new BandwidthEstimator for  video
ABR: Steps for buffer based chooser. bufferLevel: 4, bitrate: 261200 ,bufferLevel: 11.282472603188815, bitrate: 493200 ,bufferLevel: 16.3908777711888, bitrate: 933200 ,bufferLevel: 20.74330629161195, bitrate: 1402000 ,bufferLevel: 24.897896998854318, bitrate: 2757200 ,bufferLevel: 29.33130222097497, bitrate: 4016800 ,bufferLevel: 31.923724450444492, bitrate: 5194800
ABR: enter starvation mode.
ABR: Choosing representation with bandwidth estimation. 5194800 video=5194800
ABR: Steps for buffer based chooser. bufferLevel: 4, bitrate: 261200 ,bufferLevel: 11.282472603188815, bitrate: 493200 ,bufferLevel: 16.3908777711888, bitrate: 933200 ,bufferLevel: 20.74330629161195, bitrate: 1402000 ,bufferLevel: 24.897896998854318, bitrate: 2757200 ,bufferLevel: 29.33130222097497, bitrate: 4016800 ,bufferLevel: 31.923724450444492, bitrate: 5194800
ABR: Choosing representation with bandwidth estimation. 5194800 video=5194800
Stream: changing representation video video=5194800 5194800
Stream: Creating RepresentationStream video 5194800
SQ: Media segments now need to be requested. Starting queue. video 6
SF: Beginning request video P: 1 A: 2 R: video=5194800 S: 1747124119.7633333-1.92
SF: Beginning request video P: 1 A: 2 R: video=5194800 S: init
DRM: Creating a new temporary session
DRM-LSS: calling `createSession` temporary
DRM-LSS: MediaKeySession added temporary 1
DRM: Binding session events 
DRM: transmitting current keystatuses 
DRM: processing init data video 5194800 228eca5945bc41109f0ba8eda9b2e78b
Compat: Calling generateRequest on the MediaKeySession
Compat: Trying to move CENC PSSH from init data at the end of it.
DRM: Creating a new temporary session
DRM-LSS: calling `createSession` temporary
DRM-LSS: MediaKeySession added temporary 2
DRM: Binding session events 
DRM: transmitting current keystatuses 
Compat: Calling generateRequest on the MediaKeySession
Compat: Trying to move CENC PSSH from init data at the end of it.
SF: Segment request ended with success audio P: 1 A: 1 R: audio_157457_eng=157200 S: 1747124119.7725-1.92
AVSB: receiving order to push data to the SourceBuffer audio audio P: 1 A: 1 R: audio_157457_eng=157200 S: init
AVSB: pushing segment audio audio P: 1 A: 1 R: audio_157457_eng=157200 S: init
SBI: receiving order to push data to the SourceBuffer audio
SBI: pushing segment audio
SQ: no more init segment to request. Cancelling queue. audio
SF: Segment request cancelled audio P: 1 A: 1 R: audio_157457_eng=157200 S: init
ABR: New last stable representation 157200
AVSB: receiving order to push data to the SourceBuffer audio audio P: 1 A: 1 R: audio_157457_eng=157200 S: 1747124119.7725-1.92
AVSB: pushing segment audio audio P: 1 A: 1 R: audio_157457_eng=157200 S: 1747124119.7725-1.92
SBI: receiving order to push data to the SourceBuffer audio
SF: Beginning request audio P: 1 A: 1 R: audio_157457_eng=157200 S: 1747124121.6925-1.92
SF: Segment request ended with success audio P: 1 A: 1 R: audio_157457_eng=157200 S: init
AVSB: receiving order to push data to the SourceBuffer video video P: 1 A: 2 R: video=5194800 S: init
AVSB: pushing segment video video P: 1 A: 2 R: video=5194800 S: init
SBI: receiving order to push data to the SourceBuffer video
SBI: updating codec video/mp4;codecs="avc1.4D4028"
SBI: pushing segment video
SQ: no more init segment to request. Cancelling queue. video
SF: Segment request cancelled video P: 1 A: 2 R: video=5194800 S: init
SF: Segment request ended with success video P: 1 A: 2 R: video=5194800 S: init
AVSB: receiving order to push data to the SourceBuffer audio audio P: 1 A: 1 R: audio_157457_eng=157200 S: 1747124121.6925-1.92
AVSB: pushing segment audio audio P: 1 A: 1 R: audio_157457_eng=157200 S: 1747124121.6925-1.92
SBI: receiving order to push data to the SourceBuffer audio
SF: Segment request ended with success audio P: 1 A: 1 R: audio_157457_eng=157200 S: 1747124121.6925-1.92
API: current media element state tick event timeupdate position 0 seeking 0 internalSeek false rebuffering false freezing false ended false paused true playbackRate 1 readyState 0 pendingPosition 1747124121.2960334
API: current playback timeline:

^0 
timeupdate
2SI: synchronizing unknown buffered ranges: 
ABR: Choosing representation with bandwidth estimation. 5194800 video=5194800
MMSI: Merging 2 segments together for perf audio
SBI: pushing segment audio
SI: synchronizing unknown buffered ranges: 
SI: synchronizing unknown buffered ranges: 
ABR: Incrementing blocking raise in BufferBasedChooser due to unstable quality 9000
ABR: Choosing representation with bandwidth estimation. 5194800 video=5194800
DRM: Received message event, type license-request ksid2146D596
DRM: Calling `getLicense` license-request
DRM: Received message event, type license-request ksidD468FAC9
DRM: Calling `getLicense` license-request
SI: first segment pushed audio 1747124119.7725 1747124121.6925
SI: synchronizing audio buffered ranges: 1747124119.772-1747124123.612
SI: found true buffered start audio 1747124119.772 1747124119.7725
SI: range end too far from expected end audio 1747124123.612 1747124121.6925
SI: Pushing segment strictly after previous one. audio 1747124121.6925 1747124121.6925
SI: synchronizing audio buffered ranges: 1747124119.772-1747124123.612
SI: found true buffered end audio 1747124123.612 1747124123.6125002
SI: current audio inventory timeline:
1747124119.77|A|1747124123.61
[A] P: 1 || R: audio_157457_eng=157200(157200)
2DRM: Updating MediaKeySession with message
API: current media element state tick event loadedmetadata position 0 seeking 0 internalSeek false rebuffering false freezing false ended false paused true playbackRate 1 readyState 1 pendingPosition 1747124121.2960334
API: current playback timeline:

^0 
loadedmetadata
SI: synchronizing unknown buffered ranges: 
SI: synchronizing audio buffered ranges: 1747124119.772-1747124123.612
SI: current audio inventory timeline:
1747124119.77|A|1747124123.61
[A] P: 1 || R: audio_157457_eng=157200(157200)
ABR: Choosing representation with bandwidth estimation. 5194800 video=5194800
API: Seeking internally 1747124121.2960334
2DRM: MediaKeySession update succeeded.
API: current media element state tick event internal-seeking position 1747124121.296033 seeking 1 internalSeek true rebuffering true freezing false ended false paused true playbackRate 1 readyState 1 pendingPosition null
API: current playback timeline:

^1747124121.296033 
seeking
SI: synchronizing unknown buffered ranges: 
SI: synchronizing audio buffered ranges: 1747124119.772-1747124123.612
SI: current audio inventory timeline:
1747124119.77|A|1747124123.61
[A] P: 1 || R: audio_157457_eng=157200(157200)
ABR: Choosing representation with bandwidth estimation. 5194800 video=5194800
Init: Pause playback to build buffer
API: current media element state tick event ratechange position 1747124121.296033 seeking 1 internalSeek true rebuffering true freezing false ended false paused true playbackRate 0 readyState 1 pendingPosition null
API: current playback timeline:

^1747124121.296033 
ratechange
SI: synchronizing unknown buffered ranges: 
SI: synchronizing audio buffered ranges: 1747124119.772-1747124123.612
SI: current audio inventory timeline:
1747124119.77|A|1747124123.61
[A] P: 1 || R: audio_157457_eng=157200(157200)
ABR: Choosing representation with bandwidth estimation. 5194800 video=5194800
DRM: keystatuseschange event received ksid2146D596
DRM: key status update (1b9f0ea294bc41109f0ba8eda9b2e78b): usable
DRM: key status update (228eca5945bc41109f0ba8eda9b2e78b): usable
DRM: key status update (2f920e8a45bc41109f0ba8eda9b2e78b): usable
DRM: key status update (da4aca5945bc41109f0ba8eda9b2e78b): usable
Decipherability changed for "audio_157457_eng=157200" (157200) true
Decipherability changed for "video=261200" (261200) true
Decipherability changed for "video=493200" (493200) true
Decipherability changed for "video=933200" (933200) true
Decipherability changed for "video=1402000" (1402000) true
Decipherability changed for "video=2757200" (2757200) true
Decipherability changed for "video=4016800" (4016800) true
Decipherability changed for "video=5194800" (5194800) true
DRM: keystatuseschange event received ksidD468FAC9
DRM: key status update (1b9f0ea294bc41109f0ba8eda9b2e78b): usable
DRM: key status update (228eca5945bc41109f0ba8eda9b2e78b): usable
DRM: key status update (2f920e8a45bc41109f0ba8eda9b2e78b): usable
DRM: key status update (da4aca5945bc41109f0ba8eda9b2e78b): usable
DASH: WASM MPD Parser not initialized. Running JS one.
DASH Parser: merging "switchable" AdaptationSets 3 2
MF: Manifest parsed in 34.30000000025757ms
AVSB: receiving order to push data to the SourceBuffer video video P: 1 A: 2 R: video=5194800 S: 1747124119.7633333-1.92
AVSB: pushing segment video video P: 1 A: 2 R: video=5194800 S: 1747124119.7633333-1.92
SBI: receiving order to push data to the SourceBuffer video
SBI: pushing segment video
SF: Segment request ended with success video P: 1 A: 2 R: video=5194800 S: 1747124119.7633333-1.92
ABR: New last stable representation 5194800
SF: Beginning request video P: 1 A: 2 R: video=5194800 S: 1747124121.6833334-1.92
SI: first segment pushed video 1747124119.7633333 1747124121.6833334
SI: synchronizing video buffered ranges: 1747124119.763-1747124121.683
SI: found true buffered start video 1747124119.763 1747124119.7633333
SI: found true buffered end video 1747124121.683 1747124121.6833334
ABR: Incrementing blocking raise in BufferBasedChooser due to unstable quality 12000
ABR: Choosing representation with bandwidth estimation. 2757200 video=2757200
Stream: new video bitrate estimate 5217517.821239992
Stream: urgent Representation switch video
Stream: Urgent switch, terminate now. video
SQ: no more media segment to request. Cancelling queue. video
SF: Beginning request audio P: 1 A: 1 R: audio_157457_eng=157200 S: 1747124123.6125-1.92
SF: Segment request cancelled video P: 1 A: 2 R: video=5194800 S: 1747124121.6833334-1.92
Stream: Urgent switch, terminate now. video
Stream: changing representation video video=2757200 2757200
Stream: Creating RepresentationStream video 2757200
DRM: processing init data video 2757200 da4aca5945bc41109f0ba8eda9b2e78b
DRM-LSS: Reusing session: ksidD468FAC9 temporary
DRM: Init data already processed. Skipping it.
SQ: Media segments now need to be requested. Starting queue. video 6
SF: Beginning request video P: 1 A: 2 R: video=2757200 S: 1747124121.6833334-1.92
SF: Beginning request video P: 1 A: 2 R: video=2757200 S: init
SF: Segment request aborted video P: 1 A: 2 R: video=5194800 S: 1747124121.6833334-1.92
AVSB: receiving order to push data to the SourceBuffer audio audio P: 1 A: 1 R: audio_157457_eng=157200 S: 1747124123.6125-1.92
AVSB: pushing segment audio audio P: 1 A: 1 R: audio_157457_eng=157200 S: 1747124123.6125-1.92
SBI: receiving order to push data to the SourceBuffer audio
SBI: pushing segment audio
SF: Segment request ended with success audio P: 1 A: 1 R: audio_157457_eng=157200 S: 1747124123.6125-1.92
SI: Pushing segment strictly after previous one. audio 1747124123.6125 1747124123.612
SI: buffered range not known after sync. Skipping history. 1747124123.6125 1747124125.5325
Stream: Received fatal buffer error audio 157200 n: BUFFER_APPEND_ERROR: InvalidStateError: Failed to execute 'appendBuffer' on 'SourceBuffer': The HTMLMediaElement.error attribute is not null.
Stream: audio Stream crashed. Stopping playback. n: BUFFER_APPEND_ERROR: InvalidStateError: Failed to execute 'appendBuffer' on 'SourceBuffer': The HTMLMediaElement.error attribute is not null.
SF: Segment request cancelled video P: 1 A: 2 R: video=2757200 S: init
SF: Segment request cancelled video P: 1 A: 2 R: video=2757200 S: 1747124121.6833334-1.92
SB: Aborting SegmentSink audio
AVSB: Calling `dispose` on the SourceBufferInterface
SB: Aborting SegmentSink video
AVSB: Calling `dispose` on the SourceBufferInterface
HTD: Stopping HTMLTextDisplayer
Init: Clearing HTMLMediaElement's src
Init: Revoking previous URL
Locking `contentLock` to clean-up the current content.
DRM: Clearing-up DRM session.
API: The player stopped because of an error n: BUFFER_APPEND_ERROR: InvalidStateError: Failed to execute 'appendBuffer' on 'SourceBuffer': The HTMLMediaElement.error attribute is not null.
API: playerStateChange event STOPPED
DRM: closing all current sessions.
DRM-LSS: Closing all current MediaKeySessions 2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions