oceanarts wrote: ↑Sun Dec 15, 2024 6:42 pm
So, I reinstalled Fedora which I used before I attempted Pop! OS (Ubuntu based) and the problem is no longer there.
Hollywood no longer crashes and the sample plays fine no matter how many times it is triggered.
I don't know what it was... A Pipewire issue, maybe?
Maybe, audio on Linux is a difficult thing and I've also seen buggy audio drivers. That being said, you must make sure there is a free channel before you start audio playback using
PlaySample() or
PlayMusic(). By default, Hollywood allocates 8 channels so if you call
PlaySample() 9 times you'll get an error. If you don't want that, you could hard-code the channel for each audio playback by using the "Channel" tag of
PlaySample() or
PlayMusic(). From the manual:
"Channel": Channel to use for playback of this sample. By default,
PlaySample() will automatically choose a vacant channel and will fail if there is no vacant channel. To override this behaviour, you can use this field. When specified, it will always enforce playback on the very channel specified here. If the channel is already playing, it will be stopped first.
If you hard-code the channel to use, there'll never be an error complaining about not enough free channels. But of course it means that if there's already something playing on the channel you specify, that previous playback will be stopped.