Skip to content

Allow AddTrack when the JACK backend is open - #44

Open
ethanrxla wants to merge 1 commit into
maolan:mainfrom
ethanrxla:jack-add-track
Open

ethanrxla wants to merge 1 commit into
maolan:mainfrom
ethanrxla:jack-add-track

Conversation

@ethanrxla

Copy link
Copy Markdown

Problem

Engine::add_track (src/engine/topology.rs) sizes the new track from hw_driver_info, which only the hardware
drivers set. With the JACK backend open it is None, so every AddTrack fails with "Engine needs to open audio
device before adding audio track", and no tracks can be created over JACK.

Change

Use current_cycle_samples() and sample_rate() instead. Both already fall back from the hardware driver to the
JACK runtime, so the track is sized from whichever backend is open. It's a three-line change.

Tests

  • On 0.4.29 with jackd -d dummy, AddTrack failed without the change and created the track with it.
  • Not tested: audio through JACK, and the same check in handle_iodelay_configure, which still requires
    hw_driver_info and so still refuses to enable iodelay over JACK.
  • There's no unit test because it needs a running JACK server. If you have a way to fake jack_runtime in tests, I'll
    add one.

Prepared with the help of an AI coding assistant (Claude Code). The JACK result above was run, not inferred.

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.

2 participants