Skip to content

feat-ish: Grocery bag of improvements - #114

Draft
urwrstkn8mare wants to merge 11 commits into
hgaiser:mainfrom
urwrstkn8mare:pr/grocery-bag-improvements
Draft

feat-ish: Grocery bag of improvements#114
urwrstkn8mare wants to merge 11 commits into
hgaiser:mainfrom
urwrstkn8mare:pr/grocery-bag-improvements

Conversation

@urwrstkn8mare

Copy link
Copy Markdown
Contributor

this is kind of a grocery bag of stuff i've been using locally:

  • splits Moonlight input types across separate ENet channels and makes control parsing more tolerant
  • drains the gamepad feedback queue properly and gives input channels more room
  • makes DualSense touchpad events use the actual touch lifecycle instead of pressure, which made the touchpad feel better for me
  • trims some packetizer/control-stream overhead
  • moves Moonshine virtual inputs onto their own seat so they don't leak into the host desktop

Fixes #38.

personally tried this out on Spider-Man, and the touchpad felt better as well as responsiveness.

Copilot AI review requested due to automatic review settings June 14, 2026 16:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR optimizes video shard accumulation and control-stream responsiveness by reducing copies/allocations, caching AES-GCM state across packets, and improving input/touch handling and ENet channel configuration.

Changes:

  • Replace shard-batch extension with an ownership-based API to enable move/append semantics and remove packetizer timing instrumentation.
  • Update control-stream encryption/decryption to use a cached AES-128-GCM cipher keyed by key rotation id; increase ENet channel count and channel buffer sizes.
  • Improve PS5 touchpad handling by using explicit Moonlight touch lifecycle events and track active touch pointers.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
moonshine-core/src/session/stream/video/shard_batch.rs Switch shard batch extension to move/append to avoid copies in common cases.
moonshine-core/src/session/stream/video/packetizer.rs Use new shard batch extension API; remove per-block timing instrumentation.
moonshine-core/src/session/stream/control/mod.rs Cache GCM cipher, increase channel_limit, drain feedback bursts, and adjust peer targeting + parse behavior.
moonshine-core/src/session/stream/control/input/mod.rs Increase channel capacity to reduce input/control backpressure.
moonshine-core/src/session/stream/control/input/gamepad.rs Use touch lifecycle event types and track active touch pointers for CancelAll.
moonshine-core/src/crypto.rs Introduce GcmCipher to reuse AES-GCM initialization across packets and encrypt/decrypt in place.
dist/60-moonshine.rules Change udev rules for Moonshine devices, including permissions/seat environment.
Comments suppressed due to low confidence (1)

moonshine-core/src/session/stream/control/mod.rs:1

  • The loop no longer records which peer connected/disconnected, but later sends control messages (feedback/HDR/termination) anyway. Combined with the PeerId(0) hardcode, this makes outgoing delivery depend on an implementation detail (peer slot assignment). Track the peer_id from Event::Connect (and clear it on disconnect) and use that for outbound sends.
use std::net::SocketAddr;

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread moonshine-core/src/session/stream/control/mod.rs Outdated
Comment thread moonshine-core/src/session/stream/control/mod.rs
Comment thread moonshine-core/src/crypto.rs Outdated
Comment thread moonshine-core/src/session/stream/video/shard_batch.rs
Comment thread moonshine-core/src/session/stream/control/input/gamepad.rs
@urwrstkn8mare
urwrstkn8mare force-pushed the pr/grocery-bag-improvements branch from 937a395 to 251919e Compare June 16, 2026 07:57
urwrstkn8mare added a commit to urwrstkn8mare/moonshine that referenced this pull request Jun 16, 2026
@urwrstkn8mare
urwrstkn8mare marked this pull request as draft June 19, 2026 16:21
@urwrstkn8mare

Copy link
Copy Markdown
Contributor Author

will wait for #116

@urwrstkn8mare
urwrstkn8mare force-pushed the pr/grocery-bag-improvements branch from 251919e to 851a36b Compare August 6, 2026 01:20
@urwrstkn8mare

Copy link
Copy Markdown
Contributor Author

still in draft until i can fully test it myself. there seems to be 2 regressions from main with detecting HDR (at least on Spiderman 2) and Forza Horizon 6 just being a black screen - might have something to do with #93 ). until i get that sorted out and am able to use Moonshine for a bit I can't really 100% back it. (most of the commits r fine just some that effect input handling I want to see how it compares to main).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature request] Isolate gamepad/joypad/gaming controllers

2 participants