20 releases

0.6.2 Sep 24, 2019
0.6.0 Feb 2, 2018
0.5.7 Dec 29, 2017
0.5.5 Nov 29, 2017
0.1.2 Oct 26, 2016

#5 in Audio

Download history 77/week @ 2019-07-11 84/week @ 2019-07-18 23/week @ 2019-07-25 29/week @ 2019-08-01 32/week @ 2019-08-08 11/week @ 2019-08-15 187/week @ 2019-08-22 79/week @ 2019-08-29 84/week @ 2019-09-05 37/week @ 2019-09-12 194/week @ 2019-09-19 70/week @ 2019-09-26 91/week @ 2019-10-03 18/week @ 2019-10-10 108/week @ 2019-10-17

350 downloads per month
Used in 3 crates (2 directly)

MIT license

190KB
4K SLoC

Rust JACK

License: MIT

crates.io docs.rs

Build Status

Nice Rust bindings for JACK Audio Connection Kit

Documentation for Master

Check out the examples directory for usage.

Crates

Stable

[dependencies]
jack = "0.6"

Master

[dependencies]
jack = { git = "https://github.com/RustAudio/rust-jack.git" }

Completeness

For details on which functions from the JACK headers have been implemented, see ffi_completeness.md.

More high-level, creating clients, creating/reading/writing/connecting ports, audio, and midi are supported.

Missing categories include, JACK threading, synchronous processing, transport and control functionality.

Running

  • libjack is required. Consult your package manager or the official website.

  • The general workflow for a JACK application is to start up a JACK daemon and connect the client to it. qjackctl is a convinient way to configure and bring up a JACK server through a GUI.

  • JACK FAQ

Testing

Testing requires setting up a dummy server and running the tests using a single thread.

$ # Set up a dummy server for tests.
$ ./dummy_jack_server.sh
$ # Run tests with limited concurrency.
$ RUST_TEST_THREADS=1 cargo test

Note: We use a single thread for tests since too multiple client instantiations in short periods of time cause the JACK server to become flaky.

Possible Issues

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

  1. Increase the value used by sleep_on_test in client/common.rs.

Another case is that libjack may be broken on your setup. Try switching between libjack and libjack2 (they have the same API and libjack2 isn't necessarily newer than libjack), or using a different version.

"C" & Rust API differences

  • String lengths in the "C" API include the NULL character while these Rust bindings do not. generally rust_size(x) = c_size(x) - 1.
  • "C" bindings require functions to be registered while Rust bindings register an object with a trait.
  • jack_on_shutdown has been removed, uses only jack_on_info_shutdown.
  • Rust enums vs C enums
  • Rust bitflags vs C integers used as flags
  • deprecated JACK functions are not used/implemented in Rust bindings

C JACK API

Main Page

Dependencies

~115KB