-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
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
How to open only the mouse control thread? #5542
Comments
When video playback is turned off, the default mouse mode has changed from "uhid" to "disabled" in 2c25fd7. Update the documentation accordingly. Refs Genymobile#5410 <Genymobile#5410> Refs Genymobile#5542 <Genymobile#5542>
You can control it using the -M parameter with the app tool you provided. How can I control it in my own developed tool, for example, by using the following adb command-line parameters: adb CLASSPATH=/data/local/tmp/scrcpy-server.jar app_process / com.genymobile.scrcpy.Server 3.0 log_level=debug video_bit_rate=8000000 tunnel_forward=false control=True audio=False video=False display_id=0 show_touches=False stay_awake=False power_off_on_close=false downsize_on_error=true cleanup=true max_size=1080 |
You would need to mimic the protocol between the client and the server: https://github.com/Genymobile/scrcpy/blob/master/doc/develop.md#protocol |
I have completed everything related to the protocol, and everything is working fine. What I am referring to is that scrcpy-server does not provide a usable parameter to configure the mouse mode as uhid, is that correct? |
Correct, this is a client configuration. UHID events are generated by the client (so that the HID code is shared between AOA and UHID, where AOA does not use a server, but sends the events directly over USB). |
When I was using scrcpy-server version 2.7, I could enable the mouse thread separately. Why is it no longer possible in version 3.0? Has scrcpy-server in version 3.0 disabled this feature? I only enabled the mouse thread and then used the Socket protocol you provided to control mouse clicks. In version 3.0, after sending the mouse click Socket data packet, an exception is thrown saying: 'The mouse Socket has been disconnected. |
Can you fix this issue? Otherwise, I will have to revert to scrcpy-server version 2.7, as version 2.7 allows me to enable only the mouse control thread. |
What do you mean?
I don't remember changing anything related to that. Check the git log between 2.7 and 3.0. |
I developed my program using only your scrcpy-server file and using the socket protocol for controlled communication. In version 2.7 of scrcpy-server, I can only open the mouse control thread, but in the latest release version 3.0, after sending the click packet, an exception will be thrown, that is, the host you call closed the connection。 This means that the 3.0 version of scrcpy-server must have changed something, so that I can not only open the mouse thread. In addition, starting both video and mouse threads at the same time is normal in version 3.0. |
Use |
When I close the video and audio socket, after connecting to the scrcpy-server, it returns an info message: 'No video mirroring, SDK mouse disabled.' Is it because of this error message that prevents the use of the mouse socket for communication?I need this SDK mouse works! |
This is a client side message (see my previous comment: #5542 (comment)). If you use scrcpy-server directly, this code is not called. |
Oh, alright. This is indeed the result from using your client sample. But I still haven't found where the bug is.Sorry to bother you. |
Did you |
Sorry, I'm not very good at using this. |
The information about this exception, is it helpful to you? When I sent the mouse move information, scrcpy-server threw this exception: {[server] INFO: Device: [Xiaomi] Redmi 23013RK75C (Android 14) |
I use scrcpy-server only and communicate by socket connection. v2.7 works fine, but v3.0 doesn't. This is the first time I try
I then tested against commit Note that in v3.0 scrcpy just quits, which is different from commit |
Please test branch |
I've tested branch |
Please also test this new branch: |
Branch |
Merged into |
This version 3.0.2 still has some bugs. When only using scrcpy-server and enabling the mouse thread, the 'maxsize=xxxx' parameter does not work, and the mouse operation position is still relative to the original size. This bug did not exist in version 2.7, but it appears in version 3.0.2 |
OS: Windows 11
Scrcpy version: 3.0
Installation method: Windows release
I am a developer, and I am using scrcpy to develop a keypress automation tool for controlling Android phones. It is a program that controls an Android phone by configuring 'click location information' on the computer. In version 2.7, I could keep only the mouse thread active while disabling both video and audio to save resources. However, I have found that in version 3.0, it is not possible to enable only the mouse thread. How should I proceed?
The text was updated successfully, but these errors were encountered: