Genymobile / scrcpy

Display and control your Android device
Apache License 2.0
110.65k stars 10.61k forks source link

Through scrcpy my mouse and keyboard input lags #2655

Open spellsleeper opened 3 years ago

spellsleeper commented 3 years ago

Environment

Describe the bug Most of the time when I use scrcpy my input is delayed (on the whole PC not only on the mobile device). Sometimes it is also necessary to change the USB port of the keyboard because it does not respond at all.

Unfortunately I do not get any errors

yudenzel commented 2 years ago

having the same issue on my Windows 64 bit.

When the issue occurs, most of time the mouse/keyboard can get freeze for a period sometimes. mouse will stop moving for a while then suddenly continue to move keyboard may keep input characters looks like the key is sticked.

if scrcpy closed, these issue disappeared.

and sometimes the mouse stop moving at all unless unplug and replug the usb cable.

rom1v commented 2 years ago

Run scrcpy -Vverbose and keep the terminal open. Are the logs delayed when you press a key, or only the actions on the device?

yudenzel commented 2 years ago

for my issue, it's not the action on device get delayed, it's the mouse and keyboard get frozen on the host.

I tried reduce the max fps to 15, looks like the symptom is gone.

GZKPT commented 2 years ago

Hi, I have the same problem. When Scrcpy is on screen every input on my keyboard can get stuck. For example if the mirroring window is open and i write something in a PC application the same letter gets repeated multiple times. Previously everything worked fine but even if i try an older versione of the application the issue still remains. Now i'm on version 1.24.

rom1v commented 2 years ago

Try with an older SDL2.dll (replace the one from an older version of scrcpy).

GZKPT commented 2 years ago

I tried SDL 2.0.16 (from Scrcpy 1.19) but still no luck.

Hemkinator commented 6 months ago

Apologies for necro-ing this issue, but I had been encountering this problem exactly as explained by the others in this thread after years of using scrcpy with no issues.

In my case, the cause of the lag was because my mouse, keyboard, and phone were connected to a USB hub that was connected to my computer instead of being plugged in directly. Plugging either my mouse & keyboard or my phone directly into a usb port on my computer eliminated the lag. I guess scrcpy + input devices result in too much data being sent through a single USB C port.