# Fmod recording latency dramatically scales with channels

**URL:** <https://qa.fmod.com/t/fmod-recording-latency-dramatically-scales-with-channels/22443>\
**Category:** Unity\
**Tags:** windows, unity, csharp\
**Created:** [December 22, 2024, 4:27pm UTC](https://qa.fmod.com/t/fmod-recording-latency-dramatically-scales-with-channels/22443 "2024-12-22T16:27:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ozey](https://avatars.discourse-cdn.com/v4/letter/o/919ad9/32.png) [@ozey](https://qa.fmod.com/u/ozey)\
**Post date:** [December 22, 2024, 4:27pm UTC](https://qa.fmod.com/t/fmod-recording-latency-dramatically-scales-with-channels/22443/1 "2024-12-22T16:27:40Z")

</div>

Hi all,  
I’ve been banging my head against this for weeks and i hope someone here can help me.  
So essentially i’m trying to record multiple channels from an asio device, split the buffer of interleaved samples into separate buffers for each channel and then send them of in the main thread. Doesn’t sound so hard right?  
yeah well i’ve got to the point where everything works but i have a big latency issue. I’m extracting in buffers of 2048 samples and when recording with 48000hz i therefore can’t have latency larger than 50ms or the system will build up latency over time and it gets worse and worse.  
my problem is that as soon as i add a second channel to the recording my latency doubles from 40-50ms to 80-100ms which shouldn’t be the case (a small increase yeah, but double?!)  
I cant upload .cs files (and i don’t have a registered project in my profile yet where i could upload them) so i’ve added both relevant classes to a gist [here](https://gist.github.com/05k4rausdertonne/7b495df32238fba66de0dfa2af3f3a1f)

My guess is either i have a bug in how i check if a new buffer is ready or i misconfigured the fmod system in a way that it adds this much latency.

as asio device i’m using the ASIO4ALL driver

I really hope someone can help me since my research project depends on this working 😅

Anyhow, kind regards and happy holidays 🙂

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [December 30, 2024, 2:08am UTC](https://qa.fmod.com/t/fmod-recording-latency-dramatically-scales-with-channels/22443/2 "2024-12-30T02:08:38Z")

</div>

Hi, happy holidays to you too!

Thank you for the detailed explanation.

Unfortunately, I was not able to get the code to run. Would it be possible to upload the project to your [profile](https://fmod.com/profile), or a stripped out version?

Thank you

---

<div class="post-metadata">

**Author:** ![ozey](https://avatars.discourse-cdn.com/v4/letter/o/919ad9/32.png) [@ozey](https://qa.fmod.com/u/ozey)\
**Post date:** [January 2, 2025, 8:44pm UTC](https://qa.fmod.com/t/fmod-recording-latency-dramatically-scales-with-channels/22443/3 "2025-01-02T20:44:13Z")

</div>

I Figured it out (while hiking during the holidays lol)  
I somehow assumed that getRecordPosition() spits out the position in regards to total interleaved samples so i always waited too long (i waited times the number of channels)  
But turns out the record position advances one sample for every multi channel sample (as it should, idk why i assumed otherwise 🤦‍♂️)

Anyhow hope this helps someone 🙂

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [January 2, 2025, 8:48pm UTC](https://qa.fmod.com/t/fmod-recording-latency-dramatically-scales-with-channels/22443/4 "2025-01-02T20:48:42Z")

</div>

Thank you for sharing the solution!
