Skip to content

Save and restore Jamulus settings #4008

Backlog
Backlog

Description

@pljones

Human guided but AI generated with GPT-6.1 Terra under CoPilot Fusion in VSCode.

Someone tell me if I've missed another proposal for this. It was triggered by me deciding using "github" in our Jamulus Android app package name isn't a good idea.


Allow users, especially on mobile devices, to export and restore all settings normally written to the Jamulus client or server .ini file. The feature is not limited to mobile, the GUI, or the client: support both client and server, GUI and JSON-RPC, on applicable platforms.

This is separate from the existing mixer-channel setup import/export. Related work: jamulussoftware/jamulus#3997 addresses the suggested filename for mixer setups on iOS.

Proposed behavior

  • Export a snapshot of all settings normally written to the relevant .ini, including remembered mixer channels and window state.
  • Preserve the current window positions and visibility when importing; do not move, open or close windows to match the imported file.
  • Reject client import while connecting or connected. Disable the GUI action, reject the RPC request early, and enforce the restriction in the core.
  • Reject server import while clients are connected. Enforce this independently of the GUI or RPC entry point.
  • Apply supported settings and report individual exceptions rather than pretending a partially successful import was complete.
  • Support headless server import/export over RPC without introducing automatic .ini loading or saving for headless servers.
  • Extend JSON-RPC with optional line-oriented attachments, leaving ordinary request and response framing unchanged. Only explicitly permitted operations can opt in.

Current implementation and constraints

  • src/settings.cpp reads and writes XML despite the .ini extension. Its startup loader directly mutates client or server state; simply calling it again will not refresh every live setting or GUI control.
  • Some GUI and mixer values are copied into settings only when the client window closes. A current export therefore needs an explicit state snapshot.
  • Client settings include 250 remembered fader slots with six fields each. Their compact XML alone is at least about 59 KB even with minimal values. Server settings have 13 fields and no comparable fader array.
  • JSON-RPC currently uses newline-delimited JSON and limits request lines to 16 KiB. Full client settings cannot fit in a normal request.
  • Server recording-directory changes stop and wait for the recorder thread; directory changes may unregister and re-register the server. Delay panning affects mixing. Existing setters do not by themselves establish that bulk application is safe during an active session.
  • Language changes currently require an application restart. Other settings may have runtime or platform restrictions that must be established.

1. Inventory and specify settings

  1. Inventory every field written by CClientSettings::WriteSettingsToXML and CServerSettings::WriteSettingsToXML, including collections, optional fields and window state. Trace each field to its live owner and GUI.
  2. Classify each field as live-applicable, restart-required, preserved rather than imported, or unavailable/unsafe in a particular mode. Document side effects and any order dependencies.
  3. Decide and document how missing fields, unknown fields, older settings files, and invalid individual values behave. Do not retain stale fader entries accidentally when replacing a full snapshot.
  4. Confirm command-line precedence during explicit import. Retaining existing command-line precedence is the proposed default; report overrides to the caller instead of silently claiming the imported value was applied.
  5. Define partial success: which values were applied, skipped, failed or need restart, and whether failures can leave side effects. Specify handling of wrong-mode files and malformed XML before mutation.

2. Shared settings snapshot and application

  1. Provide shared operations to capture, serialize, validate and apply settings for GUI and RPC callers. Reuse existing format and compatibility logic where safe; preserve existing startup behavior.
  2. Capture current GUI and mixer state before export without closing windows, disconnecting, or triggering shutdown-only side effects. Headless mode must work without GUI objects.
  3. Validate input size, document structure, numeric and boolean values, encoded data and other bounds before unsafe use. Surface file and parse errors explicitly.
  4. Apply values in the required order, synchronize the live core and UI, and report per-setting failures. Do not claim atomic rollback for a partial import unless it is actually implemented.
  5. Keep the existing active .ini filename. Importing an external file is not a request to switch future saves to that file. Respect normal persistence for GUI client/server and headless client, and retain the existing absence of automatic persistence for headless server.
  6. Avoid blocking, allocations and file I/O in real-time processing paths. Review runtime side effects and threading against project requirements.

3. Client integration

  1. Add Save Settings As... and Load Settings... alongside, but clearly distinct from, the existing mixer-channel setup actions.
  2. Keep the load action disabled whenever the client is connecting or connected; use connection state, not just whether audio is running. Reject RPC imports early and recheck in the shared core immediately before application, including after a file picker or attachment transfer.
  3. Apply profile, audio device and mappings, buffer and quality, MIDI, directory, mixer and UI preferences in a safe order. Explicitly report unavailable devices and failed initialization.
  4. Refresh dialogs, menu selections, mixer state and other affected UI from the resulting settings. Preserve current window geometry and visibility.
  5. Emit applicable existing notifications and specify any additional settings-change notification needed by RPC consumers.

4. Server integration

  1. Add the same GUI actions and shared RPC capability for the server.
  2. Disable or reject import when clients are connected; enforce this in the core. Design the check/application boundary so a client arriving during import cannot bypass the safety policy.
  3. Investigate runtime effects of each setting, including registration, recording, directory-list persistence, delay panning, language and platform-specific autostart. Apply safely or report a failure/restart requirement; do not assume an idle server makes every operation safe.
  4. Update server controls and relevant notifications to match actual state, including partial failures.
  5. Make the settings/RPC plumbing available to headless servers without accidentally activating settings autosave or shutdown-only side effects.

5. File handling and mobile UX

  1. Use appropriate native file pickers for import and export. Verify actual read/write access to chosen files on iOS and Android, including document provider URLs where applicable, rather than assuming ordinary local paths.
  2. Supply a useful suggested filename and extension, including on iOS; make the exported file selectable in the import picker.
  3. Treat cancellation as a no-op. Report open, read, write and parse failures and show a useful summary of partial application and restart requirements.
  4. Verify transfer between devices, including settings containing device names, paths and geometry that do not exist on the destination.

6. JSON-RPC attachment transport

Develop this as a separately reviewable transport change before the settings RPC methods.

  1. Keep ordinary newline-delimited JSON request/response behavior unchanged. Only explicitly permitted operations may opt in to attachments. An eligible request opts in with an additional top-level member describing a delimiter and decoded byte count; an attachment response is sent only when the requester has opted in and the operation permits it. Reject attachment opt-in for other operations before accepting attachment data.
  2. Follow the JSON line with base64 text lines and a delimiter line. Use a maximum of 76 base64 characters per line and LF framing; define whether all non-final lines must be full, padding, empty attachments and delimiter syntax. Delimiters must be bounded and unable to collide with base64 data.
  3. Specify how attachments associate with request IDs, how errors are returned, and how notifications are queued so they cannot interleave with an attachment. Initially reject attachments in batch requests.
  4. Accept attachments only after authentication. Enforce decoded and encoded size limits, line limits, absolute transfer deadlines, and per-connection and aggregate resource limits. Check declared against actual decoded size. Close malformed, oversized or incomplete transfers rather than waiting indefinitely for a delimiter.
  5. Measure full client exports with realistic history and strings before selecting limits. Consider slow readers and backpressure for responses as well as slow or malicious uploads.
  6. Keep ordinary clients compatible, document the extension and its security properties, and avoid logging attachment contents. The existing TCP transport is not encrypted.

7. JSON-RPC settings operations

  1. Add client and server operations for exporting current settings and importing an attachment using the shared core. Define method names, capability negotiation and response shapes as part of the specification.
  2. Return an explicit busy/session error before accepting an import where possible and recheck at application time. Define connection behavior when a rejected request has an attachment already in flight.
  3. Return structured partial-success details and restart requirements; do not report success for file, validation or application failures.
  4. Regenerate docs/JSON-RPC.md from its source annotations and document attachment and settings behavior.

8. Verification and delivery

  • Discuss and agree the specification before coding, in accordance with CONTRIBUTING.md. Keep independently reviewable changes focused.
  • Test export/import round trips for client and server, GUI and headless, with current state distinct from the last saved file. Verify remembered faders, settings dialogs, notifications and normal persistence.
  • Test rejection while connecting/connected and with server clients, including state changes during a picker or transfer; test successful import afterward.
  • Exercise unavailable audio/MIDI devices, paths, command-line overrides, partial files, older files, invalid values, wrong-mode and malformed XML, and restart-required settings. Confirm window geometry and visibility stay unchanged.
  • Test legacy JSON-RPC clients, authentication, attachment framing, maximum size boundaries, opt-in on permitted and non-permitted operations, malformed base64 and delimiters, interrupted/slow transfers, concurrency, batching, backpressure and notification ordering.
  • Verify mobile save/load using the native picker and a cross-device transfer, plus relevant desktop and headless builds and functional tests. Compare changed behavior against the baseline and record untested platforms.

This plan is based on source inspection; implementation and runtime verification remain outstanding.

Activity

  1. added
    needs documentation
    JSON-RPC
    AI
    on Nov 24, 2026
  2. added theissue type on Nov 24, 2026
  3. modified the milestone: Release 4.1.0 on Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    AIJSON-RPCfeature requestneeds documentation

    Projects

    • Status
      Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions