You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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):
$ go version
go version go1.18 linux/amd64
$ uname -a
Linux vendetta 5.17.3-arch1-1 #1 SMP PREEMPT Thu, 14 Apr 2022 01:18:36 +0000 x86_64 GNU/Linux
The text was updated successfully, but these errors were encountered:
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.
polpettone
added a commit
to polpettone/adventure
that referenced
this issue
Aug 20, 2022
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):
The text was updated successfully, but these errors were encountered: