Home Forums Breakaway Audio Enhancer Fine Tuning Breakaway Audio Enhancer – All about Interfaces, Buffers and Rates

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #16264
    Milky
    Keymaster

    This is an unashamedly long tutorial on possibly improving BAE’s ability to process the audio efficiently, and therefore, possibly reduce CPU loads, audio glitches and latency.

    The first time you install BAE, it will run a Wizard which will ask you a couple of questions, and, based on your responses, it will try to configure and optimise the work environment.
    But, what if it gets it wrong? What if you changed your sound device? What if you changed your playout software? Will BAE still be optimised? Chances are that the answer is “no”.

    Any time into the future, you can right click on BAE and select “Settings”. This will take you back to the setup options as last saved, possibly as part of the program’s installation. You should check in here fairly regularly, but especially if your music or PC environment has changed.

    The first thing I would do is click on the “Test” button. You can do it with a generated tone, or with “Pass Through” meaning you should hear music (assuming you are playing something at the time).
    Have a look at the “Jitter” percentage for both Input and Output. They should be the lowest possible numbers – ideally zero, but typically more like 10% or so. Sometimes, the input may be low, but the output high, or vice versa.

    What is jitter?
    In layman’s terms it is the number of dropped or partially processed frames in the “buffers”. Imagine the buffers as a workspace in memory where BAE needs to examine every sample of the music sent to it from your playout software, apply the preset adjustments, compression etc to it, and pass it to the output buffer, where the device you have selected takes over and (hopefully) makes beautiful music.
    In the perfect world, if all the input samples get processed within a given time constant (say) a second, then jitter would be zero. However, depending on the CPU speed, available memory, OS overheads, other programs in the “job mix”, sound device timing errors, (to name a few), not every sample gets processed, so must be held over into the next buffer full. This creates a “queuing effect”, and if the queue is long enough, there will be an audible glitch as the output device is starved of processed audio information.

    Now, we could solve this queuing problem by simply configuring an exceptionally large buffer that never overflows. However, this would introduce another undesirable – latency.
    Remember, your output device cannot play anything until it is in the output buffer, so, if it takes seconds to get processed and passed on, that appears as a delay. This is not as noticeable with just audio, but what about a video music file? Lip synch, and synchronisation between the musicians’ movements and the sounds of their instruments will be out of whack.

    So, the general rule of thumb to minimise latency is to create the smallest possible buffers which do not produce any artefacts or jitter. This is what the Wizard attempts to do at installation, but it never hurts to check from time-to-time in case things have changed.

    Let’s look at the various configuration options and see how they interact with each other.
    1) Interface
    This can be “KS” (Kernel Streaming), “WAV” (wave or PCM) or “DS” (Direct Sound) and should be selected in order of preference from left to right. KS is raw processing at the lowest level of Windows influence, WAV is next best, but Windows tries to get in the way, and DS is basically through the Windows Mixer, so there are “layers” which all have an effect on the end result.

    2) Audio Device
    Usually, if you are using BAE to improve the sound from playout software such as Winamp, the input will be the Breakaway Pipeline, which is a virtual connection between Winamp and BAE. It can most likely handle “KS”, but it doesn’t hurt to experiment. In effect, Winamp “plays” to BAE’s input buffers, and BAE “plays” to the selected output device buffers after processing.
    You may want to select “KS” in and “KS” out, but there are a few things which may force your hand here. For instance, many Bluetooth devices have to pass through a transport layer (for the wireless interface), so KS may not be an option, or may be less efficient, so “KS” in and “WAV” out might be the way to go in that circumstance.
    If you sometimes play to your inbuilt speakers, and sometimes to a Bluetooth headset, you will need to go through this configuration exercise for each of them, because the options may differ.

    3) Buf Size/Buffers
    As suggested above, this is the size of each workspace and the number of them that BAE needs to buffer the input from Winamp or other software, process it and pass it to the output device. If you are processing music which was ripped from a CD (sample rate 44.100 kHz), I would focus on a buffer size of multiples of 441 (ten times the sample rate). There are a bunch of technical reasons why, but it stands to reason that samples are going to “fit” better if the buffer is aligned in some way with the number of music samples taken. I have often seen 882 yield a better result, but the theory still holds – it’s a multiple of the sample rate.
    Similarly, if you have DVD quality audio sampled at 48kHz, I would experiment with 480, 960 etc

    This is probably where most of the tweaking is needed. You might find an input buffer of 441/3 will yield a low input jitter percentage, but the same sized or number of output buffers might produce a high output jitter percentage, so you might end up with 441/3 in, 441/4 out or 441/3 in, 882/2 out.

    4) Rate (Sample Rate)
    This is the number of digital samples taken to produce one wave of sound. As you can see, you can upscale or downscale from the original, but, unless there is a very good reason to do so, I would advise against it. There is a common misconception that, as speakers and earbuds have become more capable of producing higher quality, the audio should be upscaled accordingly. That’s fine if there is material there to reproduce, but, if a track has been recorded in a lossy MP3 format, there is nothing to upscale, so the end result will just be empty frames to pad out the difference between the input and the output rates selected.
    If a CD has been ripped at 44.1 kHz, then upscaling to 48 kHz will not make one jot of difference to the audio. However, if the output device is set to “listen” at 48 kHz, you will need to upscale just so that the output from BAE aligns with the expected input of the device.

    So, as you can see, there are some tweaks that you can experiment with, and the benefit may be no glitches in your audio, less CPU overheads, better latency and an overall better listening experience – the very reason you are on this forum, reading this.

    #16265
    MrKlorox
    Participant

    This post is excellent and enlightening. Thank you. I nominate it for a pin.

    #16267
    Milky
    Keymaster

    Thank you! And pinned.

    #17133
    omarelifaz
    Participant

    Greetings, thank you very much for the information, now I understand part of the BAE configuration, I have a question, I use the program on the radio, all the material is in 44,100 hz. In input I must use ks, buf 441, buffers 4, rate 44100. and in output ks, buf 480, buffers 4, rate 48000 Is this configuration correct? Thank you very much in advance.
    The second unknown that I have, on the right click there is an option that says fm how to use it or when to use it? thank you so much…

    #17134
    Milky
    Keymaster

    If all of your material is at 44.1 why are you upscaling to 48K on output? There is no audible advantage, in fact there may be some audible artefacts as a result.

    As the preceding article says, it’s all about getting the lowest possible jitter rate. You might find that 882/2 might yield a better result, but it might not.

    #17135
    omarelifaz
    Participant

    Thank you very much, then I must configure BAE
    Input = ks, Breakaway pipeline, 441, 4, 44100, 2.
    Output = ks, Sound Blaster xfi, 441, 4, 44100, 2.
    Is this the correct way to configure BAE? Thank you so much…

    #17136
    Milky
    Keymaster

    That looks OK, but it really depends on your particular hardware. If you find the jitter figure (when you turn on the “test” light) is higher than (say) 15%, try a different combination of buffers and buffer size until you get the lowest numbers. However, the larger the buffers, the more latency becomes noticeable, because it takes BAE some time to fill the buffers.

    So, ultimately, it is a juggling act between minimal jitter and minimal latency. For instance, you might get lower jitter numbers with a buffer size of 882, but it may introduce a degree of latency. At the end of the day, if you can’t hear the dropped frames (jitter), it may not be a problem, but you should aim for less than 5% if you can achieve it.

    #17137
    omarelifaz
    Participant

    @Milky Thank you very much friend, for the guidance.
    Now I have another question, how or when to use the FM Mode option?

    • This reply was modified 1 year, 7 months ago by omarelifaz.
    #17139
    Milky
    Keymaster

    I am seeking absolute clarification, but I believe that in FM mode, BAE limits the top end frequencies to less that 15kHz, to allow for the 4 kHz guard band either side of the 19 kHz pilot tone used to produce a stereo FM signal.

    An FM stereo signal is broadcast as a mono signal 53 kHz wide, with the Right channel (23 – 53 kHz) “stacked” on top of the Left channel (50 Hz to 15 kHz). A pilot tone at 19 kHz separates the two channels, with a guard band of 4 kHz either side of that to allow for deviation. This means that the useable music frequencies cannot go above 15 kHz without encroaching on the guard band.

    #17173

    that is a good peace of information about

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.