From: Jan Stary <hans@stare.cz>
To: sox-users@lists.sourceforge.net
Subject: Re: multitasking
Date: Wed, 25 Oct 2017 21:49:32 +0200 [thread overview]
Message-ID: <20171025194931.GA38405@www.stare.cz> (raw)
In-Reply-To: <20171025180735.GA49885@www.stare.cz>
On Oct 25 20:07:36, hans@stare.cz 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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users
next prev parent reply other threads:[~2017-10-25 19:49 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-24 19:00 multitasking Glenn English
2017-10-24 19:44 ` multitasking Jeremy Nicoll - ml sox users
2017-10-25 0:29 ` multitasking Glenn English
2017-10-25 18:39 ` multitasking Jeremy Nicoll - ml sox users
2017-10-25 18:07 ` multitasking Jan Stary
2017-10-25 19:49 ` Jan Stary [this message]
2017-10-25 20:25 ` multitasking Glenn English
2017-10-25 21:11 ` multitasking Jeremy Nicoll - ml sox users
2017-10-26 2:35 ` multitasking Glenn English
2017-10-26 7:39 ` multitasking Jeremy Nicoll - ml sox users
2017-10-26 9:51 ` multitasking Jan Stary
2017-10-26 14:41 ` multitasking Glenn English
2017-10-26 18:57 ` multitasking Jan Stary
2017-10-26 19:17 ` multitasking Glenn English
2017-10-26 20:27 ` multitasking Jeremy Nicoll - ml sox users
2017-10-26 22:05 ` multitasking Glenn English
2017-10-26 9:43 ` multitasking Jan Stary
2017-10-26 14:26 ` multitasking Glenn English
2017-10-26 9:48 ` multitasking Jan Stary
2017-10-26 14:34 ` multitasking Glenn English
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://lists.sourceforge.net/lists/listinfo/sox-users
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171025194931.GA38405@www.stare.cz \
--to=sox-users@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/sox.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).