Csound Csound-dev Csound-tekno Search About

[Csnd] Real Time Performance - Latency

Date2019-08-01 18:51
FromSlobodan Ivanovic
Subject[Csnd] Real Time Performance - Latency
Hello! I was wondering how much latency an opcode will add to an Audio Output. It is possible to know? How can I know how many effect or oscillator can I add before it starts to make errors? 

I'm asking this because I'm planning to be conscious about the limits of I/O while I'm coding my instruments and everything so I can be able to play in Real-Time without having any problem (without too much latency).

Any suggestions?

Thank you!
Slobodan

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2019-08-01 19:48
FromSteven Yi
SubjectRe: [Csnd] Real Time Performance - Latency
Opcodes in general don't really "affect latency" unless they delay
signal output (e.g., convolution).  The latency is generally going to
be affected by buffer sizes and ksmps value which determines time in
samples coming into and out of Csound or when scheduled events fire.
Having too much processing when using smaller buffers though can delay
delivery of samples which can cause breakups in audio: is this what
you are concerned about?  If so, then you can try to either apply
limits to polyphony or create a fixed audio graph (always-on setup of
instruments) that you would need to test with your hardware.

Additionally, the one part of Csound that might cause an issue in
constrained systems is initialization time. Csound may allocate memory
in these situations, which is generally unpredictable and typically
avoided when on audio threads. You can have Csound do initialization
off the main audio thread by using the --realtime flag.  There can be
a delay if initialization takes a long time, but it avoids the
possibility of audio breakups. Depending on the opcode, and because
Csound uses a memory pool, you might be fine to not use --realtime and
just pre-allocate instrument instances before performing.


On Thu, Aug 1, 2019 at 1:51 PM Slobodan Ivanovic  wrote:
>
> Hello! I was wondering how much latency an opcode will add to an Audio Output. It is possible to know? How can I know how many effect or oscillator can I add before it starts to make errors?
>
> I'm asking this because I'm planning to be conscious about the limits of I/O while I'm coding my instruments and everything so I can be able to play in Real-Time without having any problem (without too much latency).
>
> Any suggestions?
>
> Thank you!
> Slobodan
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2019-08-01 21:58
FromJohn ff
SubjectRe: [Csnd] Real Time Performance - Latency
Some years ago a student of mine wrote a it's band without lead guitar in csound with no issues of drop outs or latency.  Since then computers have got faster and Victor wrote the real-time mode so I do not expect you to have many probls if you avoid the very heavy opcodes.


Sent from TypeApp
On 1 Aug 2019, at 18:52, Slobodan Ivanovic <slobodanip@gmail.com> wrote:
Hello! I was wondering how much latency an opcode will add to an Audio Output. It is possible to know? How can I know how many effect or oscillator can I add before it starts to make errors? 

I'm asking this because I'm planning to be conscious about the limits of I/O while I'm coding my instruments and everything so I can be able to play in Real-Time without having any problem (without too much latency).

Any suggestions?

Thank you!
Slobodan

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2019-08-01 22:09
FromVictor Lazzarini
SubjectRe: [Csnd] Real Time Performance - Latency
Often the question is down to the operating system. An extreme example is that Csound can run on the Bela system with 2 frames latency.

On a well-tuned linux, it should work very well. On MacOS, with which I have more
experience, 32/64 frames buffers give
you good performance.

I don't know how it is on Windows.

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 1 Aug 2019, at 21:59, John ff <jpff@codemist.co.uk> wrote:

Some years ago a student of mine wrote a it's band without lead guitar in csound with no issues of drop outs or latency.  Since then computers have got faster and Victor wrote the real-time mode so I do not expect you to have many probls if you avoid the very heavy opcodes.


Sent from TypeApp
On 1 Aug 2019, at 18:52, Slobodan Ivanovic <slobodanip@gmail.com> wrote:
Hello! I was wondering how much latency an opcode will add to an Audio Output. It is possible to know? How can I know how many effect or oscillator can I add before it starts to make errors? 

I'm asking this because I'm planning to be conscious about the limits of I/O while I'm coding my instruments and everything so I can be able to play in Real-Time without having any problem (without too much latency).

Any suggestions?

Thank you!
Slobodan

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2019-08-01 23:01
FromGuillermo Senna
SubjectRe: [Csnd] Real Time Performance - Latency
On 1/8/19 18:09, Victor Lazzarini wrote:
> I don't know how it is on Windows.

Pretty bad?

Has JACK (https://csound.com/docs/manual/RealTimeJack.html) been
mentioned already? Very nice for working with audio in general. And if
your buffers aren't properly tuned, you'll see the xruns pretty quick.


Cheers.

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2019-08-02 01:11
FromSteven Yi
SubjectRe: [Csnd] Real Time Performance - Latency
I re-tested on Windows and found it to be quite good really if using
the WASAPI device option with the PortAudio driver. I'm running
Windows 10 in Bootcamp on a Macbook Pro and I'm able to use -b32 -B64
here. I do not have ASIO drivers installed so did not test that. MME
has poor latency but that's pretty well known. WDM-KS driver did not
work well here which was a bit surprising.

I was a bit surprised that the WASAPI option was running so well. It
might be nice if we could get others to test and if it's overall good
for everyone to find a way to default to it in rtpa.

On Thu, Aug 1, 2019 at 6:02 PM Guillermo Senna  wrote:
>
> On 1/8/19 18:09, Victor Lazzarini wrote:
> > I don't know how it is on Windows.
>
> Pretty bad?
>
> Has JACK (https://csound.com/docs/manual/RealTimeJack.html) been
> mentioned already? Very nice for working with audio in general. And if
> your buffers aren't properly tuned, you'll see the xruns pretty quick.
>
>
> Cheers.
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here