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
ALSA lib pcm.c:8526:(snd_pcm_recover) underrun occurred #290
Comments
I have also been getting this error on rare occasions, but I don't know what triggers it so I can't reproduce. |
Also getting this. Like Rua, I can't figure out how to reproduce it |
It makes me wonder if it's caused by some other outside factor |
At least in my use case, I've found that the 0.10 release of rodio doesn't have this issue. |
Time to compare and contrast code! |
getting the same thing on rodio 0.11, with large FLAC sources. I thought maybe the BufReader initially reading the file was underrunning so I increased its capacity significantly, but that only seems to delay the problem somewhat. I would be happy to insert some larger buffers between steps but I'm not sure that's doable. I don't see any way to tweak the rest of the chain from decoder to sink to device. |
FWIW I'm getting this every time Bevy initializes its audio system; that's got rodio 0.13. (I'm on Fedora Workstation 34 pre-release with pipewire, fwiw.) |
Also getting this error every other time when Bevy loads audio. Didn't have this problem before switching from PulseAudio to PipeWire 0.3.24. Haven't noticed any other audio applications misbehaving. |
Same problem on Linux with PipeWire 0.3.24 |
Rereading my original post, or makes me wonder if Rodio doesn't strip null bytes. We're getting a bunch of "Hey me too" comments, which isn't very helpful. Could we get some code of what y'all are doing and see what's in common? Is this specifically to Linux, or does it apply to other OS' too? If it does apply to Linux, which Distros and audio software are y'all using? I'm using Ubuntu and PulseAudio. |
The code I used is the first example from docs (how to play an audio file). I tried to run this example on all 3 linux distros that I use: Arch, Manjaro, Fedora. And result is always the same: no sound and error |
I found this on another thread: https://bbs.archlinux.org/viewtopic.php?id=185736 Maybe this helps? |
I have the same issue, I can reproduce it with the example
Another run:
System info:
I'm using Arch Linux, I have installed |
I also have the same issue on Fedora35 using Pipewire and I was wondering if there was any progress regarding this issue? So while this runs like a charm:
these 2 options result in the underrun error:
|
Also ran into this. I've got a short WAV file that I'm repeating while a button is pressed. This code would cause the error once each time sound started ( let mut sink = Sink::try_new(&handle)?;
let mut running = false;
loop {
match rx.recv()? {
ButtonEvent::Pressed => if !running {
println!("Starting sound");
sink = Sink::try_new(&handle)?;
sink.append(Decoder::new_wav(SOUND_FILE.clone())?.repeat_infinite());
running = true;
}
ButtonEvent::Released => if running {
println!("Stopping sound");
sink.stop();
running = false;
}
}
} But this code does not cause the error: let mut sink = Sink::try_new(&handle)?;
let sound = Decoder::new_wav(SOUND_FILE.clone())?.repeat_infinite();
let mut running = false;
loop {
match rx.recv()? {
ButtonEvent::Pressed => if !running {
println!("Starting sound");
sink = Sink::try_new(&handle)?;
sink.append(sound.clone());
running = true;
}
ButtonEvent::Released => if running {
println!("Stopping sound");
sink.stop();
running = false;
}
}
} I'm running on a Raspberry Pi with Raspberry Pi OS's default sound implementation (I have to admit I don't actually know what that is) |
Maybe you hit into it also outside of using this particular project. E.g. on my system I get the same error (albeit on a slightly different line of code) by just letting the linux q4vl2 camera tool record video from my webcam:
|
I have the following function:
However, on the first half(ish?) seconds, I get the error
ALSA lib pcm.c:8526:(snd_pcm_recover) underrun occurred
. This also causes some audio mishaps. After doing some Googling, this error happens when a null byte it passed. The files I'm playing are raw .mp3 files, I don't believe there to be any null bytes. This doesn't happen with any other music player either. Any clue?The text was updated successfully, but these errors were encountered: