scrcpy: [server] ERROR: Encoding error: java.lang.IllegalStateException: null WARN: Device disconnected
Environment
- OS: Windows 11
- scrcpy version: 1.23
- installation method: windows release
- device model: Redmi Note 10 Pro
- Android version: 12
scrcpy 1.23 <https://github.com/Genymobile/scrcpy>
C:\Users\Admin\Downloads\scrcpy-win64\scrcpy-ser...ed, 0 skipped. 16.1 MB/s (41123 bytes in 0.002s)
[server] INFO: Device: Xiaomi M2101K6G (Android 12)
INFO: Renderer: direct3d
INFO: Initial texture: 1080x2400
[server] ERROR: Encoding error: java.lang.IllegalStateException: null
WARN: Device disconnected
[server] ERROR: Exception on thread Thread[main,5,main]
java.lang.IllegalStateException
at android.media.MediaCodec.native_dequeueOutputBuffer(Native Method)
at android.media.MediaCodec.dequeueOutputBuffer(Unknown Source:9)
at com.genymobile.scrcpy.ScreenEncoder.encode(ScreenEncoder.java:152)
at com.genymobile.scrcpy.ScreenEncoder.internalStreamScreen(ScreenEncoder.java:102)
at com.genymobile.scrcpy.ScreenEncoder.streamScreen(ScreenEncoder.java:74)
at com.genymobile.scrcpy.Server.scrcpy(Server.java:101)
at com.genymobile.scrcpy.Server.main(Server.java:331)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(Unknown Source:24)
Press any key to continue . . .
that’s all i got 2 device Redmi note 4x (it’s work perfectly) Redmi note 10 Pro (as the error above)
EDIT by @rom1v: It looks like a bug in MIUI 13. You’ll have to wait until Xiaomi fixes the issue. EDIT2: to fix the problem, upgrade to MIUI 13.0.12.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 140
I’m having the same issues in Redmi Note 10 Pro after updating to MIUI 13 and Android 12, any fixes found?
EDIT: changing the encoder works: --encoder ‘OMX.google.h264.encoder’ EDIT2: you can control the phone but it freezes on PC screen.
Hi guys, there is an update on this. I have just got a security update on my Xiaomi Note 10 Pro and scrcpy started working! MIUI 13 Global 13.0.12.0 Stable.
This is so sad all redmi note 10 pro after updates it makes scrcpy stop functioning, hope a solution soon.
Also using Xiaomi redmi note 10 pro and scrcpy is not working now. i also have issues on its camera even before the update. annoying
oh god could anybody fix this issue, this sucks man!
scrcpy --encoder ‘OMX.qcom.video.encoder.avc’
Result: crash
scrcpy --encoder ‘c2.android.avc.encoder’ scrcpy --encoder ‘OMX.google.h264.encoder’
Result: starts, but freezes screen (no update or refresh)
Ok, I don’t know if I’m doing it well with github (not used on commenting here), but I’m managed to make it work.
I notice that, when using another encoder, scrcpy would just stop executing itself without any error :
scrcpy --encoder OMX.qcom.video.encoder.avc
Gave me this :
scrcpy 1.23 <https://github.com/Genymobile/scrcpy>
C:\XXX\scrcpy-win64-v1.... file pushed, 0 skipped. 51.4 MB/s (41123 bytes in 0.001s)
[server] INFO: Device: Xiaomi Mi A1 (Android 11)
INFO: Renderer: direct3d
INFO: Initial texture: 1080x1920
But nothing else.
But if I run scrcpy again (without any command parameter, just clicking scrcpy.exe) while the other instance is running, it works perfectly fine ! I have no idea why, but maybe that could help someone here.
Exact same problem 😦
(I love you rom1v 🧡💚💙)
This applies to all Xiaomi/Redmi devices affected
Check xiaomifirmwareupdater.com for official updates, if any. Sometimes the MIUI updater just doesn’t push them to you.
If there is no official update and you are comfortable tinkering with the device, an alternative would be to use custom ROMs, especially Xiaomi.eu ROM if you like how MIUI does things and want a stable experience for the device. For an actual guide on how to do so, I would have to ask you to google it.
PS: Xiaomi.eu doesn’t have a ROM build for
sweetin
devices, i.e. Redmi Note 10 Pro Max India. However, the build forsweet
devices, i.e. Redmi Note 10 Pro Global works fine with it. For other Xiaomi devices, one might have to test several ROMs before finding the right one.@iMaiconP @daydy225
Unfortunately RN10 Pro Max India has not receive the update the lastest update is 13.0.5.0 😕
Open the screen, but the screen doesn’t update after the first frame. However, the phone remains controllable.
scrcpy --encoder 'OMX.qcom.video.encoder.avc'
Directly leads to crashI’m on Android 12, MIUI 13
You probably get an upgrade on the phone. The error occurs on the device, and the client operating system has no impact on it.
There is NO need to complain here. Everybody with this problem, should send e-mail directly to Xiaomi.
Is THEIR responsibility to fix it.
It seems like MIUI 13 has an issue with the scrcpy’s default encoder
OMX.qcom.video.encoder.avc
.scrcpy
not crash with other two encoders, they are -scrcpy --encoder 'OMX.google.h264.encoder'
scrcpy --encoder 'c2.android.avc.encoder'
With those, you can control the device but it will freeze on the first frame.
But with default encoder
scrcpy --encoder 'OMX.qcom.video.encoder.avc'
, java server throw errorEncoding error: java.lang.IllegalStateException: null
and crash with the same java exceptionIt seems a lot of people are having issues with the encoder lately and can’t use scrcpy anymore. Hope the author finds a fix.
Xiaomi is rolling out update that fixed the issue. I got september patch install recently 13.0.10 and yep no more crash like before. That’s crazy cool!
you need to edit the
updater-script
inside the zip package. instructions can be found on the internet. @iMaiconPplease do not hijack the comment section here, GH sends out a ping to everyone for every comment. dm me on Twitter/Insta (see my website/profile for handles) if necessary.
Indeed! Xiaomi.eu 13.0.12 for
sweet
andsweetin
devices fixes the bug as well. @dmytromarchukWhat would be the right action for the GH issue here @rom1v? The bug clearly resided on Xiaomi’s side and is being fixed with OTA updates. Should the issue be closed?
Please how to get 13.0.12 update on glabal rom, i’ve been dead waiting for update.
People with xiaomi redmi 10 on Global Rom make us know if you fixed the issue.
I can confirm that on Xiaomi Note 10 Pro with MIUI-V13.0.13.0.SKFEUXM it works.
yes, plz help, I’m stuck in this ~ and I’m sweeping the internet for this issue and looking this issue(github) since feb
I’m using note 10 pro, and it just do not work!
I just did it and it worked. I’m very grateful for that. Many blessings to you
Having the same issue with a modern Samsung device here, so yeah, probably not something unique to Xiaomi.
Sorry, but I am not complaining about it. and my phone is a Huawei device and never upgrade years ago. maybe there is something wrong with my ubuntu environment. I am still working on it.
it is weird that I didn’t have this problem until I reinstall my ubuntu. Same hardware and same phone. Just ubuntu reinstalled. I don’t know what I installed in the previous ubuntu.
Estou com o mesmo problema no redmi note 10 pro. Tanto no scrcpy como nos outros apps de controle. Espero que o autor resolva
man oh man i guess there is no hope for xiaomi devices , suck i should have not updated the phone…
I’m also facing similar issues as @Gradius2 has reported.
Can confirm this issue isn’t fixed as of today. Do not update.
What’s sad about this is it’s gonna take months before this gets fixed for RN10/Xiaomi users haha. Understandable on your side tho. Thanks for the efforts!
Does it work with screenrecord:
?
EDIT: fixed.
still same got error lol… i tried to change encoder to
but it’s freeze frame