Open AstraLuma opened 11 months ago
(An RPi4 does keep up, although it's consistently 0-10ms off.)
This will also likely impact the Raspberry Pi Zero 2.
@AstraLuma Thanks for the feedback! I saw your other issue too, I noticed there that you ran cargo build
without the --release
flag. Does compiling with optimizations help?
I did both, enabling default release optimizations didn't get it running fast enough.
I'm assuming there's non-default optimizations that might help? I haven't dug into Rust compile/link options and if there's a "maximum optimizing for your current CPU" available.
I might have to look into it then! Right now it resamples inside the audio data callback, which is the cause of the ALSA underruns. I'm working on a branch which introduces a second buffer to decouple the DSP from the realtime network and audio threads, so hopefully that will help here too. I'll keep you posted.
Enabling all of https://nnethercote.github.io/perf-book/build-configuration.html (except PGO) isn't enough.
[profile.release]
codegen-units = 1
lto = true
panic = "abort"
RUSTFLAGS="-C target-cpu=native" cargo build --release
For comparison, the RPi3 at least keeps a consistent ~500ms behind.
An RPi1's delay just grows without bound, extremely rapidly.
How did you get it to work in the first place, @AstraLuma? I mean the Pulseaudio setup and Bark configuration part. If you have a few mins, would be great to get a few pointers there. So far I'm not managing to get a working PulseAudio sink against ALSA going :-/
How did you get it to work in the first place, @AstraLuma? I mean the Pulseaudio setup and Bark configuration part. If you have a few mins, would be great to get a few pointers there. So far I'm not managing to get a working PulseAudio sink against ALSA going :-/
I think I just installed a desktop distro and let it handle it.
Not enough CPU, so it never catches up--ALSA also complains about buffer underruns, and
bark stats
consistently shows it 500ms off.It might run if PulseAudio wasn't necessary? But I couldn't figure out how to run it without pulse.