Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Freeze on trying to load modplug audio with jump markers #2156

Open
Endaris opened this issue Feb 18, 2025 · 0 comments
Open

Freeze on trying to load modplug audio with jump markers #2156

Endaris opened this issue Feb 18, 2025 · 0 comments

Comments

@Endaris
Copy link

Endaris commented Feb 18, 2025

When trying to load a modplug file that defines an infinite loop, e.g. by specifying a jump back to the start on the final row, as either a static Source or SoundData, love freezes up and proceeds to flood the RAM of the machine.

Here is an example project with a suitable file simple_test_with_loop.it:
modplug_repro.zip
I recommend having a process kill ready.

I did some research and there seems to be some baggage attached to the general behaviour with some interesting discussion on the SDL_mixer repo here: libsdl-org/SDL_mixer#117

Of notable interest is the following comment:

BTW, using modplug's builtin looping of the whole track also avoids silence at the end of the track which can happen when using SDL_mixer's looping.

Which is an observation also true for love and for that reason also part of the repro example above. Using source:setLooping(true) for a modplug file that does not define an infinite loop results in an audible silence between loops.
However, when an infinitely looping file is loaded as a streamed source, it will play forever without a delay between loops, regardless of whether setLooping(true) has been called.

Overall these quirks means that modplug audio cannot be treated like other audio at all: Looping only works when specific conditions in the file are met and these conditions require very particular management if the use case requires the use of queueable Source where using a stream Source and calling it a day is no longer an option.
I realize the best option is to just not use modplug but unfortunately that is not an option for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant