LMMS / lmms

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

Clicks and pops on VST tracks that are assigned to FX channels #1662

Closed ghost closed 9 years ago

ghost commented 9 years ago

Loading up a VST through VeSTige and assigning it to an FX channel causes clicks and pops to be audible when playing notes or the entire song. They are also present in .wav and .ogg renders. When unassigned, the problem is gone. This problem does not occur when assigning non-VST tracks to FX channels.

LMMS 1.1.0 64 bit

tresf commented 9 years ago

@caLRo thanks for the bug report. I installed mda Delay VST effect to reproduce this.

Unfortunately, I'm having a hard time reproducing. Can you please supply some additional information:

  1. Does this occur when the VST is assigned to the instrument and not the FX channel?
  2. Can you link a VST that is freely available that we can reproduce the bug with?

Thanks.

-Tres

ghost commented 9 years ago

@tresf

  1. I'm not sure what you mean by assigning the VST to the instrument. The bug occurs when the VST is assigned to a channel on the FX mixer. After loading a VST as an instrument track on the song editor, I click on the plus sign on the FX mixer to add an unused channel (FX 1), then click the VST instrument track in the song editor and then set its FX from 0 to 1. The effects chains are empty, no effect plugins (native or VST) are used.
  2. I have used Synth1 and DSK Darkness Theory VSTs to reproduce the bug. Both are instrument plugins, not effect plugins.

http://www.geocities.jp/daichi1969/softsynth/#down http://www.dskmusic.com/dsk-darkness-theory-3/

tresf commented 9 years ago

Oh these are VST instruments? We support VST effects too, I thought this was separate than https://github.com/LMMS/lmms/issues/1662 but it appears to be a duplicate or very similar.

Are you saying VST instruments work fine unless they are assigned to an FX channel? Does it play properly when routed through 0 (master) ?

tresf commented 9 years ago

I just assigned a VST instrument called "DSK musicbox" to an empty FX channel 1 and could not reproduce. You'll have to provide some more details as I cannot reproduce what you are experiencing.

tresf commented 9 years ago

Tested with Darkness Theory as well. Still cannot reproduce.

ghost commented 9 years ago

The clicks and pops appear inconsistently when only 1 VST instrument is assigned to 1 FX channel. When multiple instances of a VST instrument are loaded and each of them are assigned to a separate channel (FX 1 for instrument a, FX 2 for b, etc.) there are more clicks and pops.

And yes, they work fine again when they are unassigned and are routed through to the master.

Some additional details that may help: OS - Windows 8.1 x64 Audio interface - SDL

tresf commented 9 years ago

Thanks. The VBScript mentioned in the other bug report changes CPU priority on all RemoteVSTPlugin processes. Have you confirmed this does not remedy the issue?

Spekular commented 9 years ago

Ate we sure this isn't the same/simiar to bug that was fixed by setting high priority? @calro What OS are you using? Have you tried setting VSTsomething.exe to high?

ghost commented 9 years ago

@Spekular I have tested with a project with 6 VST instances assigned to 6 FX channels. I have manually changed the 6 RemoteVstPlugin.exe processes to high, and the clicks and pops are still there. They are gone again when all 6 are unassigned from their channels.

Spekular commented 9 years ago

@caLro hmm. I guess it isn't the same. Thanks for the thorough testing.

ghost commented 9 years ago

You're welcome, hopefully I've given you guys enough info to squash this bug. Squash it real good.

tresf commented 9 years ago

Whoops, bad post there.. Fixed.

So @diizy this is what I'm seeing... Do you have an idea why the FX channel would be so much higher lower than master in this case? I believe this may be part of the cause of this bug (rather than the performance issues we've noted in other bugs).

image

tresf commented 9 years ago

@caLRo I just tried to reproduce this again to no avail.

Can you please click through your FX channels and copy/paste screenshots. We need more info here. :smile:

ghost commented 9 years ago

@tresf I too have trouble reproducing this. It seems the more instances of VeSTige instrument tracks there are (and thus more FX channels on the mixer are used) the more clicks and pops there are. To me this is strange, as I have a pretty decent core i7 cpu and 6 gb ram which should be sufficient to handle larger projects with multiple VSTs.

I have tested with up to 6 instances of VeSTige, each loaded with Synth1 VST and each assigned to a separate channel as shown below: bug project 01 bug project 02 bug project 03

I have set the master channel volume to 50% in order to prevent clipping and to make it easier to spot the clicks and pops.

tresf commented 9 years ago

@caLRo thanks for the superb testing.

I have the feeling this is a performance issue with the mixer in general and the VSTs are taxing the CPU in a way that makes it more apparent.

We'll leave this open for now in the hopes that future performance improvements make this go away.

badosu commented 9 years ago

@caLRo Can you see the CPU monitor inside LMMS and tell us if it's accusing high CPU usage when you hear the pops?

ghost commented 9 years ago

@badosu There are no CPU spikes and usage stays very low.

badosu commented 9 years ago

It's difficult for to reproduce your issue @caLRo, I wonder if the fact that you use Windows and SDL may be a factor here.

@tresf Do you know if SDL on windows is known to present issues? And VST maybe is just making them more clear?

tresf commented 9 years ago

@tresf Do you know if SDL on windows is known to present issues? And VST maybe is just making them more clear?

SDL is all I've ever composed with on Windows. I've never had reliability with any other backends on Windows. If it does present additional performance issues, I wouldn't necessarily consider it a direct cause.

curlymorphic commented 9 years ago

Has anyone reproduced this on linux? i've got 60 Darkness theories on 60 fx channels, with my cpu 70-80% and im starting to hear pops. I would consider this normal. I fear im having trouble reporducing this.

tresf commented 9 years ago

I would consider this normal. I fear im having trouble reporducing this.

My concern is the amount of CPU our mixer may be adding here to escalate the issue. Do you see a considerable drop in CPU when they are all routed to master?

curlymorphic commented 9 years ago

I have done some testing with screen shots

60 Darkness theories , all routed to master, with no fx channels while idle image

60 Darkness theories , all routed to master, with no fx channels while playing image

60 Darkness theories , all routed to master, with 60 empty fx channels while playing. image

60 Darkness theories , with 60 fx channels while idle. image

60 Darkness theories , with 60 fx channels while playing. image

My concern is the amount of CPU our mixer may be adding here to escalate the issue. Do you see a considerable drop in CPU when they are all routed to master?

On my machine with ubuntu 14.10 no.

Some additional details that may help: OS - Windows 8.1 x64 Audio interface - SDL

I have a pretty decent core i7 cpu and 6 gb ram

There is obviously something very wrong if pops can be reproduced regularly with only 6 instances. I have a feeling is may be os dependant.

I would be interested to see what os's this can be reproduced in.

@badosu im unsure if you ever managed to reproduce this? if so on what os

musikBear commented 9 years ago

For "60 Darkness theories , with 60 fx channels while idle." What is that from 60sec to 50sec? Also @curlymorphic, you write '6 instances' but also '60 Darkness theories' What is correct ...surely, you do not have 60 vst's in the test?!

((you have 8.. cpu's ... :gem: wow..

curlymorphic commented 9 years ago

What is that from 60sec to 50sec?

Probably the project loading maybe.

also the top image for the idle, only really the last few seconds is idle.

you do not have 60 vst's in the test?

i do. the 6 instances was from the description on how to recreate.

With 6 instances the cpu usage was low with poping on the bug report. I had to put my cpu under load to get occasional pops, maybe 1 - 2 a min.

musikBear commented 9 years ago

i do. the 6 instances was from the description on how to recreate.

..60! That is amazing -You have a serious monster running there! :zap:

badosu commented 9 years ago

@curlymorphic Never was tried to reproduce this one :-(. Gonna try later with some synth1 instances. But I hardly believe it's gonna present some problem as well.

musikBear commented 9 years ago

1.1 win32 Here is mine cpu-usage, with resp 5 and 10 instances of darknes-theories. I wont say that the click / pop occourences is significant different when the individual instruments are allocated to own FX-mixer channels That is in fact also difficult to access, just by ear. -It is way to biased, and could in no way be reconized as data. Some reproduceable and reliable way to detect 'pop/clicks' would be needed. This whole investigation also lack consistency in respect to what actually is played -eg what notes what register *what volume i would expect those paramters to be most important pastenot

(the jaggeds are from adding instances)

Sti2nd commented 9 years ago

I just talked to a LMMS user who leaved LMMS (not Evan), and he says clicks and pops in his song were the reason for him leaving... So this issue seems fairly important. I think the user said that he didn't use any VSTs (or external stuff), so I am trying to get a project file from him where he have the issue.

curlymorphic commented 9 years ago

So this issue seems fairly important.

I would say very important. pops and clicks at normal cpu usage are unacceptable. at high cpu uses bigger sample buffers can be used but clicks are unavoidable when processing power is limited.

I am trying to get a project file from him where he have the issue.

That would be really useful, any information about his setup, cpu / memory / sound card / os etc.

I wont say that the click / pop occourences is significant different when the individual instruments are allocated to own FX-mixer channels

@musikBear so you cant confirm the original bug report?

That is in fact also difficult to access, just by ear. -It is way to biased, and could in no way be reconized as data. Some reproduceable and reliable way to detect 'pop/clicks' would be needed.

I do agree on reliable. but im not sure how to do this. We cant simply test for this in lmms because this could be happening further down the chain, maybe audio driver or the sound card. using the same machine to record audio also introduces loads on the system that are not present in normal use.

This whole investigation also lack consistency in respect to what actually is played

Has there ever been a survey done on lmms users about performance. maybe now would be a good time?

If we could get some data, then maybe we can see what the problems could be.

If this sounds like a good idea I can work on some suggested questions, and some benchmark projects.

I'm not sure how this should be delivered to the users (forum page, asked to fill out on github, a dedicated page on the lmms.io site facebook etc) and when (only when reporting problems, on download, generaly on social media etc).

This could be a big task, but could give us benifits in a lot of issues present and future

Fastigium commented 9 years ago

Ok, here goes :P. I'm the user Sti-Jay mentioned, and let's start with saying that the clicks and pops are not the reason for me to leave, they just royally piss me off (so they don't help, let's keep it at that).

I have found a reliable way to reproduce the clicks and pops on my laptop (Win7 x64 but with 32-bit LMMS 1.1 stable, SDL audio backend, Intel i7-2670QM @ 2.20Ghz, 6GB RAM, Realtek HD Audio Vendor 10EC Device 0269). Download Reproduce.mmpz, open it, press play in the Song-Editor to start looping. No cracks and pops. Now start adding FX channels by repeatedly clicking the big + bar in the mixer panel. The pops and clicks start almost immediately, and after adding like 30 or 40 mixer channels, they occur regularly even if I stop adding new channels. Here's a screenshot of a pop zoomed in on in Audacity:

pop2

As you can see, the sound is distorted in a peculiar way. This screenshot is of a recording of the "live" playback made using SoundLeech. But, hold your breath, the pops are there when exporting, too! Examine this wav export of Reproduce.mmpz with 45 FX channels. That was exported using File -> Export with all the default settings. Crazy, right?

My question to you now is: what would you have me try? Should I try the 64-bit version? Different audio backends (note that I've never had any luck with all non-SDL ones)? Is there some way to debug the mixer on Win 7?

Edit: An extra discovery now that I plugged in my laptop's power supply: the pops are way more frequent when the laptop is in "Power saver" mode than when it is in "High performance" mode. Still, they do not entirely disappear, even with the laptop plugged in.

tresf commented 9 years ago

Thanks for the detailed write up.

In terms of doing a debug on Windows, our capabilities are extremely limited. For now we'll assume there are no debug method available. This may change down the road but for now, what we see is what we get on Windows.

What I find interestong is the fact that you are running 32-bit version. Can you try and reproduce on 64-bit please? That may be the missing link.

Lastly, the Core i7 is a hefty machine so that is good to know as well. Thanks again.

When you refer to "reason for me to leave" what is that in regards to? We don't hold prejudice against those who leave our software for others, but we do require a certain amount of involvement to resolve these things so if you can at least see this bug report through that would be a tremendous help. :+1:

Umcaruje commented 9 years ago

Well, I just opened your project on Ubuntu 14.10 64bit. I managed to get a small glitch only when I added a ridiculous amount of channels(200+) and it was a one-time thing only. I will boot into my windows 8 now, to test it there.

ghost commented 9 years ago

This is strange. I cannot reproduce this bug anymore. @Fastigium I have opened your project and encountered no problems. I switched TripleOscillator for Synth1, made 2 clones, added 30 fx channels and was assign-scrolling through the channels. No clicks and pops.

Edit: I just tested with the project setup shown in the screenshots I posted earlier, and the clicks and pops were there. I still have no idea why one project has them while another doesn't.

Fastigium commented 9 years ago

@tresf The steps I described also result in pops and clicks on the 64-bit edition of LMMS, with about the same intensity as with the 32-bit edition. What still puzzles me most is that the bug occurs in the export function. I mean, it seems clear that it is closely related to CPU load and/or responsivity, but during exportation no kinds of underruns should be possible, right? Would it be helpful to verbosely dump the complete sample calculations to a file during exportation? That might disclose whether the erroneous values are generated within the mixing process itself or if they originate from the instrument plugin. If somebody can build me an exe that dumps out extra data, I'll be happy to reproduce the bug with it and upload the resulting file.

As for my reasons to leave LMMS: I want to get a track signed, and I became convinced that using professional tools would make that a whole lot easier, so I bought FL Studio. So far, I have found that Maximus seems to be the missing link between the best I can create using native LMMS and the sound of artists I admire. That said, I hope to be able to see this bug report through. LMMS has been my stepping stone into the world of EDM creation, and I'd love to see it be the same for others. Be advised, though, that I am still recovering from a burnout, so that I may get overwhelmed from time to time and not respond to inquiries in a timely manner.

@caLRo Would you happen to work on a laptop? If so, could you try switching to the "Power saver" power plan? That might help trigger the bug. Heck, it might even help on a desktop computer.

Umcaruje commented 9 years ago

Ok here is my testing:

On windows 8 Pro x64 I added 500 channels to the Reproduce.mmpz @Fastigium shared. 500 channels When using the 64 bit version of LMMS I had absolutely no clicks.

When I used the 32 bit version I got quite a few clicks, and they started appearing after I added ~100 channels and they got more frequent as I added more channels.

Here is how one of them looks: click

Audio backend I used was SDL, and latency was 512 samples.

I have a pretty old-ish machine with AMD Athlon II X2 240 CPU and 4GB of RAM.

Sti2nd commented 9 years ago

I did not manage to reproduce with Fastigum's project. 500 FX channels.

I can reproduce with this project (I stole and modified) https://drive.google.com/uc?export=download&id=0B-1kciTMrTBZUzRSWE5fMVdiRFU The clicks here happens from bar 5 and onward. If you enable the effects chain I tried to boost the clicks so they are more noticeable. The orignial from the lsp https://lmms.io/lsp/?action=show&file=6349

ghost commented 9 years ago

@Fastigium I'm on a laptop with similar specs as yours, and on power saving mode there are indeed clicks and pops in your project file. They are also present in the exported wav files.

When I opened this issue I thought the bug had something to do with VeSTige and the FX mixer. Now it seems I can reproduce the bug even without VeSTige.

curlymorphic commented 9 years ago

@Fastigium Thanks for your time. I am going to try out your project now.

@Umcaruje could you upload the wav from the screenshot please, is this rendered, and what buffer size are you using. (Edit, Settings, buffersize)

I can reproduce this on ubuntu 14.10 64 bit with the use of @Fastigium Reproduce.mmpz. with as few a 3 fx channels and some paitence, I would get a pop every munite or so. When increased to 200+ it would nearly always pop atleast once per 16 bars, often more.

This happens on render. image

looks like a change in gain for 256 samples. , my sample buffer is 64 samples long.

When looking at @Fastigium reproduce.wav i can see a gain for 64 samples.

I'm on a laptop with similar specs as yours, and on power saving mode there are indeed clicks and pops in your project file. They are also present in the exported wav files.

have you tried with the power saving turned off.

Umcaruje commented 9 years ago

@Umcaruje could you upload the wav from the screenshot please, is this rendered, and what buffer size are you using. (Edit, Settings, buffersize)

I'm sorry I disposed of it, it was a audacity recording of my output. I can record again and send you the wav.

As I mentioned, my buffer is 512 samples.

ghost commented 9 years ago

I have tested with "Balance" (my default) and "High performance" power plans as well, and the clicks and pops appear when 5 FX channels are added.

curlymorphic commented 9 years ago

but during exportation no kinds of underruns should be possible, right?

@Fastigium

I initially thought that this was an unde run, but i am not so sure, because of the export being effected, And that fact that the wave, while distorted, does follow the pattern of the wave, just at a different amplitude, as opposed to trash data left from the last period.

I'm sorry I disposed of it, it was a audacity recording of my output. I can record again and send you the wav.

@Umcaruje That would be really helpful, an exported one would be really good as well :+1: in fact a few more of these from various users would help :) stating how many fx channels it takes to click, your os, 32/64 would be really useful in tracking this down.

@caLRo so the power settings seem not to effect this issue, thats good info :)

Fastigium commented 9 years ago

@curlymorphic Power settings do affect the issue on my laptop, but sometimes only after I restart LMMS (gotta love glitches like this). Also, my buffer size has been set at 64 frames in all this testing.

curlymorphic commented 9 years ago

Power settings do affect the issue on my laptop

thanks.

I cant reproduce this issue using the command line to render

image

same project rendered with GUI image

lmms -r Reproduce.mmpz May need lmms on the path

can anyone confirm this please?

Fastigium commented 9 years ago

Say, it just occurred to me: on my screen, whenever a pop occurs, the master dB meter has a higher peak, but the instrument FX channel dB meter does not. Can anyone confirm this? If it's true, it suggests that the problem is indeed in the mixer and not in the instrument, and it happens somewhere between the output of the FX channel and the measuring of the master channel.

Umcaruje commented 9 years ago

Ok here is a wav of the recorded output: https://drive.google.com/file/d/0B49dcRGtm8vJUlZXWm1wRk5vRVk/view?usp=sharing

LMMS 1.1 32bit

Bug appeared with 5-6 FX channels, I added up to 45 and the glitches increased.

OS: Windows 8 Pro x64

Buffer size: 512 samples.

I will try to reproduce on linux now.

curlymorphic commented 9 years ago

it happens somewhere between the output of the FX channel and the measuring of the master channel.

sounds like a good place to start looking.

@Umcaruje using your win8 64 with 512 sample, the glitch is only 256 bytes long

image

musikBear commented 9 years ago

Guys! do you have autosave enabled -its evil i say! -And it will occour in regular intervals!

In will do tests on reproduce.mmpz on win32 later and post my results It is a good thing that this file now can be a 'test-standard', that is a tiny step towards reliable reproduce tests -But the issue of 'user-chosen-optimation' - f.i. autosave, is also very important. In fact, we should establish a test-setting std, and work from that, sp at least lmms instances are comparable -right?

curlymorphic commented 9 years ago

Guys! do you have autosave enabled -its evil i say! -And it will occour in regular intervals!

Nice thinking, im going to try that now. Ive been working on this for about 12 hours now. The good news is i have a better understand of the mixer now. The bad news, i cant seem to remove them clicks. well not yet. I have 1 more thing to try,then i need to start thinking out of the box,

In fact, we should establish a test-setting std, and work from that

:+1:

curlymorphic commented 9 years ago

Guys! do you have autosave enabled -its evil i say!

just tested, thats not making any difference on my machine

Fastigium commented 9 years ago

Alright, so I've been poking around the source a bit (checked out the v1.1.0 tag, managed to reproduce the bug on Linux Mint 17) and tried printing gain values in FxMixer.cpp to see if they would be != 1. While doing so, I noticed a strange side-effect. Adding a qWarning() call in the right place stopped the pops from being visible on the master channel dB meter! Huh?

Normally, every time I hear a pop I see that the peak lines on the master channel dB meter are briefly higher than those on FX 1's dB meter. When this qWarning() call is added, the peak lines of the master channel and FX 1 always keep the same height. The qWarning() call in FxMixer.cpp:

149     const float v = m_volumeModel.value();
150
151     // DEBUG print the v level
152     qWarning( "%f", v );
153
154     if( m_hasInput )

That's in the FxChannel::doProcessing() method, right after the v of the channel itself is set (i.e. not inside the foreach loop). I also tried not printing the value of v but just a constant number -- qWarning( "%f", 1337.0 ); --, and it had the same effect.

Which leads me to think that this is a threading issue of some kind. I feel a bit out of my league here :P. Can anyone reproduce that adding such a qWarning removes the peak line difference?