cpal
cpal copied to clipboard
Popping/hitching in beep example
On Linux with alsa backed by pulse, I'm experiencing extremely erratic artifacts in the beep example. Sometimes they'll occur practically continuously, and sometimes they won't occur at all, but they're common on average and unmistakeable when you hear them.
I've encountered the same thing on the master branch (0354548426f7b4c48392cae9876a3e77ea5c1c40) on windows 7... Sometimes I go several minutes without hitches, sometimes they're only a few seconds apart. I've tried checking if it's my audio by listening to a 1000hz sine wave on youtube, and that hasn't yet hitched once. Perhaps this is grasping at straws, but any hitches I encountered occurred when typing in Discord.
On current master, I can only reproduce this by e.g. aggressively cycling between windows while running the example; running heavy compiles in the background doesn't affect it. Other programs like mpv, however, don't glitch no matter what I try, so this remains an issue.
I wonder if this might be caused by the buffer not being filled up (#432)?
Can confirm this is still happening on Windows 11:
Default output config: SupportedStreamConfig { channels: 2, sample_rate: SampleRate(48000), buffer_size: Unknown, sample_format: F32 }
I upped the length to be 60 seconds and it seems to consistantly click/pop, both on debug & release. This is also with very light load <2% cpu utilization during the entire run.