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

Error java.lang.IllegalStateException on connect #3033

Closed
jonguim opened this issue Feb 18, 2022 · 14 comments
Closed

Error java.lang.IllegalStateException on connect #3033

jonguim opened this issue Feb 18, 2022 · 14 comments

Comments

@jonguim
Copy link

jonguim commented Feb 18, 2022

Environment

  • OS:Windows 10
  • scrcpy version: 1.22
  • installation method
  • device model: Xiaomi M2101K6G
  • Android version: 12

Describe the bug
When i connect give me the error java.lang.IllegalStateException:

 
`[server] INFO: Device: Xiaomi M2101K6G (Android 12)
INFO: Renderer: direct3d
INFO: Initial texture: 1080x2400
[server] ERROR: Encoding error: java.lang.IllegalStateException: null
[server] ERROR: Exception on thread Thread[main,5,main]
java.lang.IllegalStateException
WARN: Device disconnected
        at android.media.MediaCodec.native_dequeueOutputBuffer(Native Method)
        at android.media.MediaCodec.dequeueOutputBuffer(MediaCodec.java:3535)
        at com.genymobile.scrcpy.ScreenEncoder.encode(ScreenEncoder.java:147)
        at com.genymobile.scrcpy.ScreenEncoder.internalStreamScreen(ScreenEncoder.java:99)
        at com.genymobile.scrcpy.ScreenEncoder.streamScreen(ScreenEncoder.java:73)
        at com.genymobile.scrcpy.Server.scrcpy(Server.java:100)
        at com.genymobile.scrcpy.Server.main(Server.java:326)
        at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
        at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:363)
Press any key to continue . . .`

@rom1v
Copy link
Collaborator

rom1v commented Feb 18, 2022

Try #2990

@jonguim
Copy link
Author

jonguim commented Feb 18, 2022

nothing help.. I recently updated to miui 13 and it stopped working maybe its a bug in miui 13.
dont worry, thanks

@rom1v
Copy link
Collaborator

rom1v commented Feb 18, 2022

scrcpy -m1024

@jonguim
Copy link
Author

jonguim commented Feb 18, 2022

i already try that:
scrcpy -m 1920
scrcpy -m 1024
scrcpy -m 800
and i try run with different Encoder,i have 3 encoder, two of them run but the image is freezing, the error is with this encoder "OMX.qcom.video.encoder.avc".

I try runing with the :
scrcpy v1.18,v1.21,v1.22

@rom1v
Copy link
Collaborator

rom1v commented Feb 18, 2022

If you record, is the recorded file also frozen?

scrcpy --record file.mp4

or even:

scrcpy --record file.mp4 --no-display

@jonguim
Copy link
Author

jonguim commented Feb 18, 2022

i try with that two commands and give me the error

@scresante
Copy link

I just figured I would chime in here and let you know, I have tested scrcpy versions 1.{17,18,19,22} off of the caches I have from archlinux, as well as a complete server and client build from dev branch I made a night ago.

They all work if I use scrcpy -m1920 .

In some way these issues are all inter-related but I know close to nothing about Java to debug the root cause of the issue.

I can do further user testing on which values for the -m flag work, and which don't but I have no further information about the problem.

Thanks for making this excellent software @rom1v

@Crusnik05
Copy link

I got excatly the same like this one..
Device : Redmi note 10 Pro
Android : 12
MIUI 13

I think it's the problem with the android 12.
before im update, it's work normally.

@jonguim
Copy link
Author

jonguim commented Feb 22, 2022

I got excatly the same like this one.. Device : Redmi note 10 Pro Android : 12 MIUI 13

I think it's the problem with the android 12. before im update, it's work normally.

ok thanks

@jonguim jonguim closed this as completed Feb 22, 2022
@Solat-Ali
Copy link

Same issue, Redmi Note 10, MIUI 13, Android 12.. Did you fix this issue??

@Apihplays
Copy link

here same on mojito(Redmi note 10) miui 13 xiaomi.eu . if solve do reply ..i really miss using scrcpy. i use it alot before upgrade to miui 13 .. so sad

@kurinoko
Copy link

kurinoko commented Mar 7, 2022

Facing the same issue on my Xiaomi Mi A1, I just upgraded to LineageOS 18.1 (Android 11) from LineageOS 16 (Android 9). Of course, everything was fine before upgrading :/

@fulanda-prog
Copy link

hopefully someone will workout a fix soon as looks many are suffering.

@rom1v
Copy link
Collaborator

rom1v commented Mar 16, 2022

#3051

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants