#5874

macOS: remote mouse input silently dies after uptime — keyboard survives, fixed by process restart

Openjune8572-designopened 22d ago

Is there an existing issue for this?

  • I have searched the existing issues

Is your issue described in the documentation?

  • I have read the documentation

Is your issue present in the latest beta/pre-release?

This issue is present in the latest release

Describe the Bug

On a macOS host, remote mouse input silently stops being injected while a Moonlight session is active. When it happens:

  • Video stream continues normally.
  • Remote keyboard input still works.
  • Remote mouse is completely dead — no movement, no clicks.
  • The physically attached mouse on the Mac keeps working.
  • Nothing abnormal appears in sunshine.log at the default log level.

Restarting the Sunshine process immediately restores remote mouse input:

launchctl kickstart -k "gui/$(id -u)/dev.lizardbyte.Sunshine"

The symptom has recurred 3 times over 2 days (Oct 7, Oct 8 twice — once only ~5 h after a restart), always with the same signature: keyboard alive, mouse dead, restart fixes it. Possibly related to #4652 (mouse movement dead on macOS while click/keyboard worked), though in my case there is no cursor jitter — the injected mouse input is simply absent.

Expected Behavior

Mouse input injection should keep working for the lifetime of the Sunshine process.

Additional Context

Accessibility/Screen Recording permissions are granted and had been working (keyboard injection still functioning while mouse was dead suggests this is not a TCC revocation). Happy to reproduce with min_log_level = debug if maintainers tell me which log lines to look for.

Host Operating System

macOS

Operating System Version

27.0.1 (build 26A434)

Architecture

arm64/aarch64

Sunshine commit or version

2026.914.233613 (commit 63d35f702ee9e362e43263742981836ec0710384)

Package

macOS - Homebrew

GPU Type

Apple Silicon

GPU Model

Apple M5 Max (Mac17,14)

GPU Driver/Mesa Version

NA

Capture Method

None (default)

Config

address_family = both
encoder = software
locale = ko
native_pen_touch = disabled
sw_preset = ultrafast
sw_tune = zerolatency

Apps

(desktop streaming)

Relevant log output

Nothing relevant at default log level — the failure is silent.
Client: Moonlight Qt on Arch Linux.

Activity

3
june8572-design22d ago

Attaching logs from the run that covered the most recent occurrence.

The dead-mouse window was the streaming session 15:38:21 → 15:38:31 below — client connected, remote mouse completely unresponsive (remote keyboard still worked, physical mouse on the Mac unaffected), client disconnected, then Sunshine was restarted via launchctl kickstart -k at 15:41 which immediately restored input.

Note the failure is completely silent at the default log level — nothing but encoder/audio boilerplate between CLIENT CONNECTED and CLIENT DISCONNECTED. No input errors, no warnings.

sunshine.log excerpt — process run 10:40:05 → 15:41:04, dead-mouse session at 15:38
[2026-10-08 15:38:21.451]: Info: New streaming session started [active sessions: 1]
[2026-10-08 15:38:21.621]: Info: CLIENT CONNECTED
[2026-10-08 15:38:21.722]: Info: Configuring selected display (14) to stream
[2026-10-08 15:38:21.722]: Info: Creating encoder [libx264]
[2026-10-08 15:38:21.723]: Info: Color coding: SDR (Rec. 709)
[2026-10-08 15:38:21.723]: Info: Color depth: 8-bit
[2026-10-08 15:38:21.723]: Info: Color range: MPEG
[2026-10-08 15:38:21.723]: Info: Streaming bitrate is 7308000
[2026-10-08 15:38:21.727]: Info: [libx264 @ 0x77a4169f80] using cpu capabilities: ARMv8 NEON DotProd I8MM
[2026-10-08 15:38:21.727]: Info: [libx264 @ 0x77a4169f80] profile Constrained Baseline, level 4.0, 4:2:0, 8-bit
[2026-10-08 15:38:21.728]: Info: Minimum FPS target set to ~15fps (66.6667ms)
[2026-10-08 15:38:21.741]: Info: Using macOS system audio tap for capture.
[2026-10-08 15:38:21.741]: Info: Sample rate: 48000, Frame size: 240, Channels: 2
[2026-10-08 15:38:21.778]: Info: Opus initialized: 48 kHz, 2 channels, 96 kbps (total), LOWDELAY
[2026-10-08 15:38:31.013]: Info: CLIENT DISCONNECTED
[2026-10-08 15:41:04.757]: Info: Terminate handler called
[2026-10-08 15:41:04.757]: Error: Couldn't accept incoming connections: Operation canceled
[2026-10-08 15:41:04.761]: Info: Main loop has exited
[2026-10-08 15:41:04.761]: Info: Deregistered DNS service.

An earlier dead session the same day (13:00:20 → 13:00:45 connect/disconnect, same signature) is also in this log with zero input-related output.

min_log_level = debug is now enabled and Sunshine restarted, so the next recurrence will capture packet-level input logs — I'll attach them here when it happens.

june8572-design22d ago

It recurred, and this time min_log_level = debug was armed — so we can see exactly where it breaks.

Timeline: Sunshine restarted with debug logging at 2026-10-08 15:47:49. Mouse input died sometime before 2026-10-09 01:27 — roughly ~9.7 h of process uptime. Process restarted at ~01:33, mouse restored again.

Key finding — mouse packets arrive fine, injection is what dies:

During the dead-mouse window, Sunshine received and parsed valid mouse packets with real coordinates and button presses — yet the macOS cursor never moved. So the failure is downstream of packet parsing, inside the macOS event-injection path (CGEvent posting silently becomes a no-op while the process keeps running). Remote keyboard input was still working during the same window.

Dead session excerpt (client connected 01:31:49, mouse dead on host):

[2026-10-09 01:31:49.604]: Debug: --begin relative mouse move packet--
[2026-10-09 01:31:49.609]: Debug: --begin relative mouse move packet--
[2026-10-09 01:31:51.176]: Debug: --begin absolute mouse move packet--
x      [1668]
y      [579]
width  [2559]
height [1439]
--end absolute mouse move packet--
[2026-10-09 01:31:51.184]: Debug: --begin mouse button packet--
action [00000008]
button [01]
--end mouse button packet--
[2026-10-09 01:31:51.184]: Debug: --begin absolute mouse move packet--
x      [1715]
y      [559]
width  [2559]
height [1439]
--end absolute mouse move packet--
[2026-10-09 01:31:51.203]: Debug: --begin absolute mouse move packet--
x      [1725]
y      [556]
...

(hundreds of move packets follow — coordinates keep changing as expected — and the session ends cleanly at CLIENT DISCONNECTED 01:31:55 with zero errors anywhere in between)

Nothing on the host changed between working and dead states — same Sunshine process, no TCC changes, no lock-screen transitions that I noticed. Full 456 KB debug log available if useful; tell me which parts to attach.

ReenigneArcher22d ago

Thanks for reporting this! I have put up a PR at https://github.com/LizardByte/libvirtualhid/pull/183 to try to resolve this. Are you able to test a self compiled build of Sunshine with this version of the library applied?