Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 10 additions & 2 deletions src/host/pipewire/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,11 @@ where
};
let channels = config.channels as _;
let rate = config.sample_rate as _;
let stream = pw::stream::StreamRc::new(core.clone(), "cpal-playback", properties)?;
let stream = pw::stream::StreamRc::new(
core.clone(),
&format!("cpal-playback-{}", std::process::id()),
properties,
)?;

let listener = stream
.add_local_listener_with_user_data(data)
Expand Down Expand Up @@ -802,7 +806,11 @@ where

let channels = config.channels as _;
let rate = config.sample_rate as _;
let stream = pw::stream::StreamRc::new(core.clone(), "cpal-capture", properties)?;
let stream = pw::stream::StreamRc::new(
core.clone(),
&format!("cpal-capture-{}", std::process::id()),
properties,
)?;
let listener = stream
.add_local_listener_with_user_data(data)
.param_changed(move |stream, user_data, id, param| {
Expand Down
4 changes: 3 additions & 1 deletion src/host/pulseaudio/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use std::{
ffi::CString,
fmt,
hash::{Hash, Hasher},
mem::discriminant,
Expand Down Expand Up @@ -135,7 +136,8 @@ impl Host {
// returns, fall through to the next host with no other option than to leak the thread.
let (tx, rx) = mpsc::channel();
std::thread::spawn(move || {
let _ = tx.send(pulseaudio::Client::from_env(c"cpal-pulseaudio"));
let name = CString::new(format!("cpal-pulseaudio-{}", std::process::id())).unwrap();
let _ = tx.send(pulseaudio::Client::from_env(&name));
});
let client = rx
.recv_timeout(INIT_TIMEOUT)
Expand Down
Loading