10: Latency, C++ Real-Time Audio Programming with Bela

  Рет қаралды 2,972

Bela Platform

Bela Platform

Күн бұрын

Lecture 10 of C++ Real-Time Audio Programming with Bela. This lecture explains latency, where it comes from and how to measure it, showing Bela's 1ms latency in action.
In this lecture:
Section 1: Explaining latency 0:00
Section 2: Sources of latency 8:41
Section 3: Measuring latency 17:26
Section 4: Automatic latency tester 24:25
Example code and companion materials:
github.com/BelaPlatform/bela-...
This course is a deep dive into how Bela processes data, and how to implement real-time audio and interaction. If you want to learn or improve your skills with C++ and audio programming, this is a great way to start!
Bela is the open-source platform for creating beautiful interaction. If you’d like to get a Bela system to follow along with these lectures, visit shop.bela.io. Use promo code CREATEATHOME for £10 off Bela and Bela Mini Starter Kits.
Music by Vula Viel (vulaviel.com).

Пікірлер: 9
@kostantinosmag2986
@kostantinosmag2986 2 жыл бұрын
Great ....Nice one....
@maehw4070
@maehw4070 4 жыл бұрын
Why is the latency measured at two differenct edges? The rising edge on channel #1 and the falling edge on channel #2?
@apm414
@apm414 4 жыл бұрын
Good question. The way the Bela audio codec is set up, the passthrough produces a phase inversion, so the rising edge on the input corresponds to the falling edge on the output. I perhaps should have mentioned that in the video! This could be eliminated by multiplying the output by -1 before sending it, but I chose to use the built-in passthrough example.
@DmitryIvanovDfcreative
@DmitryIvanovDfcreative 4 жыл бұрын
I wonder if there was another sort of mic and ADC, structurally similar to cochlea with frequency domain data as output. It would populate input buffer immediately with 0 latency (digits there would always be relevant). Processing as well would be simpler for many cases, like filtering. Outputting is potentially also 0 delay. It looks like the whole set of latency problems is caused by initially picked time domain.
@joeblack375
@joeblack375 4 жыл бұрын
The cochlea essentially performs a frequency-to-location transform due to its continuously varying impedance. You would still have to determine/digitize the level in multiple locations. If all you need is a continuously updated FFT (instead of a cheap, block-wise computation), there are algorithms for that. Processing completely in the frequency domain would in fact result in *infinite* latency, as you have to know the entire signal a priori. In any case, there *are* cochlea-like chips (for HF processing): dspace.mit.edu/bitstream/handle/1721.1/59982/Mandal-2009-A%20Bio-Inspired%20Active%20Radio-Frequency%20Silicon%20Cochlea.pdf;sequence=2
@joeblack375
@joeblack375 4 жыл бұрын
The data sheets show 21 and 17 samples of (filter) latency, the measured hardware latency (both on the Bela and the oscilloscope) is 41 samples, leaving three samples unaccounted for. Would be nice if you explained those as well (fairly sure two of them are due to serial transfer via I2S which obviously requires time separate from the built-in anti-aliasing filter).
@apm414
@apm414 4 жыл бұрын
Good question. I would expect 1 frame of latency on each of the input and output from the I2S transfer, as you say. The remaining sample of latency is probably the effect of slow rise time of the output signal because of the band-limited audio output. If you turn down the overall level of the output in the Bela settings and run the same code, you'll get another 1-2 samples of apparent latency because of the time it takes the input to cross the threshold specified in the code.
@richardsewell5159
@richardsewell5159 4 жыл бұрын
I'm interested in measuring the latency between USB midi controller pads (MPD218) and Bela output. Best way I can think of is to set a microphone over the pads and plug that to the left channel of my DAW and then record bela output on the right channel and look at the difference between pad press and bela output. The midi callback routine is an auxiliary (non-realtime) task on Bela, so I'm not sure what to expect, but it seems quite tight at the moment. I'm considering hooking up the MPC pads directly to ADC inputs on Bela, but not sure if it's really worth it. p.s. I want to hear a cheer in this video when you measure 1ms latency ;)
@oromoiluig
@oromoiluig 4 жыл бұрын
yes, that should work. It's the same approach that was used here www.tandfonline.com/doi/pdf/10.1080/09298215.2017.1340485?needAccess=true
11: Circular Buffers, C++ Real-Time Audio Programming with Bela
37:08
Lessons Learned from a Decade of Audio Programming
26:14
Cat Corn?! 🙀 #cat #cute #catlover
00:54
Stocat
Рет қаралды 16 МЛН
ТАМАЕВ УНИЧТОЖИЛ CLS ВЕНГАЛБИ! Конфликт с Ахмедом?!
25:37
19: Phase Vocoder (part 2), C++ Real-Time Audio Programming with Bela
47:28
Gliss Video Manual
36:48
Bela Platform
Рет қаралды 5 М.
21: ARM Assembly Language,  C++ Real-Time Audio Programming with Bela
1:00:46
20: Phase Vocoder (part 3), C++ Real-Time Audio Programming with Bela
1:07:54
Scientific Concepts You're Taught in School Which are Actually Wrong
14:36
Designing Flexible Sensors in KiCad with Flex PCB
22:46
Bela Platform
Рет қаралды 18 М.
Barker meets Gliss
3:45
Bela Platform
Рет қаралды 1,9 М.
Что делать если в телефон попала вода?
0:17
Лена Тропоцел
Рет қаралды 1,4 МЛН
Здесь упор в процессор
18:02
Рома, Просто Рома
Рет қаралды 382 М.
1$ vs 500$ ВИРТУАЛЬНАЯ РЕАЛЬНОСТЬ !
23:20
GoldenBurst
Рет қаралды 1,8 МЛН