Skip to content

Conversation

@Decodetalkers
Copy link

@Decodetalkers Decodetalkers commented Jan 6, 2026

Add support to pipewire

You can test it with pipewire feature open

Pipewire support use config to define rates. So the default config of cpal with pipewire can be changed through config like following.

cat ~/.config/pipewire/pipewire.conf.d/custom-rates.conf
context.properties = {
    default.clock.rate          = 48000
    default.clock.allowed-rates = [ 44100 48000 88200 96000 176400 192000 ]
}

Still problems left:

*once we do 'pipewire::init', we can only dequeue it after the whole thread. even put the function to another thread, the function still works.. But seems we can run init many times.. (Ok, seems it is not a problem, because in when we call init, the init action will only be called once. I think it will be ok)
*The crates by pipewire need edition 2024. I think that should be another pr.

@Decodetalkers Decodetalkers marked this pull request as draft January 6, 2026 12:20
@Decodetalkers Decodetalkers changed the title Pipewire support Support pipewire as host Jan 6, 2026
@Decodetalkers Decodetalkers marked this pull request as ready for review January 6, 2026 14:41
@Decodetalkers Decodetalkers force-pushed the pipewire branch 4 times, most recently from 9e2ef9f to fd59a29 Compare January 6, 2026 14:57
@Decodetalkers
Copy link
Author

Seems pipewire need edition 2024..

@Decodetalkers
Copy link
Author

@roderickvd can you help review this pr? Thanks, and when can this crate be upgraded to edition 2024? I would also want to help

@roderickvd
Copy link
Member

@roderickvd can you help review this pr?

Definitely will help you review it. Need a bit more time.

Thanks, and when can this crate be upgraded to edition 2024? I would also want to help

Actually cpal itself doesn't need to be upgraded to Rust 2024, it just needs a MSRV of Rust of 1.85 or higher to support dependencies that are Rust 2024 already.

When we can I'd like to stick cpal to Rust 2021 so we keep our MSRV down.

@SuperKenVery
Copy link
Contributor

Super cool man! Happy to see cpal having better linux support, opening the possibility of loopback recording on Linux!

@Decodetalkers
Copy link
Author

ok, only one ci that I cannot fix

@Decodetalkers Decodetalkers force-pushed the pipewire branch 3 times, most recently from a81e104 to 5a3817c Compare January 10, 2026 16:19
@Decodetalkers
Copy link
Author

ok cross-rs based on ubuntu20.04, so

@Decodetalkers Decodetalkers force-pushed the pipewire branch 2 times, most recently from 9fc57c0 to 4e44276 Compare January 11, 2026 00:39
@Decodetalkers Decodetalkers force-pushed the pipewire branch 6 times, most recently from 758398a to f457c69 Compare January 11, 2026 08:46
because cross-rs is based on ubuntu20.04, so it does not contains
pipewire
@Be-ing
Copy link
Contributor

Be-ing commented Jan 15, 2026

How does this differ from #692?

@Decodetalkers
Copy link
Author

How does this differ from #692?

This one is a finished version, and used the roundtrip to get the information, instead of using thread to control it.

@roderickvd
Copy link
Member

You think this renders #692 obsolete - should we close that in favor of this one?

@Decodetalkers
Copy link
Author

You think this renders #692 obsolete - should we close that in favor of this one?

Maybe . If you think that is no problem

loxoron218 and others added 5 commits January 20, 2026 23:05
Replace boolean check with match expression to properly handle both
timeout expiration and channel receive errors, returning a more
accurate StreamConfigNotSupported error instead of DeviceNotAvailable.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants