Can the performance of Nyquist in Audacity be improved ?

Using Nyquist scripts in Audacity.
Post and download new plug-ins.

If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like

Can the performance of Nyquist in Audacity be improved ?

Permanent link to this post Posted by Trebor » Wed Oct 29, 2014 9:06 am

Is there any way of improving the performance of Nyquist plugins in Audacity,
e.g. by giving it more memory to work with , (i.e. increase "buffer size" ).

The reason I ask is when using Paul-L's excellent plugins processing time is slow if many "frequency-bands" are selected.
It's not a plugin bug : it's just that the process is very computationally demanding.

[ with the settings I'm using processing-time is a multiple of playback-time :cry: ]
Trebor
 
Posts: 4027
Joined: Sat Dec 27, 2008 5:22 pm
Operating System: Windows Vista

Re: Can the performance of Nyquist in Audacity be improved ?

Permanent link to this post Posted by Gale Andrews » Wed Oct 29, 2014 10:45 am

Does CPU use and memory use go up dramatically, or is little memory used?

There is also a Nyquist-in-Audacity problem with too much memory being used:
http://bugzilla.audacityteam.org/show_bug.cgi?id=87

http://audacity.238276.n2.nabble.com/Nyquist-in-Audacity-crashes-with-long-sound-files-td238715.html .


Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual
Gale Andrews
Quality Assurance
 
Posts: 26089
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10

Re: Can the performance of Nyquist in Audacity be improved ?

Permanent link to this post Posted by Trebor » Wed Oct 29, 2014 12:08 pm

Gale Andrews wrote:Does CPU use and memory use go up dramatically, or is little memory used?

CPU increases from about 5% to about 50%, no obvious increase in use of memory ...

DeClicker processing 1 second of audio  (with 25 frequency bands).gif
click on this image to see it in is entirety.
DeClicker processing 1 second of audio (with 25 frequency bands).gif (114.14 KiB) Viewed 1660 times

To be fair , with 25 bands selected it's like running 25 compressors simultaneously, so it's understandable it's going to take longer than the typical plugin , but processing takes about 10x playback time on my [old] computer.

I suspect better hardware is the only solution , (harnessing a GPU would be nice ).
Trebor
 
Posts: 4027
Joined: Sat Dec 27, 2008 5:22 pm
Operating System: Windows Vista

Re: Can the performance of Nyquist in Audacity be improved ?

Permanent link to this post Posted by steve » Wed Oct 29, 2014 1:22 pm

The efficiency of Nyquist plug-ins is largely down to the plug-in design. Nyquist is an interpreted language, so loop structures tend to be slow (the code has to be re-evaluated each time). Nyquist includes a large number of DSP primitives which are written by computer in highly optimised C code. Code that can perform most of its processing using the DSP primitives should run reasonably quickly (on my machine, about 5 to 10% of real time). By necessity, Paul's plug-in has to loop many thousands of times, so it is not surprisingly rather slow. There are also memory issues due to the very simple way that Audacity interfaces with Nyquist. To significantly speed up a plug-in like the one you are referring to, the core DSP would need to be written in a compiled language such as C or C++ so that the plug-in spends less time in LISP loops.

Yes, better hardware will improve things ;)
If you are on a single processor machine, background processes and applications running in the background will have a stronger impact on performance than on a multi-core or multi-processor machine.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Site Admin
 
Posts: 45383
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Can the performance of Nyquist in Audacity be improved ?

Permanent link to this post Posted by Trebor » Wed Oct 29, 2014 11:26 pm

steve wrote:... background processes and applications running in the background will have a stronger impact on performance than on a multi-core or multi-processor machine.

I've yet to try Paul-L's plugins on Linux , which isn't slowed by the anti-virus, (as on Windows), running in the background. I'll do a bench-mark test : Paul-L's plugins on Windows versus Linux and report back ,
( but going Linux isn't going to give an order-of-magnitude speed-improvement on the same hardware ).
Trebor
 
Posts: 4027
Joined: Sat Dec 27, 2008 5:22 pm
Operating System: Windows Vista

Re: Can the performance of Nyquist in Audacity be improved ?

Permanent link to this post Posted by steve » Wed Oct 29, 2014 11:36 pm

Trebor wrote: but going Linux isn't going to give an order-of-magnitude speed-improvement on the same hardware

You'll need to be using a recent version of Audacity or it will probably be an order of magnitude slower!
Building Audacity on Debian based systems is pretty easy, so no reason to not have the latest version.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Site Admin
 
Posts: 45383
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Can the performance of Nyquist in Audacity be improved ?

Permanent link to this post Posted by Paul L » Mon Nov 03, 2014 2:49 pm

Trebor, there are these XLisp functions, which you could call from the Nyquist Prompt effect:


gc() [SAL]
(gc) [LISP] - force garbage collection
returns - nil

expand(num) [SAL]
(expand num) [LISP] - expand memory by adding segments
num - the number of segments to add
returns - the number of segments added

alloc(num) [SAL]
(alloc num) [LISP] - change number of nodes to allocate in each segment
num - the number of nodes to allocate
returns - the old number of nodes to allocate

info() [SAL]
(info) [LISP] - show information about memory usage.
returns - nil

room() [SAL]
(room) [LISP] - show memory allocation statistics
returns - nil


I suspect some judicious
Code: Select all
(expand x)

or
Code: Select all
(alloc y)


at the prompt, for some wise values of x and y, might improve performance a very long declicking. But I have never got around to this experiment.

I was quoting this.
http://www.cs.cmu.edu/~rbd/doc/nyquist/part19.html
Paul L
 
Posts: 881
Joined: Mon Mar 11, 2013 7:37 pm
Operating System: Please select

Re: Can the performance of Nyquist in Audacity be improved ?

Permanent link to this post Posted by Paul L » Mon Nov 03, 2014 2:58 pm

As I have mentioned elsewhere, Nyquist runs on a very old Lisp interpreter -- the code goes back to the 80's. Its garbage collector is mark-and-sweep, not a modern generational one. A radical idea would be rewriting that.

"Mark and sweep" collection does work proportional to the total memory allocation, each time collection happens. Whereas generational collection only does work proportional to the amount of live, non-garbage data in memory.

Short of that, I also believe the interpreter itself causes much garbage to need collection. Some less radical hacks to the interpreter might send interpreter garbage straight to the free list for reallocation, so garbage collections would be less frequent.

This would make a difference I think in code like mine that has inner loops in Lisp where none of the C routines were right for it.

Such things would be changes not to Audacity proper, but to the Nyquist project which it includes and has its official source repository somewhere else. I don't know how the team would feel about forking Nyquist.

"I know a guy" who might be eager to try this out, but unfortunately he is even more eager right now to do other features...
Paul L
 
Posts: 881
Joined: Mon Mar 11, 2013 7:37 pm
Operating System: Please select

Re: Can the performance of Nyquist in Audacity be improved ?

Permanent link to this post Posted by Gale Andrews » Mon Nov 03, 2014 3:54 pm

Paul L wrote:Such things would be changes not to Audacity proper, but to the Nyquist project which it includes and has its official source repository somewhere else. I don't know how the team would feel about forking Nyquist.

I think you should discuss such things with Roger Dannenberg.


Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual
Gale Andrews
Quality Assurance
 
Posts: 26089
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10

Re: Can the performance of Nyquist in Audacity be improved ?

Permanent link to this post Posted by steve » Mon Nov 03, 2014 4:06 pm

Paul L wrote:I don't know how the team would feel about forking Nyquist.

Going on the response from previous times this has been discussed, it is preferred to keep "Audacity Nyquist" and "CMU Nyquist" fairly close in step.

There are two ways that can happen. Either Audacity waits for changes "upstream", or CMU Nyquist merges changes from Audacity Nyquist. Both approaches can and do happen, but to date there have been few Audacity developers other than Roger that are particularly interested in Nyquist. If we get an active developer that is interested in Nyquist, then I think that will be highly beneficial to both projects.

As Gale has just this moment posted, such things need to be discussed with Roger Dannenberg (who is both the originator / maintainer of Nyquist, and a co-founders of Audacity).
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Site Admin
 
Posts: 45383
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Next

Return to Nyquist



Who is online

Users browsing this forum: No registered users and 1 guest