Genymobile / scrcpy

Display and control your Android device
Apache License 2.0
113.14k stars 10.8k forks source link

Scrcpy mouse input modes don't work in my specific case... #5386

Open Marietto2008 opened 1 month ago

Marietto2008 commented 1 month ago

Hello again.

I read that scrcpy has a few keyboard and mouse only modes. I've thought : maybe at least one of those modes works.

I've google a little bit and I found this thread :

https://android.stackexchange.com/questions/253317/how-to-connect-mouse-to-android-phone-via-adb

This is the post that caught my attention :

I figured a way out how to do it with :

https://github.com/Genymobile/scrcpy/blob/master/doc%2Fhid-otg.md#physical-mouse-simulation :

Get scrcpy from your package manager
Connect adb
scrcpy --hid-mouse or scrcpy -M for short

So,I've decided to try. First of all,this link :

https://github.com/Genymobile/scrcpy/blob/master/doc%2Fhid-otg.md#physical-mouse-simulation

is dead,but no problem,the working one is this :

https://github.com/Genymobile/scrcpy/blob/master/doc/mouse.md

I tried all the modes supported by scrcpy :

1) 

[root@marietto /bhyve]==> scrcpy --mouse=sdk --tcpip=192.168.1.7:5555

scrcpy 2.7 <https://github.com/Genymobile/scrcpy>
INFO: Connecting to 192.168.1.7:5555...
INFO: Connected to 192.168.1.7:5555
/usr/local/share/scrcpy/scrcpy-server: 1 file pushed, 0 skipped. 87.0 MB/s (71200 bytes in 0.001s)
[server] INFO: Device: [FreeBSD] Android-x86 BHYVE (Android 7.1.1)
[server] WARN: Audio disabled: it is not supported before Android 11
INFO: Renderer: opengl
INFO: OpenGL version: 4.6 (Compatibility Profile) Mesa 24.3.0-devel (git-c8c354d9c3a)
INFO: Trilinear filtering enabled
WARN: Demuxer 'audio': stream explicitly disabled by the device
INFO: Texture: 1440x896

No error here,but the mouse does not move inside the VM.

2)

[root@marietto /bhyve]==> scrcpy -M --tcpip=192.168.1.7:5555

scrcpy 2.7 <https://github.com/Genymobile/scrcpy>
INFO: Connecting to 192.168.1.7:5555...
INFO: Connected to 192.168.1.7:5555
/usr/local/share/scrcpy/scrcpy-server: 1 file pushed, 0 skipped. 87.3 MB/s (71200 bytes in 0.001s)
[server] INFO: Device: [FreeBSD] Android-x86 BHYVE (Android 7.1.1)
[server] WARN: Audio disabled: it is not supported before Android 11
[server] ERROR: Controller error
java.io.IOException: android.system.ErrnoException: open failed: EACCES (Permission denied)
    at com.genymobile.scrcpy.control.UhidManager.open(UhidManager.java:69)
    at com.genymobile.scrcpy.control.Controller.handleEvent(Controller.java:213)
    at com.genymobile.scrcpy.control.Controller.control(Controller.java:102)
    at com.genymobile.scrcpy.control.Controller.lambda$start$0$com-genymobile-scrcpy-control-Controller(Controller.java:110)
    at com.genymobile.scrcpy.control.Controller$$ExternalSyntheticLambda0.run(D8$$SyntheticClass:0)
    at java.lang.Thread.run(Thread.java:761)
Caused by: android.system.ErrnoException: open failed: EACCES (Permission denied)
    at libcore.io.Posix.open(Native Method)
    at libcore.io.BlockGuardOs.open(BlockGuardOs.java:187)
    at android.system.Os.open(Os.java:317)
    at com.genymobile.scrcpy.control.UhidManager.open(UhidManager.java:52)
    ... 5 more
INFO: Renderer: opengl
INFO: OpenGL version: 4.6 (Compatibility Profile) Mesa 24.3.0-devel (git-c8c354d9c3a)
INFO: Trilinear filtering enabled
WARN: Device disconnected
WARN: Demuxer 'audio': stream explicitly disabled by the device
WARN: Killing the server...

Any method to fix the Permission denied error ?

3) 

[root@marietto /bhyve]==> scrcpy --mouse=aoa --tcpip=192.168.1.7:5555

scrcpy 2.7 <https://github.com/Genymobile/scrcpy>
INFO: Connecting to 192.168.1.7:5555...
INFO: Connected to 192.168.1.7:5555
/usr/local/share/scrcpy/scrcpy-server: 1 file pushed, 0 skipped. 83.2 MB/s (71200 bytes in 0.001s)
[server] INFO: Device: [FreeBSD] Android-x86 BHYVE (Android 7.1.1)
[server] WARN: Audio disabled: it is not supported before Android 11
ERROR: Could not find USB device 192.168.1.7:5555
ERROR:         20130506005976F    (0480:a007)  TOSHIBA External USB 3.0
ERROR:         000000002961       (05e3:0764)  Generic USB Storage
ERROR:         BE0191500218       (4971:8034)  HGST G-DRIVE USB
ERROR:         2015020204055E     (0480:a207)  TOSHIBA External USB 3.0
ERROR:         NM13N4CZ           (0bc2:61b5)  Seagate M3 Portable
ERROR:         20D11E800818       (174c:225c)  ULT-Best Best USB Device
ERROR:         38434B4237354B45   (1058:25a3)  Western Digital Elements 25A3
ERROR:         575845583038524844323238 (1058:0704)  Western Digital  External HDD    
ERROR:         044726540147       (045e:02c4)  Microsoft Xbox NUI Sensor
WARN: Killing the server...
rom1v commented 1 month ago

Any method to fix the Permission denied error ?

Run a newer version of Android, 7.1.1 is too old for UHID with shell permissions.

Marietto2008 commented 1 month ago

I can't use another VM : this is a special version of Android...

By rooting the VM,I will fix the problem ? This version of Android has the gearlock recovery mode :

https://github.com/axonasif/gearlock

so,I suspect that I can root it...