Skip to content

Commit

Permalink
feat: add JACK and ASIO backend support
Browse files Browse the repository at this point in the history
Add support for professional audio backends:
- JACK backend for audio routing between applications (Linux only)
- ASIO backend for low-latency audio with direct hardware access (Windows only)
- Update device examples to include new backends
- Document build requirements and dependencies
  • Loading branch information
roderickvd committed Dec 9, 2024
1 parent a95338d commit 9279700
Show file tree
Hide file tree
Showing 7 changed files with 220 additions and 31 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/check-beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,15 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: ubuntu-latest
features: --features jack

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install build tools and ALSA dependencies (Linux only)
- name: Install build tools and dependencies (Linux only)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update && sudo apt-get install -y libasound2-dev
Expand All @@ -27,6 +30,6 @@ jobs:
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2

- name: Check on ${{ matrix.os }} with Rust stable
- name: Check on ${{ matrix.os }} with Rust beta
run: |
cargo check --verbose
cargo check --verbose ${{ matrix.features || '' }}
9 changes: 6 additions & 3 deletions .github/workflows/check-stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,18 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: ubuntu-latest
features: --features jack

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install build tools and ALSA dependencies (Linux only)
- name: Install build tools and dependencies (Linux only)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update && sudo apt-get install -y libasound2-dev
sudo apt-get update && sudo apt-get install -y libasound2-dev libjack-dev
- name: Install Rust stable
run: rustup toolchain install stable --profile minimal
Expand All @@ -37,4 +40,4 @@ jobs:

- name: Compile on ${{ matrix.os }} with Rust stable
run: |
cargo check --verbose
cargo check --verbose ${{ matrix.features || '' }}
6 changes: 3 additions & 3 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install build tools and ALSA dependencies
- name: Install build tools and dependencies
run: |
sudo apt-get update && sudo apt-get install -y libasound2-dev
sudo apt-get update && sudo apt-get install -y libasound2-dev libjack-dev
- name: Install Rust stable
run: rustup toolchain install stable
Expand All @@ -34,4 +34,4 @@ jobs:
run: cargo fmt --all -- --check

- name: Check Clippy lints
run: cargo clippy --all-targets -- -D warnings
run: cargo clippy --all-targets --all-features -- -D warnings
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ and [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/).
## [Unreleased]

### Added
- [player] Support JACK and ASIO audio backends
- [player] Queue reordering with position tracking
- [remote] Queue shuffle support with state synchronization
- [remote] Initial volume setting that remains active until client takes control below maximum
Expand Down
117 changes: 114 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,22 @@ maintenance = { status = "actively-developed" }

[features]
default = ["binary"]

# Enable command-line interface and binary build
binary = ["dep:clap"]

# Enable ASIO (Audio Stream Input/Output) backend for low-latency audio (Windows only)
# Requires Steinberg ASIO SDK and additional build setup
# See: https://docs.rs/crate/cpal/latest
asio = ["cpal/asio"]

# Enable JACK (JACK Audio Connection Kit) backend for low-latency audio with flexible routing
# (Linux only)
# Requires JACK development files:
# - Debian/Ubuntu: libjack-dev
# - Fedora: jack-audio-connection-kit-devel
jack = ["cpal/jack"]

[dependencies]
base64 = "0.22"
blowfish = "0.9"
Expand Down Expand Up @@ -111,6 +125,7 @@ protoc-bin-vendored = "3"
[package.metadata.deb]
copyright = "2024, Roderick van Domburg"
depends = "libasound2"
suggests = "libjack-dev"
section = "sound"
priority = "optional"
assets = [
Expand Down
Loading

0 comments on commit 9279700

Please sign in to comment.