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

ExoPlayer 2.15.1 throws NoSuchElementException on loading Live LL HLS manifest #9592

Closed
jrw95 opened this issue Oct 22, 2021 · 9 comments
Closed
Assignees
Labels

Comments

@jrw95
Copy link

jrw95 commented Oct 22, 2021

I'll forward a link to the stream to the dev email, along with a bugreport.zip.

Reproducible in:
ExoPlayer 2.15.1 demo
ExoPlayer 2.13.0 demo
Notable that the stream plays in the ExoPlayer 2.10.8 demo (although also noted that LL HLS support was not announced until 2.13.0, just noting here that it played without apparent problems in ExoPlayer 2.10.8).

Describe how the issue can be reproduced, ideally using the ExoPlayer demo app:

  • Added the manifest URL (sent to the dev email) to the media.exolist.json file in the demo app
  • Launch the demo app
  • Select the asset from the list

Expected:

  • When the player loads, the master and chunklist manifest requests are successful
  • As with ExoPlayer 2.10.8, segments are then requested and can be played

Actual:

  • When the player loads, the master and chunklist manifest requests are successful
  • No segments are requested
  • A NoSuchElementException is thrown, and playback does not start:
2021-10-22 10:47:55.845 1849-1849/com.google.android.exoplayer2.demo W/exoplayer2.dem: Accessing hidden method Landroid/media/AudioTrack;->getLatency()I (greylist, reflection, allowed)
2021-10-22 10:47:55.858 1849-1849/com.google.android.exoplayer2.demo I/ExoPlayerImpl: Init 7d9e151 [ExoPlayerLib/2.15.1] [sunfish, Pixel 4a, Google, 30]
2021-10-22 10:47:55.888 1849-1849/com.google.android.exoplayer2.demo D/EventLogger: playWhenReady [eventTime=0.00, mediaPos=0.00, window=0, true, USER_REQUEST]
2021-10-22 10:47:55.897 1849-1849/com.google.android.exoplayer2.demo D/EventLogger: timeline [eventTime=0.01, mediaPos=0.00, window=0, periodCount=1, windowCount=1, reason=PLAYLIST_CHANGED
2021-10-22 10:47:55.897 1849-1849/com.google.android.exoplayer2.demo D/EventLogger:   period [?]
2021-10-22 10:47:55.897 1849-1849/com.google.android.exoplayer2.demo D/EventLogger:   window [?, seekable=false, dynamic=true]
2021-10-22 10:47:55.897 1849-1849/com.google.android.exoplayer2.demo D/EventLogger: ]
2021-10-22 10:47:55.898 1849-1849/com.google.android.exoplayer2.demo D/EventLogger: mediaItem [eventTime=0.01, mediaPos=0.00, window=0, reason=PLAYLIST_CHANGED]
2021-10-22 10:47:55.901 1849-1849/com.google.android.exoplayer2.demo D/EventLogger: state [eventTime=0.01, mediaPos=0.00, window=0, BUFFERING]
2021-10-22 10:47:55.941 1849-1849/com.google.android.exoplayer2.demo D/EventLogger: surfaceSize [eventTime=0.05, mediaPos=0.00, window=0, 1080, 2160]
2021-10-22 10:47:55.955 1849-1849/com.google.android.exoplayer2.demo D/EventLogger: loading [eventTime=0.07, mediaPos=0.00, window=0, period=0, true]
2021-10-22 10:47:58.652 1849-1972/com.google.android.exoplayer2.demo E/LoadTask: Unexpected exception loading stream
      java.util.NoSuchElementException
        at com.google.common.collect.Iterables.getLast(Iterables.java:807)
        at com.google.android.exoplayer2.source.hls.playlist.HlsPlaylistParser.parseMediaPlaylist(HlsPlaylistParser.java:861)
        at com.google.android.exoplayer2.source.hls.playlist.HlsPlaylistParser.parse(HlsPlaylistParser.java:277)
        at com.google.android.exoplayer2.source.hls.playlist.HlsPlaylistParser.parse(HlsPlaylistParser.java:68)
        at com.google.android.exoplayer2.upstream.ParsingLoadable.load(ParsingLoadable.java:176)
        at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:409)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:923)
2021-10-22 10:47:58.665 1849-1849/com.google.android.exoplayer2.demo E/EventLogger: internalError [eventTime=2.77, mediaPos=0.00, window=0, loadError
      com.google.android.exoplayer2.upstream.Loader$UnexpectedLoaderException: Unexpected NoSuchElementException: null
        at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:430)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:923)
     Caused by: java.util.NoSuchElementException
        at com.google.common.collect.Iterables.getLast(Iterables.java:807)
        at com.google.android.exoplayer2.source.hls.playlist.HlsPlaylistParser.parseMediaPlaylist(HlsPlaylistParser.java:861)
        at com.google.android.exoplayer2.source.hls.playlist.HlsPlaylistParser.parse(HlsPlaylistParser.java:277)
        at com.google.android.exoplayer2.source.hls.playlist.HlsPlaylistParser.parse(HlsPlaylistParser.java:68)
        at com.google.android.exoplayer2.upstream.ParsingLoadable.load(ParsingLoadable.java:176)
        at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:409)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
        at java.lang.Thread.run(Thread.java:923) 
    ]
2021-10-22 10:47:58.668 1849-1955/com.google.android.exoplayer2.demo E/ExoPlayerImplInternal: Playback error
      com.google.android.exoplayer2.ExoPlaybackException: Source error
        at com.google.android.exoplayer2.ExoPlayerImplInternal.handleIoException(ExoPlayerImplInternal.java:624)
        at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:600)
        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: com.google.android.exoplayer2.upstream.Loader$UnexpectedLoaderException: Unexpected NoSuchElementException: null
        at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:430)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:923)
     Caused by: java.util.NoSuchElementException
        at com.google.common.collect.Iterables.getLast(Iterables.java:807)
        at com.google.android.exoplayer2.source.hls.playlist.HlsPlaylistParser.parseMediaPlaylist(HlsPlaylistParser.java:861)
        at com.google.android.exoplayer2.source.hls.playlist.HlsPlaylistParser.parse(HlsPlaylistParser.java:277)
        at com.google.android.exoplayer2.source.hls.playlist.HlsPlaylistParser.parse(HlsPlaylistParser.java:68)
        at com.google.android.exoplayer2.upstream.ParsingLoadable.load(ParsingLoadable.java:176)
        at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:409)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
        at java.lang.Thread.run(Thread.java:923) 

Output of running "adb bugreport" in the console shortly after encountering the issue

  • Sent to the dev email

URI to test content for reproduction

  • Sent to the dev email

ExoPlayer version number

  • Noted above

Android versions: 6.0.1 and 11
Android devices: Samsung S5 (Android 6.0.1) and Google Pixel 4a (Android 11)

@tonihei
Copy link
Collaborator

tonihei commented Oct 22, 2021

The playlist link provided in the email returns HTTP code 500 for me. Could you check it's actually accessible?

Other than that, the error is thrown when parsing #EXT-X-RENDITION-REPORT in the media playlist. Our code currently assumes these tags come after all media segments and parts and that the list of media segments isn't empty.
While both assumptions are true for all LL-HLS playlists we've seen so far, there isn't anything in the spec saying that this has to be the case. So I assume your playlist has one of these two problems and I think we should handle them correctly.

@marcbaechinger Would you mind taking a look? Looks like we need to save rendition reports with some UNSET value if the default fallback (=current number of segments) should be used and only fill it in once we parsed the whole playlist.

@jrw95
Copy link
Author

jrw95 commented Oct 23, 2021

@tonihei Thanks so much for the quick response. I will check with the team to make sure that that stream is not geo-blocked (it plays for me here in the US), and provide a new stream if necessary.

@jrw95
Copy link
Author

jrw95 commented Oct 25, 2021

@tonihei I've heard back from team, that the issue with the 500 errors has been resolved. Further, another teammate outside the US has confirmed that the 500 errors are gone. Please let me know if the content continues to be inaccessible, though. Thanks again.

@marcbaechinger
Copy link
Contributor

marcbaechinger commented Oct 28, 2021

I think I have a fix ready for parsing the playlist with the #EXT-X-RENDITION-REPORT tags before the segment/part list in the media playlist.

I tried accessing the playlist you sent in the email, but it seems like I get a HTTP/503 currently.Yesterday, it seemed to me that I was able to curl the master and a media playlist, but then got a 503 for the media segments. Now I get a 503 Service Temporarily Unavailable for the master playlist. If you want me to test the cahnge with your stream, please let me know whether this can be fixed.

@jrw95
Copy link
Author

jrw95 commented Oct 28, 2021

@marcbaechinger I will let the team know about this. Apologies for this problem.

@jrw95
Copy link
Author

jrw95 commented Oct 28, 2021

@marcbaechinger
I've confirmed that the test stream is now available again.

marcbaechinger added a commit that referenced this issue Oct 29, 2021
This makes sure that #EXT-X-RENDITION-REPORT tags can be placed before the list of segments/parts as well. We were previously assuming that these come at the end, which naturally would make sense and is done like this in all examples, but it is not explicitly defined by the spec.

Issue: #9592
PiperOrigin-RevId: 406329684
@marcbaechinger
Copy link
Contributor

Thanks! I was able to play your stream.

@jrw95
Copy link
Author

jrw95 commented Oct 29, 2021

@marcbaechinger Thanks for fixing this so quickly.
If I could ask a couple questions:

  1. I was hoping to see this working in the dev-v2 demo, but attempting to install that demo onto a device failed with this Android Studio error (this doesn't happen when installing the release-v2 version of the demo):
A problem occurred evaluating project ':demo'.
> Failed to apply plugin 'com.android.internal.application'.
   > Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.
     You can try some of the following options:
       - changing the IDE settings.
       - changing the JAVA_HOME environment variable.
       - changing `org.gradle.java.home` in `gradle.properties`.
  1. Is it possible to get an estimated release timeframe for this fix?

Thanks again.

@marcbaechinger
Copy link
Contributor

Looks like gradle JDK needs to be to Java 11. You can configure this in File > Settings. Then search for gradle where you can select the JDK used by gradle.

The fix will land in the next release. I think this will happen approximately within the next two weeks or so.

icbaker pushed a commit to androidx/media that referenced this issue Nov 9, 2021
This makes sure that #EXT-X-RENDITION-REPORT tags can be placed before
the list of segments/parts as well. We were previously assuming that
these come at the end, which naturally would make sense and is done like
this in all examples, but it is not explicitly defined by the spec.

Issue: google/ExoPlayer#9592
PiperOrigin-RevId: 406329684
@google google locked and limited conversation to collaborators Dec 29, 2021
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

4 participants