Romain Vimont
9787fe5d26
Preserve original scroll values in mouse event
...
Clamp scroll values to [-1, 1] only for the SDK mouse.
HID mouse implementations perform their own clamping to [-127, 127] (in
hid_mouse.c).
PR #6172 <https://github.com/Genymobile/scrcpy/pull/6172 >
2025-06-20 18:30:50 +02:00
Romain Vimont
98d30288f7
Prepare the main looper earlier
...
The looper must be initialized before listing apps, to avoid the
following error:
> Can't create handler inside thread that has not called
> Looper.prepare()
Refs 283326b2f6
Fixes #6165 <https://github.com/Genymobile/scrcpy/issues/6165 >
2025-06-17 21:08:54 +02:00
Romain Vimont
d74cfd5711
Silence DiscouragedPrivateApi lint warning
2025-06-13 09:40:45 +02:00
Romain Vimont
cd3a5d50b6
Create ClipboardManager from the main thread
...
The ClipboardManager is instantiated by the first call to
ServiceManager.getClipboardManager().
Now that scrcpy uses android.content.ClipboardManager directly, it must
ensure that it is created on the main thread (or at least on a thread
with a Looper), to avoid the following error:
> Can't create handler inside thread that has not called
> Looper.prepare()
Refs 8a02e3c2f5
Fixes #6151 <https://github.com/Genymobile/scrcpy/issues/6151 >
2025-06-13 09:37:32 +02:00
Romain Vimont
772f42134a
Use Context.CLIPBOARD_SERVICE directly
...
The constant is defined in Context, not FakeContext.
2025-06-13 09:37:32 +02:00
berk ziya
38256d8ff9
Fix deprecated brew command
...
`brew cask` is an outdated command, replaced by `brew install --cask`.
Refs #5398 <https://github.com/Genymobile/scrcpy/pull/5398 >
PR #6149 <https://github.com/Genymobile/scrcpy/pull/6149 >
Signed-off-by: Romain Vimont <rom@rom1v.com>
2025-06-12 15:30:04 +02:00
Romain Vimont
4e1cf13a50
Run a main looper in the cleanup process
...
Since a main looper is explicitly run in the main process, the
initialization of workarounds no longer calls
Looper.prepareMainLooper(), leading to a crash:
java.lang.RuntimeException: Can't create handler inside thread
Thread[main,5,main] that has not called Looper.prepare()
As a result, --power-off-on-close was broken.
Refs 283326b2f6
Fixes #6146 <https://github.com/Genymobile/scrcpy/issues/6146 >
2025-06-12 09:10:11 +02:00
Romain Vimont
696402c68c
Update links to 3.3
2025-06-11 22:15:30 +02:00
Romain Vimont
dc169e425e
Bump version to 3.3
2025-06-11 19:39:48 +02:00
Romain Vimont
13fc75902a
Merge branch 'master' into release
2025-06-11 19:39:09 +02:00
Romain Vimont
454beaa757
Upgrade libusb (1.0.29)
2025-06-11 19:39:02 +02:00
Romain Vimont
1a9ffb3814
Upgrade SDL (2.32.8)
2025-06-11 19:38:29 +02:00
Romain Vimont
ac16be54c8
Upgrade platform-tools (36.0.0)
2025-06-11 19:36:22 +02:00
Romain Vimont
8a02e3c2f5
Simplify ClipboardManager wrapper
...
Use the public ClipboardManager API, with the FakeContext as context.
This requires a running main looper, otherwise clipboard changes are not
processed.
Refs #6009 <https://github.com/Genymobile/scrcpy/pull/6009 >
PR #6129 <https://github.com/Genymobile/scrcpy/pull/6129 >
Suggested by: Simon Chan <1330321+yume-chan@users.noreply.github.com>
2025-06-11 17:47:37 +02:00
Romain Vimont
283326b2f6
Run a main looper
...
Instead of blocking the main thread until completion, run a looper.
This will allow the main thread to process any event posted to the main
looper.
Refs #6009 comment <https://github.com/Genymobile/scrcpy/pull/6009#issuecomment-2940810736 >
PR #6129 <https://github.com/Genymobile/scrcpy/pull/6129 >
2025-06-11 17:47:07 +02:00
Simon Chan
ca4f50c5ef
Associate UHID devices to virtual displays
...
This allows the mouse pointer to appear on the correct display (only for
devices running Android 15+).
Fixes #5547 <https://github.com/Genymobile/scrcpy/issues/5547 >
PR #6009 <https://github.com/Genymobile/scrcpy/pull/6009 >
Signed-off-by: Romain Vimont <rom@rom1v.com>
2025-06-05 20:34:11 +02:00
Romain Vimont
7a3fe830d4
Synchronize access to DisplayManager
...
The DisplayManager and its method getDisplayInfo() may be used from both
the Controller thread and the video (main) thread.
PR #6009 <https://github.com/Genymobile/scrcpy/pull/6009 >
2025-06-05 20:34:11 +02:00
Romain Vimont
ee414231ed
Cache getDisplayInfo method
...
Do not use reflection to retrieve the method for every call.
PR #6009 <https://github.com/Genymobile/scrcpy/pull/6009 >
2025-06-05 20:34:11 +02:00
Simon Chan
41ed40f5f9
Simplify InputManager wrapper
...
Use the public InputManager API.
PR #6009 <https://github.com/Genymobile/scrcpy/pull/6009 >
Signed-off-by: Romain Vimont <rom@rom1v.com>
2025-06-05 20:34:11 +02:00
Colin Kinloch
d2cc930975
Add app name SDL hint
...
This allows pulseaudio to label the audio stream "scrcpy" rather than
"SDL Application".
PR #6107 <https://github.com/Genymobile/scrcpy/pull/6107 >
Signed-off-by: Romain Vimont <rom@rom1v.com>
2025-06-05 19:59:59 +02:00
Romain Vimont
52f5d08d1f
Avoid calling wait(0)
...
Calling wait(0) results in waiting without a timeout, which is
unintended.
Refs #6009 comment <https://github.com/Genymobile/scrcpy/pull/6009#issuecomment-2935930294 >
2025-06-03 21:15:11 +02:00
Romain Vimont
70bfa2cf39
Remove useless flag in zsh completion script
...
The -N flag is only useful after a pattern section (-p) to switch back
to listing command names.
Refs <https://zsh.sourceforge.io/Doc/Release/Completion-System.html >
2025-05-22 20:00:58 +02:00
hltdev8642
38f779d9d3
Escape parentheses in zsh completion script
...
PR #6079 <https://github.com/Genymobile/scrcpy/pull/6079 >
Co-authored-by: Romain Vimont <rom@rom1v.com>
Signed-off-by: Romain Vimont <rom@rom1v.com>
2025-05-22 20:00:53 +02:00
Romain Vimont
8cd63cb63e
Report specific error for INJECT_EVENT permission
...
Some devices require a specific option to be enabled in Developer
Options to avoid a permission issue when injecting input events.
When this error occurs, hide the stack trace and print a human-readable
message explaining how to fix the issue.
PR #6080 <https://github.com/Genymobile/scrcpy/pull/6080 >
2025-05-15 19:52:52 +02:00
Romain Vimont
cc309a2b34
Build static linux binary on Ubuntu 22.04
...
Ubuntu 20.04 is no longer available on GitHub Actions.
Refs <https://github.com/actions/runner-images/issues/11101 >
Refs #6050 <https://github.com/Genymobile/scrcpy/pull/6050 >
This reverts commit 69858c6f43
.
2025-05-02 11:39:47 +02:00
Romain Vimont
91a4a74641
Move regex pattern initialization
...
If text == null, then the Pattern is not used.
2025-04-25 10:24:07 +02:00
Romain Vimont
48f38c4bb6
Fix default locked capture orientation
...
The default landscape locked orientation was reversed.
Fixes #6010 <https://github.com/Genymobile/scrcpy/issues/6010 >
2025-04-24 16:12:28 +02:00
Romain Vimont
6875e9aa88
Revert "Fix AudioRecord package name for Android 16"
...
This reverts commit c27d116a66
.
This commit breaks audio on Android 16 beta 4.
Refs #5960 comment <https://github.com/Genymobile/scrcpy/issues/5960#issuecomment-2816608015 >
Fixes #6021 <https://github.com/Genymobile/scrcpy/issues/6021 >
2025-04-24 16:05:13 +02:00
Nicholas Wilson
c5ed2cfc28
Replace "licence" with "license" in README
...
Although "licence" is correct in British English, the rest of the
statement uses "license," so change it for consistency.
PR #6017 <https://github.com/Genymobile/scrcpy/pull/6017 >
Signed-off-by: Romain Vimont <rom@rom1v.com>
2025-04-19 10:30:29 +02:00
Romain Vimont
1a0d300786
Add missing --screen-off-timeout doc in manpage
...
Refs eff5b4b219
2025-04-14 18:07:37 +02:00
Romain Vimont
d2447b5c19
Fix --screen-off-timeout bash completion
...
Only the option must be auto-completed, not its value.
2025-04-14 18:05:08 +02:00
Romain Vimont
5900e9e39c
Remove irrelevant link in FAQ
2025-04-07 10:30:56 +02:00
Romain Vimont
882003f314
Fix segfault on SDL event without window
...
Since #5804 , controls have been enabled even with --no-window. As a
result, the Android clipboard is synchronized with the computer, causing
SDL to trigger an SDL_CLIPBOARDUPDATE event.
This event is ignored by scrcpy, but it was still transmitted to the
sc_screen instance, even if it had not been initialized.
Fix the issue by calling sc_screen_handle_event() only when a screen
instance exists.
Refs #5804 <https://github.com/Genymobile/scrcpy/pull/5804 >
Fixes #5970 <https://github.com/Genymobile/scrcpy/issues/5970 >
2025-04-03 08:15:55 +02:00
Romain Vimont
db9dc6ae83
Make the snap version as obsolete
...
The version of scrcpy packaged in snap is currently 1.25.
Refs <https://snapcraft.io/scrcpy >
2025-04-01 11:04:34 +02:00
Romain Vimont
e0f37f834b
Update links to 3.2
2025-03-29 16:15:14 +01:00
Romain Vimont
89b624770c
Bump version to 3.2
2025-03-29 15:45:28 +01:00
Romain Vimont
79227af89f
Merge branch 'master' into release
2025-03-29 15:44:29 +01:00
Romain Vimont
5d12d9071d
Upgrade FFmpeg (7.1.1)
2025-03-29 15:34:48 +01:00
Romain Vimont
b7add42154
Upgrade SDL (2.32.2)
...
Also apply this additional patch to fix the build:
<6be87ceb33
>
2025-03-29 15:34:20 +01:00
Romain Vimont
dd1bfae4e0
Upgrade libusb (1.0.28)
2025-03-29 15:02:38 +01:00
Romain Vimont
bef2d8473b
Add more audio sources
...
Expose more audio sources from MediaRecorder.AudioSource.
Refs <https://developer.android.com/reference/android/media/MediaRecorder.AudioSource >
Fixes #5412 <https://github.com/Genymobile/scrcpy/issues/5412 >
Fixes #5670 <https://github.com/Genymobile/scrcpy/issues/5670 >
PR #5870 <https://github.com/Genymobile/scrcpy/pull/5870 >
2025-03-29 14:54:35 +01:00
Romain Vimont
609719bde0
Refactor audio sources
...
Store the target audio source integer (one of the constants from
android.media.MediaRecorder.AudioSource) in the AudioSource enum (or -1
if not relevant).
This will simplify adding new audio sources.
PR #5870 <https://github.com/Genymobile/scrcpy/pull/5870 >
2025-03-29 14:54:35 +01:00
Romain Vimont
3a0703f428
Handle audio stream discontinuities
...
The audio regulator assumed a continuous audio stream. But some audio
sources (like the "voice call" audio source) do not produce any packets
on silence, breaking this assumption.
Use PTS to detect such discontinuities.
PR #5870 <https://github.com/Genymobile/scrcpy/pull/5870 >
2025-03-29 14:54:35 +01:00
Romain Vimont
245981281e
Fix PTS produced by the default opus/flac encoders
...
The default OPUS and FLAC encoders on Android rewrite the input PTS so
that they exactly match the number of samples.
As a consequence:
- audio clock drift is not compensated
- implicit silences (without packets) are ignored
To work around this behavior, generate new PTS based on the current time
(after encoding) and the packet duration.
PR #5870 <https://github.com/Genymobile/scrcpy/pull/5870 >
2025-03-29 14:45:05 +01:00
Romain Vimont
1d25338119
Report underflow samples in verbose mode
...
Report the number of silence samples inserted due to underflow every
second, along with the other metrics.
PR #5870 <https://github.com/Genymobile/scrcpy/pull/5870 >
2025-03-29 14:40:52 +01:00
Romain Vimont
457c7fe5cf
Disable audio regulator underflow logs
...
Only enable them if SC_AUDIO_REGULATOR_DEBUG is set, as they may spam
the output.
PR #5870 <https://github.com/Genymobile/scrcpy/pull/5870 >
2025-03-29 14:39:43 +01:00
Romain Vimont
7998811fa5
Mention that no Android app is required
2025-03-09 21:16:17 +01:00
Romain Vimont
7044122fc5
Simplify wording in README
2025-03-09 21:10:21 +01:00
Romain Vimont
c63d9e1803
Work around broken display listener on Android 15
...
A recent Android 15 upgrade broke the display listener (again). Use the
alternative method for Android >= 14.
Fixes #5908 <https://github.com/Genymobile/scrcpy/issues/5908 >
2025-03-07 18:40:28 +01:00
Romain Vimont
d892a9aac5
Disable checkstyle line length warning
...
Checkstyle reports a warning because the line containing a long URL is
more than 150 characters. But we can't split the URL, so disable the
warning.
2025-02-22 12:22:45 +01:00