Romain Vimont
ecde32dd01
Handle mouse integer scrolling locally
...
Do not rely on SDL to expose integer scroll values, as they are not
available in all versions.
It was reimplemented in SDL 3.2.12 by this commit:
<0447c2f3c3 >
Refs #6156 <https://github.com/Genymobile/scrcpy/issues/6156 >
2025-06-29 18:24:06 +02:00
Romain Vimont
5b18ce0d2e
Bump version to 3.3.1
2025-06-20 19:54:16 +02:00
Romain Vimont
4841fdd1ef
Add horizontal scrolling support for HID mouse
...
PR #6172 <https://github.com/Genymobile/scrcpy/pull/6172 >
2025-06-20 19:54:16 +02:00
Romain Vimont
fc75319bb2
Fix HID mouse support with SDL precise scrolling
...
Over HID, only integral scroll values can be sent. When SDL precise
scrolling is active, scroll events may include fractional values (e.g.,
0.05), which are truncated to 0 in the HID event.
To fix the problem, use the integral scroll value reported by SDL, which
internally accumulates fractional deltas.
Fixes #6156 <https://github.com/Genymobile/scrcpy/issues/6156 >
PR #6172 <https://github.com/Genymobile/scrcpy/pull/6172 >
2025-06-20 19:54:16 +02:00
Romain Vimont
7c8bdccbdc
Extend value range for SDK mouse scrolling
...
SDL precise scrolling can sometimes produce values greater than 1 or
less than -1.
On the wire, the value is encoded as a 16-bit fixed-point number.
Previously, the range was interpreted as [-1, 1], using 1 bit for the
integral part (the sign) and 15 bits for the fractional part.
To support larger values, interpret the range as [-16, 16] instead,
using 5 bits for the integral part and 11 bits for the fractional part
(which is more than enough).
PR #6172 <https://github.com/Genymobile/scrcpy/pull/6172 >
2025-06-20 19:54:16 +02:00
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
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
dc169e425e
Bump version to 3.3
2025-06-11 19:39:48 +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
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
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
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
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
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
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
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
chengjian.scj
fd8bef68b7
Add --display-ime-policy option
...
Add an option to select where the IME should be displayed.
Possible values are "local", "fallback" and "hide".
PR #5703 <https://github.com/Genymobile/scrcpy/pull/5703 >
Signed-off-by: Romain Vimont <rom@rom1v.com >
2025-02-22 11:05:22 +01:00
Sam Listopad II
986328ff9e
Allow controls with --no-window
...
Without a window, mouse and keyboard events may not be received, but
the control channel is still necessary for other features:
* --turn-screen-off
* --stay-awake
* --show-touches
* --power-off-on-close
* --start-app
Fixes #5803 <https://github.com/Genymobile/scrcpy/issues/5803 >
PR #5804 <https://github.com/Genymobile/scrcpy/pull/5804 >
Signed-off-by: Romain Vimont <rom@rom1v.com >
2025-01-31 10:11:17 +01:00
Romain Vimont
cac8e9c821
Happy new year 2025!
2025-01-01 15:01:18 +01:00
Romain Vimont
af15c72f9c
Cleanup includes
...
Improved manually with the help of neovim LSP warnings and iwyu:
iwyu -Ibuilddir/app/ -Iapp/src/ app/src/XXX.c
2024-12-23 12:19:47 +01:00
Romain Vimont
fb47b87eeb
Fix pipe read return value
...
The function incorrectly returned false, whereas its return type is
ssize_t.
2024-12-20 20:57:20 +01:00
Colin Kinloch
ec4e826976
Set icon and server env paths for meson devenv
...
This allows users to compile and run the project in a dev environment.
meson setup x
meson compile -C x
meson devenv -C x
scrcpy
This is an alternative to `./run x`.
PR #5658 <https://github.com/Genymobile/scrcpy/pull/5658 >
Signed-off-by: Romain Vimont <rom@rom1v.com >
2024-12-12 18:15:26 +01:00
Romain Vimont
17e205e54f
Replace meson join_paths() by '/'
...
A new '/' operator was introduced in Meson 0.49 to replace join_paths():
- <https://mesonbuild.com/Reference-manual_functions.html#join_paths >
- <https://mesonbuild.com/Syntax.html#string-path-building >
Refs #5658 <https://github.com/Genymobile/scrcpy/pull/5658 >
2024-12-12 18:15:26 +01:00
Romain Vimont
754f4fc6fe
Bump version to 3.1
2024-12-09 22:29:51 +01:00
Romain Vimont
aca6d30af5
Include dav1d in releases
...
Scrcpy supports AV1, but no decoder was provided in binary releases.
Include dav1d:
- <https://www.videolan.org/projects/dav1d.html >
- <https://code.videolan.org/videolan/dav1d >
Fixes #4744 <https://github.com/Genymobile/scrcpy/issues/4744 >
PR #5644 <https://github.com/Genymobile/scrcpy/pull/5644 >
2024-12-09 19:07:18 +01:00
Romain Vimont
f2018e026c
Remove broken macOS flags
...
Due to a typo (a space was missing before the second '-L'), the
resulting LDFLAGS value was broken:
"-L/opt/homebrew/opt/zlib/lib-L/opt/homebrew/opt/libiconv/lib"
This proves that the flag was useless. Remove it.
Refs #5517 comment <https://github.com/Genymobile/scrcpy/pull/5517#issuecomment-2495522201 >
PR #5644 <https://github.com/Genymobile/scrcpy/pull/5644 >
2024-12-09 19:07:03 +01:00
Romain Vimont
65256d7cc7
Upgrade SDL (2.30.10)
2024-12-08 18:17:07 +01:00
Romain Vimont
328bb74f80
Log gamepad added/removed
...
Add a log when a gamepad is added or removed.
PR #5623 <https://github.com/Genymobile/scrcpy/pull/5623 >
2024-12-08 18:16:57 +01:00
Withoutruless
7418fd0662
Use Xbox 360 gamepad name
...
Some games do not work without a known gamepad name.
Fixes #5362 <https://github.com/Genymobile/scrcpy/issues/5362 >
Refs #5623 comment <https://github.com/Genymobile/scrcpy/pull/5623#issuecomment-2525685323 >
PR #5623 <https://github.com/Genymobile/scrcpy/pull/5623 >
Signed-off-by: Romain Vimont <rom@rom1v.com >
2024-12-08 17:01:03 +01:00
Romain Vimont
0a09518a49
Use Xbox 360 gamepad USB ids
...
Use the vendorId and productId of an Xbox 360 controller for better
support (the HID gamepad protocol used in scrcpy is similar to that of
the Xbox 360 controller).
Fixes #5362 <https://github.com/Genymobile/scrcpy/issues/5362 >
PR #5623 <https://github.com/Genymobile/scrcpy/pull/5623 >
2024-12-08 11:00:18 +01:00
Romain Vimont
27a5934a1d
Define UHID vendorId and productId from the client
...
Let the client choose the USB ids, that it transmits in UHID_CREATE
requests.
PR #5623 <https://github.com/Genymobile/scrcpy/pull/5623 >
2024-12-08 11:00:18 +01:00
Romain Vimont
86a68fac6c
Fix gamepad axis initial values
...
By default, initialize axis to 0, which is represented by 0x8000 as a
16-bit unsigned value.
PR #5623 <https://github.com/Genymobile/scrcpy/pull/5623 >
2024-12-08 11:00:18 +01:00
Romain Vimont
1786f28e6f
Fix gamepad HID descriptor
...
Use Z and Rz for L2/R2, which are more widely supported than
Brake/Accelerator.
The right stick must then be bound to Rx and Ry.
Fixes #5362 <https://github.com/Genymobile/scrcpy/issues/5362 >
PR #5623 <https://github.com/Genymobile/scrcpy/pull/5623 >
2024-12-08 11:00:18 +01:00
Romain Vimont
9cf4d52721
Fix HID gamepad comments
...
PR #5623 <https://github.com/Genymobile/scrcpy/pull/5623 >
2024-12-08 11:00:18 +01:00
Romain Vimont
4bd1c5981d
Split gamepad device added/removed events
...
Use two separate callbacks for gamepad device added and gamepad device
removed.
It looks cleaner.
PR #5623 <https://github.com/Genymobile/scrcpy/pull/5623 >
2024-12-08 11:00:18 +01:00
Romain Vimont
6c6607d404
Add --no-vd-destroy-content
...
Add an option to disable the following flag for virtual displays:
DisplayManager.VIRTUAL_DISPLAY_FLAG_DESTROY_CONTENT_ON_REMOVAL
With this option, when the virtual display is closed, the running apps
are moved to the main display rather than being destroyed.
PR #5615 <https://github.com/Genymobile/scrcpy/pull/5615 >
2024-12-08 09:33:03 +01:00
Romain Vimont
988174805c
Fix boolean assignment
...
On --no-vd-system-decoration, the boolean option must be set to false.
It was wrongly assigned from optarg (this worked because optarg is NULL
at this point, so it was converted to false).
PR #5615 <https://github.com/Genymobile/scrcpy/pull/5615 >
2024-12-08 09:26:53 +01:00
Romain Vimont
2ed2247e8f
Bump version to 3.0.2
...
The version was not bumped for 3.0.1.
2024-12-04 22:35:25 +01:00
Romain Vimont
0e473eb005
Reset TCP/IP connection with a '+' prefix
...
When running scrcpy with --tcpip=xx.xx.xx.xx, to make sure a new working
connection is established, it was first disconnected by a call to:
adb disconnect <addr>
However, this caused all running instances connected to that address to
be killed. Running several instances of scrcpy on the same device is now
useful with virtual displays, so change the default behavior to NOT
disconnect.
To force a reconnection, a '+' prefix can be added:
scrcpy --tcpip=+192.168.0.x
Fixes #5562 <https://github.com/Genymobile/scrcpy/issues/5562 >
2024-12-04 13:16:51 +01:00
Romain Vimont
aea6a371aa
Remove scrcpy wrapper script for static builds
...
All portable builds now use the files located in the same directory as
the scrcpy executable by default.
PR #5560 <https://github.com/Genymobile/scrcpy/pull/5560 >
2024-12-02 18:23:18 +01:00