Commit Graph
2779 Commits
Author SHA1 Message Date
Cameron Gutman e3fd29e4d7 Fix a livelock that can occur between SDL, libdecor-gtk, and Qt
The Qt UI continuously redrawing prevents libdecor-gtk's glib dispatch loop
from ever returning since it constantly posts new messages to draw again.

The result is that Moonlight randomly hangs (with the spinner still animating)
at the "Starting app..." phase of connection establishment and never proceeds
until the livelock is broken by loss of focus, hiding the window, or similar.

For posterity, the hanging stack:

QtWaylandClient::QWaylandWindow::waitForFrameSync (this=this@entry=..., timeout=timeout@entry=...) at qwaylandwindow.cpp:891
QtWaylandClient::QWaylandGLContext::swapBuffers (this=..., surface=...) at qwaylandglcontext.cpp:494
QRhiGles2::endFrame (this=..., swapChain=..., flags=...) at qrhigles2.cpp:2390
QRhi::endFrame (this=..., swapChain=..., flags=...) at qrhi.cpp:11600
QSGGuiThreadRenderLoop::renderWindow (this=..., window=...) at qsgrenderloop.cpp:714
QQuickWindow::event (this=..., event=...) at qquickwindow.cpp:1663
QCoreApplication::notifyInternal2 (receiver=..., event=...) at qcoreapplication.cpp:1126
QCoreApplication::sendEvent (receiver=..., event=...) at qcoreapplication.cpp:1571
QPlatformWindow::deliverUpdateRequest (this=...) at qplatformwindow.cpp:831
QObject::event (this=..., e=...) at qobject.cpp:1480
QCoreApplication::notifyInternal2 (receiver=..., event=...) at qcoreapplication.cpp:1126
QCoreApplication::sendEvent (receiver=..., event=...) at qcoreapplication.cpp:1571
QCoreApplicationPrivate::sendPostedEvents (receiver=..., event_type=..., data=...) at qcoreapplication.cpp:1926
postEventSourceDispatch (s=...) at qeventdispatcher_glib.cpp:248
g_main_dispatch (context=...) at gmain.c:3591
g_main_context_dispatch_unlocked (context=...) at gmain.c:4451
g_main_context_iterate_unlocked (context=context@entry=..., block=block@entry=..., dispatch=dispatch@entry=..., self=...) at gmain.c:4516
g_main_context_iteration (context=..., context@entry=..., may_block=may_block@entry=...) at gmain.c:4582
libdecor_plugin_gtk_dispatch (plugin=..., timeout=...) at libdecor-gtk.c:509
Wayland_PumpEvents (_this=...) at SDL_waylandevents.c:610
Wayland_GLES_LoadLibrary (_this=..., path=...) at SDL_waylandopengles.c:51
SDL_GL_LoadLibrary_REAL (path=...) at SDL_video.c:4735
SDL_RecreateWindow (window=..., flags=...) at SDL_video.c:2796
GLES2_CreateRenderer (renderer=..., window=..., create_props=...) at SDL_render_gles2.c:2329
SDL_CreateRendererWithProperties_REAL (props=props@entry=...) at SDL_render.c:1126
SDL_CreateRenderer_REAL (window=..., name=...) at SDL_render.c:1287
SDL_CreateRenderer_REAL (window=..., idx=..., flags=...) at sdl2_compat.c:5986
EGLRenderer::initialize (this=..., params=...) at eglvid.cpp:445
FFmpegVideoDecoder::initializeRendererInternal (this=..., renderer=..., params=...) at ffmpeg.cpp:323
FFmpegVideoDecoder::createFrontendRenderer (this=..., params=..., useAlternateFrontend=...) at ffmpeg.cpp:426
FFmpegVideoDecoder::completeInitialization (this=..., decoder=..., requiredFormat=..., params=..., testMode=..., useAlternateFrontend=...) at ffmpeg.cpp:486
FFmpegVideoDecoder::tryInitializeRenderer(AVCodec const*, AVPixelFormat, _DECODER_PARAMETERS*, AVCodecHWConfig const*, IFFmpegRenderer::InitFailureReason*, std::function<IFFmpegRenderer* ()>)
    (this=..., decoder=..., requiredFormat=..., params=..., hwConfig=..., failureReason=..., createRendererFunc=...) at ffmpeg.cpp:1200
FFmpegVideoDecoder::tryInitializeHwAccelDecoder (this=..., params=..., pass=..., terminallyFailedHardwareDecoders=...) at ffmpeg.cpp:1544
FFmpegVideoDecoder::initialize (this=..., params=...) at ffmpeg.cpp:1701
Session::chooseDecoder (vds=..., renderer=..., window=..., videoFormat=..., width=..., height=..., frameRate=..., enableVsync=..., enableFramePacing=..., testOnly=..., chosenDecoder=...) at session.cpp:322
Session::getDecoderAvailability (window=..., vds=..., videoFormat=..., width=..., height=..., frameRate=...) at session.cpp:498
Session::initialize (this=..., qtWindow=...) at session.cpp:755
2026-09-10 21:00:57 -05:00
Cameron Gutman f743c23663 Fix PixelShaderMinPrecision bitfield comparison 2026-09-07 00:07:10 -05:00
Cameron Gutman e9d77967a6 Replace Nvidia FL 11.1 check with driver version check
The bug is driver-specific rather than GPU-specific.
2026-09-06 22:53:24 -05:00
Cameron Gutman 31ce68f136 Log the GPU driver version in the D3D11VA renderer 2026-09-06 22:22:07 -05:00
Cameron Gutman b86b5f71e3 Allow separate devices for Vega+ and block them for Fermi
Fermi is known broken, Kepler and Maxwell v1 may work but are currently untested
2026-09-06 16:12:52 -05:00
Cameron Gutman 09873287ca Only use separate D3D11 devices on Intel and Nvidia
Preserve the texture array binding path on AMD FL11.1+, since it seems to work fine on Polaris with shared devices.

Fixes #2003
2026-09-06 15:21:11 -05:00
Cameron Gutman 54f8fed51d Don't try fallback driver paths with the host libva 2026-09-05 14:30:28 -05:00
Cameron Gutman da19fa73fa Fix typo in vaMapBuffer2 2026-09-03 00:24:33 -05:00
Cameron Gutman b1824e9dbb Check for vaMapBuffers2 which is required by FFmpeg with libva 2.21+ 2026-09-03 00:07:42 -05:00
luanweslley77 526bde5586 Stop bundling libva in the AppImage so VAAPI works on modern hosts
The AppImage bundles libva from the build environment (Ubuntu 22.04,
VA-API 1.20). VA-API driver modules (e.g. Mesa's radeonsi_drv_video.so)
are dlopen()ed by libva and export an entrypoint named after the libva
minor version they were built against (e.g. __vaDriverInit_1_23). An
older libva cannot load newer drivers, so on any host more recent than
the build container va_openDriver() fails:

    Trying .../radeonsi_drv_video.so
    libva error: has no function __vaDriverInit_1_0
    va_openDriver() returns -1

and Moonlight silently falls back to software decoding (reproduced on
Fedora 44 / Mesa 26.1 / RX 6500 XT; overriding the bundled libva with
LD_PRELOAD of the host libva immediately yields HW decode). Refreshing
the bundled libva at each release only postpones the breakage: the host
drivers always eventually outrun it (see #1398).

Exclude libva and its backends from linuxdeploy so Moonlight and the
bundled FFmpeg resolve them through the loader's normal search path and
pick up the host libva, which the distro's package manager keeps in step
with the host drivers. This mirrors how Mesa/GL/EGL are already
host-provided.

Hosts without a usable libva (e.g. bare NVIDIA systems) must still not
fail to launch, since libva.so.2 is a direct DT_NEEDED of Moonlight and
the bundled FFmpeg. Stage the build-environment libva in
opt/libva-fallback (outside every loader search path) together with
libva-probe, a tiny program whose only job is to carry the same
DT_NEEDED entries and VA_API_* versioned symbol references as the
binaries shipped in the AppImage. The generated AppRun runs the probe
first: if the dynamic loader can start it against the host, the host
libva is used (probe passing is, by construction, exactly Moonlight
being loadable); if not, it prepends the fallback directory and launches
with the bundled libva, matching pre-existing behavior. The build script
verifies that the probe references every version node required by the
shipped binaries, so the two cannot silently drift apart.
2026-09-02 23:45:07 -05:00
Cameron Gutman d2f6990be6 Send LI_CTYPE_STEAM for known Steam Controllers 2026-08-18 22:26:07 -05:00
Cameron Gutman 7cf8b46c79 Pass the correct renderer to EGLImageFactory
We should be using the EGL renderer's colorspace and color range
rather than the backend renderer's for fallbacks. The former is
what actually gets passed to the host PC during stream init.
2026-08-06 00:29:53 -05:00
Cameron Gutman c1623ff44e Switch the default renderer color range to full 2026-08-05 23:56:18 -05:00
Cameron Gutman b2f0828df8 Use requested color range as a fallback in isFrameFullRange() 2026-08-05 23:54:19 -05:00
Cameron Gutman 3f26217df7 Select color range based on plane COLOR_RANGE property values 2026-08-05 23:49:09 -05:00
Cameron Gutman 4570fba87d Add full range handling to SdlRenderer 2026-08-05 23:44:11 -05:00
Cameron Gutman a903c5cef2 Explicitly request limited range for renderers that require it 2026-08-05 23:25:30 -05:00
Cameron Gutman 2bea406f67 Guess frame color metadata if left unspecified
Some decoders don't populate metadata, but the renderer may need it
to determine which shader or EGL import parameters to use.
2026-08-05 22:56:34 -05:00
Cameron Gutman 5ac254216c Update LSMinimumSystemVersion to match Qt 6.10+ and our prebuilts 2026-08-05 00:54:52 -05:00
Cameron Gutman 131cb27095 Add NSBonjourServices entry to Info.plist 2026-08-05 00:24:45 -05:00
Cameron Gutman b5d7f3b9f8 Update Windows, macOS, and AppImage dependencies
- SDL -> 3.4.14
- FFmpeg -> 9.0
- libplacebo -> 4d82c689
2026-08-04 23:12:04 -05:00
Cameron Gutman 7f7f2c26d0 Fix capturing mouse motion outside the window on sdl2-compat 2026-07-27 00:10:06 -05:00
Cameron Gutman 3aa111e825 Fix unused parameter warning on non-macOS platforms 2026-07-26 20:03:04 -05:00
Cameron Gutman fba7c4119a Validate that the SPS didn't change in debug builds 2026-07-26 19:39:34 -05:00
Cameron Gutman acea86de24 Revert "Make h264bitstream dependency optional"
This reverts commit 2328713f4e.
2026-07-26 19:23:34 -05:00
Cameron Gutman b7adc70ea4 Import minimal set of code from h264bitstream needed for SPS fixups 2026-07-26 19:23:34 -05:00
Cameron Gutman 2fc0d84aa0 Write the original H.264 SPS if it required no fixups 2026-07-26 18:33:28 -05:00
Cameron Gutman 490229be3f Fix GEM handle leak in DRM renderer
Huge thanks to @oliverlj for identifying this longstanding bug.

This is likely responsible for many different issues with the DRM renderer randomly failing.
2026-07-26 15:22:15 -05:00
Cameron Gutman 2328713f4e Make h264bitstream dependency optional 2026-07-19 14:11:27 -05:00
Daniel Dunderfelt 191cd32bb7 Fix crash when skipping oversized displays 2026-07-18 18:28:19 -05:00
Cameron Gutman 2a1749e231 Add workaround for gamescope#2261
Fixes #1925
2026-07-18 18:19:35 -05:00
dependabot[bot] 30114588f6 Bump app/SDL_GameControllerDB from 1fc89ca to 8d9fefd
Bumps [app/SDL_GameControllerDB](https://github.com/gabomdq/SDL_GameControllerDB) from `1fc89ca` to `8d9fefd`.
- [Commits](https://github.com/gabomdq/SDL_GameControllerDB/compare/1fc89ca5787f4b8279e6c793cf3007657d9bb35c...8d9fefd7b810f2541f78cc7a8ccbd185bc84c7a5)

---
updated-dependencies:
- dependency-name: app/SDL_GameControllerDB
  dependency-version: 8d9fefd7b810f2541f78cc7a8ccbd185bc84c7a5
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-18 18:17:45 -05:00
Cameron Gutman 4453e4aef1 Add a renderer selection option for macOS
There are numerous conflicting reports about which Mac renderer works best (even on the same systems!). I give up, just let the users figure it out.
2026-07-18 16:38:40 -05:00
Cameron Gutman 8b18d58aa0 Add workaround for interoperability issue with out-of-tree FFmpeg zero-copy v4l2m2m patches and libplacebo
Fixes #1786
2026-07-08 23:40:08 -05:00
Cameron Gutman fd34a1fd28 Disable the text outline when line wrapping is required 2026-07-01 23:43:40 -05:00
Cameron Gutman 9067db8915 Switch to UTF-8 for overlay text rendering 2026-07-01 23:24:31 -05:00
MiraandCameron Gutman 177f845183 Add outline to stream overlay text (#1887)
Co-authored-by: Cameron Gutman <aicommander@gmail.com>
2026-07-01 23:03:45 -05:00
Cameron Gutman c9b03f80f8 Partially revert "Use GL_NEAREST when possible without degrading quality"
The changes to GL_NEAREST for overlay textures and disabling alpha blending in SDL renderer are left intact.

This reverts commit 0f49dca4c0.
2026-07-01 21:56:54 -05:00
Cameron Gutman 561d824814 Move HDR toggle into the Basic Settings panel 2026-07-01 21:41:05 -05:00
Cameron Gutman b2d77f48f8 Rerun lrelease 2026-06-28 17:00:34 -05:00
Cameron Gutman 872731ceeb Fix a few more incorrect translation strings 2026-06-28 16:59:41 -05:00
Cameron Gutman 6cad296138 Remove all vanished translations 2026-06-28 16:52:52 -05:00
Cameron Gutman 444c6ccf06 Remove the experimental tag from HDR, AV1, and YUV 4:4:4 2026-06-28 16:51:58 -05:00
Cameron Gutman d35532b03e Rerun lupdate 2026-06-28 16:51:34 -05:00
Cameron Gutman 1e0110b0f4 Fix broken translation format strings 2026-06-28 16:41:05 -05:00
Cameron Gutman e5353d9758 Remove some translations that contained typos or incorrect grammar 2026-06-28 16:37:32 -05:00
Cameron Gutman f7c660129b Merge remote-tracking branch 'origin/weblate' 2026-06-28 16:26:37 -05:00
Cameron Gutman cdacb3d28d Loosen applist XML validation to accept empty app names
This matches the behavior of the Android and iOS clients.

Fixes #1921
2026-06-28 12:18:42 -05:00
Cameron Gutman 5034a324b4 Fix manual address being clobbered when using the CLI
Fixes #1920
2026-06-28 11:48:09 -05:00
Cameron Gutman e223bf9a1b Use libplacebo renderer on macOS 2026-06-25 22:30:03 -05:00