Closed rom1v closed 6 days ago
-KM --no-video --no-audio -d scrcpy 2.4 https://github.com/Genymobile/scrcpy INFO: ADB device found: INFO: --> (usb) JZU4CURGLJA6P74H device Realme_Pad_LTE INFO: (tcpip) 192.168.1.204:5555 device AFTSSS C:\scrcpy\scrcpy-server: 1 file pushed, 0 skipped. 23.1 MB/s (69243 bytes in 0.003s) [server] INFO: Device: [Realme] Realme Realme Pad LTE (Android 13) INFO: Renderer: directed
Hey, so this is what I got when using the command you mentioned on Reddit. It seems the command works, and there's a window with an Android logo (same as OTG mode), but it quickly disappears and exits the command.
Also I'm not sure if this is possible yet via the --no-window or --no-video option, but just wanted to add this feature request from my Reddit comment:
A windowless approach to OTG mode (meaning it wouldn't be a window, it could exist in the system tray maybe), where a user-defined hotkey can be used to toggle between the host screen and the android device. This would make it very similar to deskdock.
I believe the rest of the things work already: ADB wifi works, UHID keyboards have gestures and hotkeys (unlike OTG mode).
Thanks.
Thank you for your report.
but it quickly disappears and exits the command.
Without any error message?
I cannot reproduce the problem. Maybe because the binary was from an old version of this PR. Please test this new one:
scrcpy-pr4868.2.zip
SHA-256: 2d0827e876485d5afb5476577953efc2d3df7fb81ee6e30092f5d94b41b125c
Also, do you have the same issue with another device?
A windowless approach to OTG mode (meaning it wouldn't be a window, it could exist in the system tray maybe), where a user-defined hotkey can be used to toggle between the host screen and the android device. This would make it very similar to deskdock.
Technically, scrcpy receives events from the scrcpy window. If there is no window, I don't think it is possible to receive the events with SDL. It would only be possible by platform-specific means I guess.
I cannot reproduce the problem.
OK, on Windows, I can reproduce. I will investigate.
OK, with these two changes it should be fixed:
Please test this new binary:
scrcpy-pr4868.3.zip
SHA-256: 1c1dea45e87ea101c29a314dd4e4994b12ce33aecbb95317bbfcd4ff642d365
Thank you! It's working now. And yes I'm on Windows 10.
Just wanted to clarify a few things:
So the scrcpy -KM --no-video --no-audio
command basically is like OTG mode, but with the UHID keyboard/mouse.
The --no-window
option removes the scrcpy window, so it is only used for audio playback. Nothing else seems to work.
But as you mentioned, the control events are not possible without a window? So --no-window can't be combined with -KM it seems.
Anyway thank you, I will check if I can assign a hotkey with AHK or EventGhost and make this suit my workflow a bit more.
So the scrcpy -KM --no-video --no-audio command basically is like OTG mode, but with the UHID keyboard/mouse.
The main purpose of OTG mode is to work without adb (USB debugging), not to only control the device.
With this PR, if you want to only control the device and have USB debugging enabled, you can.
OTG uses AOA, so the most similar command would be:
scrcpy --keyboard=aoa --mouse=aoa --no-video --no-audio
But it is better to use UHID:
scrcpy --keyboard=uhid --mouse=uhid --no-video --no-audio
scrcpy -KM --no-video --no-audio
The
--no-window
option removes the scrcpy window, so it is only used for audio playback.
In the current stable version, several features do not open a window at all: audio-playback only, recording, v4L2.
With this PR, these features now open a window, but there's a new option --no-window
to restore the previous behavior. No window implies no control.
The options --window-height
doesn't seem to work with this option, at least not with -KM --no-video --no-audio
. My use case involves moving scrcpy's window off screen with just 1px shown. This creates an indicator where my phone is physically located next to the my monitor. 🙂
It works if I start with --keyboard aoa --mouse aoa --no-video --no-audio --otg --window-height=600
. For me on Linux, this gives almost the same end result, except --legacy-paste
only works when running with -KM --no-video --no-audio
. Copy paste doesn't work without --legacy-paste
on my setup. My phone is a Samsung Galaxy S23 / Android 14 (non-rooted).
there's a new option --no-window to restore the previous behavior. No window implies no control.
Is there a reason why this mode has to imply --no-control
? If it didn't, it would be possible to run scrcpy
from a keyboard shortcut to control the Android device and then kill the process using an OS shortcut. :grimacing: (although it might be that scrcpy
would not then grab the keyboard and mouse, defeating the intended use)
The options
--window-height
doesn't seem to work with this option
Thank you for the report. Fixed:
scrcpy-pr4868.4.zip
SHA-256: b769c9bc403d91d78fae3efa87856dbe2af5905c8d3a33392beaf5fa7103c30
except
--legacy-paste
only works when running with …
Yes, legacy paste processing is performed on the server side, and there is no server in OTG mode.
(although it might be that scrcpy would not then grab the keyboard and mouse, defeating the intended use)
That's it.
@rom1v Confirm, fixed. Thank you!
I fixed some bugs and merged into dev
.
Add the possibility to solely control the device without screen mirroring:
This is different from OTG mode, which does not require USB debugging at all. Here, it is just the standard mode but with the possibility to disable video playback.
By default, always open a window (even without video playback), and add an option
--no-window
.This impacts the behavior of some usages.
For example, the following command used to only play audio without video or controls:
Now, it opens a window, and allows to control it using the keyboard and mouse (by default, mouse mode is switched to UHID if video mirroring is disabled, because a relative mouse mode is required).
The controls must be disabled explicitly if necessary to play audio only:
To get the same behavior as before (play audio without window), disable the window:
(this implicitly set
--no-control
and--no-video-playback
, which in turn set--no-video
if there is no recording or V4L2 sink)Fixes #4727 Fixes #4793
Here is a binary for Windows:
scrcpy-pr4868.4.zip
SHA-256: b769c9bc403d91d78fae3efa87856dbe2af5905c8d3a33392beaf5fa7103c30
old
- [`scrcpy-pr4868.zip`](https://tmp.rom1v.com/scrcpy/4868/1/scrcpy-pr4868.zip) `SHA-256: cf100b210e75c19d58f50b3c704d193a6ddbd45520928b7f83acc40a8246815`