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

Using LoopingMediaSource on Samsung GT-I9082 on 4.1.2 causes Internal Runtime Error #2900

Closed
aaronpatel93 opened this issue Jun 2, 2017 · 7 comments
Labels

Comments

@aaronpatel93
Copy link

Issue description

Attempting to use a LoopingMediaSource on throws an internal runtime error.
A regular media source works fine.

Reproduction steps

Simply prepare the exoplayer with a LoopingMediaSource.

Link to test content

Any Mp4 file causes the bug.

Version of ExoPlayer being used

r2.0.1

Device(s) and version(s) of Android being used

Samsung GT-I9082 on 4.1.2. It is reproducible every time.

A full bug report captured from the device

adb bugreport doesn't seem to work on this device.

06-02 10:41:40.115 133-5661/? I/brcm-vd: [video_decoder__return_buffer]: received event ERRO on port 1,0
06-02 10:41:40.115 5450-5659 E/ACodec: [OMX.BRCM.vc4.decoder.avc] ERROR(0x00000000)
06-02 10:41:40.115 5450-5659/ E/MediaCodec: Codec reported an error. (omx error 0x00000000, internalError -2147483648)

06-02 10:41:40.125 5450-5637/ E/ExoPlayerImplInternal: Internal runtime error.
java.lang.IllegalStateException
at android.media.MediaCodec.queueInputBuffer(Native Method)
at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.feedInputBuffer(MediaCodecRenderer.java:675)
at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:490)
at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:464)
at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:300)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:137)
at android.os.HandlerThread.run(HandlerThread.java:60)
at com.google.android.exoplayer2.util.PriorityHandlerThread.run(PriorityHandlerThread.java:40)
06-02 10:41:40.125 133-5661/? D/brcm-vd: [video_decoder__check_complete]: state changing completed
06-02 10:41:40.135 133-5661/? D/brcm-vd: [video_decoder__openmax_main]: OMX_CommandStateSet - loaded, ready to set/get
06-02 10:41:40.135 133-5661/? D/brcm-vd: [video_decoder__openmax_main]: state changed ( 0, 1 )
06-02 10:41:40.135 133-420/? D/brcm-vd: [video_decoder__FreeBuffer]: deallocated 0x422d4a50 (42285800)
06-02 10:41:40.135 133-133/? D/brcm-vd: [video_decoder__FreeBuffer]: deallocated 0x422f0a50 (42283200)
06-02 10:41:40.135 133-396/? D/brcm-vd: [video_decoder__FreeBuffer]: deallocated 0x424181e0 (42280c00)
06-02 10:41:40.135 133-4718/? D/brcm-vd: [video_decoder__FreeBuffer]: deallocated 0x422b8d80 (4227e600)
06-02 10:41:40.135 133-4738/? D/brcm-vd: [video_decoder__FreeBuffer]: deallocated 0x4230df80 (4227c000)
06-02 10:41:40.135 133-6339/? D/brcm-vd: [video_decoder__FreeBuffer]: deallocated 0x422d9c90 (422d0f68)
06-02 10:41:40.135 133-4737/? D/brcm-vd: [video_decoder__FreeBuffer]: deallocated 0x422c9cd0 (80000055)
06-02 10:41:40.135 133-420/? D/brcm-vd: [video_decoder__FreeBuffer]: deallocated 0x422d3e20 (80000066)
06-02 10:41:40.135 133-133/? D/brcm-vd: [video_decoder__FreeBuffer]: deallocated 0x422c9810 (800000ba)
06-02 10:41:40.135 133-396/? D/brcm-vd: [video_decoder__FreeBuffer]: deallocated 0x4228a1a0 (80000050)
06-02 10:41:40.135 133-4718/? D/brcm-vd: [video_decoder__FreeBuffer]: deallocated 0x41f9a380 (8000003d)
06-02 10:41:40.135 133-4738/? D/brcm-vd: [video_decoder__FreeBuffer]: deallocated 0x422cfe10 (8000002a)
06-02 10:41:40.135 133-6339/? D/brcm-vd: [video_decoder__FreeBuffer]: deallocated 0x41f9be80 (8000000c)
06-02 10:41:40.145 133-4737/? D/brcm-vd: [video_decoder__FreeBuffer]: deallocated 0x4241b1d0 (80000099)
06-02 10:41:40.145 133-420/? D/brcm-vd: [video_decoder__FreeBuffer]: deallocated 0x41f9cf00 (8000007e)
06-02 10:41:40.145 133-133/? D/brcm-vd: [video_decoder__FreeBuffer]: deallocated 0x422f0220 (800000a8)
06-02 10:41:40.145 133-396/? D/brcm-vd: [video_decoder__FreeBuffer]: deallocated 0x42418590 (8000005e)
06-02 10:41:40.145 133-4718/? D/brcm-vd: [video_decoder__FreeBuffer]: deallocated 0x42316e80 (800000b0)
06-02 10:41:40.145 133-4738/? D/brcm-vd: [video_decoder__FreeBuffer]: deallocated 0x422d0430 (8000000a)
06-02 10:41:40.145 133-6339/? D/brcm-vd: [video_decoder__FreeBuffer]: deallocated 0x4225fe90 (8000002b)
06-02 10:41:40.145 133-4737/? D/brcm-vd: [video_decoder__FreeBuffer]: deallocated 0x422946c0 (80000093)
06-02 10:41:40.145 133-420/? D/brcm-vd: [video_decoder__FreeBuffer]: deallocated 0x422dcf10 (8000002c)
06-02 10:41:40.145 133-133/? D/brcm-vd: [video_decoder__FreeBuffer]: deallocated 0x422c0c40 (8000009a)
06-02 10:41:40.145 133-396/? D/brcm-vd: [video_decoder__FreeBuffer]: deallocated 0x422b83d0 (80000053)
06-02 10:41:40.145 133-4718/? D/brcm-vd: [video_decoder__FreeBuffer]: deallocated 0x422e04d0 (80000041)
06-02 10:41:40.145 133-4738/? D/brcm-vd: [video_decoder__FreeBuffer]: deallocated 0x425c0bf0 (80000026)
06-02 10:41:40.145 133-6339/? D/brcm-vd: [video_decoder__FreeBuffer]: deallocated 0x4235ecf0 (8000008d)
06-02 10:41:40.155 133-5661/? D/brcm-vd: [video_decoder__openmax_main]: thread exiting
06-02 10:41:40.165 5450-5450/E/: LL_E W [1:main].java:201/error in playback: null; exception=com.google.android.exoplayer2.ExoPlaybackException
### begin stack trace 3.0.0-website-debug
com.google.android.exoplayer2.ExoPlaybackException
at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:350)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:137)
at android.os.HandlerThread.run(HandlerThread.java:60)
at com.google.android.exoplayer2.util.PriorityHandlerThread.run(PriorityHandlerThread.java:40)
Caused by: java.lang.IllegalStateException
at android.media.MediaCodec.queueInputBuffer(Native Method)
at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.feedInputBuffer(MediaCodecRenderer.java:675)
at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:490)
at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:464)
at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:300)
at android.os.Handler.dispatchMessage(Handler.java:95) 
at android.os.Looper.loop(Looper.java:137) 
at android.os.HandlerThread.run(HandlerThread.java:60) 
at com.google.android.exoplayer2.util.PriorityHandlerThread.run(PriorityHandlerThread.java:40) 
### end stack trace

@ojw28
Copy link
Contributor

ojw28 commented Jun 6, 2017

Apparently this device can be upgraded to Android 4.2.2. Is the upgrade available for your test device, and if so does taking it resolve the issue?

@aaronpatel93
Copy link
Author

aaronpatel93 commented Jul 19, 2017

It isn't resolved with upgrading the GT-I9082 to 4.2.2. It appears to also occur in other devices including GT-I9152 (4.2.2), GT-I9063T(4.2.2), GT-I8552, GT-S7582L(4.2.2), GT-S5310(4.1.2), GT-S6293T(4.1.2), GT-I8552B(4.1.2), GT-I9060L(4.2.2). In all cases, it appears the buffer is just smaller by 10 bytes or so than what is required as shown in the following stack trace.

begin stack trace

com.google.android.exoplayer2.b
at com.google.android.exoplayer2.e.handleMessage(ExoPlayerImplInternal.java:350)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:137)
at android.os.HandlerThread.run(HandlerThread.java:60)
at com.google.android.exoplayer2.i.l.run(PriorityHandlerThread.java:40)
Caused by: java.lang.IllegalStateException: Buffer too small (107866 < 107871)
at com.google.android.exoplayer2.b.e.d(DecoderInputBuffer.java:144)
at com.google.android.exoplayer2.b.e.c(DecoderInputBuffer.java:102)
at com.google.android.exoplayer2.e.a$c.a(ExtractorMediaPeriod.java:3297)
at com.google.android.exoplayer2.k.a(RendererCapabilities.java:2271)
at com.google.android.exoplayer2.d.b.s(MediaCodecRenderer.java:595)
at com.google.android.exoplayer2.d.b.a(MediaCodecRenderer.java:490)
at com.google.android.exoplayer2.e.handleMessage(ExoPlayerImplInternal.java:3464)
... 4 more

end stack trace

Using the Default Media Source works fine. This issue occurs once a Looping Media Source is used and occurs towards the end of the playback of the first loop (I'm guessing a slightly larger buffer is needed to loop back to the beginning). Also, after getting this error, I cannot play videos with the Default Media Source, (It appears something goes wrong with the decoder.) Also, regardless of which decoder was used OMX.BRCM.vc4.decoder.avc or OMX.google.h264.decoder, this still occurred.

@andrewlewis
Copy link
Collaborator

Is this reproducible in the demo app if you add code to wrap the media source with a LoopingMediaSource and play one of the samples that uses ExtractorMediaSource? If not, please provide a link to the stream you're playing and steps to reproduce. Thanks.

@aaronpatel93
Copy link
Author

This issue is reproducible after wrapping with LoopingMediaSource. It doesn't happen with the sample video, but if i change the uri to use the attached video, the error occurs.
gif.zip

I get the same same message:
07-24 12:39:14.126 7107-7129/com.google.android.exoplayer2.demo E/ExoPlayerImplInternal: Internal runtime error.
java.lang.IllegalStateException: Buffer too small (8128 < 8133)
at com.google.android.exoplayer2.decoder.DecoderInputBuffer.createReplacementByteBuffer(DecoderInputBuffer.java:160)
at com.google.android.exoplayer2.decoder.DecoderInputBuffer.ensureSpaceForWrite(DecoderInputBuffer.java:110)
at com.google.android.exoplayer2.extractor.DefaultTrackOutput.readData(DefaultTrackOutput.java:292)
at com.google.android.exoplayer2.source.ExtractorMediaPeriod.readData(ExtractorMediaPeriod.java:339)
at com.google.android.exoplayer2.source.ExtractorMediaPeriod$SampleStreamImpl.readData(ExtractorMediaPeriod.java:573)
at com.google.android.exoplayer2.BaseRenderer.readSource(BaseRenderer.java:274)
at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.feedInputBuffer(MediaCodecRenderer.java:621)
at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:511)
at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:479)
at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:308)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:137)
at android.os.HandlerThread.run(HandlerThread.java:60)

@andrewlewis
Copy link
Collaborator

I couldn't reproduce this on a Nexus device so trying to get hold of a Samsung Galaxy Mega GT-I9152.

@andrewlewis
Copy link
Collaborator

This issue is triggered by adaptive reconfigurations, where we queue reconfiguration data into the decoder input buffer but the buffer was only created to store the maximum input sample size in the container.

ojw28 pushed a commit that referenced this issue Aug 3, 2017
Issue: #2900

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=164110904
@ojw28 ojw28 closed this as completed Aug 3, 2017
@ojw28
Copy link
Contributor

ojw28 commented Aug 3, 2017

Fixed in dev-v2, and will be cherry picked into r2.5.0.

ojw28 pushed a commit that referenced this issue Aug 4, 2017
Issue: #2900

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=164110904
@google google locked and limited conversation to collaborators Dec 2, 2017
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