LMMS / lmms

Cross-platform music production software
https://lmms.io
GNU General Public License v2.0
8.13k stars 1.01k forks source link

Constant freezing at 0% during export #7320

Open SalutanisOrkonus opened 4 months ago

SalutanisOrkonus commented 4 months ago

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.

zonkmachine commented 4 months ago

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?

SalutanisOrkonus commented 4 months ago

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

zonkmachine commented 4 months ago

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

SalutanisOrkonus commented 4 months ago

It's set to SDL (Simple DirectMedia Layer)

SalutanisOrkonus commented 4 months ago

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 commented 2 months ago

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.

sakertooth commented 2 months ago

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

SalutanisOrkonus commented 2 months ago

it did not

tresf commented 2 months ago

@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...

Some further questions:

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.

SalutanisOrkonus commented 2 months ago

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

tresf commented 2 months ago

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.

SalutanisOrkonus commented 2 months ago

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.

tresf commented 2 months ago

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?

SalutanisOrkonus commented 2 months ago

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

tresf commented 2 months ago

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)?

SalutanisOrkonus commented 2 months ago

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

SalutanisOrkonus commented 2 months ago

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)

michaelgregorius commented 2 months ago

@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.

sakertooth commented 2 months ago

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).

SalutanisOrkonus commented 2 months ago

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

michaelgregorius commented 2 months ago

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.

SalutanisOrkonus commented 2 months ago

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 commented 2 months ago

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 commented 2 months ago

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.

sakertooth commented 2 months ago

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).

SalutanisOrkonus commented 2 months ago

my goodness it worked my song exported

SalutanisOrkonus commented 2 months ago

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 commented 2 months ago

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.

sakertooth commented 2 months ago

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 commented 2 months ago

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

SalutanisOrkonus commented 2 months ago

I'll admit I did forget to make sure I set it to that, but I looked and apparently my buffer already was 256

michaelgregorius commented 2 months ago

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

By the way, I have tested that file under Windows some time ago. I already have "Raum" and I downloaded the "Live HQ Natural Soundfont", but did not want to subscribe for "Slate Digital Fresh Air". For me the exports worked every time with "Raum" and "Live HQ Natural Soundfont". So it might be related to the Slate effect or some other system differences, e.g. using Windows 11.

SalutanisOrkonus commented 1 month ago

Any news on when this may be a proper commit?

sakertooth commented 1 month ago

Any news on when this may be a proper commit?

The build I sent over removed functionality that had so much trickery when starting and stopping audio devices, which lead to bugs like this one. However, it seems to have some crucial uses and acts as a suboptimal remedy for other poorly implemented functionality, which is the major blocker for removing it altogether. That poorly implemented functionality needs to be properly implemented before the trickery can be removed.

TLDR: It might take a while. Depends.

SalutanisOrkonus commented 1 month ago

Ah, understood.

SalutanisOrkonus commented 1 month ago

I know you've got a jist on the issue but just to add to this for completeness, I just had a project with nothing but Kontakt 6 loaded with Hollywoodwinds and a muted sample track and it froze on export