Their respective X-axes vertically line up in real-world time. Sample accuracy refers to the ability for a sound to render audio at an arbitrary sample (point in time) within an audio buffer rather than at the beginning of the buffer.Ī represents the game thread, with X-axis demarcations indicating game frame ticks, while B represents the audio render thread with X-axis demarcations indicating rendered audio buffers. Quartz is a system that works around the issues of variable latency and game-thread timing incompatibility by providing a way to accurately play any sound sample. Sample accuracy is the ability for a sound to start at an arbitrary sample in the audio renderer (such as the middle of a buffer) instead of on a buffer boundary. However, for some audio applications, such as interactive music, precisely timed repeating weapon fire, or other rhythmically-dependent audio, these issues are a significant problem. Depending on the CPU load of a game or the constraints of a particular platform, it is usually possible to tweak the buffer sizes and number of buffers rendered ahead of time to a size where most timing issues are below the threshold of perception. These issues of variable latency and game-thread-dependent timing of audio events are not significant for the majority of audio applications. If you need to play a sound at a precise moment in time (exactly when a different sound is finishing or starting), calling that command from the game thread will not work because the game-thread and audio render-thread event timings are decoupled. Game-thread ticks are also timed for gameplay and graphical rendering, not for audio rendering and audio timing. To complicate matters, game-thread ticks are highly variable (at least from the perspective of an audio renderer), and are often susceptible to arbitrary hitches-during garbage collection, loading assets, and so on. If an audio request comes in after a buffer has started to render ( 1), then the request will carry forward without playing ( 2) until the beginning of the next buffer ( 3). If a threading or gameplay latency is 13 ms (a feasible number), and we use the same buffer size of 2048 samples at 48 kHz, and if the command just missed the start of the current buffer being rendered, there will be a worst-case accumulated latency of 56 ms. In addition to this inherent latency with an audio renderer due to the render buffer size, audio commands issued from the game thread take time to get to the audio engine due to game-thread and audio-thread ticks, and general thread communication overhead. This means that for a buffer that contains 2048 samples rendered at 48k samples per second (kHz), the buffer would result in an audible latency of up to 43 milliseconds (ms). For example, if you were to trigger an explosion VFX and an explosion sound on the same game-thread tick, the latency between seeing the VFX explosion and hearing the sound is determined by this buffer size. This rate also describes the perceived audible latency of any issued commands. A command, for example, might be to play a new sound, stop an old one, or change the parameter of a sound like volume or pitch.īecause of this, the size of the rendered audio buffer directly controls the rate at which new commands are consumed. It is important to understand that audio engine rendering commands are typically consumed at the beginning of an audio buffer render. These buffers typically contain hundreds or even thousands of samples at a time. A number of reasons make this the only feasible way to render audio in real time on a CPU-CPU cache coherency, hardware API overhead, and so on. In an audio engine, for CPU performance reasons, audio samples are rendered in buffers, and submitted individually to output hardware-a digital audio converter (DAC). Maybe I will one day.Issues with Accurate Timing and Latency in Audio Rendering I suspect I’m (unduly) glamourizing the stage but I feel like I’d need to polish the game so much that it might be better to make a new game instead. it’d be a tiny, kinda unpolished 1hr experience… for no particular intended audience. I’ve considered fixing up the game and selling it on steam. my initial idea was to have a free game and a two dollar OST. That does also draw my attention to nfoldn. I still think they’re nice little pieces. If the paywall was stopping you before, check them out. So, the following albums are $0 PWYW: Practicing Retrocognition, Melosylexic Wares, nfoldn OST, and bite-sized pieces of candy that you can listen to I don’t think I want to delete anything, but I do think it’s silly to charge money for these little albums. I’ve decided to clean out my bandcamp a bit.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |