Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
fa9283b
chore: little process
Decodetalkers Jan 5, 2026
92b9dea
feat: base settings
Decodetalkers Jan 5, 2026
d309a90
chore: base connect function
Decodetalkers Jan 6, 2026
d344160
chore: nearly finished
Decodetalkers Jan 6, 2026
af2d9d0
chore: seems working well
Decodetalkers Jan 6, 2026
8a5faee
fix: feature wrong in platform/mod.rs
Decodetalkers Jan 6, 2026
1eca9ce
chore: tidy up, clippy, fmt
Decodetalkers Jan 6, 2026
36325b6
fix: output error
Decodetalkers Jan 6, 2026
4e1a62d
feat: sink can do both side
Decodetalkers Jan 6, 2026
912411e
chore: complete supported configs
Decodetalkers Jan 6, 2026
49dfbdb
feat: support show the device type
Decodetalkers Jan 6, 2026
82ef700
chore: modify the _typos.toml
Decodetalkers Jan 6, 2026
1a3fa40
chore: reset default backend to alsa
Decodetalkers Jan 6, 2026
fd59a29
chore: add pipewire dependence
Decodetalkers Jan 6, 2026
674225b
fix: target object should be the node name
Decodetalkers Jan 7, 2026
a6cc7d1
chore: use object_serial instead
Decodetalkers Jan 7, 2026
ca41b12
chore: capture should be output
Decodetalkers Jan 7, 2026
8695b5d
chore: remove unused timeout
Decodetalkers Jan 8, 2026
6cea2ad
fix: test pipewire with rust 1.85
Decodetalkers Jan 9, 2026
a49e3bf
chore: keep rust version
Decodetalkers Jan 9, 2026
f457c69
fix: ci
Decodetalkers Jan 10, 2026
424d78f
fix: ci problem
Decodetalkers Jan 11, 2026
5881587
fix: remove the unexisted variable
Decodetalkers Jan 11, 2026
81c7e8e
feat(pipewire): add support for I64, U64, and F32 sample formats
loxoron218 Jan 20, 2026
cbba3fe
feat(pipewire): support multiple sample rates in device configuration
loxoron218 Jan 21, 2026
7c0be36
fix(pipewire): improve error handling for stream initialization timeout
loxoron218 Jan 21, 2026
d6329aa
fix(pipewire): normalize channel list parsing and improve code format…
loxoron218 Jan 21, 2026
30e37b6
Merge pull request #1 from loxoron218/pr/Decodetalkers/1093
Decodetalkers Jan 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/workflows/platforms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ on:

env:
# MSRV varies by backend due to platform-specific dependencies
MSRV_AAUDIO: "1.82"
MSRV_ALSA: "1.82"
MSRV_AAUDIO: "1.85"
MSRV_ALSA: "1.85"
MSRV_COREAUDIO: "1.80"
MSRV_JACK: "1.82"
MSRV_WASIP1: "1.78"
MSRV_WASM: "1.82"
MSRV_WINDOWS: "1.82"

PACKAGES_LINUX: libasound2-dev libjack-jackd2-dev libjack-jackd2-0 libdbus-1-dev
PACKAGES_LINUX: libasound2-dev libjack-jackd2-dev libjack-jackd2-0 libdbus-1-dev libpipewire-0.3-dev

ANDROID_COMPILE_SDK: "30"
ANDROID_BUILD_TOOLS: "30.0.3"
Expand Down Expand Up @@ -94,10 +94,10 @@ jobs:
run: cargo +${{ env.MSRV_ALSA }} check --examples --no-default-features --workspace --verbose

- name: Run tests (all features)
run: cargo +${{ steps.msrv.outputs.all-features }} test --all-features --workspace --verbose
run: cargo +${{ steps.msrv.outputs.all-features }} test --features=jack --workspace --verbose

- name: Check examples (all features)
run: cargo +${{ steps.msrv.outputs.all-features }} check --examples --all-features --workspace --verbose
run: cargo +${{ steps.msrv.outputs.all-features }} check --examples --features=jack --workspace --verbose

# Linux ARMv7 (cross-compilation)
linux-armv7:
Expand Down Expand Up @@ -150,10 +150,10 @@ jobs:
run: cross +${{ env.MSRV_ALSA }} test --no-default-features --workspace --verbose --target ${{ env.TARGET }}

- name: Run tests (all features)
run: cross +${{ steps.msrv.outputs.all-features }} test --all-features --workspace --verbose --target ${{ env.TARGET }}
run: cross +${{ steps.msrv.outputs.all-features }} test --features=jack --workspace --verbose --target ${{ env.TARGET }}

- name: Check examples (all features)
run: cross +${{ steps.msrv.outputs.all-features }} test --all-features --workspace --verbose --target ${{ env.TARGET }}
run: cross +${{ steps.msrv.outputs.all-features }} test --features=jack --workspace --verbose --target ${{ env.TARGET }}

# Windows (x86_64 and i686)
windows:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ jobs:
if: runner.os == 'Linux'
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libasound2-dev libjack-jackd2-dev libjack-jackd2-0 libdbus-1-dev
packages: libasound2-dev libjack-jackd2-dev libjack-jackd2-0 libdbus-1-dev libpipewire-0.3-dev

- name: Setup ASIO SDK
if: runner.os == 'Windows'
Expand Down Expand Up @@ -128,7 +128,7 @@ jobs:
- name: Cache Linux audio packages
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libasound2-dev libjack-jackd2-dev libjack-jackd2-0 libdbus-1-dev
packages: libasound2-dev libjack-jackd2-dev libjack-jackd2-0 libdbus-1-dev libpipewire-0.3-dev

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@nightly
Expand Down
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ asio = [
# Platform: Linux, DragonFly BSD, FreeBSD, NetBSD, macOS, Windows
# Note: JACK must be installed separately on all platforms
jack = ["dep:jack"]
pipewire = ["dep:pipewire"]

# WebAssembly backend using wasm-bindgen
# Enables the Web Audio API backend for browser-based audio
Expand Down Expand Up @@ -53,6 +54,8 @@ audioworklet = [
# Platform: All platforms
custom = []

default = []

[dependencies]
dasp_sample = "0.11"

Expand Down Expand Up @@ -89,6 +92,7 @@ alsa = "0.11"
libc = "0.2"
audio_thread_priority = { version = "0.34", optional = true }
jack = { version = "0.13", optional = true }
pipewire = { version = "0.9.2", optional = true, features = ["v0_3_44"]}

[target.'cfg(target_vendor = "apple")'.dependencies]
mach2 = "0.5"
Expand Down
4 changes: 1 addition & 3 deletions Cross.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@
dockerfile = "Dockerfile"

[target.armv7-unknown-linux-gnueabihf.env]
passthrough = [
"RUSTFLAGS",
]
passthrough = ["RUSTFLAGS"]
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ ENV PKG_CONFIG_PATH=/usr/lib/arm-linux-gnueabihf/pkgconfig/
RUN dpkg --add-architecture armhf && \
apt-get update && \
apt-get install libasound2-dev:armhf -y && \
apt-get install libjack-jackd2-dev:armhf libjack-jackd2-0:armhf -y \
apt-get install libjack-jackd2-dev:armhf libjack-jackd2-0:armhf -y
# TODO: now the cross-rs is based on ubuntu:20.04, so it does not contain pipewire-0.3-dev
2 changes: 2 additions & 0 deletions _typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[default.extend-words]
datas = "datas"
37 changes: 36 additions & 1 deletion examples/beep.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,19 @@ struct Opt {
#[arg(short, long)]
#[allow(dead_code)]
jack: bool,
/// Use the pipewire host
#[cfg(all(
any(
target_os = "linux",
target_os = "dragonfly",
target_os = "freebsd",
target_os = "netbsd"
),
feature = "pipewire"
))]
#[arg(short, long)]
#[allow(dead_code)]
pipewire: bool,
}

fn main() -> anyhow::Result<()> {
Expand Down Expand Up @@ -64,6 +77,28 @@ fn main() -> anyhow::Result<()> {
} else {
cpal::default_host()
};
// Conditionally compile with jack if the feature is specified.
#[cfg(all(
any(
target_os = "linux",
target_os = "dragonfly",
target_os = "freebsd",
target_os = "netbsd"
),
feature = "pipewire"
))]
// Manually check for flags. Can be passed through cargo with -- e.g.
// cargo run --release --example beep --features jack -- --jack
let host = if opt.pipewire {
cpal::host_from_id(cpal::available_hosts()
.into_iter()
.find(|id| *id == cpal::HostId::PipeWire)
.expect(
"make sure --features pipewire is specified. only works on OSes where jack is available",
)).expect("jack host unavailable")
} else {
cpal::default_host()
};

#[cfg(any(
not(any(
Expand All @@ -72,7 +107,7 @@ fn main() -> anyhow::Result<()> {
target_os = "freebsd",
target_os = "netbsd"
)),
not(feature = "jack")
not(any(feature = "jack", feature = "pipewire"))
))]
let host = cpal::default_host();

Expand Down
39 changes: 37 additions & 2 deletions examples/record_wav.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,19 @@ struct Opt {
#[arg(short, long)]
#[allow(dead_code)]
jack: bool,
/// Use the pipewire host
#[cfg(all(
any(
target_os = "linux",
target_os = "dragonfly",
target_os = "freebsd",
target_os = "netbsd"
),
feature = "pipewire"
))]
#[arg(short, long)]
#[allow(dead_code)]
pipewire: bool,
}

fn main() -> Result<(), anyhow::Error> {
Expand All @@ -49,7 +62,7 @@ fn main() -> Result<(), anyhow::Error> {
feature = "jack"
))]
// Manually check for flags. Can be passed through cargo with -- e.g.
// cargo run --release --example beep --features jack -- --jack
// cargo run --release --example record_wav --features jack -- --jack
let host = if opt.jack {
cpal::host_from_id(cpal::available_hosts()
.into_iter()
Expand All @@ -61,14 +74,36 @@ fn main() -> Result<(), anyhow::Error> {
cpal::default_host()
};

// Conditionally compile with jack if the feature is specified.
#[cfg(all(
any(
target_os = "linux",
target_os = "dragonfly",
target_os = "freebsd",
target_os = "netbsd"
),
feature = "pipewire"
))]
// Manually check for flags. Can be passed through cargo with -- e.g.
// cargo run --release --example record_wav --features pipewire -- -- pipewire
let host = if opt.pipewire {
cpal::host_from_id(cpal::available_hosts()
.into_iter()
.find(|id| *id == cpal::HostId::PipeWire)
.expect(
"make sure --features pipewire is specified. only works on OSes where jack is available",
)).expect("jack host unavailable")
} else {
cpal::default_host()
};
#[cfg(any(
not(any(
target_os = "linux",
target_os = "dragonfly",
target_os = "freebsd",
target_os = "netbsd"
)),
not(feature = "jack")
not(any(feature = "jack", feature = "pipewire"))
))]
let host = cpal::default_host();

Expand Down
5 changes: 5 additions & 0 deletions src/host/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ pub(crate) mod emscripten;
)
))]
pub(crate) mod jack;
#[cfg(all(
any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd"),
feature = "pipewire"
))]
pub(crate) mod pipewire;
#[cfg(windows)]
pub(crate) mod wasapi;
#[cfg(all(target_arch = "wasm32", feature = "wasm-bindgen"))]
Expand Down
Loading