Playing a move used to show two progress indicators at once: the thin
bar on the card and a sticky bottom toast (Loading / Uploading NN% /
Playing NN Hz) that also collided with the playback dock on phones.
Move every piece of live feedback into the card via a shared
createPlaybackReadout helper:
- spinner on the play button + "Uploading NN%" in the meta line while
the move streams to the daemon (the bare spinner never told you how
far along a big move was)
- top bar + "M:SS / M:SS" ticking in the meta line once the daemon
reports playback started
- scrollIntoView so a card far down a long folder is still visible
- progress bar can resume from a fraction so the folder's async
render() swapping the card mid-playback no longer restarts the fill
The wizard's review preview uses the same helper (it previously had
the bar but no upload feedback). The Hz readout is gone: Playback.liveHz
was a hardcoded 100, and the debug HUD already has a live rate.
Share: drop the sticky "Uploadi…
fix: delay motion for robot-audio playback so it no longer leads the sound
The daemon's play_move kicks off play_sound then enters the motion loop
immediately, but the robot's GStreamer playbin has a warmup before sound
reaches the speaker — so with a zero audio lead the head starts moving
before the music ("animation starts too early"). Add a positive baseline
audio_lead_ms (ROBOT_AUDIO_PLAYBIN_LEAD_MS, in lib/motor.js) for daemon-side
audio, layered on top of the user's Settings/folder offset, applied in both
the folder playback and the wizard review-preview paths. Device-output audio
(browser playbin-free) keeps the raw offset. Bump version to r2.
Co-authored-by: Cursor <cursoragent@cursor.com>
HF dataset-viewer fix: configs + metadata.jsonl on share/compress, auto-repair sweep at startup
RemiFabre
2a4933f
Implements docs/hf-viewer-fix-spec.md (root cause: extension-inferred
JSON loader chokes on motion files and disables the whole viewer).
Share & compress paths (deliverable A):
- viewerConfigPlan/renderViewerConfigBlock/ensureViewerConfig/
buildViewerMetadataRows/buildMetadataJsonl/parseMetadataJsonl helpers
(exported for tests); ensureViewerConfig only touches the frontmatter's
configs: key — byte-preserving, idempotent
- uploadMove: README is no longer regenerated on every share (the old
clobber-customized-READMEs failure mode). Fresh repos get the community
README (+configs when audio); existing repos get only the configs key
ensured; metadata.jsonl rebuilt to cover ALL audio in the repo
(titles = stems, descriptions from local moves via opts.localMoves,
existing rows kept). Rename-cleanup-doomed files excluded (rule 4).
fetchRepoText distinguishes 404 from network failure: on failure the
share proceeds WITHOUT touching README/metadata (never clobber).
- compres…
folder: don't block playback start on the folder re-render
RemiFabre
19b7fc0
playMove awaited render() so the spinner/progress bound to the fresh
card — but on big folders that rebuild decodes every audio blob and
delayed the robot's first motion by a user-visible amount. The progress
binder now re-resolves its card lazily on every event (update/start/
stop), so render() can be fire-and-forget and playback starts
immediately.
hf: harden rename cleanup (F1-F3) — delete after upload, only existing paths, skip sibling-slug collisions
RemiFabre
80e8277
- Cleanup now runs AFTER hfUploadFiles: a failed upload can no longer
leave the dataset with neither old nor new files
- Stale paths come from listDatasetFiles + a SOUND_EXTENSIONS match, so
Opus-era .ogg sidecars are cleaned too (was hardcoded .json/.wav) and
the atomic delete commit never trips on a missing path
- opts.protectedStems (wired from the folder share handler): when the
old slug now belongs to a sibling move, skip the delete instead of
destroying that move's live remote copy
Port tfrere UX redesign onto compression base (mechanical replay)
RemiFabre
477cd2b
- Thibaut's one-sided files wholesale: views/components/* (13), welcome,
topbar, settings, main.js, index.html, style.css, db.js, mic-meter,
waveform, hands illustration, dev tooling (live-server, dev-local.js)
- 3-way merged (base 9e420d7): hf.js, state.js, util.js, folder.js,
folders.js, wizard.js — compression era (canonicalizeMotion, Opus
record/save, compress-&-republish banner, Ogg playback, direct share)
grafted into his redesigned structure
- Dropped wizardFromFolder in favor of his wizardOrigin (subsumes the
back-from-folder fix)
- Ported the Opus upload diff into views/components/upload-field.js
(transcodeToReachyAudio, real ext/mime instead of hardcoded .wav)
- SDK pin 1.8.0-rc1-main.dbe26af -> 1.8.4 everywhere (daemon runs 1.8.4;
his 1.8.1 pin skipped)
61/61 unit tests pass. Known follow-ups land next: rename-cleanup
hardening, wizard Back guard, EXPERIMENTAL chip, toast bar fix.
Sync from marionette-js @53b07de: compression era (Opus audio, canonical 50Hz/6dp motion, compress & re-publish, folder-share fixes)
RemiFabre
ff2b76b
r3 (Jun): "Share this tuning with viewers" button
RemiFabre
9e420d7
Author can tune the per-folder Audio sync offset slider and propagate
the value to viewers without re-sharing a move. Until now the marionette.json
sidecar was only committed as a side effect of uploadMove, so a slider
edit after the last share never reached HF; viewers were stuck on the
offset baked into the most recent move commit.
New piece: a "📤 Share this tuning with viewers" button rendered below
the slider, visible only when the user is the author of the folder's
HF repo AND the local audioOffsetMs differs from what was last
published. Click → HF.publishFolderTuning commits a marionette.json-only
change → folder.publishedAudioOffsetMs updated to match → button
hides.
Plumbing:
- lib/hf.js: publishFolderTuning(repoId, audioOffsetMs, token).
Always writes the file (even at 0) so an author reverting a
non-zero published value back to 0 propagates correctly.
- views/folder.js share path: persists folder.repoId (parsed from
the uploadMove URL) and folder.publishedA…
r2 (Jun): trim sync banner copy + move it from home view to folder view
RemiFabre
1d7ed2e
r1 (Jun): surgical community-folder update — keep local recordings
RemiFabre
d28dca6
The Update banner inside a community-imported folder used to call
deleteDatasetAndMoves(folder.id) before re-importing, which nuked
every move in the folder regardless of provenance. A colleague who
filed local recordings into a community folder lost all of them
after clicking Update.
The schema already knows what's local vs imported: every move carries
`fromCommunity: true|false` (set by lib/hf.js at import time, defaulted
to false by the wizard). The fix is to partition before importing:
1. List local moves; collect ids where fromCommunity === true
(prevCommunityIds).
2. importDataset returns the set of ids it imported (one tweak to
lib/hf.js: track + return importedIds alongside the existing
{ datasetId, imported }).
3. Orphans = prevCommunityIds minus importedIds. These are community
moves the upstream owner deleted; we drop them via deleteMove.
4. Local recordings (fromCommunity:false) are never touched.
UX: the confirm-dialog now says "Your N local recordings in th…
r8: replace softReturnToBase / prepForPlayback with safelyReturnToPose
RemiFabre
99b04e6
Delete marionette's local wrappers (softReturnToBase, prepForPlayback,
_waitFreshState, sampleAtTime, planDurationToPose, poseSnapshot) plus
the now-unused HEAD_LEAD_S / ANTENNA_LEAD_S / SLEEP_* tunables. All
call sites switch to safelyReturnToPose from
@pollen-robotics/reachy-mini-sdk/animation, passing MARIONETTE_DURATION_PRESET
(min 0.2 s, max 1.5 s; SDK default minDurationSec of 0.01 reads as a
snap for auto-returns).
The pin-then-enable scaffolding existed because setMotorMode("enabled")
used to be unsafe (daemon kept a stale commanded target and would snap
the motors toward it on torque-up). Daemon PR #1138 fixed that by
pinning to the present pose internally on enable, which lets
safelyReturnToPose collapse the whole sequence to enable -> read state
-> scaledDuration -> gotoTarget. Six lines of marionette glue replaced
with three SDK-helper calls.
Motor.wakeUpRobot (failsafe recovery) splits into Motor.stepThroughDisabled
(gotoSleep + sleep + setMotorMode("disabled") + sleep) …
r7: freshen state before post-playback softReturnToBase
RemiFabre
658a3eb
User's log captured the smoking gun: at "playback ended, entering
return-to-base" the cached robot.robotState showed is_move_running:true
and was up to 500ms stale (state events arrive at ~2Hz). Stale state
meant setTarget(stalePose) snapped the motors to where they used to
be, then gotoTarget(INIT, 0.22s) smoothly moved them to INIT. The
combined effect is the antenna oscillation the user observed at the
end of every recorded move.
motor.js's softReturnToBase already exposes {freshen: true} which
requests a state and waits one round-trip before reading; the
post-recording path uses it. Plumb the same flag through the
post-playback path.
r5: diagnostic logs around end-of-playback return-to-base
RemiFabre
d11a35d
User reports a brutal short motion at the end of a recorded move even
after r3's three-channel scaledDuration. Adds two log lines:
- "playback ended, entering return-to-base" in views/folder.js,
captures the wire-shape pose snapshot at the boundary between the
daemon's last play frame and softReturnToBase.
- "softReturnToBase plan" in lib/motor.js, captures the current pose
snapshot, the SDK's distanceBetweenPoses result, the full
scaledDuration plan (duration, limiter, perChannel), and the goto
target with its computed duration.
User can copy/paste these from Settings → Diagnostics → View log when
the brutal motion reproduces, and we can see whether the duration was
computed from a stale pose, missing a channel, or correctly computed
but still snapping for a different reason.
Per-folder offset travels through HF; banner phrasing; no em-dashes
RemiFabre
eb05859
Banner text updated per user request, "visible if played on a different
setup". uploadMove now writes a marionette.json sidecar at the repo
root carrying audio_offset_ms when it is non-zero; importDataset
reads it on import so downloaders get the corrected offset by
default. Opportunistic em-dash cleanup in the files touched this turn.
Banner on HomeView (dismissible) explaining the 2026-05-25 architecture
change. Per-folder audioOffsetMs slider in FolderView header — adds to
the global offset at play time so authors can salvage legacy datasets
recorded before the upload-then-play rollout.
Auto-convert non-WAV audio at import + on first play
RemiFabre
3b65ad3
Three places where stray MP3/OGG/M4A audio used to slip into
IndexedDB and break playMove:
1. lib/hf.js importDataset: sniff each downloaded audio blob, run
normalizeToReachyAudio on anything that isn't WAV BEFORE
putMove. The downloaded community datasets routinely have MP3
files mislabeled as .wav (e.g. Anne-Charlotte/comptines); they
now arrive in IndexedDB as canonical 16 kHz mono WAV.
2. views/folders.js importCommunityDataset: after the import
completes, run runMigrationWithOverlay. Belt-and-suspenders for
anything the inline normalize missed (or moves left over from
an older import before this commit).
3. views/folder.js playMove: when audio sniff fails, instead of
refusing with a toast we now trigger runMigrationWithOverlay
right there. The user clicks Play once, sees the migration
overlay convert everything in the database, and on completion
the move is replayed normally. No reload required.
The combined effect is that the user never has to…
Option E: upload audio with the move, daemon plays both (single clock)
RemiFabre
301aa65
When the user has 'Robot' selected as the audio output, the WAV is
now uploaded to the daemon alongside the move (same upload_id pairs
them). Daemon's GStreamer playbin and the motion loop run on the
same CM4 clock -- there is no cross-network sync to drift, no
per-platform decoder padding, no audio-pipeline latency to
compensate for.
When the user selects 'Device' output, the old browser-side path
(Audio_.prepare + start on the daemon's started event) is kept --
useful for previewing without the robot speaker.
Driver (lib/move-upload.js):
- makePlaybackDriver.run gains audioBlob + audioLeadMs options.
- Audio uploads after the move-finish, before play_uploaded_move.
Same fire-and-forget pipelining as the move chunks, paced on
_dc.bufferedAmount. PCM compresses poorly so we skip gzip and
just base64-encode.
- The play command carries audio_lead_ms straight through.
- onStarted now receives { duration_s, has_audio } so the caller
knows whether the daemon alre…
Audio: normalize every blob to 16 kHz mono PCM WAV at the door
RemiFabre
46aa53d
Picks one canonical shape for all saved audio so playback sync is
repeatable across browsers, formats, and robots. Targets Reachy
Mini's ReSpeaker native rate (16 kHz, see reachy_mini/media/audio_base.py:43)
and the robot's single mono speaker.
lib/audio.js:
- REACHY_AUDIO_SAMPLE_RATE = 16000, REACHY_AUDIO_CHANNELS = 1.
- normalizeToReachyAudio(blob): decode any browser-supported
format, resample + mix to mono via OfflineAudioContext, encode
16-bit PCM WAV.
- transcodeToWav(): now delegates to normalizeToReachyAudio so
mic recordings get the same canonical shape.
- trimAudioToWavBlob(): rewritten to use OfflineAudioContext so a
trim of a non-WAV upload also lands in the canonical shape.
- sniffWavBlob(): magic-byte detector (RIFF/WAVE) plus reason
label for MP3 / OGG / FLAC / M4A.
views/wizard.js: the file picker runs normalizeToReachyAudio
synchronously before storing state.audio.blob, so an uploaded MP3
never reaches IndexedDB or HF as-is. Move name …
Audio: pre-decode in parallel with upload, kill the seconds-long sync drift on long songs
RemiFabre
3b70fc6
The previous flow awaited Audio_.play() inside onStarted, which
called decodeAudioData on the full audio buffer at trigger time.
For a 3-minute song that's hundreds of ms to multiple seconds of
blocking work AFTER the daemon's play_move loop has already
started -- so motion runs ahead of audio by exactly that amount.
This commit:
- Audio_.prepare(blob) -> { start, stop, waitEnd, duration }.
Decodes + arms the BufferSource + replaceTracks the audio
sender during the upload phase. start() at trigger time is
sub-millisecond.
- folder.js: kicks off the prepare promise the moment we know
the move has audio (parallel with chunk upload). onStarted
just awaits the already-resolved handle and calls .start().
- Manual audio sync offset in Settings (0-500 ms, 25 ms steps,
persisted in localStorage). Default 0; tune up only if the
song still feels slightly off after the pre-decode fix.
start() also takes the offset and uses AudioContext.currentTime
scheduling ra…
Daemon-side playback: upload move via DataChannel, daemon runs play_move
RemiFabre
06c1260
Replaces the per-frame robot.setTarget streaming loop in Playback.play
with a chunked upload to the daemon (lib/move-upload.js) followed by
play_uploaded_move + cancel_move. The daemon's Backend.play_move ticks
at 100 Hz with no network in the inner loop, fixing the wireless
shakes.
Audio stays in the browser (existing WebRTC audio sender track swap).
The sync point: folder.js starts audio in the onStarted callback,
which fires when the daemon's started-ack arrives — i.e. the moment
the daemon's playback loop has actually begun. Drift bound is the
data-channel ack RTT, typically <100 ms on direct P2P.
UI: a progress bar pill appears under the freq readout while chunks
are uploading. Short moves barely flash it; multi-minute songs sit
there for a few seconds while the chunks fly across.
Requires the matching reachy_mini daemon branch
(feature/daemon-side-move-upload). The driver surfaces a clear error
on first start_ack timeout so the user knows to deploy the daemon
update.
Also inc…
Community: refresh button + auto-invalidate cache on share
RemiFabre
5ea9144
Symptom: a freshly-shared dataset (verified to be on HF, correctly
tagged) wouldn't appear in the Community tab. The list is fetched
once per session and cached in state.communityDatasets; navigating
away from Community and back just paints the cache, so newly-shared
datasets never showed up until the page was reloaded.
Two fixes:
1. Refresh button — circular reload icon next to the Mine/Community
segment chips, visible only when Community is active. Click
clears the cache and re-runs renderFolderList. Useful for the
"someone else just shared" case where the user hasn't done
anything that would auto-invalidate.
2. Auto-invalidate after share — in folder.js's share success path,
set state.communityDatasets = null. Next time the user opens
Community (or hits refresh), the fetch goes out again. Covers
the "I just shared, now looking" case without needing the button.
Previously, clicking the ✓ Shared chip marked the move
locally-unshared without touching the HF dataset, then required a
second click on the Share chip to re-publish. Two clicks plus a
confusing intermediate state.
New behaviour: clicking ✓ Shared opens a confirm dialog offering
"Re-publish" — re-runs uploadMove on the same repo (derived from the
stored sharedUrl, so it works even if the folder has been renamed).
The re-publish carries the README upload from the previous commit,
which is what fixes the missing community-tag problem on datasets
created before today's fix.
Removed the local-only unshare path. It was implementing an
edge case (mark something unshared locally without deleting from HF)
that no one actually needed; the confusing toast it produced was
worse than the missing feature.
Initial clone from RemiFabre/marionette-js + experimental marker
RemiFabre
f8035c7
This Space (RemiFabre/marionette-experimental) is the staging ground
for the Phase 3 + 4 work in REFACTOR_PLAN.md — replacing the full-DOM
rebuild on every state change with lit-html surgical updates, which
will eliminate the flicker users have been reporting.
Production stays at RemiFabre/marionette-js. Once a refactor pass is
stable here, we'll merge back.
Surfaces that flag this as the experimental Space:
- README frontmatter title "Marionette (experimental)", warning
emoji 🧪, contrast yellow→red colors
- Browser tab title "Marionette (experimental) · Reachy Mini"
- Topbar chip "EXPERIMENTAL" rendered next to the brand whenever
APP_VERSION starts with "exp " — driven by lib/version.js so
code stays identical between the two Spaces
- Version label "exp 2026-05-18 r1" in the settings sheet
Everything else is a verbatim clone of the marionette-js source as
of commit 81c3108 (SDK pinned to upstream v1.7.2 via jsDelivr).