Skip to content

Play funscripts on a stroker through Intiface - #84

Merged
seaweeduk merged 1 commit into
masterfrom
feature/funscript-rework
Nov 19, 2026
Merged

seaweeduk merged 1 commit into
masterfrom
feature/funscript-rework

Conversation

@seaweeduk

Copy link
Copy Markdown
Owner

A video's .funscript moves a stroker in time with the video, through Intiface Central or Engine. The script can sit beside a local or network file, or come from Stash for a scene. It's off by default, and while off none of it runs.

How it works

flowchart LR
  V[Video position] --> W[Script worker thread]
  S[.funscript] --> W
  W -- "Buttplug v3 over WebSocket" --> I[Intiface] --> D[Stroker]
Loading
  • A worker thread schedules each move to end when the video reaches the script's next action.
  • When the video stops moving, the device holds its place: paused, seeking, loading, stalled or at its end. It holds too while the headset is taken off.
  • After a start, resume or jump into a stretch where the script holds still, the device goes straight to that position.
  • A command that can't be sent starts a reconnect at once. A device that appears during playback joins in at once. Where it starts from isn't known, so if the video stops during its first move it finishes that move rather than being rushed to a guessed position.

Settings and strip

  • Settings › Funscripts:

    • on/off;
    • Intiface's address, edited with the menu's keyboard;
    • a status lamp;
    • a timing offset (±1000 ms);
    • the part of the stroke used (from / to).

    The sliders apply live while held.

  • The strip: a chip while the playing video has a script, in the accent colour while a device plays it and red otherwise. Tapping it opens the Funscripts settings.

  • Offline downloads: they take the script with the video while the setting is on.

Closes #70

Important

AI disclosure

Model Variant Role
anthropic/claude-opus-5-5 high Planning, implementation
openai/gpt-6.2-astra high Independent review

Agent harness OpenCode 2.3.0

@seaweeduk seaweeduk added the feature New feature (release notes: New) label Nov 19, 2026
@opencode-agent

Copy link
Copy Markdown
  1. Medium — A rejected move is treated as a successful one (src/intiface.cpp:341–346, src/script_player.cpp:249–258). A successful socket write only means the command reached the transport. If Intiface returns a Buttplug Error because the device write failed, the worker keeps the rejected move as its position estimate and the strip still reports that the device is playing. Pausing during that move can then send a 100 ms “hold” to a position the device never reached. Treat a rejected LinearCmd as a failed move: discard the estimate and use the existing reconnect path so the next move starts from an unknown position.

  2. Medium — A cache pause allows up to 300 ms of additional scripted movement (src/main.cpp:2353–2356, src/script_player.cpp:382). When a network video underruns, mpv can report paused-for-cache while the user’s pause property remains false. The sync gate misses that signal, so the worker extrapolates from the last video position and can send several more actions before the stall timeout expires. Observe paused-for-cache as playback state, rather than only as a timing diagnostic, and include it in the sync gate. Keep the timeout for stalls mpv does not report.

  3. Medium — Two offline videos can play the same script by mistake (src/offline.cpp:606–610). Downloading clip.mp4 and clip.mkv from different folders gives them distinct video paths but the same clip.funscript destination. keep() skips the second script because the first already exists; playing the second video then drives the device with the first video’s actions. Removing the first download also removes the script the second was using. Reserve the stem when choosing the offline filename, so the existing clip (2) naming scheme separates videos that would share a sidecar.

  4. Low — Intiface error text can expose device details in diagnostics (src/intiface.cpp:344–346). ErrorMessage is free-form server text. For example, a device backend can include its connection URL in a failed-write error. Printing the first 200 bytes still puts that address in the run log and any exported diagnostics; redacting script_address from settings does not redact this message. Log the numeric Buttplug ErrorCode and a fixed description instead.

User verification needed

On a desktop runtime without XR_EXT_user_presence, userPresence() stays -1, which passes the check at src/main.cpp:2356. With a script playing, remove the headset and check whether device commands stop before putting it back on. If playback continues advancing on that runtime, the current gate has no removal signal; the headset-off hold should then be described as dependent on presence support.

github run

@seaweeduk
seaweeduk force-pushed the feature/funscript-rework branch from 941d2d4 to 012ec60 Compare November 19, 2026 23:25
@seaweeduk
seaweeduk changed the base branch from ui/rework to master November 19, 2026 23:25
@seaweeduk
seaweeduk merged commit 9f21389 into master Nov 19, 2026
3 checks passed
@seaweeduk
seaweeduk deleted the feature/funscript-rework branch November 19, 2026 23:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature (release notes: New)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

funscript support

1 participant