Commit Graph

1229 Commits

Author SHA1 Message Date
Cameron Gutman
bd6235efba Use async logging while streaming only
The benefits of reliable output outweigh performance concerns during non-streaming activities.
2025-10-25 00:18:34 -05:00
Cameron Gutman
c7bc76325f Revert macOS audio buffer size workaround
This causes excessive glitching and needs to be fixed by Apple (if it hasn't already in the 2 years since the report).
2025-10-23 21:42:44 -05:00
Cameron Gutman
ccaca68570 Don't use CAMetalDisplayLink on Intel Macs
When in Direct mode, skipping a frame will cause the display to flash black on Tahoe.
2025-10-23 21:16:53 -05:00
Cameron Gutman
57db20016a Rewrite frame pacing mechanism for VTMetalRenderer
This should hopefully improve performance and avoid performance issues on Tahoe.
2025-10-23 19:43:10 -05:00
Cameron Gutman
bdb6d02dac Add (currently harmless) missing break 2025-10-22 23:21:07 -05:00
Cameron Gutman
9bcc6291be Auto-lock the cursor in single display borderless windowed scenarios 2025-10-22 23:13:03 -05:00
Brad Smith
4ec549650d Add fast AES detection for FreeBSD/OpenBSD on ARM/AArch64 using elf_aux_info() 2025-10-22 18:40:20 -05:00
Cameron Gutman
14027f3c74 Limit the IME workaround to Windows only 2025-10-20 23:37:31 -05:00
Qian23333
fb9a164111 feat: disable text input when window gains focus 2025-10-20 23:33:10 -05:00
Cameron Gutman
200cab9d17 Attach EDR metadata to Metal layer
This improves the accuracy of HDR streaming and enables HDR->SDR tonemapping.
2025-10-20 22:28:27 -05:00
Brad Smith
c52a57f0ec build: Fix building on *BSD/riscv64 2025-10-20 21:21:00 -05:00
Cameron Gutman
c5ca672865 Don't set pix_fmt for hwaccel decoders
This works around a bug in the AV1 Vulkan decoding code in FFmpeg
that causes it to incorrectly skip hwaccel init.

Fixes #1511
2025-10-19 16:16:06 -05:00
Cameron Gutman
c0d38ee78f Switch the decoder lock to a mutex
It can be held for non-trivial amounts of time.
2025-10-12 15:47:09 -05:00
Cameron Gutman
a20d429bc1 Remove usage of deprecated Metal API 2025-10-11 11:41:28 -05:00
Cameron Gutman
4189903233 Remove libsoundio audio backend
SDL has been the default audio backend for years now, and libsoundio has
not been well-maintained upstream.
2025-10-11 10:35:31 -05:00
armin-25689
1fd545ae1f build: fix no <linux/dma-buf.h> for BSDs 2025-08-31 15:05:03 -05:00
Laszlo Racz
0c8354336b Fix: Improve stream window resizing logic 2025-07-27 14:23:12 -05:00
Odizinne
65c04fd560 Added option to disable pre launch warning and delay 2025-07-04 15:04:10 -05:00
James Poje
9c9bfd8428 Add quit-app-and-exit shortcut Ctrl+Alt+Shift+E
Add a shortcut to quit the current app and exit Moonlight entirely.
2025-04-02 21:55:38 -05:00
ABeltramo
d9c7a245ef DualSense adaptive trigger support (#1561) 2025-04-01 21:45:25 -05:00
rinsuki
fabb4fdadc Fix INTERNATIONAL keys wouldn't work properly
since those keys aren't exist in US keyboard, we shouldn't treat (and convert) as a US keyboard keycodes (on Sunshine).
2025-02-19 22:18:34 -06:00
rinsuki
9491884cb4 Add some key definitions to support Japanese Keyboard Layout
Tested environment:

Moonlight on macOS 15.3 w/ MacBook Pro Internal Keyboard
Sunshine 2025.122.141614 w/ Windows 11 24H2
2025-02-19 22:18:34 -06:00
Cameron Gutman
bf51577787 Fix macOS build 2025-02-18 19:52:33 -06:00
Cameron Gutman
4c5bcee8dc Give up immediately if the backend fails to initialize 2025-02-18 19:46:29 -06:00
Cameron Gutman
fd70865026 Avoid retrying renderer init if we know the error was not transient 2025-02-18 19:02:12 -06:00
Cameron Gutman
351aaa6759 Add an enum type for each renderer 2025-02-18 18:58:04 -06:00
Cameron Gutman
dd2a99a96b Prepare for SDL3 support 2025-01-25 16:20:20 -06:00
Cameron Gutman
15e337fff8 Only call SDL_NumJoysticks() once per loop
It does non-trivial work when using sdl2-compat.
2024-11-12 23:52:31 -06:00
Cameron Gutman
4af9623727 Replace C++ VLAs with std::vector 2024-10-15 22:41:21 -05:00
Cameron Gutman
9936085aee Fix incorrect selection if pix_fmt is overridden before ffGetFormat()
The DRM renderer does this for the out-of-tree v4l2m2m patches to ensure
we get NV12 buffers, but it ends up clobbering our own preference for
DRM_PRIME frames in the process.
2024-10-03 20:28:51 -05:00
Cameron Gutman
3531fe0a4f Fix typo in version check for new Vulkan queue API 2024-10-02 00:37:22 -05:00
Cameron Gutman
6ce02616f0 Use new Vulkan queue API in FFmpeg 7.1 2024-09-29 23:04:23 -05:00
Cameron Gutman
13880353d8 Use new avcodec_get_supported_config() API in FFmpeg 7.1 2024-09-29 22:23:37 -05:00
Cameron Gutman
72ae324d71 Fix unused parameter warnings 2024-09-28 00:08:35 -05:00
Cameron Gutman
901cbd255c Disable Vulkan debug layers by default
The vast majority of Vulkan code running in Moonlight
is part of FFmpeg or libplacebo, so the debug layers
really just slow things down without finding any bugs
in our code.

Additionally, there are some overzealous checks firing
constantly on libplacebo and FFmpeg with certain Vulkan
drivers that we can't do anything about.
2024-09-28 00:05:17 -05:00
Cameron Gutman
6d023c2dfa Defer launch warnings until after launch validation
We need to destroy the SDL window before we can be sure that Qt
can draw to the screen if we used KMSDRM.
2024-09-23 21:48:43 -05:00
Cameron Gutman
023b6b2772 Fix DRM FD leak with Vulkan windows 2024-09-21 21:41:43 -05:00
Cameron Gutman
6f39d120cb Unify handling of DRM devices between DRM and VAAPI
SDL may not be able to give us a DRM FD for Vulkan windows.
2024-09-21 20:46:11 -05:00
Cameron Gutman
6b11f43302 Don't set the output rect until after modesetting
It's possible that modesetting will also change the resolution
not just the refresh rate. This can happen in cases where the
CRTC is currently set to 4K 30 Hz and we choose 1080p 60 Hz as
a better mode match for displaying a 1080p 60 FPS stream.
2024-09-19 22:43:34 -05:00
Matt Tannahill
76deafbd7b Fix build for Xcode < 14 2024-09-18 22:12:04 -05:00
Cameron Gutman
f786e94c7b Fix excessive latency with Vulkan video decoding on Nvidia
For yet unknown reasons, high frame queue delay leads to massive decode latency.
2024-09-16 21:59:17 -05:00
Cameron Gutman
4838a75c58 Suppress spammy libplacebo messages
Streaming 10-bit content on Nvidia GPUs spams the log with the following for every rendered frame:
Masking `blit_src` from wrapped texture because the corresponding format 'rx10' does not support PL_FMT_CAP_BLITTABLE
Masking `blit_src` from wrapped texture because the corresponding format 'rxgx10' does not support PL_FMT_CAP_BLITTABLE
2024-09-15 22:01:39 -05:00
Cameron Gutman
c5ec8c0fdb Add libplacebo prefix to log messages 2024-09-15 21:58:19 -05:00
Cameron Gutman
b266f61ba6 Disable direct rendering of YUV444 using vaPutSurface()
It doesn't work as of libva 2.21 + iHD 24.2.5 despite the fact that
the VAEntrypointVideoProc advertises VA_RT_FORMAT_YUV444.
2024-09-15 21:03:00 -05:00
Cameron Gutman
d1dffdc34c Prefer optimal 8-bit hardware codec if 10-bit codec is not available 2024-09-15 16:47:30 -05:00
Cameron Gutman
268f8db26b Never negotiate 10-bit profiles without a 10-bit renderer 2024-09-15 15:53:45 -05:00
Cameron Gutman
de28eda266 Don't enable HDR checkbox if no HDR renderers work 2024-09-15 15:09:11 -05:00
Cameron Gutman
96fb6ee5e9 Share SDL's EGL display with EGLRenderer
Fixes #1396
2024-09-12 22:37:25 -05:00
Cameron Gutman
02853e74ba Reduce the bitrate to YUV420 defaults if YUV444 was selected but not negotiated
If the user has selected a custom bitrate, we will leave it alone.
2024-09-12 21:52:27 -05:00
Cameron Gutman
46910cf774 Remove black background workaround now that SDL is fixed 2024-09-12 21:38:30 -05:00