-
Notifications
You must be signed in to change notification settings - Fork 359
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Entire system sound mutes while debugging #872
Comments
It's surprising that the audio stops when you pause on a sleep call, but this is because every single thread in your program gets paused whenever a breakpoint is hit. If you're using GDB, you may want to look at Non-Stop Mode. I'm using ASIO on Windows and I don't have the issue where audio from other programs is blocked. To troubleshoot this further you could look at a few different things:
If you are in fact using PipeWire, it would be helpful to know how PipeWire is expected to behave when you block in the callback. |
My system sound (as well as the beep) continues when breaking while Non-Stop Mode is on. The output of beep.rs:
I also tried this with separate devices (external interface, BT headphones and frontpanel audio). All yield the same behavior. About trying different libs: use soloud::*;
fn main() {
let sl = Soloud::default().unwrap();
let mut wav = Wav::default();
wav.load_mem(include_bytes!("../creepypasta.mp3")).unwrap();
sl.play(&wav);
while sl.voice_count() > 0 {
// Breakpoint here
std::thread::sleep(std::time::Duration::from_millis(100));
}
} I dont have nearly enough knowledge to pinpoint the source of the Problem (CPAL or PipeWire or ...). But I think using Non-Stop mode is just a workaround. Especially because I dont know how to enable it in Rustrover ... 😭 |
It seems like cpal doesn't suppport pulseaudio. From the readme:
edit: ref #259 I've run into the same thing, I think when you connect to ALSA, it commandeers the whole audio system and prevents other programs from using it. |
This seems to have been fixed in Pipewire at some point. I was able to reproduce this bug back in August but now I'm on Pipewire 1.2.5 and other programs continue to play sound when debugging. |
Turns out it has stopped working again despite having pipewire 1.0.8. |
Hello everyone,
my entire system sounds mutes when debugging while a sound plays.
using gdb to break in the Beep-Example at line 123 causes all other programs (Firefox...) to mute / no longer output any audio:
rust-gdb target
b beep.rs:123
r
cpal/examples/beep.rs
Line 123 in 2ec761d
I dont expect that my programs audio continues (because execution is suspended). But at least other programs should be able to continue to output audio.
pactl info | grep "Server Name"
:Server Name: PulseAudio (on PipeWire 0.3.79)
The text was updated successfully, but these errors were encountered: