-
Notifications
You must be signed in to change notification settings - Fork 50
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
Aborting Panic on Jack host #122
Comments
I've forked kira and added a good old println to the error callback, it seems we get
in quick succession. That overflows the ringbuffer and aborts. |
I wrote that code with the assumption that a stream would stop after one error. What a fool I was! Would it make sense to add a |
Okay, so right now, Kira aborts if there's more than one error within 500 milliseconds, which is the poll interval of the stream manager.
The question of adding a IMO, apart from the "brute force approach" of simply giving the rb a higher capacity and the "quick fix" approach of simply discarding |
BTW, I'd be available for a PR once a solution is settled on |
What do you mean by "the error callback should be cold"? I'd be down to add a growable ringbuffer type if you can find a way to not allocate on the audio thread. Otherwise, I think it'll suffice to increase the ringbuffer size to 128 or so. If you're getting more than 128 errors every 500ms, something's horribly wrong and you should probably deal with the first 128 errors before worrying about the rest of them. Go ahead and implement whatever solution you think is best! I'm not super opinionated on this because I haven't dealt with many errors from cpal. |
By that I mean it shouldn't be called often during "normal" operation, so it's not absolutely vital to have the error callback be lock-free and allocation-free. So there's two options: Bounded transport (with any capacity) and any errors that don't fit are discarded (optionally with an atomic counter to track how many have been discarded), OR an unbounded transport with the risk of incurring stuttering at high error rates. Edit: I'd personally prefer an unbounded channel, simply out of correctness. Should this in the future turn out to be problematic, this can always be reconsidered. |
PR open at #123, would be happy if you could take a look @tesselode |
The default host on linux/dragonfly/freebsd/netbsd is alsa, but cpal also supports Jack. I wrote a little non-portable snippet that prefers jack if available, otherwise falls back to alsa. I've noticed that this results in an abort in kira when there is another process actively using alsa as host (this doesn't happen if the alsa client isn't sending anything though).
StreamError::BackendSpecific
, because it doesn't seem like kira handles this anywhere.System
Arch Linux 6.13.1-arch2-1
pipewire 1:1.2.7-1
pipewire-audio 1:1.2.7-1
pipewire-alsa 1:1.2.7-1
pipewire-jack 1:1.2.7-1
pipewire-pulse 1:1.2.7-1
libpipewire 1:1.2.7-1
Reproducing?
Backtrace
The text was updated successfully, but these errors were encountered: