Re: multitasking

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Oct 25 20:07:36, hans@xxxxxxxx wrote:
> $ sox input output effect1 effect2 effect3 ...
> A single SoX process will run on a single CPU.
> The effects are applied in the order you specify them.
> 
> > so I wanted to do several things in parallel.
> 
> A single instance of SoX will perform the effects in sequence.
> You can try running a pipeline of many SoX instances instead:
> $ sox input - effect1 | sox - - effect2 | ... | sox - output effectN
> Then your operating system could assign each SoX process to a separate CPU.

To get an idea of how much there is to gain, here is a naive experiment.

$ f='-t raw -c 1 -r 48000 -b 16 -e signed' 
$ sox $f -n input.raw synth noise gain -6 trim 0 02:00:00

That's two hours of white noise. Now run three effects on it,
first as an effect-chain of a single sox process,
then as a pipeline of three sox processes.

$ time sox $f input.raw $f output.raw lowpass 8k equalizer 4k 1o +3 gain -n   
$ time sox $f input.raw $f - lowpass 8k \
     | sox $f - $f - equalizer 4k 1o +3 \
     | sox $f - $f output.raw gain -n

(Run it several times to be sure the second one
does not have the benefit of filesystem caching).

On my machine, both take about 52 seconds.
With two hours of a sine wave, the result is almost the same.

Naively, this makes me think you will not gain much by making sox run
on different CPUs. Just run the sequence of effects you need to do.

	Jan


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Sox-users mailing list
Sox-users@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/sox-users



[Index of Archives]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Photo Sharing]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux