# High latency \>30ms

**URL:** <https://discourse.zynthian.org/t/high-latency-30ms/5769>\
**Category:** Using Zynthian\
**Created:** [April 26, 2021, 6:01am UTC](https://discourse.zynthian.org/t/high-latency-30ms/5769 "2021-04-26T06:01:59Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jude](https://discourse.zynthian.org/letter_avatar_proxy/v4/letter/j/bc8723/32.png) [@Jude](https://discourse.zynthian.org/u/Jude)\
**Post date:** [April 26, 2021, 6:01am UTC](https://discourse.zynthian.org/t/high-latency-30ms/5769/1 "2021-04-26T06:01:59Z")

</div>

Hi folks! I’ve been playing Zynthian for a few weeks now and I’m having fun but I noticed latency. I thought that maybe I was just too sensitive to the latency since I’m used to playing hardware however I finally did a test and I can confirm high latency (if my methodology is ok). I have a hardware synth (Yamaha reface) with built in speakers and an aux input. Midi ran out from the usb of the reface and into the usb of the Zynthian. Audio ran out from the Zynthian headphone port into the aux in of the Yamaha. I placed a mic near the speakers of the Yamaha and recorded while I played a very short sound from the Yamaha and from the Zynthian. I compared the beginning of the Zynthian wave to the beginning of the Yamaha wave and got the following results:  
Pianoteq 7 U4 - 46ms of latency  
ZynSubAddFx white noise - 36 ms  
Noizemaker white noise - 32 ms

I measured these numbers in Logic Pro X.

Can this latency be improved? Thanks!

---

<div class="post-metadata">

**Author:** ![wyleu](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/wyleu/32/514_2.png) [@wyleu](https://discourse.zynthian.org/u/wyleu)\
**Post date:** [April 26, 2021, 6:49am UTC](https://discourse.zynthian.org/t/high-latency-30ms/5769/2 "2021-04-26T06:49:30Z")

</div>

The pi headphone jack probably isn’t the best reference.  
You probably want to trigger both devices from the same trigger, perhaps a 5 in din Midi port to ensure a consistent delay for each. You probably want to compare the responses in a similar fashion. The aux in may or may not be digital, it’s unlikely but you never know.  
Try to ensure the signal chains are identical for both devices.

Feeding the zynth from a usb MIDI derived from the MIDI out of the yamaha will also add a couple of buffers of delay into the rig which will mean the zynth isn’t getting the same starting impulse that the yamaha is…

I know I showed a latency rig using speakers and a microphone but this was primarily fanciful and realistically the actually measurements are best done electronically as cutting down the number of elements and transitions will allow you to focus on what you are really measuring…

---

<div class="post-metadata">

**Author:** ![riban](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/riban/32/2331_2.png) [@riban](https://discourse.zynthian.org/u/riban)\
**Post date:** [April 26, 2021, 7:35am UTC](https://discourse.zynthian.org/t/high-latency-30ms/5769/3 "2021-04-26T07:35:57Z")

</div>

Yep! That is not quite like-for-like so take into consideration all that @wyleu says. The “headphone” output does have poor latency for several reasons. Test with a soundcard, even with your current test method and you _should_ see much improved results.

---

<div class="post-metadata">

**Author:** ![Jude](https://discourse.zynthian.org/letter_avatar_proxy/v4/letter/j/bc8723/32.png) [@Jude](https://discourse.zynthian.org/u/Jude)\
**Post date:** [April 27, 2021, 4:53am UTC](https://discourse.zynthian.org/t/high-latency-30ms/5769/4 "2021-04-27T04:53:46Z")

</div>

Wyleu, Riban, thank you for the responses. Based on your recommendations, I set up a test that better controlled the variables.

My Roland A70 has 4 MIDI DIN outs so I sent one to the computer through an interface, one to the MIDI IN of the Zynthian, and one to the MIDI in of the reface(a hardware synth as an experiment control). I sent audio out of my reface and audio out of the Zynthian (the actual audio out, NOT the headphone out) into the interface and into Logic. I hit notes on the A70, and recorded the MIDI event and the audio from the reface and the Zynthian. I then measured the difference between where Logic records the MIDI event and the audio. These are the results:  
reface audio - 3ms  
Zynthian setBfree - 23ms  
Zynthian Pianoteq U4 - 17 ms  
Zynthian Noize Mak3r - 15 ms  
Zynthian SubAddFX - 17 ms

These results are much better and Im sure, much more accurate than my first results. I would still like to be able to bring these numbers down by a third. I don’t expect Zynthian to compete with my MacBook Pro but I think I read on this forum of people getting latency results significantly lower than mine. What would you folks recommend?

---

<div class="post-metadata">

**Author:** ![le51](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/le51/32/1706_2.png) [@le51](https://discourse.zynthian.org/u/le51)\
**Post date:** [April 27, 2021, 6:31am UTC](https://discourse.zynthian.org/t/high-latency-30ms/5769/5 "2021-04-27T06:31:07Z")

</div>

Do you run zynthian with the official kit or on some customised setup ?  
You Can try to modify jackd sound server parameters (through webconf/hardware/audio/advanced view) but keep in mind that reducing jackd latency (wich is a part of the total latency) coule produce Xruns.

---

<div class="post-metadata">

**Author:** ![Jude](https://discourse.zynthian.org/letter_avatar_proxy/v4/letter/j/bc8723/32.png) [@Jude](https://discourse.zynthian.org/u/Jude)\
**Post date:** [April 27, 2021, 7:05am UTC](https://discourse.zynthian.org/t/high-latency-30ms/5769/6 "2021-04-27T07:05:47Z")

</div>

Hi le51, I use a Zynthian kit V4. I’ll try playing with the buffer. I don’t use a sustain pedal so I might be able to get along with a smaller buffer.

---

<div class="post-metadata">

**Author:** ![Jude](https://discourse.zynthian.org/letter_avatar_proxy/v4/letter/j/bc8723/32.png) [@Jude](https://discourse.zynthian.org/u/Jude)\
**Post date:** [April 28, 2021, 10:21am UTC](https://discourse.zynthian.org/t/high-latency-30ms/5769/7 "2021-04-28T10:21:05Z")

</div>

Hi folks, I changed the buffer to 128 and got interesting results:  
Pianoteq - constant xruns  
setBfree - 7ms  
Noise mak3r - 6ms

There are a few xruns here and there with setBfree and Noisemaker but not bad. It’s worth the trade for such low latency. It feels good and snappy to play at this buffer. Although I would trade a couple ms for fewer x runs, the about 20ms I was getting at 256 was difficult to play.

At 128, I can’t use Pianoteq though. Is there any way to reduce latency at 256 so I can still use Pianoteq?  
Thanks!

---

<div class="post-metadata">

**Author:** ![riban](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/riban/32/2331_2.png) [@riban](https://discourse.zynthian.org/u/riban)\
**Post date:** [April 28, 2021, 5:29pm UTC](https://discourse.zynthian.org/t/high-latency-30ms/5769/8 "2021-04-28T17:29:52Z")

</div>

You could try increasing samplerate which reduces latency but may increase load / xruns. You can also access Pianoteq GUI and reduce internal sample rate but it is already fairly low so the frequency response may too poor for you.

---

<div class="post-metadata">

**Author:** ![Jude](https://discourse.zynthian.org/letter_avatar_proxy/v4/letter/j/bc8723/32.png) [@Jude](https://discourse.zynthian.org/u/Jude)\
**Post date:** [April 28, 2021, 7:28pm UTC](https://discourse.zynthian.org/t/high-latency-30ms/5769/9 "2021-04-28T19:28:47Z")

</div>

Thanks for the reply, Riban. I might play with the sample rate. Since setBfree can run smooth and fast at 128, I might have enough to play with without getting Pianoteq going anyway.

About the headphone out: does having RPi headphone on/off effect anything other than the headphone out? What I mean is, would turning it off improve performance?

---

<div class="post-metadata">

**Author:** ![riban](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/riban/32/2331_2.png) [@riban](https://discourse.zynthian.org/u/riban)\
**Post date:** [April 28, 2021, 10:31pm UTC](https://discourse.zynthian.org/t/high-latency-30ms/5769/10 "2021-04-28T22:31:10Z")

</div>

Turning headphone off has significant improvement effect. The option adds a samplerate converter to mirror main output to the built-in RPi audio interface which itself isn’t very efficient. Headphone output should only be used for testing and avoided where possible.

---

<div class="post-metadata">

**Author:** ![wyleu](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/wyleu/32/514_2.png) [@wyleu](https://discourse.zynthian.org/u/wyleu)\
**Post date:** [April 29, 2021, 4:21am UTC](https://discourse.zynthian.org/t/high-latency-30ms/5769/11 "2021-04-29T04:21:41Z")

</div>

I reckon we deserve a [🧐](http://wiki.zynthian.org/index.php/Talk:Zynthian_Wiki_Home) at the very least here . . …

---

<div class="post-metadata">

**Author:** ![Jude](https://discourse.zynthian.org/letter_avatar_proxy/v4/letter/j/bc8723/32.png) [@Jude](https://discourse.zynthian.org/u/Jude)\
**Post date:** [April 29, 2021, 5:08am UTC](https://discourse.zynthian.org/t/high-latency-30ms/5769/12 "2021-04-29T05:08:38Z")

</div>

Thanks, Riban. Wyleu, could you clarify what 🧐 means?

I tried a new test with different configurations.

I first turned off the headphone out:  
Pianoteq - 14ms  
setBfree - 17ms

I then raised the sample rate to 48k:  
Pianoteq - 12ms  
setBfree - 15ms

I then raised it to 88.2k  
Pianoteq - 6ms and frequent clicks

It seems to me that 256/48k with the headphone off is pretty decently low latency and has been very stable for me. I dont use a sustain pedal and I’m not a virtuoso so I’m fairly happy with this setting.

---

<div class="post-metadata">

**Author:** ![riban](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/riban/32/2331_2.png) [@riban](https://discourse.zynthian.org/u/riban)\
**Post date:** [April 29, 2021, 6:21am UTC](https://discourse.zynthian.org/t/high-latency-30ms/5769/13 "2021-04-29T06:21:36Z")

</div>

Follow the link [🧐](http://wiki.zynthian.org/index.php/Talk:Zynthian_Wiki_Home). @wyleu is the master of cryptic messaging.

Good to hear you have a workable solution. I reckon you will still suffer xruns and I am (slowly, very slowly) trying to improve that because it is one thing I think we should eradicate - or at least have a method of identifying configurations that work without xruns. There are many causes and we inch ever-closer to utopia but with every improvement the horizon seems to move further away! (Blooming feature creep…)

---

<div class="post-metadata">

**Author:** ![Jude](https://discourse.zynthian.org/letter_avatar_proxy/v4/letter/j/bc8723/32.png) [@Jude](https://discourse.zynthian.org/u/Jude)\
**Post date:** [April 30, 2021, 11:37pm UTC](https://discourse.zynthian.org/t/high-latency-30ms/5769/14 "2021-04-30T23:37:31Z")

</div>

Ah, I see what 🧐 means. Wyleu, I think you’re right. It’s the least I could do. Since, Noise Mak3r, setBfree and Pianoteq are the engines I’ve been using for these test, stand by for a funky sample featuring them. Do we post 🧐 here on the thread or another spot?

---

<div class="post-metadata">

**Author:** ![wyleu](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/wyleu/32/514_2.png) [@wyleu](https://discourse.zynthian.org/u/wyleu)\
**Post date:** [May 1, 2021, 1:57am UTC](https://discourse.zynthian.org/t/high-latency-30ms/5769/15 "2021-05-01T01:57:02Z")

</div>

Most people attach them to a post in this forum.

---

<div class="post-metadata">

**Author:** ![riban](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/riban/32/2331_2.png) [@riban](https://discourse.zynthian.org/u/riban)\
**Post date:** [May 1, 2021, 9:14am UTC](https://discourse.zynthian.org/t/high-latency-30ms/5769/16 "2021-05-01T09:14:32Z")

</div>

@Jude put it here.  
@wyleu as funny and esoteric / kitsch as 🧐 is, it is probably one of the most frequently misunderstood things on this forum with correspondingly highest support burden. How about adding some musical notes to a custom version of the emoji? You know very well that every time you post that request you will get a 😕 response. 😛

---

<div class="post-metadata">

**Author:** ![Jude](https://discourse.zynthian.org/letter_avatar_proxy/v4/letter/j/bc8723/32.png) [@Jude](https://discourse.zynthian.org/u/Jude)\
**Post date:** [May 4, 2021, 12:19am UTC](https://discourse.zynthian.org/t/high-latency-30ms/5769/17 "2021-05-04T00:19:35Z")

</div>

[/uploads/default/original/2X/8/81be43209947b33f87d3dbaa3c88103c0b1d686b.mp3](https://discourse.zynthian.org/uploads/default/original/2X/8/81be43209947b33f87d3dbaa3c88103c0b1d686b.mp3)  
Alright folks, I put together a quick 🧐 featuring Noize Mak3r on bass, setBfree with a healthy amount of drive, Fluid Drums and finally, a Pianoteq Clavinet with an auto-wah. I recorded it into Logic pro X. Thanks for all the help and cheers to the Zynthian community! Enjoy the funk!

---

<div class="post-metadata">

**Author:** ![tkc](https://discourse.zynthian.org/letter_avatar_proxy/v4/letter/t/67e7ee/32.png) [@tkc](https://discourse.zynthian.org/u/tkc)\
**Post date:** [May 22, 2021, 5:54pm UTC](https://discourse.zynthian.org/t/high-latency-30ms/5769/18 "2021-05-22T17:54:17Z")

</div>

I too am experiencing high latency when listening through the Raspberry Pi 4 headphone jack. Will adding a HiFiBerry card fix the latency by itself, or is it possible the MIDI through USB is the culprit as well?

---

<div class="post-metadata">

**Author:** ![riban](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/riban/32/2331_2.png) [@riban](https://discourse.zynthian.org/u/riban)\
**Post date:** [May 22, 2021, 6:18pm UTC](https://discourse.zynthian.org/t/high-latency-30ms/5769/19 "2021-05-22T18:18:31Z")

</div>

Raspberry Pi _headphone_ output adds significant latency. A modern USB MIDI interface should add minimal latency.
