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

Constant freezing at 0% during export #7320

Open
1 task done
SalutanisOrkonus opened this issue Jun 14, 2024 · 37 comments · May be fixed by #7568
Open
1 task done

Constant freezing at 0% during export #7320

SalutanisOrkonus opened this issue Jun 14, 2024 · 37 comments · May be fixed by #7568
Assignees
Labels

Comments

@SalutanisOrkonus
Copy link

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.

  • I have searched all existing issues and confirmed that this is not a duplicate.
@zonkmachine
Copy link
Member

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
Copy link
Author

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

@zonkmachine
Copy link
Member

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

@SalutanisOrkonus
Copy link
Author

It's set to SDL (Simple DirectMedia Layer)

@SalutanisOrkonus
Copy link
Author

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
Copy link
Author

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
Copy link
Contributor

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

@SalutanisOrkonus
Copy link
Author

it did not

@tresf
Copy link
Member

tresf commented Aug 13, 2024

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

@SalutanisOrkonus
Copy link
Author

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
Copy link
Member

tresf commented Aug 13, 2024

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
Copy link
Author

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
Copy link
Member

tresf commented Aug 13, 2024

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
Copy link
Author

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 tresf changed the title Constant freezing during export Constant freezing at 0% during export Aug 13, 2024
@tresf
Copy link
Member

tresf commented Aug 13, 2024

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
Copy link
Author

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

@SalutanisOrkonus
Copy link
Author

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
Copy link
Contributor

@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
Copy link
Contributor

sakertooth commented Aug 17, 2024

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 sakertooth self-assigned this Aug 18, 2024
@SalutanisOrkonus
Copy link
Author

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
Copy link
Contributor

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Contributor

sakertooth commented Sep 3, 2024

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
Copy link
Author

my goodness it worked my song exported

@SalutanisOrkonus
Copy link
Author

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
Copy link
Author

SalutanisOrkonus commented Sep 3, 2024

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
Copy link
Contributor

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
Copy link
Contributor

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

@SalutanisOrkonus
Copy link
Author

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
Copy link
Contributor

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
Copy link
Author

Any news on when this may be a proper commit?

@sakertooth
Copy link
Contributor

sakertooth commented Sep 20, 2024

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
Copy link
Author

Ah, understood.

@SalutanisOrkonus
Copy link
Author

SalutanisOrkonus commented Sep 30, 2024

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

@sakertooth sakertooth linked a pull request Oct 31, 2024 that will close this issue
@sakertooth
Copy link
Contributor

I fixed this long overdue issue with #7568 I believe (and maybe some other audio backend issues we were having? e.g. soundio was broken in my testing until those changes). Now just waiting for reviews.

@sakertooth sakertooth linked a pull request Dec 21, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants