Audacity Bug Summary
••• Introduction •••
••• Keywords •••
    Audacity 3.0.3 development began 19th April 2021

Audacity Bugzilla



Bug 2519 - Noise Gate fails silently on longer selections
Noise Gate fails silently on longer selections
Status: RESOLVED FIXED
Product: Audacity
Classification: Unclassified
Component: Built-in FX
3.0.0
All All
: P3 RepeatableAll
Assigned To: Steve Daulton
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2020-08-09 04:44 UTC by Peter Sampson
Modified: 2020-09-30 06:37 UTC (History)
6 users (show)

See Also:
Steps To Reproduce:
1) generate 1 hour stereo chirp 2) Effect > Noise Gate 3) Observe: Effect appears to proceed normally for about 2/4 of the estimated time 4) Observe: it stalls with "Not responding" 5) Observe: after a short pause the effect dialog disappears and you are returned to the unmodified chirp 6) Edit > Undo 7) Observe: there is no trace of Noise gate on the undo stack
Release Note:
Group: Effects *Noise gate will fail silently, with no error message, on longer selections of audio. For example a one hour stereo selection will fail
First Git SHA:
Group: ---
Workaround:
Make you selections for Noise gate in half hour chunks for stereo or one hour chunks for mono.
Closed: 2020-09-30 00:00:00
james.k.crook: Must‑Test‑All‑OS-
petersampsonaudacity: Test‑OK‑Win+
petersampsonaudacity: Test‑OK‑Mac?


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Sampson 2020-08-09 04:44:30 UTC
Noise Gate fails silently on longer selections - I tested with a one hour stereo track. 

If you select the first half hour and apply Noise Gate and the select the second half hour the effect works.

Tested on W10 and macOS, fails on both - so assume all platforms.


This may be a cousin of Bug #2352
Comment 1 Steve Daulton 2020-08-14 09:03:30 UTC
(In reply to Peter Sampson from comment #0)
> This may be a cousin of Bug #2352

It's more like a distant cousin ;-)

Since the Nyquist library was updated, Nyquist now limits the amount of data that can be held in RAM to a little under 1GB. This plug-in uses the Nyquist function "GATE", which stores samples in RAM during processing and is thus limited to a little under 125 billion samples (about 47 minutes at 44100 Hz sample rate).

The amount of RAM available to Nyquist may be increased, but it will of course still be limited by the amount of physical RAM available on the machine.

Nyquist has no way of knowing how much physical RAM is available, so we need to set a limit on audio memory to terminate computations before memory is totally exhausted. More details here: https://www.cs.cmu.edu/~rbd/doc/nyquist/part8.html#index301
Comment 2 Steve Daulton 2020-08-18 12:01:00 UTC
Roger is investigating why the Nyquist GATE function is hanging onto samples.
The current GATE function also produces a warning message which the Noise Gate plug-in currently hides. Roger explained this error:


> The ABS-ENV says to compute the behavior
> starting at time zero instead of the default start time which would be
> the end of (cue sound), so when SEQ tries to add (s-rest lookahead)
> starting at time t, but (s-rest lookhead) already should have started at
> time 0, it complains. I think ABS-ENV was trying to avoid any stretch
> factor being applied to the duration lookahead, which could be done
> better with (stretch-abs 1 (s-rest lookahead))


At this stage I think it's worth waiting for Roger to complete his investigation, with a view to backporting fixes from upstream into Audacity. If that turns out to not be a practical option, then the alternative is to fix the warning (as above) and resolve the length issue by modifying the plug-in's GATE-FOLLOW function to reduce the sample rate (to say 100 Hz).
Comment 3 Peter Sampson 2020-09-02 05:35:53 UTC
See Bug #439
Comment 4 Peter Sampson 2020-09-03 05:50:20 UTC
Upgarded to P3 (because of the silemt fail with no error message).

Added a Release Note and a workaround
Comment 5 Steve Daulton 2020-09-03 06:16:34 UTC
(In reply to Peter Sampson from comment #3)
This is actually a different issue to bug 439.

The problem in 439 is due to overflowing 32-bit integer. In this bug it is due to exceeding the allocated "sound" memory.
Comment 6 Steve Daulton 2020-09-29 11:37:48 UTC
Fix committed:
https://github.com/audacity/audacity/commit/a48f8a4
Comment 7 Peter Sampson 2020-09-30 04:36:40 UTC
(In reply to Steve Daulton from comment #6)
Tested on W10 with Audacity 3.0.0 f144a1f

a) The steps in Bug 2519 work fine

b) I then tried 13 hours mono chirp - that worked fine

c) I then tried 13 hours mono chirp - that worked fine too

d) I then tried with 14 hours stereo and got this error message
>Noise gate:Nyquist Error
>Selection too long for Nyquist code
>Maximum allowed selection is 2137483647 samples
>(about 13.5 hours at 44100 Hz sample rate).

Do the bug as stated now works on Windows.

-----------------------------------------------------------------

Residuals:

1) The number of samples, while presumably accurate, just looks odd and unfathomable - and would be better as 2,137,483,647

2) There is no "?" help button - could link to 
https://alphamanual.audacityteam.org/man/Noise_Gate
Comment 8 Peter Sampson 2020-09-30 04:49:45 UTC
(In reply to Peter Sampson from comment #7)
I updated the Manual:
https://alphamanual.audacityteam.org/man/Noise_Gate#Limitations
Comment 9 James Crook 2020-09-30 05:00:05 UTC
RESOLVED FIXED
It's a P3 that only needs testing on one platform
The 'residuals' of comment #7 are 'nice-to-haves' and don't merit keeping this bug open.

Thanks for fixing, Steve, and thanks for testing, Peter.
Comment 10 Peter Sampson 2020-09-30 05:18:10 UTC
Tested on macOS 10.15.6 Catalina with Audacity 3.0.0 f144a1f

This also works with 13 hours stereo and fails with 14 hours stereo.

the error message is much simpler (too simple in fact) and less techy on Mac:
>Noise Gate
>Error.
>Selection too long.

So here there is no indication of the maximum length allowed - and of course mo "?" help button to link to the Manual the the maximum limit is now explained.

Accordingly I am going to mark this as "?" on Mac



Also note there is no header in the message dialog.
Comment 11 Steve Daulton 2020-09-30 05:39:13 UTC
(In reply to Peter Sampson from comment #10)
The difference between error messages is because the 32-bit Windows build of Audacity is limited to 2137483647 samples for any Nyquist plug-in.
(Are you sure that number is correct? I'd have expected 2147483647 as that is 2^31-1)

On 64-bit builds (Linux and macOS), Nyquist can handle longer selections.

The Noise Gate can handle a bit more than 2^31 samples on 64-bit Linux / macOS builds, but probably not much more, so I set the limit to 2^31-1 samples for all platforms. 

The "Noise Gate" code throws an error message at 2^31-1 samples, but on 32-bit windows the error gets caught earlier in Nyquist.cpp, hence the different messages.

Of course, very few users will ever see this error message, but we can easily change it. (I think this would be a 'nice to have' that does not need to be discussed on bugzilla).
Comment 12 Peter Sampson 2020-09-30 06:37:15 UTC
(In reply to Steve Daulton from comment #11)
(Are you sure that number is correct? I'd have expected 2147483647 as that is 2^31-1)

Sorry yes - a fat-fingered typo.