scrcpy icon indicating copy to clipboard operation
scrcpy copied to clipboard

scrcpy not working in Huawei and Xiaomi devices

Open ned-lambdatest opened this issue 4 years ago • 7 comments

Environment

  • OS: Ubuntu

  • scrcpy version: 1.19

  • installation method: snap

  • device model: M2003J15SC

  • Android version: 10

  • Name: Redmi Note 9

  • device model: ELE_L29 -product:ELE-L29EEA

  • Android version: 10

  • Name: HUAWEI P30 Pro

Describe the bug We are trying to record the device screens but the scrcpy command is exiting with the below error

Xiaomi Output:

ltadmin@ul-sf10-1206-mobile-mgmt9:~$ scrcpy -s 0e16808b0501 -V debug -p 21300:22300
INFO: scrcpy 1.19 <https://github.com/Genymobile/scrcpy>
DEBUG: Using server: /usr/local/share/scrcpy/scrcpy-server
/usr/local/share/scrcpy/scrcpy-server: 1 file pushed. 1.9 MB/s (37330 bytes in 0.018s)
Segmentation fault (core dumped)
ltadmin@ul-sf10-1206-mobile-mgmt9:~$ [server] INFO: Device: Xiaomi M2003J15SC (Android 10)
[server] DEBUG: Using encoder: 'OMX.MTK.VIDEO.ENCODER.AVC'
Huawei Output:

ltadmin@ul-sf9-301-mobile-mgmt3:~$ scrcpy -s XPH0219417009946 -p 27100:27500 -m 1024 -b 2M --max-fps 10 --record file.mp4
INFO: scrcpy 1.19 <https://github.com/Genymobile/scrcpy>
/usr/local/share/scrcpy/scrcpy-server: 1 file pushed. 4.0 MB/s (37330 bytes in 0.009s)
Segmentation fault (core dumped)
ltadmin@ul-sf9-301-mobile-mgmt3:~$ [server] INFO: Device: HUAWEI ELE-L29 (Android 10)
[server] ERROR: Exception on thread Thread[main,5,main]
java.lang.AssertionError: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference
	at com.genymobile.scrcpy.wrappers.DisplayManager.getDisplayInfo(DisplayManager.java:30)
	at com.genymobile.scrcpy.Device.<init>(Device.java:60)
	at com.genymobile.scrcpy.Server.scrcpy(Server.java:24)
	at com.genymobile.scrcpy.Server.main(Server.java:255)
	at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
	at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:359)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference
	at com.genymobile.scrcpy.wrappers.DisplayManager.getDisplayInfo(DisplayManager.java:17)
	... 5 more

Xiaomi_logcat.txt

ned-lambdatest avatar Oct 29 '21 06:10 ned-lambdatest

Please try a non-snap version.

https://github.com/Genymobile/scrcpy/blob/master/BUILD.md#option-2-use-prebuilt-server

And enable ASAN:

meson x -Db_sanitize=address
ninja -Cx
./run x

rom1v avatar Oct 29 '21 07:10 rom1v

may be is mtk cpu can't support frame as encode size= phone size try to this: scrcpy -s 0e16808b0501 -V debug -p 21300:22300 -m 1920

heweisheng avatar Nov 15 '21 07:11 heweisheng

I was experiencing problems with Redmi Note 10 Pro with Debian 11, everything was working fine since an update at the beginning of the year. But 2 weeks ago I 've updated to MIUI 13.0.4 and scrcpy now works.

carlosm2 avatar Oct 06 '22 23:10 carlosm2

Encountered the same issue when using the latest version2.1 of scrcpy for a Huawei VOG-l29. The following worked for me.

Temporary Workaround 🩹

Downgrade scrcpy version to 1.21.0.

Windows 🪟

If you are using Chocolatey like I am, run the command below in command prompt with admin privileges:

choco install scrcpy --version=1.21.0 --force

Linux 🐧

If you are using apt-get like I am, run the command below in bash terminal:

sudo apt-get update
sudo apt-get install scrcpy=1.21.0

cardboardcode avatar Jan 21 '24 12:01 cardboardcode

@cardboardcode Please test scrcpy 2.3.1.

Does it work? If not, what is the output in the console?

rom1v avatar Jan 21 '24 13:01 rom1v

@cardboardcode Please test scrcpy 2.3.1.

Does it work? If not, what is the output in the console?

@rom1v Thank you for the prompt response.

Solution [For Huawei Only] ⭐

Tested with scrcpy 2.3.1. It is working successfully with Huawei VOG-L29. 🥳

Still not sure about the Xiaomi since I don't use Xiaomi devices.

cardboardcode avatar Jan 21 '24 13:01 cardboardcode

what do i do if i have 0 display on the mobile phone? Do i need to accept anything? Do i need to do anything? I just turned it on and windows detects but no response from scrcpy

error:

error: no devices/emulators found ERROR: "adb get-serialno" returned with value 1 ERROR: Could not get device serial ERROR: Server connection failed Press any key to continue . . .

Device : Huawei VOG-L29

Ronalds13424 avatar May 03 '24 16:05 Ronalds13424