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

LL-HLS Streams with CMCD enabled lead to ExoPlaybackException #1395

Closed
1 task done
mikef-dk opened this issue May 24, 2024 · 2 comments
Closed
1 task done

LL-HLS Streams with CMCD enabled lead to ExoPlaybackException #1395

mikef-dk opened this issue May 24, 2024 · 2 comments
Assignees
Labels

Comments

@mikef-dk
Copy link

Version

Media3 main branch

More version details

Can be reproduced with Media3 1.3.1 as well.

Devices that reproduce the issue

All devices (including Emulator)

Devices that do not reproduce the issue

No response

Reproducible in the demo app?

Yes

Reproduction steps

  1. Add .setCmcdConfigurationFactory(CmcdConfiguration.Factory.DEFAULT) in PlayerActivity#createMediaSourceFactory when creating the DefaultMediaSourceFactory
  2. Add the following entry in media.exolist.json in the HLS samples array
      {
        "name": "Apple LL-HLS",
        "uri": "https://ll-hls-test.cdn-apple.com/llhls4/ll-hls-test-04/multi.m3u8"
      }
  1. Launch demo app and select the Apple LL-HLS test stream

Expected result

Stream plays and CMCD data is reported.

Note: Worth mentioning that without CMCD the streams play without a problem.

Actual result

Playback fails and following error message is shown in Logcat

playerFailed [eventTime=2.58, mediaPos=16.00, window=0, period=0, errorCode=ERROR_CODE_UNSPECIFIED                                             
  androidx.media3.exoplayer.ExoPlaybackException: Unexpected runtime error                                                                                    
      at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:720)                                                        
      at android.os.Handler.dispatchMessage(Handler.java:102)                                                                                                 
      at android.os.Looper.loopOnce(Looper.java:201)                                                                                                          
      at android.os.Looper.loop(Looper.java:288)                                                                                                              
      at android.os.HandlerThread.run(HandlerThread.java:67)                                                                                                  
  Caused by: java.lang.IndexOutOfBoundsException: index (11) must be less than size (10)                                                                      
      at com.google.common.base.Preconditions.checkElementIndex(Preconditions.java:1371)                                                                      
      at com.google.common.base.Preconditions.checkElementIndex(Preconditions.java:1353)                                                                      
      at com.google.common.collect.RegularImmutableList.get(RegularImmutableList.java:84)                                                                     
      at androidx.media3.exoplayer.hls.HlsChunkSource.getNextSegmentHolder(HlsChunkSource.java:608)                                                           
      at androidx.media3.exoplayer.hls.HlsChunkSource.getNextChunk(HlsChunkSource.java:520)                                                                   
      at androidx.media3.exoplayer.hls.HlsSampleStreamWrapper.continueLoading(HlsSampleStreamWrapper.java:783)                                                
      at androidx.media3.exoplayer.source.CompositeSequenceableLoader$SequenceableLoaderWithTrackTypes.continueLoading(CompositeSequenceableLoader.java:178)  
      at androidx.media3.exoplayer.source.CompositeSequenceableLoader.continueLoading(CompositeSequenceableLoader.java:131)                                   
      at androidx.media3.exoplayer.hls.HlsMediaPeriod.continueLoading(HlsMediaPeriod.java:409)                                                                
      at androidx.media3.exoplayer.source.MaskingMediaPeriod.continueLoading(MaskingMediaPeriod.java:229)                                                     
      at androidx.media3.exoplayer.MediaPeriodHolder.continueLoading(MediaPeriodHolder.java:235)                                                              
      at androidx.media3.exoplayer.ExoPlayerImplInternal.maybeContinueLoading(ExoPlayerImplInternal.java:2565)                                                
      at androidx.media3.exoplayer.ExoPlayerImplInternal.handleContinueLoadingRequested(ExoPlayerImplInternal.java:2526)                                      
      at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:585)           

On another stream with LL-HLS + HEVC the following exception can be observed as well:

androidx.media3.exoplayer.ExoPlaybackException: Source error                                                                                
	at androidx.media3.exoplayer.ExoPlayerImplInternal.handleIoException(ExoPlayerImplInternal.java:717)                                     
	at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:693)                                         
	at android.os.Handler.dispatchMessage(Handler.java:102)                                                                                  
	at android.os.Looper.loop(Looper.java:223)                                                                                               
	at android.os.HandlerThread.run(HandlerThread.java:67)                                                                                   
Caused by: androidx.media3.exoplayer.hls.SampleQueueMappingException: Unable to bind a sample queue to TrackGroup with MIME type video/hevc.
	at androidx.media3.exoplayer.hls.HlsSampleStream.maybeThrowError(HlsSampleStream.java:62)                                                
	at androidx.media3.exoplayer.BaseRenderer.maybeThrowStreamError(BaseRenderer.java:182)                                                   
	at androidx.media3.exoplayer.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:1125)                                           
	at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:544)                                         
	at android.os.Handler.dispatchMessage(Handler.java:102)    

Media

Sample URLs with the issue:

We can observe another issue (Caused by: androidx.media3.exoplayer.hls.SampleQueueMappingException: Unable to bind a sample queue to TrackGroup with MIME type video/hevc) with one of our streams. Our stream is from a LL-HLS stream packaged by AWS MediaPackage.

Bug Report

@marcbaechinger
Copy link
Contributor

Thanks for reporting! I can repro this with the provided test stream!

copybara-service bot pushed a commit that referenced this issue Jun 13, 2024
Determine `nextMediaSequence` and `nextPartIndex` based on the last `SegmentBaseHolder` instance, as it can update `mediaSequence` and `partIndex` depending on whether the HLS playlist has trailing parts or not.

Issue: #1395
PiperOrigin-RevId: 642961141
@rohitjoins
Copy link
Contributor

A fix for the bug has been submitted to the main branch and will be included in our next release.

Thank you again for reporting the issue.

@androidx androidx locked and limited conversation to collaborators Aug 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants