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

[server] ERROR: Encoding error: java.lang.IllegalStateException: null WARN: Device disconnected #3051

Closed
2 tasks done
Crusnik05 opened this issue Feb 23, 2022 · 143 comments
Closed
2 tasks done

Comments

@Crusnik05
Copy link

Crusnik05 commented Feb 23, 2022

  • I have read the FAQ.
  • I have searched in existing issues.

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.

@rom1v
Copy link
Collaborator

rom1v commented Feb 23, 2022

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:

  • scrcpy-server sha256:479228ed980190367875078a9979426f6e9067d8a395d4250dcf0be2469a76c6
diff
diff --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;
                     }
                 }

@Crusnik05
Copy link
Author

Crusnik05 commented Feb 23, 2022

C:\Users\Admin\Downloads\scrcpy-win32-v1.23\scrc...ed, 0 skipped. 36.4 MB/s (61061 bytes in 0.002s)
[server] INFO: Device: Xiaomi M2101K6G (Android 12)
INFO: Renderer: direct3d
[server] INFO: FIRST FRAME SENT
INFO: Initial texture: 1080x2400
[server] ERROR: Encoding error: java.lang.IllegalStateException: null
[server] INFO: downsizeOnError=true; firstFrameSent=true
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:153)
        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)
WARN: Killing the server...


@rom1v
Copy link
Collaborator

rom1v commented Feb 23, 2022

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 scrcpy -m1024?

@Crusnik05
Copy link
Author

Crusnik05 commented Feb 23, 2022

C:\Users\Admin\Downloads\scrcpy-win32-v1.23>scrcpy -d -m1024
scrcpy 1.23 <https://github.com/Genymobile/scrcpy>
C:\Users\Admin\Downloads\scrcpy-win32-v1.23\scrc...ed, 0 skipped. 25.3 MB/s (61061 bytes in 0.002s)
[server] INFO: Device: Xiaomi M2101K6G (Android 12)
[server] INFO: FIRST FRAME SENT
INFO: Renderer: direct3d
INFO: Initial texture: 464x1024
[server] ERROR: Encoding error: java.lang.IllegalStateException: null
[server] INFO: downsizeOnError=true; firstFrameSent=true
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:153)
        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)``

still same got error lol..
i tried to change encoder to

    --encoder 'c2.android.avc.encoder'
    --encoder 'OMX.google.h264.encoder' 

but it's freeze frame

@rom1v
Copy link
Collaborator

rom1v commented Feb 23, 2022

Does it work with screenrecord:

adb shell screenrecord /sdcard/file.mp4
adb pull /sdcard/file.mp4

?

EDIT: fixed.

@Crusnik05
Copy link
Author

C:\Users\Admin\Downloads\scrcpy-win32-v1.23>scrcpy --record file.mp4 -d
scrcpy 1.23 <https://github.com/Genymobile/scrcpy>
C:\Users\Admin\Downloads\scrcpy-win32-v1.23\scrc...ed, 0 skipped. 25.1 MB/s (61061 bytes in 0.002s)
[server] INFO: Device: Xiaomi M2101K6G (Android 12)
INFO: Renderer: direct3d
INFO: Initial texture: 1080x2400
[server] INFO: FIRST FRAME SENT
INFO: Recording started to mp4 file: file.mp4
[server] ERROR: Encoding error: java.lang.IllegalStateException: null
[server] INFO: downsizeOnError=true; firstFrameSent=true
[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:153)
        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)
INFO: Recording complete to mp4 file: file.mp4
WARN: Device disconnected

C:\Users\Admin\Downloads\scrcpy-win32-v1.23>

did i use the right command?
--record file.mp4

@rom1v
Copy link
Collaborator

rom1v commented Feb 23, 2022

Sorry, I forgot adb shell:

adb shell screenrecord /sdcard/file.mp4
adb pull /sdcard/file.mp4

@Crusnik05
Copy link
Author

Crusnik05 commented Feb 23, 2022

Microsoft Windows [Version 10.0.22000.493]
(c) Microsoft Corporation. All rights reserved.

C:\Users\Admin\Downloads\scrcpy-win32-v1.23>adb pull /sdcard/file.mp4
adb server version (39) doesn't match this client (41); killing...
* daemon started successfully
/sdcard/file.mp4: 1 file pulled, 0 skipped. 19.7 MB/s (1229492 bytes in 0.060s)

C:\Users\Admin\Downloads\scrcpy-win32-v1.23>adb shell screenrecord /sdcard/file.mp4
adb pull /sdcard/file.mp4

is it right? or im too dumb on this command? ahhahaha
i put the adb shell screenrecord /sdcard/file.mp4 1st

then nothing happen
and i put adb pull /sdcard/file.mp4 on next

anyway its pull the file, i can see file.mp4 on the folder

@rom1v
Copy link
Collaborator

rom1v commented Feb 23, 2022

anyway its pull the file, i can see file.mp4 on the folder

And it is correct? You can play it?

@Crusnik05
Copy link
Author

yes i can play it without problem

@rom1v
Copy link
Collaborator

rom1v commented Feb 23, 2022

What's its resolution? Any logs when you record with screenrecord in your console?

If you reduce the definition even more?

scrcpy -m400

?

For some reason, your device encoder fails with the parameters scrcpy uses for encoding.

@Crusnik05
Copy link
Author

C:\Users\Admin\Downloads\scrcpy-win32-v1.23>scrcpy -m400
scrcpy 1.23 <https://github.com/Genymobile/scrcpy>
* daemon not running; starting now at tcp:5037
* daemon started successfully
C:\Users\Admin\Downloads\scrcpy-win32-v1.23\scrc...hed, 0 skipped. 2.5 MB/s (61061 bytes in 0.023s)
[server] INFO: Device: Xiaomi M2101K6G (Android 12)
[server] INFO: FIRST FRAME SENT
INFO: Renderer: direct3d
[server] ERROR: Encoding error: java.lang.IllegalStateException: null
[server] INFO: downsizeOnError=true; firstFrameSent=true
[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:153)
        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)
INFO: Initial texture: 184x400
WARN: Device disconnected

C:\Users\Admin\Downloads\scrcpy-win32-v1.23>adb shell screenrecord /sdcard/file.mp4

C:\Users\Admin\Downloads\scrcpy-win32-v1.23>adb pull /sdcard/file.mp4
/sdcard/file.mp4: 1 file pulled, 0 skipped. 29.2 MB/s (206850495 bytes in 6.759s)

C:\Users\Admin\Downloads\scrcpy-win32-v1.23>

@Crusnik05
Copy link
Author

it's so sad on Redmi Note 10 Pro after update hahaha

@rom1v
Copy link
Collaborator

rom1v commented Feb 23, 2022

You can play with the encoder settings: see #2819 (comment)

Maybe you'll find what parameter your device does not like.

@jtrogdon-pre
Copy link

I have something similar when I try to mirror one of my Android devices:

scrcpy 1.23 https://github.com/Genymobile/scrcpy
C:\scrcpy\scrcpy-server: 1 file pushed, 0 skipped. 29.7 MB/s (41123 bytes in 0.001s)
adb.exe: error: more than one device and emulator
ERROR: "adb reverse" returned with value 1
WARN: 'adb reverse' failed, fallback to 'adb forward'
[server] INFO: Device: amltd TETON_P8303 (Android 5.0.2)
INFO: Renderer: direct3d
INFO: Initial texture: 800x480
[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(MediaCodec.java:1033)
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(RuntimeInit.java:249)

@Hosam11
Copy link

Hosam11 commented Mar 1, 2022

same issue after update to android 12, any update?

@XLave
Copy link

XLave commented Mar 2, 2022

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.

@Solat-Ali
Copy link

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:

image

@rom1v
Copy link
Collaborator

rom1v commented Mar 2, 2022

Probably a bug in their custom ROM (for Android 12). Scrcpy works fine with other Android 12 devices.

@Apihplays
Copy link

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:

image

me redmi note 10(mojit) xiaomi.eu miui13 also the same , cant use scrcpy anymore ..

@XLave
Copy link

XLave commented Mar 5, 2022

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.

@rom1v rom1v mentioned this issue Mar 8, 2022
@rom1v
Copy link
Collaborator

rom1v commented Mar 9, 2022

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. :/

@rom1v rom1v mentioned this issue Mar 9, 2022
@vielavlrs
Copy link

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!

@kurinoko
Copy link

kurinoko commented Mar 10, 2022

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. :/

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

@kurinoko
Copy link

kurinoko commented Mar 15, 2022

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. :/

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 :

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.

@fulanda-prog
Copy link

still same problem but on android 12 based miui 13 redmi note 10 pro.

Microsoft Windows [Version 10.0.19044.1586]
(c) Microsoft Corporation. All rights reserved.

C:\WINDOWS\system32>scrcpy --encoder OMX.qcom.video.encoder.avc
scrcpy 1.22 https://github.com/Genymobile/scrcpy
D:\scrcpy-win64-v1.22\scrcpy-server: 1 file pushed, 0 skipped. 10.7 MB/s (40955 bytes in 0.004s)
[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(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)

C:\WINDOWS\system32>

@XLave
Copy link

XLave commented Aug 22, 2022

In 13.0.13 works perfectly again :D At last!

@icy-comet
Copy link

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.

Indeed! Xiaomi.eu 13.0.12 for sweet and sweetin devices fixes the bug as well. @dmytromarchuk

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?

@rom1v rom1v closed this as completed Aug 22, 2022
@daydy225
Copy link

How to push update on Global rom 13.0.9 to update 13.0.12

@iMaiconP
Copy link

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.

@icy-comet
Copy link

How to push update on Global rom 13.0.9 to update 13.0.12

does anyone have a workaround for this? ... it's been a while since we received an update from Xiaomi.

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 for sweet 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

@iMaiconP
Copy link

How to push update on Global rom 13.0.9 to update 13.0.12

does anyone have a workaround for this? ... it's been a while since we received an update from Xiaomi.

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 for sweet 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

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.

@daydy225
Copy link

Please share with me the link of xiaomi.eu MUI 13.0.12 that you have downloaded

@iMaiconP
Copy link

iMaiconP commented Aug 25, 2022

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.
This is the only way of getting it to work again, untill Xiaomi releases a new update for sweetin.

@daydy225
Copy link

You're cool

@icy-comet
Copy link

icy-comet commented Aug 25, 2022

E3004: This package is for "sweet" devices; this is a "sweetin".

you need to edit the updater-script inside the zip package. instructions can be found on the internet. @iMaiconP

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.

@alex-theoto
Copy link

One small note for Linux users, display doesn't open on Wayland (probably for security reasons).
Use Xorg...

@rom1v
Copy link
Collaborator

rom1v commented Sep 6, 2022

@NyllRE
Copy link

NyllRE commented Sep 14, 2022

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?

@xpeqex
Copy link

xpeqex commented Sep 14, 2022

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.

@fulanda-prog
Copy link

But if you use miui 13 EU latest ROM, scrcpy works without any issues

@daydy225
Copy link

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!

@carlosm2
Copy link

carlosm2 commented Oct 6, 2022

manoaratefy

Unfortunately RN10 Pro Max India has not receive the update the lastest update is 13.0.5.0 :/

my last offered update for MIUI is 13.0.4 and scrcpy now works :)

@fulanda-prog
Copy link

fulanda-prog commented Oct 11, 2022 via email

@Thiasap
Copy link

Thiasap commented Oct 18, 2022

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.

It works!! thanks!
redmi note 8 pro; Android 12; PE 12.1 plus

@manoaratefy
Copy link

For Redmi Node 10 India, the new firmware MIUI Global 13.0.7.0 SKFINXM (released few days) solve the issue.

@Jackychans
Copy link

Jackychans commented Aug 23, 2023

The issue still there with XiaomiA1 lineageOS 18 (android 11) with latest scrcpy 2.2.1
I can't understand why this been closed why the issue still around.

I can see some people saying upgrade MIUI global but this is not the case for custom rom, and not solution of scrcpy

@helamonster
Copy link

The issue still there with XiaomiA1 lineageOS 18 (android 11) with latest scrcpy 2.2.1 I can't understand why this been closed why the issue still around.

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!

@rom1v
Copy link
Collaborator

rom1v commented Sep 27, 2024

I can't understand why this been closed why the issue still around.

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.

@officialismailshah
Copy link

yes, 13.0.4.0 on RN 10Pro seems to carry the day with this issue AND NO OTHER SCREEN MIRRORING APP SEEMS TO WORK, VIA USB OR WIRELESS.

this worked for me wireless suggestion Note 13 android 15 HyperOs 2.0.4

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