Skip to content

IllegalStateException when drainToEndOfStream when in tunneling mode #10847

Closed

Description

@tomjhall

ExoPlayer Version

2.18.2

Devices that reproduce the issue

Model: TalkTalk STB
Os: Android
Version: 10

Devices that do not reproduce the issue

Fire TV Stick (2nd Gen) running Fire OS 5.2.9.2 (Tunneling was not enabled for this media, tried other media with tunneling enabled but the issue was not present)

Reproducible in the demo app?

Yes

Reproduction steps

Turn on tunneling ie in PlayerActivity:

      trackSelectionParameters =
          new DefaultTrackSelector.ParametersBuilder(/* context= */ this)
              .setTunnelingEnabled(true)
              .build();

As our media is over http you will need to allow clear text, so in an xml file in res/xml:

<network-security-config>
  <base-config cleartextTrafficPermitted="true"/>
</network-security-config>

And in the android manifest of the demo app tag:

    android:networkSecurityConfig="@xml/network_config"

Play the video to the end, where the crash should occur.

Expected result

The audio sink should be released successfully

Actual result

The following exception is thown:

playerFailed [eventTime=33.10, mediaPos=29.47, window=0, period=0, errorCode=ERROR_CODE_FAILED_RUNTIME_CHECK
  com.google.android.exoplayer2.ExoPlaybackException: Unexpected runtime error
      at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:621)
      at android.os.Handler.dispatchMessage(Handler.java:103)
      at android.os.Looper.loop(Looper.java:214)
      at android.os.HandlerThread.run(HandlerThread.java:67)
  Caused by: java.lang.IllegalStateException
      at com.google.android.exoplayer2.util.Assertions.checkState(Assertions.java:84)
      at com.google.android.exoplayer2.audio.DefaultAudioSink.writeBuffer(DefaultAudioSink.java:1159)
      at com.google.android.exoplayer2.audio.DefaultAudioSink.processBuffers(DefaultAudioSink.java:1099)
      at com.google.android.exoplayer2.audio.DefaultAudioSink.drainToEndOfStream(DefaultAudioSink.java:1259)
      at com.google.android.exoplayer2.audio.DefaultAudioSink.handleBuffer(DefaultAudioSink.java:893)
      at com.google.android.exoplayer2.audio.MediaCodecAudioRenderer.processOutputBuffer(MediaCodecAudioRenderer.java:706)
      at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.drainOutputBuffer(MediaCodecRenderer.java:1905)
      at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:792)
      at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:994)
      at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:495)
      at android.os.Handler.dispatchMessage(Handler.java:103) 
      at android.os.Looper.loop(Looper.java:214) 
      at android.os.HandlerThread.run(HandlerThread.java:67) 
]

Media

Media Url is sent via email

Bug Report

Activity

  1. tonihei commented on Dec 8, 2022

    @tonihei
    Collaborator

    Do you have any custom AudioProcessors in your app? I can reproduce the error by adding a custom processor, but can't see a way to trigger the problem with the default processors only.

  2. tomjhall commented on Dec 14, 2022

    @tomjhall
    Author

    No this should be reproducible in the ExoPlayer reference application - we have not added a custom AudioProcessor to the reference app. I have created a patch file (sending to you via email) for the Exoplayer reference app so that you can better see the changes/apply it

  3. tonihei commented on Dec 21, 2022

    @tonihei
    Collaborator

    I just checked the emails, but can't see anything related to this issue. Could you make sure to use "Issue #10847" in the subject line? Otherwise the email may get lost in some filters.

  4. tomjhall commented on Dec 22, 2022

    @tomjhall
    Author

    I've resent the email

  5. tonihei commented on Jan 9, 2023

    @tonihei
    Collaborator

    Thanks! It again wasn't forwarded by our filters, but I was able to dig it out regardless. (Need to investigate what's going on there, but yours seem to be the only "correct" email that wasn't forwarded to us).

  6. tonihei commented on Jan 9, 2023

    @tonihei
    Collaborator

    It looks like your stream may cause this issue because it requires gapless trimming. This enables an AudioProcessor for the trimming (see my question above) and in some situations this may then run into this assertion. Will provide a fix for this!

  7. tonihei commented on Jan 26, 2023

    @tonihei
    Collaborator

    The problem is likely fixed by the commit above.

  8. locked and limited conversation to collaborators on Mar 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions