lmms icon indicating copy to clipboard operation
lmms copied to clipboard

Constant freezing at 0% during export

Open SalutanisOrkonus opened this issue 1 year ago • 36 comments

System Information

Windows 10

LMMS Version(s)

gbeedc18a

Most Recent Working Version

No response

Bug Summary

pretty much most of the time I go to export a project, the program stops responding, and never unfreezes. the only way to fix is to force close the program and hope it doesn't happen next time.

Expected Behaviour

I can export songs

Steps To Reproduce

Export a song. I don't know if there's any specifics, I just know half the time I go to export it stops responding and never comes back.

Logs

Click to expand
  

Screenshots / Minimum Reproducible Project

image

Please search the issue tracker for existing bug reports before submitting your own.

  • [X] I have searched all existing issues and confirmed that this is not a duplicate.

SalutanisOrkonus avatar Jun 14 '24 20:06 SalutanisOrkonus

Export a song. I don't know if there's any specifics, I just know half the time I go to export it stops responding and never comes back.

You mean all projects? Even the demo projects?

zonkmachine avatar Jun 14 '24 20:06 zonkmachine

Yes, I just tried it with the "ClubMix" template and got the problem first try.

SalutanisOrkonus avatar Jun 14 '24 20:06 SalutanisOrkonus

What audio interface do you use? (settings->audio->audio interface)

zonkmachine avatar Jun 14 '24 20:06 zonkmachine

It's set to SDL (Simple DirectMedia Layer)

SalutanisOrkonus avatar Jun 14 '24 23:06 SalutanisOrkonus

update I have a few projects where this seems to just happen literally every single time. I'm just not allowed to export them. They're a little Very demanding, so that might be related? I've been able to export them before so it's definitely this new issue

SalutanisOrkonus avatar Jul 05 '24 19:07 SalutanisOrkonus

update again I have more stuff I just can't export cuz it keeps not responding, and this time it's something I'm supposed to get paid for idk what could be causing this and idk how to help figure it out considering despite there being a section to put them in, I see no sign of logs.

SalutanisOrkonus avatar Aug 12 '24 02:08 SalutanisOrkonus

@SalutanisOrkonus, I'm curious to see if this fixes your issue. If it doesn't, I'll do more digging.

sakertooth avatar Aug 12 '24 19:08 sakertooth

it did not

SalutanisOrkonus avatar Aug 12 '24 23:08 SalutanisOrkonus

@SalutanisOrkonus thanks for filing this bug report. We need to determine if this is a recent regression caused by code -- and if so -- where that code is.

I'm curious to see if this fixes your issue. If it doesn't, I'll do more digging.

I matched the settings from the screenshot with unfa-Spoken and the version linked and I too could not reproduce, however I did notice some interesting things...

  • 0% - LMMS freezes for a few seconds
  • 100% - LMMS freezes for several seconds

Some further questions:

  • Does this happen on any project?
  • Does it happen without the loop markers selected?
  • What was the last version of LMMS that this works 100% on? Can you reinstall that version and confirm that it still works 100% on that version?

We take these types of bug reports seriously however we first need to determine where this bug lives and if we can reproduce this.

@sakertooth if you have any hunches as to where the bug lives, we could provide a debug build with some logs added. If lmms.exe is started from CMD or PowerShell, we can get some output on Windows which may allude to where the problem is.

tresf avatar Aug 13 '24 15:08 tresf

I do not remember the last version this didn't happen to me on, but as for the other two things -It can happen at random on any project, but some have it happen consistently every time -It happens seemingly no matter what settings I have, whatever format I'm exporting as

SalutanisOrkonus avatar Aug 13 '24 16:08 SalutanisOrkonus

I do not remember the last version this didn't happen to me on, but as for the other two things -It can happen at random on any project, but some have it happen consistently every time -It happens seemingly no matter what settings I have, whatever format I'm exporting as

Hmm... Ok. Without exact steps to reproduce, this makes it harder to narrow down the cause.

tresf avatar Aug 13 '24 16:08 tresf

Really the only thing I can think of is that most of my projects have at least one instance of Kontakt 6, but I doubt that's the issue, considering I've had the same amount of instances in one project as another and one refuses to export while the other is fine. I really with I could be more helpful considering how hindering the issue is. All I really know is it isn't my memory cuz no matter how many tracks I remove to try and export in pieces, it still stops responding.

SalutanisOrkonus avatar Aug 13 '24 17:08 SalutanisOrkonus

The screenshot shows it freezing at 0% but in my experience this has historically been more common at 100%. Is it safe to say that yours freezes at 0% every time?

tresf avatar Aug 13 '24 17:08 tresf

Yes, whenever it freezes, it's at 0%. I hit the export button, it hangs for a couple seconds, then windows marks it as not responding and it whites out. It never comes back after this

SalutanisOrkonus avatar Aug 13 '24 17:08 SalutanisOrkonus

Yes, whenever it freezes, it's at 0%. I hit the export button, it hangs for a couple seconds, then windows marks it as not responding and it whites out. It never comes back after this

Ok, thanks for clarifying. We're also discussing this on Discord. https://discord.com/channels/203559236729438208/784594576223633478

The 100% export issue is much more common and was presumably fixed already. This 0% issue is new. For clarity, are you exporting to a location which may be more volatile (cloud, removable media, network drive)?

tresf avatar Aug 13 '24 17:08 tresf

I only export onto the C drive on my laptop, but I have also tried exporting to the second internal drive. same issue.

SalutanisOrkonus avatar Aug 13 '24 17:08 SalutanisOrkonus

if it helps at all, there's a chance it's memory related. That said, I had been able to export stuff that used a lot of memory in the past (projects of which I can't export now)

SalutanisOrkonus avatar Aug 17 '24 02:08 SalutanisOrkonus

@sakertooth if you have any hunches as to where the bug lives, we could provide a debug build with some logs added. If lmms.exe is started from CMD or PowerShell, we can get some output on Windows which may allude to where the problem is.

It seems like this is the way to go. Add lots of log output to the export related code and perhaps even to the SDL audio device driver code. Then check how the output looks if everything goes fine, e.g. with a Linux build. After that check with the Windows build and check where the output stops.

For the above steps it would be great if @SalutanisOrkonus could provide a bare bones project with no external plugins which reproduces the bug 100% of the time.

In the last few weeks there was in influx of Windows-only bugs so it seems like something is really off there.

michaelgregorius avatar Aug 17 '24 10:08 michaelgregorius

I can reproduce somewhat using unfa - Spoken, but it doesn't occur all the time. First time I exported it I got it first try, but for subsequent tries I couldn't.

The problem seems to be that the main thread ends up waiting indefinitely for the FIFO thread to close, but the FIFO thread doesn't close because its waiting on someone to read from it, but the other thread never does. How we got here I do not know, but the issue is probably in the ordering of calls to AudioEngine::startProcessing and AudioEngine::stopProcessing. AudioEngine::fifoWriter needs a more robust implementation and should not have such a dependency on another thread at all when stopping (either that, or this dependency relationship needs to work better).

sakertooth avatar Aug 17 '24 14:08 sakertooth

update I don't know how to recreate it with stock plugins and also it's almost definitely not memory related because it's happening on stuff using less memory than firefox

SalutanisOrkonus avatar Aug 21 '24 17:08 SalutanisOrkonus

Then it might very well be plugin related. Although @sakertooth mentioned that he can "reproduce somewhat using unfa - Spoken" which to my knowledge does not use external plugins.

Do you have a very small project with which you can recreate the problem? In that case I'd propose to use this project as a starting point and then delete plugins until the export starts working. The last removed plugin would likely be the culprit in this case. Once such a plugin was identified it could be attempted to create a project with only that plugin and to see if the bug still occurs. If it does then it is very likely the plugin.

michaelgregorius avatar Aug 21 '24 17:08 michaelgregorius

I have actually had multiple projects where I've tried deleting tracks in an attempt to export anything, and I'll be real I don't see much of a consistent through line. the current one I'm trying, I deleted everything but an sf2 player instance with Live HQ Natural Soundfont, and effects being two instances of base lmms equalizer, Raum, and Fresh Air, and it still happens no matter what. It's not the sf2 player that's the problem though because this happens on projects without it, including this one when I delete it.

SalutanisOrkonus avatar Aug 21 '24 17:08 SalutanisOrkonus

Since even just this crashes export consistently though, here's this then. NI Raum and Slate Digital Fresh Air are free I'm pretty sure, and Live HQ Natural Soundfont is somewhere online also free I checked and I think it does export without raum or fresh air Unhell03Plus_pianoonly.zip

SalutanisOrkonus avatar Aug 21 '24 17:08 SalutanisOrkonus

I know fixing problems can take a while, but is it known if there's been any progress made on this? I am getting a little desperate.

SalutanisOrkonus avatar Sep 03 '24 00:09 SalutanisOrkonus

I know fixing problems can take a while, but is it known if there's been any progress made on this? I am getting a little desperate.

Let me know if this works for you. If you try this build, make sure your buffer size is set to 256 frames.

Edit: As this is a major experimental build, there may be issues with it that I am currently not aware of, but at least export should work (or at least I hope it does).

sakertooth avatar Sep 03 '24 01:09 sakertooth

my goodness it worked my song exported

SalutanisOrkonus avatar Sep 03 '24 01:09 SalutanisOrkonus

One weird issue, I have a project where in export, an AD2 tom that plays immediately cuts off for a second. some timpani in the same thing doesn't though ex.zip

SalutanisOrkonus avatar Sep 03 '24 22:09 SalutanisOrkonus

there may also be a problem of occasional barely broken waveforms resulting in clicking, but I'm not 100% sure if that's from the sounds I'm using or not.

SalutanisOrkonus avatar Sep 03 '24 23:09 SalutanisOrkonus

One weird issue, I have a project where in export, an AD2 tom that plays immediately cuts off for a second. some timpani in the same thing doesn't though

there may also be a problem of occasional barely broken waveforms resulting in clicking, but I'm not 100% sure if that's from the sounds I'm using or not.

Did you make sure your buffer size was set to 256?

sakertooth avatar Sep 04 '24 09:09 sakertooth

Nevermind, it doesn't seem like this is an issue with my branch.

sakertooth avatar Sep 04 '24 12:09 sakertooth