Skip to content

Fix stalled SP/mono upload over Remote NetMD#99

Open
jaeming wants to merge 1 commit into
asivery:masterfrom
jaeming:fix/remote-sp-upload
Open

Fix stalled SP/mono upload over Remote NetMD#99
jaeming wants to merge 1 commit into
asivery:masterfrom
jaeming:fix/remote-sp-upload

Conversation

@jaeming

@jaeming jaeming commented Jul 3, 2026

Copy link
Copy Markdown

Problem

Uploading a track in SP (or mono SP) over Remote NetMD hangs at 0% forever. The client opens the /upload websocket but never streams any packets, so the server waits indefinitely.

Root cause

RemoteNetMDService.upload() builds the encrypting MDTrack with WireformatDict[format.codec]. For SP, format.codec is the recording codec name SPS/SPM, but WireformatDict is keyed on wireformat names (SP/LP2/LP105/LP4). So the lookup returns undefined, MDTrack.getFrameSize() is undefined, getFrameCount() becomes NaN, and the packet worker produces nothing — the upload stalls.

The direct-USB path in netmd.ts already handles this by collapsing SPS/SPMSP before the lookup; the remote path just never did the same.

Fix

Mirror the direct-USB path: map SPS/SPMSP before the WireformatDict lookup. This keeps the existing client/server wireformat contract (the server already understands SP), so no server change is required.

AT3 handling is unchanged. Mono over remote is uploaded as SP stereo (as it effectively was intended to be sent), which is a separate enhancement.

Testing

  • tsc + vite build clean.
  • Built client loads over HTTPS (secure context, no console errors).
  • SP uploads to a Sony MZ-N505 via remote-netmd-server now proceed past 0% instead of hanging; LP2/LP4 (which were already fine) unaffected.

The remote upload path passed the raw recording codec (SPS/SPM) straight to
WireformatDict, which only keys on wireformat names (SP/LP2/LP105/LP4). The
lookup returned undefined, so the encrypting MDTrack had no frame size, the
packet worker produced nothing, and the upload hung at 0%.

Mirror the direct-USB path (netmd.ts) by collapsing SPS/SPM to SP before the
lookup, matching the existing client/server wireformat contract.
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.

1 participant