-
-
Notifications
You must be signed in to change notification settings - Fork 11k
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
[server] ERROR: Encoding error: java.lang.IllegalStateException: null WARN: Device disconnected #3051
Comments
EDIT: for new users, please ignore this comment, it was just an initial test to investigate the issue. I added some logs. Could you replace this binary in v1.23 please, and post the output:
diffdiff --git a/server/src/main/java/com/genymobile/scrcpy/ScreenEncoder.java b/server/src/main/java/com/genymobile/scrcpy/ScreenEncoder.java
index e95896d3..8b2e8707 100644
--- a/server/src/main/java/com/genymobile/scrcpy/ScreenEncoder.java
+++ b/server/src/main/java/com/genymobile/scrcpy/ScreenEncoder.java
@@ -104,6 +104,7 @@ public class ScreenEncoder implements Device.RotationListener {
codec.stop();
} catch (IllegalStateException | IllegalArgumentException e) {
Ln.e("Encoding error: " + e.getClass().getName() + ": " + e.getMessage());
+ Ln.i("downsizeOnError=" + downsizeOnError + "; firstFrameSent=" + firstFrameSent);
if (!downsizeOnError || firstFrameSent) {
// Fail immediately
throw e;
@@ -166,6 +167,8 @@ public class ScreenEncoder implements Device.RotationListener {
IO.writeFully(fd, codecBuffer);
if ((bufferInfo.flags & MediaCodec.BUFFER_FLAG_CODEC_CONFIG) == 0) {
// If this is not a config packet, then it contains a frame
+ if (!firstFrameSent)
+ Ln.i("FIRST FRAME SENT");
firstFrameSent = true;
}
} |
|
OK, thanks, that's what I thought. So the encoder is able to produce one frame, then it fails… :( Maybe I should revert 2eb6fe7. Does it work if you execute |
still same got error lol..
but it's freeze frame |
Does it work with screenrecord:
? EDIT: fixed. |
did i use the right command? |
Sorry, I forgot
|
is it right? or im too dumb on this command? ahhahaha then nothing happen anyway its pull the file, i can see file.mp4 on the folder |
And it is correct? You can play it? |
yes i can play it without problem |
What's its resolution? Any logs when you record with If you reduce the definition even more?
? For some reason, your device encoder fails with the parameters scrcpy uses for encoding. |
|
it's so sad on Redmi Note 10 Pro after update hahaha |
You can play with the encoder settings: see #2819 (comment) Maybe you'll find what parameter your device does not like. |
I have something similar when I try to mirror one of my Android devices: scrcpy 1.23 https://github.com/Genymobile/scrcpy |
same issue after update to android 12, any update? |
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' |
I am having the same issue on Redmi Note 10, MIUI 13 and Android 12... I just downloaded the Win64 "zip" version from release section, connected USB cable and opened "scrcpy-noconsole.vbs". It shows the screen for 1 second and as soon as I interact, it closes out. Checking the "scrcpy-console.bat" file gave me the exact same error as OP as well. Here's the screenshot: |
Probably a bug in their custom ROM (for Android 12). Scrcpy works fine with other Android 12 devices. |
me redmi note 10(mojit) xiaomi.eu miui13 also the same , cant use scrcpy anymore .. |
It seems a lot of people are having issues with the encoder lately and can't use scrcpy anymore. Hope the author finds a fix. |
I have currently no device with this ROM to reproduce, but I think the fix is to wait for Xiaomi to fix the bug in the latest version of their custom rom. :/ |
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! |
As I said in another comment, this is happening to me right now on my Xiaomi Mi A1 but not with MUI. I'm using LineageOS 18.1 (android 11) on this device. Before, on the same device, but with LineageOS 16.1 (android 9), it was working fine. I don't know if, and how, this information would help tho |
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 :
Gave me this :
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. |
still same problem but on android 12 based miui 13 redmi note 10 pro. Microsoft Windows [Version 10.0.19044.1586] C:\WINDOWS\system32>scrcpy --encoder OMX.qcom.video.encoder.avc C:\WINDOWS\system32> |
In 13.0.13 works perfectly again :D At last! |
Indeed! Xiaomi.eu 13.0.12 for What 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? |
How to push update on Global rom 13.0.9 to update 13.0.12 |
HI. Sorry, I know this issue is already closed but does anyone have a workaround for this? Because I have Redmi Note 10 Pro Max (India) and the latest MIUI here is the 13.0.5. And it's been a while since we received an update from Xiaomi. When I run scrcpy the phone's screen pops up and then closes in just some milliseconds, just the first frame is rendered I think, and then I get this encoding error. |
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 |
Well, I have downloaded Xiaomi.eu MIUI 13.0.12 and when I try to install it using TWRP I'm getting this error: E3004: This package is for "sweet" devices; this is a "sweetin". And I can't flash it. Maybe the solution will be using some custom ROM or finding some way to bypass the device check before flash. |
Please share with me the link of xiaomi.eu MUI 13.0.12 that you have downloaded |
https://xiaomi.eu/community/threads/miui-13-stable-release.64441/ BTW: I have just installed custom ROM Pixel Experience 12 Plus. I'm still setting it up, so can't tell if it solves the problem just yet. Will edit after everything is ready and tested. EDIT: It works! Pro Max users (sweetin) for now the solution is to install a custom ROM. It just works flawlessly. |
You're cool |
you need to edit the please 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. |
One small note for Linux users, display doesn't open on Wayland (probably for security reasons). |
I have a Redmi note 10 pro that I wanted to use scrcpy on too. Is there some sort of xiaomi forum thing that we can go and spread awareness to this issue? |
Certainly, Xiaomi has a forum, but do not expect any visibility of this issue, these forums are usually answered only by Xiaomi users and not developers. |
But if you use miui 13 EU latest ROM, scrcpy works without any issues |
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! |
my last offered update for MIUI is 13.0.4 and scrcpy now works :) |
sure, the eu version works very well both usb and wireless connection
*alexf*
…On Mon, Aug 22, 2022 at 7:07 AM hwoarang5 ***@***.***> wrote:
yup updated and it works again, wish they enable option to cast netflix
and disney plus via scrcpy too
—
Reply to this email directly, view it on GitHub
<#3051 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AWQAWAED7LDTUVRV63W4L4TV2L4IPANCNFSM5PDZWLRA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
It works!! thanks! |
For Redmi Node 10 India, the new firmware MIUI Global 13.0.7.0 SKFINXM (released few days) solve the issue. |
The issue still there with XiaomiA1 lineageOS 18 (android 11) with latest scrcpy 2.2.1 I can see some people saying upgrade MIUI global but this is not the case for custom rom, and not solution of scrcpy |
I would like to second that! |
The bug is not in scrcpy, but in the custom ROM, and AFAIK there's nothing scrcpy can do to fix it. If someone finds a solution (for example with some specific parameters: #3051 (comment)) then propose it. The open/closed state of the issue is irrelevant anyway, if there's a solution it will be fixed. |
this worked for me wireless suggestion Note 13 android 15 HyperOs 2.0.4 |
Environment
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.
The text was updated successfully, but these errors were encountered: