Open whereswaldon opened 2 years ago
I can't reproduce the crash on Mac, but perhaps that's not surprising since the (Linux) audio driver shows up in the stack trace.
Instead of streaming silence, have you considered blocking in your streamer or simply taking the mutex that the speaker exposes? (speaker.Lock()
). That should keep it from doing anything, including polling empty streamers. I don't know this introduces bad side effects, but perhaps worth a shot.
This small sample program panics on Linux:
I believe there must be a race or some kind of failed cleanup responsible, but I'm not certain.
The exact crash is:
Am I doing something wrong in how I reinitialize this? My use-case is an application that only needs to play sound sometimes. Leaving the speaker running eats 5% of the system's CPU time to process silence, so I want to shut down the speakers when they're not needed. When I try to re-initialized the speakers (even after a delay), I get a crash like this.
System info (Arch Linux):