initialize pygame mixer before use
It seems that pygame.mixer was not always initialized. Fixes #305
Thanks! I'll test these soon
Hi @NetSpida pygame mixer should always be initialized here: https://github.com/adangert/JoustMania/blob/master/piaudio.py#L274 and https://github.com/adangert/JoustMania/blob/master/piparty.py#L1050
I also tried changing the initialization from pygame.mixer.init(47000, -16, 2 , 4096) to pygame.mixer.init() which lists the frequency, size, channels, and buffer, and started getting a bunch of garbled audio and ALSA lib pcm.c:8545:(snd_pcm_recover) underrun occurred errors in the console.
have you tried doing a clean install of the raspberry pi OS and setup.sh? I'm not seeing this happen on my end.
pygame mixer also gets initialized in update.py. Is it possible it does not release control of the device for piparty.py in some cases. If so, it could cause the pygame.error: ALSA: Couldn't open audio device: Invalid argument errors.
I tried this patch, except with pygame.mixer.init(47000, -16, 2 , 4096) instead of pygame.mixer.init() but still get errors.