hex-agon / runelite-plugins

0 stars 0 forks source link

[Nex Nostalgia] Plugin creates many sound playback sources, potentially causing issues on some systems. #5

Open estivalbloom opened 4 months ago

estivalbloom commented 4 months ago

For reference, I'm running Ubuntu 22.04. I'm unaware whether or not any similar issues occur on Windows. When this plugin is used, the Clip class being used creates a new playback source on the system for every single sound loaded:

image

Enabling the plugin results in 24 new sound sources appearing, which is exactly the number of voicelines included. This is an issue because pulseaudio servers have a connection limit of 64 (which I believe also includes things such as audio sinks, as well as any tools open for configuring volume). If one has multiple runelite windows open, (even if the plugin is only enabled on one instance) as well as multiple browser tabs which play audio, etc, it's easy to hit this cap and prevent sound from working properly.

Edit: Admittedly, it seems like the method by which some other plugins which add custom sounds (eg. c-engineer, watchdog, sound swapper) use a method which is more problematic with pulseaudio.

hex-agon commented 4 months ago

I've known this for a while and it's indeed just a sad limitation of the Clip utility, i've dribbled with fixing this but it's just not something i've been priorizing. To fix this i have to write a small pcm mixer because java doesn't have one (the Mixer class is not a sound mixer!), it's not hard but i just haven't put time into it.

Another solution is to simply only load the clips relevant to nex's current phase and close/open as the fight progresses, this should at least significantly lower the amount of open sound sources in linux environments.

(Just as a note, windows is not affected by this)

hex-agon commented 4 months ago

@estivalbloom if you know how to run the plugin in devmode, try out this commit: fb6430449e14992fa584bf0e2f65e45997cdddf0

I've written a small clip player that loads clips on demand and avoids keeping them open, that should fix this issue