Repository navigation
Same-device duplex, named I/O paths, and record-offset compensation - #5
Merged
Merged
Conversation
…amed I/O paths. Recording opens the output device when no separate input is chosen, at that device's rate and buffer. A take is shifted earlier by the driver's input and output latency, or by two buffers when the driver reports none. Named input and output paths carry hardware channel lists, and Low Latency Monitoring bypasses inserts and plugin-delay alignment on tracks that are hearing their input. Co-authored-by: matt petters <mattpetters@users.noreply.github.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Record and playback can share one audio device, at one sample rate and one buffer. Named input and output paths carry hardware channel lists, tracks assign those paths (or busses), and a finished take is shifted so it lines up with what was heard.
cpal 0.18 has no single full-duplex callback. When Setup leaves the input unset, recording opens the output device's input side at the output rate and the shared buffer size. Driver timestamps supply input and output latency. If the driver reports neither and a fixed buffer is open, compensation is two buffers (one each way), plus the user offset from
setup.record_offset.Upstream work reused
Surveyed open PRs, issues, and
docs/gaps.mdon storytold/soundcraft before writing this. Nothing was opened against that repo.Looked at and did not merge: #490 (lock-free monitor ring; the existing ring already converts rates and only
try_locks), #1034 (mix block follows the device buffer, up to 8192), #491 (JACK/PipeWire), #43 (DiskWavReader, not wired into the mix), #1077 (headlesssetup.playback_enginestill only stores the session values).What landed
setup.record_offset(samples,compensate). Placing a take moves it earlier by the measured latency. A shift past sample 0 trims the head of the file. Loop passes stay on the loop's timeline.InputPath/OutputPathchannel lists.setup.ioactions:create_input,rename_input,delete_input,set_channels. New sessions start with In 1-2, In 1, and In 2. Older sessions still parse "In 3".track.input/track.outputcommands. A hardware output path sums onto those device channels and is not folded into a narrower device.Remaining gaps
try_lockFIFO, not the lock-free ring in Input monitoring: a lock-free ring that follows the devices' clocks storytold/soundcraft#490.Tests
cargo test --libon Rust 1.95, aftercargo fmtandcargo clippy -D warningsfor model, mix, playback, engine, and ui-egui (all targets):New coverage: channel maps and old sessions without input paths, hardware outputs on device channels (and not folded into stereo), a named input monitored on its channel, low-latency monitoring against a lookahead limiter, record-offset placement and the trim at sample 0, monitor backlog trim vs jitter, and one duplex buffer advancing input and output together.