LMMS / lmms

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

Exporting produces artifact-heavy files #3360

Open tukkek opened 7 years ago

tukkek commented 7 years ago

Hi guys, I'm on Linux and using LMMS 1.1.3 from the Debian testing release. I am absolutely sure that I have been able to export files normally a few months ago so I'm thinking this has been caused by updates in related libraries and not in the program itself - since LMMS hasn't been updated in a while, as far as public releases go. Anyway there seems to be a part of this that could be internal so I'm following with the report.

My problem is that while the song plays fine inside LMMS, when exporting it it results in a very artifact-heavy (noisy) file, which is unusable for any practical purposes. I'm using the default export settings and both OGG and WAV formats produce the same results.

What makes this interesting is that when I open LMMS, it will produce the same type of noise while playing, but as soon as I change the audio backend from Pulseaudio to ALSA (or SDL) the issue is solved and I can use LMMS normally. However, after an export, the audio backend seems to be set to Pulseaudio again automatically - which is why I'm betting that this is the underlying issue (exporting with Pulseaudio instead of chosen backend, if that makes any sense).

After an export and the noisy file being generated, the application will once again be very noisy until I set the backend back again to ALSA or SDL. Is it possible this "broken" backend is being used to export my song, producing a broken file? In the least, I think, the exporting process should not change my backend preferences - or at least return it to my previous choice after the exporting is done with.

Some further package version information for my system is going below, maybe it will prove useful. Thank you all very much for the work on LMMS - I can't imagine ever using another composing software, regardless of what type of work I'm doing, platform I may be using or budget for my project :) You guys rock! (btw I'm pretty excited for the next release, coming with MIDI exporting too!)

Kernel: Linux 4.9.0-1-amd64 

Versions of packages lmms depends on:
ii  calf-ladspa                       1.1.3-7
ii  libasound2                        1.1.3-4
ii  libc6                             2.24-9
ii  libfftw3-single3                  3.3.5-3
ii  libfltk1.3                        1.3.4-2
ii  libfluidsynth1                    1.1.6-4
ii  libgcc1                           1:6.3.0-6
ii  libjack-jackd2-0 [libjack-0.125]  1.9.10+20150825git1ed50c92~dfsg-4+b1
ii  libogg0                           1.3.2-1
ii  libportaudio2                     19.6.0-1
ii  libpulse0                         10.0-1
ii  libqt4-xml                        4:4.8.7+dfsg-11
ii  libqtcore4                        4:4.8.7+dfsg-11
ii  libqtgui4                         4:4.8.7+dfsg-11
ii  libsamplerate0                    0.1.8-8
ii  libsdl1.2debian                   1.2.15+dfsg1-4
ii  libsndfile1                       1.0.27-1
ii  libstdc++6                        6.3.0-6
ii  libstk-4.5.0                      4.5.2+dfsg-4
ii  libvorbis0a                       1.3.5-4
ii  libvorbisenc2                     1.3.5-4
ii  libvorbisfile3                    1.3.5-4
ii  lmms-common                       1.1.3-7
ii  stk                               4.5.2+dfsg-4
ii  zlib1g                            1:1.2.8.dfsg-5

Versions of packages lmms recommends:
ii  caps                  0.9.24-4
pn  lmms-vst-server:i386  <none>
ii  tap-plugins           0.7.3-2

Versions of packages lmms suggests:
ii  calf-ladspa [ladspa-plugin]  1.1.3-7
ii  caps [ladspa-plugin]         0.9.24-4
ii  fil-plugins [ladspa-plugin]  0.3.0-6
ii  fluid-soundfont-gm           3.1-5.1
ii  freepats                     20060219-1
ii  mcp-plugins [ladspa-plugin]  0.4.0-5
ii  omins [ladspa-plugin]        0.2.0-7.1
ii  swh-plugins [ladspa-plugin]  0.4.17-1
ii  tap-plugins [ladspa-plugin]  0.7.3-2
tukkek commented 7 years ago

Quick follow-up: ever since I first installed LMMS, the Pulseaudio backend has been noisy and unusable - but even back then, using the current (and same) LMMS version, I was able to export files normally. Today is the first time that the export procedure has been unable to generate perfect files.

From this I must deduce that the problem has started due to me updating another related package in my system - but even then, hopefully, there will be a way to fix this internally as well, since I can use LMMS normally and play songs perfectly from inside the program (as long as Pulseaudio isn't being used as the backend). Thanks again!

tukkek commented 7 years ago

Sorry for the third comment in a row but I just had an idea and with a little tinkering was able to produce perfect WAV and OGG files again. I think there are 2 issues here:

  1. LMMS isn't remembering properly which backend is being used when showing the preferences window. It seems to always show "Pulseaudio" regardless of what I had chosen just a second before. This may be why I was thinking that the "export" feature was changing my backend.

  2. The Pulseaudio backend could have been using input from another device when generating the file (or playing the song inside LMMS). I just muted the open microphone in my system and after that exporting completed normally once again. So maybe the "bad" file isn't as much filled with artifacts as it could have been noisy from mixing live microphone audio in the process.

"Unfortunately" now that I was able to produce a normal file, un-muting my microphone again doesn't seem to create noisy files anymore, which is not helping determine the cause of this. All I know is that I tried exporting files a few times before writing my initial report, all failing and now everything is working fine again after messing with the system mixer a little bit. I'm not sure what to make of it or if this report will be useful at all now, but at least the first point here should maybe be looked into... I'll come back with more information if I come across it - you'll probably want to close this bug if in the end it isn't helpful in understanding the underlying problem. Sorry for that - but maybe someone with more knowledge than me will be able to make sense of what is happening. Thanks again!

PaulBatchelor commented 7 years ago

@tukkek a few weeks ago I was getting similar problems with exported audio, and managed to fix things on my end with #3404 for the CLI renderer. If you have the knowhow, I'd be curious if this fixes the problem for you.

tukkek commented 7 years ago

Are you asking me to compile the current source and test the CLI out? I can do that but in all fairness this bug here is about the GUI dialog, which you mention should not be fixed by your commit.

Nonetheless, thank you for the tip, at least I know that there is a CLI way of doing this now - even if the GUI works, but isn't reliable or very deterministic as far as I could tell.

PaulBatchelor commented 7 years ago

I can do that but in all fairness this bug here is about the GUI dialog, which you mention should not be fixed by your commit.

@tukkek Right. Sorry, should have explained. The GUI exporter is next. The CLI renderer produced similar artifacts to the ones you described, and I think I fixed it. If things work out okay with the CLI, I can probably apply a similar fix the the GUI exporter.

tukkek commented 7 years ago

Thanks for the follow-up. Do you want me to compile the current version and see how it works here? I mean, I can do that but I have never compiled LMMS before, I'm not sure how long it'll take me to get it right. If it's a really simple process (install dependencies, run build) and you need my help, I'd be happy to do it. I'm on Linux by the way.

I mean, I've been wanting to try out the new MIDI export function, maybe that's the right time to do it since it's taking long for the new version to actually come out...

Thanks for working on this, looks like it's a nasty one to fix since it's pretty delicate, I imagine, especially for the GUI (from what I've read on your other comments).

On 16 March 2017 at 14:41, Paul Batchelor notifications@github.com wrote:

I can do that but in all fairness this bug here is about the GUI dialog, which you mention should not be fixed by your commit.

@tukkek https://github.com/tukkek Right. Sorry, should have explained. The GUI exporter is next. The CLI renderer produced similar artifacts to the ones you described, and I think I fixed it. If things work out okay with the CLI, I can probably apply a similar fix the the GUI exporter.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/LMMS/lmms/issues/3360#issuecomment-287135997, or mute the thread https://github.com/notifications/unsubscribe-auth/ADpJMiBf0Vzql6UIlN98ilElBrx6z4Lqks5rmXROgaJpZM4MCSEt .

zonkmachine commented 6 years ago

@tukkek Can you test the latest beta? You don't need to compile it as we now ship a binary (AppImage). Just download/make executable/run... https://lmms.io/download/#linux

tukkek commented 6 years ago

The issue persists on LMMS 1.2.0-rc5. Playback is perfect when playing inside the program but exporting to MP3 produces very bad artifacts.

tukkek commented 6 years ago

Like before, exporting the file subsequent times seems to work fine, mostly randomly - I tried exporting OGG and it worked fine (no artifacts), then I tried exporting MP3 again and that worked fine too, this time.

PaulBatchelor commented 6 years ago

@tukkek would it be possible to attach audio file outputs and project files to this ticket? In my experience, it's been very very helpful to be able to debug audio issues with my ears.