Home Computer Audio Asylum

Music servers and other computer based digital audio technologies.

Revisiting buffer sizes (somewhat technical).

Decided to have a look at the source code of the ASIO plugin I'm using, to see how the setting "Buffer Size" is actually used, to get the size of the buffer (in samples). On UI, the setting is exposed as a value from 0 to 63.

Here's what I discovered in the code:

ASIOGetBufferSize(&MinSize, &MaxSize, &_PreferredSize, &Granularity);
PreferredSize = _PreferredSize;
BuffPreferredSize = PreferredSize * BUFFER_SIZE * (cfg_buffer_size + 1);

First line is an ASIO SDK call to the hardware driver, populating values for Min, Max, and Preferred buffer sizes. Third line calculates the size of the buffer, where:

- PreferredSize is returned by the driver;
- BUFFER_SIZE is a constant, which is set by developer to 4;
- cfg_buffer_size is the config value set in UI, in my case 0.

So, if let's say PreferredSize=512 (I've no idea what it is in reality, and would have to run the code in debug mode on a machine with W4S XMOS driver installed), then actual buffer size in samples is

512*4*1 = 2048

When I feel like it next time, the obvious things to try are:

- Use MinSize instead of PreferredSize;
- Set BUFFER_SIZE constant to 2 or 1 - not sure how arbitrary is the value 4.


This post is made possible by the generous support of people like you and our sponsors:
  Atma-Sphere Music Systems, Inc.  


Topic - Revisiting buffer sizes (somewhat technical). - carcass93 14:13:40 04/14/14 (57)

FAQ

Post a Message!

Forgot Password?
Moniker (Username):
Password (Optional):
  Remember my Moniker & Password  (What's this?)    Eat Me
E-Mail (Optional):
Subject:
Message:   (Posts are subject to Content Rules)
Optional Link URL:
Optional Link Title:
Optional Image URL:
Upload Image:
E-mail Replies:  Automagically notify you when someone responds.