-
Notifications
You must be signed in to change notification settings - Fork 6k
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
native_window_set_buffer_count failed: Invalid argument #6930
Comments
Possible duplicate of #6874 |
Hi @shobanavelmurugan, in order to help with this, we will need:
Thanks! |
@AquilesCanta I use HLS streaming from my api it looks pretty good even shorter length, but problem i face is with previewing the video from Internal storage(Recording using Camera2-Api -(1920x1080 resolution)). |
I don't understand how HLS is involved. Please provide the items requested above. |
I have Two scenario in my requirement: |
Anyone have tested those scenarios.can you please update what are other information required from my end. |
but no solutions posted yet |
The solution is to override the method The codec can't be reused in this case, so there are some performance implications of doing that but not every app needs it. |
Hello @AquilesCanta, I'm able to reproduce this I have Xiaomi Mi Box S Android 9.0 TV Box and Cube X3 Android 9.0 TV Box. This error will NOT appear on emulators, only on real devices.
|
@ojw28 Hello! You worked with similar problems, so I decided to tag you. I have some useful information on this issue. The same bug trace that @menscikov cited above repeats both for me and only on real android tv (Xiaomi Mi Box S Android 9.0). I have localized my problem. When I want to display an advertisement over the player, I set playerView.videoSurfaceView.visibility = View.INVISIBLE and immediately get an error. If you change the visibility, a second after the player has paused, then there is no problem. Tell me at what point can I already hide the display? exoPlayer version 11.7 |
@Turalllb you shouldn't toggle the visibility of the playerView. For ads, try using the |
@saurabharora90 I'm not sure if I can use AdsMediaSource for ads. For advertising, we have our own asSDK with our exoPlayer inside, and the very logic of advertising placement is specific. For the first time I hear about VideoView, I looked at what this class is. I am using PLayerView from exoPlayer. Of course, I can hide the video under another view, but I think it's not right that when the visibility changes, problems arise. |
@Turalllb somebody can correct me if I am wrong: From my understanding, a surface view is destroyed when you toggle its visibility, which is why you shouldn't do it and hence it causes issues since the Surfaceview is destroyed by the time Exoplayer accesses it. When you do it after pause, it's not an issue anymore. |
@saurabharora90 You are right, if you do it after a pause with a delay of 2 seconds, then everything is fine. But if right after the pause, then the problem still arises. In any case, I decided not to do this, I will use alpha or another view on top. |
Hello, I have a very similar issue that the one described by @menscikov . Tested on latest exoplayer version (2.12.1). Reproducing a video with Xiaomi MiBox 3 (Android 9), it works great until home button pressed. Then the following exception is produced:
Also, in Android emulators and mobile phones Xiaomi Mi A3 (Android 10), Xiaomi Redmi Note 8 (Android 9), Xiaomi Mi Max (Android 7) and Motorola One Action (Android 10) it works correctly. After returning from background, the video continues playing on the last position. |
I am closing this issue because it is now almost impossible to follow and there seem to be two different and unrelated issues being reported:
All of the reports have ignored the issue template and failed to include steps to reproduce the issue (including a piece of media, saying "any piece of media" doesn't help) and a bugreport. A bugreport is what adb outputs when you run If you are still having issues with this, please file a fresh issue and please follow the issue template. |
ExoPlayer-2.11.1: ExoPlayerImplInternal: Internal runtime error. java.lang.IllegalArgumentException at android.media.MediaCodec.native_setSurface:
Now i am using the Exo player 2.11.1. i recorded the video for around 30-mins in landscape and previewed in landscape(The orientationlistener moves activity from portrait to landscape for preview ) .At times in preview activity the player event triggers onPlayerError() and the screen goes blank in android OS 10.
Note: We are recording and previewing the video in loop (eg: 10 videos)
Device.Samsug Galaxy S10
Searched documentation and issues
Getting sometimes an ExoPlayerImplInternal: IllegalArgumentException #6346
Why ExoPlayer in Android OS-10 shows black preview screen while preview
ExoPlayerImplInternal: Internal runtime error #6750
Why can't remove playview from its parent or call clearSurface in 2.8.1 #4335
Can't use Surface if it was used before #6454
Random internal error #642
[REQUIRED] Question
1-Why onPlayerStateChanged() show IDEAL while changing orientation.
2-Here i'm using ProgressiveMediaSource.Factory to load mediaSource from online and as well as local storage. whether this issue created by ProgressiveMediaSource.Factory?
3.When PlayerError occurs how to show the preview again?
4.While player Error occurs Player State will be in IDEAL in this case how to show the preview.
A full bug report captured from the device
E/BufferQueueProducer: [SurfaceTexture-0-22659-29] setMaxDequeuedBufferCount: requested buffer count 2 is less than minimum 3
E/Surface: IGraphicBufferProducer::setBufferCount(2) returned Invalid argument E/ACodec: native_window_set_buffer_count failed: Invalid argument (22)
E/ExoPlayerImplInternal: Internal runtime error. java.lang.IllegalArgumentException at android.media.MediaCodec.native_setSurface(Native Method) at android.media.MediaCodec.setOutputSurface(MediaCodec.java:2042) at com.google.android.exoplayer2.video.MediaCodecVideoRenderer.setOutputSurfaceV23(MediaCodecVideoRenderer.java:1014) at com.google.android.exoplayer2.video.MediaCodecVideoRenderer.setSurface(MediaCodecVideoRenderer.java:422) at com.google.android.exoplayer2.video.MediaCodecVideoRenderer.handleMessage(MediaCodecVideoRenderer.java:387) at com.google.android.exoplayer2.ExoPlayerImplInternal.deliverMessage(ExoPlayerImplInternal.java:864) at com.google.android.exoplayer2.ExoPlayerImplInternal.sendMessageToTarget(ExoPlayerImplInternal.java:835) at com.google.android.exoplayer2.ExoPlayerImplInternal.sendMessageInternal(ExoPlayerImplInternal.java:817) at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:330) at android.os.Handler.dispatchMessage(Handler.java:103) at android.os.Looper.loop(Looper.java:237) at android.os.HandlerThread.run(HandlerThread.java:67)
ExoPlayer 2.9.6 Reproducible Issue
Previously i am using ExoPlayer 2.9.6 at the time i am using DefaultDataSource for showing preview online and Local storage of media. I can able to reproduce the same issue.
The text was updated successfully, but these errors were encountered: