Jump to content

How to reduce latency?


Konskoo

Recommended Posts

I want to record piano music. I will use VST piano, MIDI keyboard controller, studio monitors, audio Interface.

How to reduce latency? I have read that if interface has ASIO 2.0 I am able to set minimum buffer value to 64 or 128 bits. This is, respectively, 1.5 and 3 ms latency. Am I right?

What is your actual latency performance and buffer settings using an audio interface?

Link to comment
Share on other sites

I have been following your other thread and you are asking very good questions and taking the time to learn about the complicated world of DAW recording. 

Audio interfaces always will have the direct monitoring feature. This is a feature that allows you to monitor your input source directly before it passes through the A/D convertors so therefore the sound is direct analog and has zero latency. This is  mixed in your monitors/ headphones with the playback from your computer via the ASIO audio / USB / D/A convertors which your DAW will automatically adjust for latency so that your overdubbed tracks are perfectly in snyc with the already recorded material in your DAW.  

You can have issues if you have VST effects that use a " look ahead" buffer. It is best to perform all overdubbing ( tracking) with all effects bypassed to eliminate this issue. 

You can also have issues with latency if you try and overdub tracks while listening the the sound of the output of the DAW instead of the input. The output of any DAW will have some amount of latency depending on the quality of the system. 

Input of interface A/D convertors add latency

The system of your USB and computer add latency

Your DAW can add latency and if there is a lot of effects it can grow. 

Your buffer and sample rate settings can change the amount of latency

Then the USB going out and the D/A convertors sending to the monitors can add even more latency. 

 

So direct monitoring solves all this and then a good ASIO driver that correctly reports to your DAW what it's latency is so the DAW can correct this is also important. 

 

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

For piano, I find a buffer size of 64 at 44.1K is the maximum I can tolerate with my Focusrite Scarlett (4.6 msec latency, 9.3msec roundtrip). Any higher, and I notice the latency.

Increasing the sampling rate to 96K will more than half these figures, giving a input/output latency of 2.2 msec (4.4 msec roundtrip)... but this also increases the CPU usage.

For a CPU intensive project, that might mean temporarily bypassing FX or freezing tracks to avoid drop-outs.

A more extreme version of this would be to mix down the whole project to a stereo track, and temporarily archive all the other tracks.  In some ways this can be more convenient as there's very little "thought" about it when switching - i.e. you select all, unselect the mixdown track, and archive everything else.

Another alternative is to use an external MIDI sound module. I used to use my old Yamaha MU10 for this purpose, however depending on the part I was recording, the differences in response (e.g. velocity / feel) may or may not work as well when the part is played on a different piano sound.

Which method I choose depends largely on where I am in the project. In the early stages, I'll use FX bypassing or freezing. The mixdown/archive approach is more useful for last minute overdubs.

In all honesty though, I rarely need to any of this as I tend to treat tracking / mixing / mastering as separate tasks - i.e. I avoid trying to mix as I go along, and only use effects that contribute to the sound during the tracking stage.

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

I find that syncing my Playback I/O buffer size and Record I/O buffer size with my Interface ASIO driver, eliminates latency for me - with all FX enabled. 

To do this: Go to preferences /hit "P" on the keyboard. Under the Sync and Caching TAB you will find the default size of 256KB  by Cakewalk. Set your ASIO driver accordingly and find the setting that works best for you.

For me the default setting works perfectly. Set my Focusrite Scarlett Asio Driver the same - that gives me 4.3msec of 256samples with Effective latency at 48khz/Stereo at 4.3msec. 

  • Thanks 1
Link to comment
Share on other sites

4 hours ago, Will_Kaydo said:

I find that syncing my Playback I/O buffer size and Record I/O buffer size with my Interface ASIO driver, eliminates latency for me - with all FX enabled. 

To do this: Go to preferences /hit "P" on the keyboard. Under the Sync and Caching TAB you will find the default size of 256KB  by Cakewalk. Set your ASIO driver accordingly and find the setting that works best for you.

For me the default setting works perfectly. Set my Focusrite Scarlett Asio Driver the same - that gives me 4.3msec of 256samples with Effective latency at 48khz/Stereo at 4.3msec. 

I checked this to see if it could be another tweak for my system. The CbB reference guide says:

"Enable Read Caching and Enable Write Caching. Choosing either of these options lets Cakewalk use the Windows disk cache while reading or writing audio data. Cakewalk will usually perform best with all caching disabled, which is the default setting. If your computer has an older IDE disk controller, or a disk controller that does not use DMA transfers, enabling caching may improve Cakewalk’s audio performance."

It seems to me that it is better to not use this option on a relatively new PC.

  • Thanks 1
Link to comment
Share on other sites

31 minutes ago, Teegarden said:

I checked this to see if it could be another tweak for my system. The CbB reference guide says:

"Enable Read Caching and Enable Write Caching. Choosing either of these options lets Cakewalk use the Windows disk cache while reading or writing audio data. Cakewalk will usually perform best with all caching disabled, which is the default setting. If your computer has an older IDE disk controller, or a disk controller that does not use DMA transfers, enabling caching may improve Cakewalk’s audio performance."

It seems to me that it is better to not use this option on a relatively new PC.

No - That's not what I said. Don't enable it - think there's misunderstanding some where. 

Don't tick any of those boxes. Set your "ASIO driver" under "Driver Settings" to the same value as your Playback and Record I/O buffer size. Dont enable read or write Caching. 

 

 

  • Thanks 2
Link to comment
Share on other sites

3 hours ago, Will_Kaydo said:

No - That's not what I said. Don't enable it - think there's misunderstanding some where. 

Don't tick any of those boxes. Set your "ASIO driver" under "Driver Settings" to the same value as your Playback and Record I/O buffer size. Dont enable read or write Caching. 

 

 

My bad. I wrongly assumed that in order to change the buffer size you needed to enable caching. Clearly you can change the buffer size without that.

I noticed that playback was double (512 KB) the size of the record (256 KB) buffer size. Is that standard for CbB? Do you know why making them both the same size has a positive effect on latency or is it just by trial and error that you found it to be better? 

Edited by Teegarden
  • Like 1
  • Thanks 1
Link to comment
Share on other sites

1 hour ago, Teegarden said:

My bad. I wrongly assumed that in order to change the buffer size you needed to enable caching. Clearly you can change the buffer size without that.

I noticed that playback was double (512 KB) the size of the record (256 KB) buffer size. Is that standard for CbB? Do you know why making them both the same size has a positive effect on latency or is it just by trial and error that you found it to be 

If the buffer size is too low, you may encounter errors during playback or may hear clicks and pops. If the buffer size is set too high while recording, there will be quite a bit of latency which can be irritable.

It's hard to say with minimum specs given. There can be numerous reasons - out-dated windows drivers is one of them. 

Cakewalk sets both Playback and Record I/O to 256KB by default, so set it back to 256KB. There might be a clock sync issue with your system? Try to reset your configurations in preferences and update your drivers. 

Your ASIO drivers needs to be sync with that of your hardware - that's why it is important to update to the latest Asio drivers, I think it's v4.65 for focusrite -- nowhere near the studio right now to check. 

 

Edited by Will_Kaydo
  • Thanks 2
Link to comment
Share on other sites

I think people get totally confused about latency and where it matters. 

If you use direct monitoring it doesn't matter what buffer size  etc you use. You will hear your input synced perfectly with the output.  DO NOT TURN ON INPUT ECHO on new audio tracks your about to record. Use direct monitoring. 

RTL only matters if you are trying to listen to what you are inputting AFTER it has passed through your system. There will always be latency if you do this. And ya,, with a top notch system and interface you can get that way down to something like 2.5 ms but there will always be latency. Most run of the mill systems ( Computers/ audio interfaces) run at more like 8ms to as high as 30 ms.  

I have a pretty basic system and my RTL is at best 12ms so that is unusable for monitoring as I overdub. I use direct monitoring and therefore I'm listening at zero latency ( or very close). 

Now all this above is related to recording audio. Midi is different. 

Midi latency can be caused once again by the entire system. 

I find it's important to use a good midi driver that comes with most of the better controllers. I had terrible latency all of sudden a while ago and it turned out the issue was caused by W10 update overwriting my Roland midi driver with a generic midi driver. I re installed the Roland midi driver and the latency was gone. 

The other times I will experience midi latency is when I have certain effects like the LP multi band active. The latency goes away the minute I bypass all my effects. So I'm in the habit of making sure I by pass all my effects before I try and overdub midi parts with my midi keyboard or my midi drums. 

As far as I can tell midi latency has little to do with audio settings. There is for sure still some latency which will be caused by the system. I can hear just a bit of echo if I listen to my midi drums brain mixed with a VST drum output. So once again I use direct monitoring when playing drums and only monitor the brain while tracking. On a top notch system it might not be as noticeable but on mine it is. Someday I'll purchase a better interface like RME but for now I get by fine with a Focusrite or my Tascam. 

  • Thanks 1
Link to comment
Share on other sites

4 hours ago, John Vere said:

Now all this above is related to recording audio. Midi is different. 

Midi latency can be caused once again by the entire system. 

 

So what was the point trying to "correct" what I said, if you're jut gonna repeat it in different words. 

Just like buffer size "Direct Monitor" also has an affect on certain machines with latency. I had the problem with a laptop I was using on the road. It was an i5 4th gen if i'm correct - if not older, with a standard 500GB HDD, 8GB ram with Windows 10 (Can't remember which build,) My Solo gave me latency with direct monitoring on. 

Yes, you're spot on on few things you've mentioned, but I think it was time wasted. Until we know the specs of the system and hardware used by Konskoo, there's no way to claim an answer. Right now, you have to assume that he is using "Asio4all." Different setups, totally different problems and approach on latency.

Before the interface and a upgrade on the laptop (with a group that hired me everytime the went on tour,) I ran a successful on-the-road setup for demo projects, with only a USB midi, USB Mic, with the laptops onboard recording interface to record guitars, a pair of Alesis 3 monitors; using Cakewalk Sonar LE and only ASIO4ALL, with the buffer size set to 1024msec and Playback buffer at 256KB and guess what? NO LATENCY. 

Edited by Will_Kaydo
  • Thanks 1
Link to comment
Share on other sites

18 hours ago, Will_Kaydo said:

If the buffer size is too low, you may encounter errors during playback or may hear clicks and pops. If the buffer size is set too high while recording, there will be quite a bit of latency which can be irritable.

It's hard to say with minimum specs given. There can be numerous reasons - out-dated windows drivers is one of them. 

Cakewalk sets both Playback and Record I/O to 256KB by default, so set it back to 256KB. There might be a clock sync issue with your system? Try to reset your configurations in preferences and update your drivers. 

Your ASIO drivers needs to be sync with that of your hardware - that's why it is important to update to the latest Asio drivers, I think it's v4.65 for focusrite -- nowhere near the studio right now to check. 

 

Thanks for all the feedback! 
I found out that I've changed the setting myself long time ago, when I started to get pops and cracks. It was advised by CbB in the Version 2018-09 release notes:

"To optimize playback and reduce the potential for dropouts or audio glitches, we recommend a Playback I/O Buffer Size value of about 512 (KB) if you are experiencing any performance problems. You can change the Playback I/O Buffer Size value in Edit > Preferences > Audio - Sync and Caching."

(So you think that both Playback and Record I/O to 256KB is better?)

Later on I found out that it was "thread scheduling" value 3 that gave problems. This however seems to have been fixed in the recent CbB releases.
Using a simple project (some EQ, compression and two normal  reverbs + one convolution) and a few audio tracks + many inactive tracks and inactive busses with preloaded FX from my template) I measured it today against against "thread scheduling" 2 which now shows the following during playing:

thread scheduling 3: Audio Processing 6%    (Max. 16%, jumps to 21% during pause and jumps to 16 again during play???), 35% (Max. 55%, jumps to 103 during a pause???), Engine Load, 0 Late Buffers
thread scheduling 2: Audio Processing 7,5% (Max. 17%, jumps to 22% during  pause) Audio Processing, 38% (Max. 54% jumps to 110 during pause), Engine Load, 0 Late Buffers
(numbers are rounded averages since they change continuously). 

So at first sight some small performance improvements. Strangely enough when I stop the project the Max. values jump up and when hitting play again the Max. values drop significantly?
 
I've got the latest RME driver for my AOI PCIe card, so that shouldn't be a problem. I make sure to always have the latest driver and software updates for anything on the PC (has become a bit of an obsession?).
Things go reasonably well right now. I expected my 16-core Threadripper 1950X with 32 GB RAM and fast PCIe SSD drives to run smooth all the time, even under heavy workload. Still, if you don't pay attention to the many different Windows settings (sleep timers, GPU audio, power settings, wireless connections etc.) and other background processes, such a system can be disappointing. After tweaking it at many sides it's finally becoming nice to work with. Because of the many uncertainties introduced by other software I now use a program (ProcessKO) to disable any background process that is not needed for the system when I run CbB. This also seems to help a bit. 

System is now running 96kHz, 24bit + 64bit double precision engine (I wonder how useful the latter is and if it uses more resources) with latency of 2,7 ms at 256 (both Playback and Record I/O, according to your advice) samples buffer size.

What I don't get is why its still possible to get pops and cracks (which happens rarely at the moment, touch wood...) when you see on the performance monitor that Audio processing and Engine Load are way below 100%? I've never seen one of the cores max out during an audio glitch.
And why in some cases late buffers seem to be building up when a song project has been opened but is not playing???

 

  • Thanks 1
Link to comment
Share on other sites

On 10/18/2020 at 6:52 PM, Craig Anderton said:

The "nuclear option" is a Thunderbolt interface or a PCIe card interface (e.g., RME, ESI), either of which can have lower latency than USB.  For USB, MOTU claims 2.5 ms round-trip latency for their M2 interface at 96 kHz with 32 sample buffers.

My 10 year old RME PCIe at 96kHz, 24bit and 64 sample buffers gives me an effective latency of 0.7 ms and roundtrip of 3.4 ms
I always wondered which one is the one you need to look at: roundtrip or effective latency? (I thought the latter when you're recording e.g. a vocal)

However, I never felt that CbB was very stable at those settings, to be on the safe side I use 256 sample buffers (effective latency of 2.7 ms and roundtrip of 7.4 ms .

  • Thanks 1
Link to comment
Share on other sites

20 minutes ago, Teegarden said:

Thanks for all the feedback! 
I found out that I've changed the setting myself long time ago, when I started to get pops and cracks. It was advised by CbB in the Version 2018-09 release notes:

"To optimize playback and reduce the potential for dropouts or audio glitches, we recommend a Playback I/O Buffer Size value of about 512 (KB) if you are experiencing any performance problems. You can change the Playback I/O Buffer Size value in Edit > Preferences > Audio - Sync and Caching."
 

Bingo! Like I said, your interface/Asio drivers need to be Sync'd with that of your hardware. Set those back to 256KB and just fiddle with your ASIO buffer size under "DRIVER SETTINGS

  • Thanks 1
Link to comment
Share on other sites

52 minutes ago, Will_Kaydo said:

Bingo! Like I said, your interface/Asio drivers need to be Sync'd with that of your hardware. Set those back to 256KB and just fiddle with your ASIO buffer size under "DRIVER SETTINGS

I'm confused: so the advice from the CbB release is wrong (that leads to 512 KB Playback and 256 KB Record with interface at 256 KB (only one setting possible for both Playback and Record so it can only be in sync with one at a time)?

Next to that I thought that for playback during mixing (especially with extensive projects) it's even better to use 1024 KB or higher driver buffer size (meaning that after tracking you always need to increase driver buffer sizes for mixing and vice versa) 

  • Thanks 1
Link to comment
Share on other sites

15 minutes ago, Teegarden said:

I'm confused: so the advice from the CbB release is wrong (that leads to 512 KB Playback and 256 KB Record with interface at 256 KB (only one setting possible for both Playback and Record so it can only be in sync with one at a time)?

Next to that I thought that for playback during mixing (especially with extensive projects) it's even better to use 1024 KB or higher driver buffer size (meaning that after tracking you always need to increase driver buffer sizes for mixing and vice versa) 

LOL. You're reading to much in what is being said. You don't touch anything under the "Sync and Caching" TAB. 

ONLY IN DRIVER SETTINGS TAB.  Here's mine 

Picture 1:

Only set these settings to taste. 2043166269_Screenshot(20201019-214403).thumb.jpg.7557fc7d45ebfdbb1b204b5460cb3f64.jpg

Picture 2: 

Don't change anything here as what was said to you and what's explained in the Documentation. 

1725662969_Screenshot(20201019-214419).thumb.jpg.bf447d1cdafc51e34e24e8a15598e6eb.jpg

Also make sure that you choose your hardware driver (Should be ASIO) under the "Playback and Recording Tab."

Edited by Will_Kaydo
  • Thanks 2
Link to comment
Share on other sites

Just remember that direct monitoring is not an issue with an "in the box" recording of a VSTi as the OP has proposed. The key here is buffer size, and the delay from playing a note on the controller (or MIDI track) to hearing the notes played back by the VSTi without any breakups or dropouts.

  • Thanks 1
Link to comment
Share on other sites

Thank you, everybody. I took into attention.

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

On 10/18/2020 at 7:17 AM, John Vere said:

I have been following your other thread and you are asking very good questions and taking the time to learn about the complicated world of DAW recording.

John, thank you.

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

On 10/19/2020 at 10:12 AM, Will_Kaydo said:

Until we know the specs of the system and hardware used by Konskoo, there's no way to claim an answer

Will, thank you. I will use Windows 10 Home 64-bit. I haven't built computer for Cakewalk yet. I will build it after I will research which VSTs and hardware I need to fulfill my artistic goals, what are system requirements of VSTs which I need.

Firstly artistic goals. Next step - VSTs for them. Next step - hardware for VSTs. Latency is important question. I research information about latency. I read, ask questions on forum, read. Thanks to everybody for answers.

Edited by Konskoo
Link to comment
Share on other sites

54 minutes ago, Konskoo said:

Firstly artistic goals. Next step - VSTs for them. Next step - hardware for VSTs. Latency is important question. I research information about latency. I read, ask questions on forum, read. Thanks to everybody for answers.

Just for reference, Cakewalk here is reporting effective latency at 48kHz/stereo: 1.3 msec at 64 samples buffer size. ASIO reported output latency (includes buffer and hardware latencies) at 3.8 msec.

For comparison, Studio One reports output latency at 3.79ms at 64 samples buffer size.

Using audio interface: Focusrite Scarlett 2i2 Gen 3 USB2, with Focusrite USB ASIO output.

System spec:

  • Intel i5-9600K 6 cores locked at 4.6GHz on Asus Prime Z390-A motherboard.
  • Intel integrated UHD graphics 630
  • RAM 16GB DDR4 at 2666 MHz XMP.
  • SSD Samsung 860 EVO 500GB SATA 6 Gb/s, benchmark sequential read 555 MB/s.
  • Avira Pro AV real-time scanning active.
  • Windows 10 Pro 2004
Edited by abacab
  • Thanks 1
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...