MCPcopy Index your code
hub / github.com/RustAudio/rust-jack

github.com/RustAudio/rust-jack @v0.13.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.13.0 ↗ · + Follow
348 symbols 726 edges 40 files 157 documented · 45%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

JACK (for Rust)

Rust bindings for JACK Audio Connection Kit.

Crates.io License
Docs.rs Test
📚 Documentation :heart: Sponsor

Using JACK

The JACK server is usually started by the user or system. Clients can request that the JACK server is started on demand when they connect, but this can be disabled by creating a client with the NO_START_SERVER option or ClientOptions::default().

  • Linux and BSD users may install JACK1, JACK2 (preferred for low latency), or Pipewire JACK (preferred for ease of use) from their system package manager.
  • Windows users may install JACK from the official website or Chocolatey.
  • MacOS users may install JACK from the official website or Homebrew.

Refer to the docs.rs documentation for details about the API. For more general documentation, visit https://rustaudio.github.io/rust-jack.

Testing

Testing requires setting up a dummy server and running the tests using a single thread. rust-jack automatically configures cargo nextest to use a single thread.

# Set up a dummy server for tests. The script is included in this repository.
./dummy_jack_server.sh &
# Run tests
cargo nextest run

Note: If cargo nextest is not available, use RUST_TEST_THREADS=1 cargo test to run in single threaded mode.

Possible Issues

If the tests are failing, a possible gotcha may be timing issues.

  1. If using cargo test, try cargo nextest. The cargo nextest configuration is set up to run single threaded and to retry flaky tests up to 3 times.
  2. Increase the value used by sleep_on_test in client/common.rs.

Another case is that libjack may be broken on your setup. Try using libjack2 or pipewire-jack.

Extension points exported contracts — how you extend this code

PortSpec (Interface)
Defines the configuration for a certain port to JACK, ie 32 bit floating audio input, 8 bit raw midi output, etc... # S [5 …
src/port/port_impl.rs
ProcessHandler (Interface)
Specifies real-time processing. [3 implementers]
src/client/callbacks.rs
PropertyChangeHandler (Interface)
A trait for reacting to property changes. # Remarks Only used if the `metadata` feature is enabled. [1 implementers]
src/properties.rs
NotificationHandler (Interface)
Specifies callbacks for JACK. [2 implementers]
src/client/callbacks.rs

Core symbols most depended-on inside this repo

raw
called by 34
src/client/client_impl.rs
mark_invalid
called by 20
src/client/callbacks.rs
raw
called by 19
src/port/port_impl.rs
iter
called by 16
src/port/midi.rs
to_ffi
called by 14
src/jack_enums.rs
check_client_life
called by 12
src/port/port_impl.rs
activate_async
called by 11
src/client/client_impl.rs
register_port
called by 11
src/client/client_impl.rs

Shape

Method 210
Function 77
Class 41
Enum 16
Interface 4

Languages

Rust100%

Modules by API surface

src/client/client_impl.rs47 symbols
src/port/port_impl.rs36 symbols
src/transport.rs34 symbols
src/client/callbacks.rs33 symbols
jack-sys/src/types.rs26 symbols
src/properties.rs25 symbols
src/port/midi.rs22 symbols
src/ringbuffer.rs20 symbols
examples/playback_capture.rs12 symbols
src/logging.rs10 symbols
jack-sys/build.rs9 symbols
src/tests/processing.rs8 symbols

For agents

$ claude mcp add rust-jack \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact