View Issue Details

IDProjectCategoryView StatusLast Update
0001585OpenMPTlibopenmptpublic2022-04-01 22:15
ReporterMrArnal Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionno change required 
Platformx64OSWindowsOS Version10
Product VersionOpenMPT 1.30.03.00 / libopenmpt 0.6.2 (upgrade first) 
Summary0001585: Missing loop detection on some modules
Description

Hi!

the module Quit the queue from Virgill (http://modland.com/pub/modules/Fasttracker%202/Virgill/quit.xm) and having the control set to "play.at_end continue" is detecting the loop only after playing the song twice.

Steps To Reproduce
  • load http://modland.com/pub/modules/Fasttracker%202/Virgill/quit.xm in a buffer
  • openmpt_module_initial_ctl ctrls[] = { { "play.at_end", "continue" }, { nullptr, nullptr } };
  • auto module = openmpt_module_create_from_memory2(data.data(), data.size(), &libopenmpt_example_logfunc, nullptr, &libopenmpt_example_errfunc, nullptr, &mod_err, &mod_err_str, ctrls);
Additional Information

It was working fine at some point with the version available in 2021-09-22 (0.5.12), but I didn't test this song after that.

TagsNo tags attached.
Has the bug occurred in previous versions?
Tested code revision (in case you know it)

Activities

Saga Musix

Saga Musix

2022-04-01 22:14

administrator   ~0005145

This isn't really a bug; it's rather a malformed module: There is a pattern loop in position 2 / pattern 0 that is never taken due to a pattern break command appearing on the last row of the loop. Due to a replayer bug in FT2 (and also some other trackers, so this behaviour isn't just XM-specific), the pattern loop state is not reset on the pattern transition and the pattern loop will stay active for the rest of the playthrough of the module. So the next time the player reaches the start of the module, it will be in a different state than it was during the first run, and since the state isn't the same the module has to play one more time until it reaches the same state. Technically you are listening to the tune with two completely different internal playback states, but the resulting audio is identical.

It is true that libopenmpt 0.5 and older don't exhibit this behaviour. This is because they don't track pattern loop states during playback. But the new pattern loop state tracking is required for accurate song length calculation and seeking in songs with pattern loops, and in order to detect infinite pattern loops (which previously would have caused some modules to never stop rendering even if you didn't configure libopenmpt to repeat the song infinitely). So there's no way to get the old behaviour back. As said, the module is technically broken in this regard.

Issue History

Date Modified Username Field Change
2022-04-01 13:54 MrArnal New Issue
2022-04-01 22:14 Saga Musix Note Added: 0005145
2022-04-01 22:15 Saga Musix Status new => closed
2022-04-01 22:15 Saga Musix Resolution open => no change required
2022-04-01 22:15 Saga Musix Product Version => OpenMPT 1.30.03.00 / libopenmpt 0.6.2 (upgrade first)