Operating Systems Latency Measurement and Analysis
Not rated
7,863
There is growing interest in utilizing PC and workstation platforms for reactive sound synthesis and processing applications. However, few operating systems are designed to provide real-time performance, and vendors typically do not guarantee or specify the expected performance levels of their operating system products. Significant experimentation is necessary with each operating system to achieve musically acceptable results. The measurement of I/O latencies poses a major technical challenge in attaining reliable real-time performance for musical applications, which is the focus of this paper. The primary issue is the synchronous logging of stimulus events, such as those from MIDI, Ethernet, USB, Firewire, and audio input, along with subsequent changes in processed or synthesized audio sound streams. Conventional instrumentation capable of such logging is often expensive and complex to configure. The proposed solution involves using an affordable and readily available multichannel digital audio recorder, such as a DAT or ADAT recorder, to record events. The challenge lies in converting high-bandwidth, event-related signals to frequencies below the Nyquist rate of the recorder. This can be achieved by recording an audio reference that is amplitude modulated with a monostable triggered by positive and negative edges derived from the event source. The time constant of the monostable represents the temporal uncertainty at the end of an event and can be adjusted to ensure adequate accuracy when logging at audio rates.
Desktop and workstation computers are increasingly appealing for reactive sound synthesis and processing applications, yet few operating systems are optimized for real-time performance. As a result, considerable experimentation is required to achieve satisfactory musical outcomes. Measurement of I/O latency is crucial for ensuring reliable real-time performance in musical applications and is the main emphasis of this paper. The initial challenge involves the synchronous logging of stimulus events communicated via MIDI, Ethernet, USB, IEEE-1394, audio input, etc., along with the changes in processed or synthesized audio streams. "In vivo" measurement of latencies in computing and networking systems is often difficult. Even in systems where time-stamping is available, most logging techniques can interfere with the system's performance being evaluated. Additionally, many latencies to be characterized are tied to hardware buffers that are inaccessible to software, such as the FIR filter delay in audio codec reconstruction filters. While modern instrumentation tools like logic analyzers and digital storage oscilloscopes can perform event logging, they tend to be costly and complex to configure. The simpler approach described here involves converting events from a variety of sources into audio frequency signals. These signals, along with synthesized sound outputs, are synchronously analyzed or recorded using standard multichannel audio recording tools, such as an ADAT recorder connected to an SGI O2 computer. The multichannel audio stream serves to maintain the temporal relationships of the event streams, despite any latencies present in the analyzing system.
The logging system requires a circuit that interfaces cleanly and non-invasively with the source of event information, along with a method to modulate events within the audio frequency range. For MIDI events, the logging circuit employs optical isolation as specified in the MIDI standard, allowing for a non-invasive connection via a MIDI thru output. A standard 8-pin T-connector is utilized for tapping into the transmission or reception differential pair of 10BaseT Ethernet. Input resistors and the CMOS inputs of a 74HC123 IC fulfill the requirement for a high-impedance, non-invasive connection. Given that pulse streams from Ethernet and MIDI are clocked at higher rates than the available audio bandwidth, some information will inevitably be lost during down-sampling. A 74HC123 monostable multivibrator is used to extend data transitions by a fixed time interval, which is sufficient to trigger an audio oscillator implemented with a CMOS 555 timer. Although this approach results in the loss of detailed information regarding each bit transition, the beginnings of events are accurately captured. The time constant of the retriggerable monostable reflects the temporal uncertainty at the end of an event and can be adjusted to ensure adequate accuracy during audio rate logging. The oscillator output drives an audio frequency isolation transformer, which isolates the circuit from the audio system and eliminates ground loops. A battery power supply is employed to allow the input to float, thereby minimizing common mode issues. The choice of a 3V supply is significant, as it enables the front-end to effectively capture transitions from various inputs, including RS422, TTL, RS232, and MIDI current loops. The high resistance values selected for the front end are crucial, as they provide current limitation for the protection diodes integrated into the inputs of the 74HC123, which are used for clamping.
The circuit design takes advantage of the two trigger inputs of the multivibrator, avoiding the need to switch between the current loop and other event sources; the desired source can simply be plugged in. Both inputs incorporate special internal circuits with hysteresis to minimize false triggering and enhance noise immunity. This circuit is part of a broader initiative known as the Responsive Systems Validation Project (RSVP). These tools have been utilized to measure sound synthesis software performance on SGI, Macintosh, and PC platforms with MIDI, Ethernet, and gestural input devices such as digitizing tablets. The initial intention behind developing latency measurement tools was to fine-tune sound synthesis software on each platform towards a latency target of 10 ± 1 ms. Although this goal is within reach on these systems, the measurement tools have uncovered significant bugs and design flaws in the underlying operating systems, drivers, and computers concerning real-time performance. Efforts to address these flaws are actively being pursued by various vendors, and ongoing development of software synthesis scheduling continues for each operating system. As of the current writing, SGI IRIX exhibits the best performance, and examples are provided below. It is encouraging to note that the performance challenges identified by latency measurement tools are not due to inadequate real-time features in the operating systems, but rather design and implementation decisions that undermine real-time requirements. A prevalent issue arises from poorly implemented I/O drivers, as programmers often delay interrupts for extended periods. This problem is particularly concerning on systems constructed from multiple vendors, such as Wintel PC clones, where no industry-wide real-time validation suite exists to identify such inefficiencies. The widespread adoption of affordable tools, such as the one described, is expected to lead to more accessible reactive computing solutions. Financial support from Emu Systems, Gibson, and Silicon Graphics Inc. is acknowledged, along with contributions from Doug Cook and Chris Pirazzi, who clarified numerous performance and timing issues on SGI machines.There is increasing interest in using PC and Workstation platforms in reactive sound synthesis and processing applications. However, few operating systems were designed to deliver real-time performance and vendors generally don`t guarantee or even specify the performance to be expected from operating systems products.
Considerable experimentation is required with each operating system to achieve musically reasonable results. The ability to measure I/O latencies represents a major technical difficulty in achieving reliable real-time performance for musical applications and is the subject of this paper. The problem is to synchronously log stimulus events like those from MIDI, ethernet, USB, Firewire, audio input, etc.
, and subsequent changes in processed or synthesized audio sound streams. Conventional instrumentation capable of such logging is expensive and challenging to configure. The solution we present records events using an affordable and readily available multichannel digital audio recorder, such as a DAT or ADAT recorder. The challenge is to convert high bandwidth, event related signals to frequencies below the Nyquist rate of the recorder.
This is easily achieved by recording an audio reference that is amplitude modulated with a monostable triggered by positive and negative edges which are derived from the event source. The time constant of the monostable is the temporal uncertainty of the end of an event and can be set to provide adequate accuracy when logging at audio rates.
Desktop and workstation computers are now very attractive for reactive sound synthesis and processing applications. Unfortunately few operating systems were designed to deliver real-time performance and vendors generally don`t guarantee or even specify the temporal performance of operating systems.
Considerable experimentation is required with each operating system to achieve acceptable musical results. Measurement of I/O latency is fundamental to achieving reliable real-time performance for musical applications and is the primary focus of this paper.
The first challenge is to synchronously log stimulus events communicated with MIDI, ethernet, USB, IEEE-1394, audio input, etc. , and subsequent changes in processed or synthesized audio sound streams. "In vivo" measurement of latencies in most computing and networking systems is challenging. Even in the rare systems where time stamping is available, most logging techniques interfere with the performance of the system being evaluated.
Also, many of the latencies to be characterized are hardware buffers inaccessible to software, e. g. FIR filter delay in audio codec reconstruction filters. Modern instrumentation tools such as logic analyzers and digital storage oscilloscopes can perform event logging but are expensive and challenging to configure. The simpler approach used here is to convert events from a wide range of sources into audio frequency signals.
These signals and synthesized sound outputs are synchronously analyzed or recorded using standard multichannel audio recording tools, such as an ADAT recorder connected to an SGI O2 computer. The multi-channel audio stream serves to bond together the event streams maintaining their temporal relationships despite latencies in the analyzing system.
The logging system requires a circuit to interface cleanly and non-invasively with the source of event information and a way to modulate events in the audio frequency range. For MIDI events the logging circuit uses optical isolation as specified in the MIDI standard. This is inherently non-invasive since the logging circuit may be connected to a MIDI thru output. A standard 8-pin T-connector is used For 10BaseT Ethernet to tap into the transmission or reception differential pair.
Input resistors and the CMOS inputs of a 74HC123 satisfies the requirement for a high impedance, non-invasive connection. Pulse streams from Ethernet and MIDI are clocked at higher rates than available audio bandwidth, so some information will be lost down-sampling.
A 74HC123 monostable multivibrator is used to stretch out data transitions by a fixed time interval that is long enough to gate an audio oscillator implemented with a CMOS 555 timer. Details of each bit transition are lost in this scheme, but the event beginnings are accurately captured.
The time constant of the retriggerable monostable is the temporal uncertainty of the end of an event. The time constant is set to provide adequate accuracy when logging at audio rates. The oscillator output drives an audio frequency isolation transformer. This isolates the circuit from the audio system, eliminating ground loops. The use of battery power supply allows the input to float, minimizing common mode problems. The choice of 3V supply is important. It allows the front-end to successfully capture transitions from a wide variety of inputs including RS422, TTL, RS232 and MIDI current loop.
The high resistance values chosen in the front end are important: they provide current limitation for the protection diodes built into the 74HC123`s inputs which are used here for clamping. Note that the circuit exploits the two trigger inputs of the multivibrator avoiding a switch between the current loop and other event sources.
The desired source is simply plugged in. Both these inputs have special internal circuits with hysteresis to minimize false triggering and improve noise immunity. The circuit described here is one of a set of tools being developed as part of a broad initiative, the Responsive Systems Validation Project (RSVP) [3].
These tools have been used to measure sound synthesis software performance on SGI, Macintosh and PC machines with MIDI, Ethernet and gestural input devices such as digitizing tablets [2]. The original thought behind the latency measurement tools was to use them to tune sound synthesis software on each platform towards the latency goal of 10 ± 1mS.
Although such a goal is within sight on these systems, the measurement tools revealed significant bugs and design flaws in the underlying operating systems, drivers and computers with respect to real-time performance. Work to address these flaws is being vigorously pursued by some of the vendors and we continue to develop our software synthesis scheduling for each operating system.
As if this writing SGI IRIX performance is the best and we include below some examples: It is encouraging that the performance difficulties identified by latency measurement tools were not from inadequate real-time features in the operating systems, but design and implementation decisions that defeat real-time requirements. A pervasive difficulty stems from poor implementations of I/O drivers. Programmers still cut corners by holding off interrupts for long periods. This is especially troublesome on systems assembled from many vendors, i. e. Wintel PC clones, since there is no industry wide real-time validation suite in use to catch this sloppiness.
Widespread use of affordable tools such as the one described here will eventually result in affordable reactive computing. We gratefully acknowledge the financial support of Emu Systems, Gibson, and Silicon Graphics Inc. Doug Cook and Chris Pirazzi clarified many performance and timing issues on SGI machines. 🔗 External reference
The CYB-P51 (Rev A) Prototyping Board is designed as a two-layer board without dedicated power and ground planes. All components, except for the premounted P-51, utilize through-hole technology for ease of probing and part replacement. The board features an...
The primary issue with the design of a stereo amplifier that includes a total bass driver is that the signals from the left and right channels eventually become combined. This summation process minimizes the separation between channels, compromising the...
The unknown resistance is connected in series with a known standard resistor, and a current is passed through both components. The voltage developed across the unknown resistor is applied to the input, while the voltage across the known resistor...
H-bridge applications for robots, robotics, and motor control. This post focuses on the low-side switch element.
H-bridges are widely utilized in robotics and motor control applications to enable bidirectional control of DC motors. An H-bridge consists of four switches arranged...
The circuit design utilizes a VHF amplifier configured to operate within the frequency range of 88 to 108 MHz, specifically for Band 2 radio applications.
The VHF amplifier circuit is designed to enhance weak radio frequency signals in the specified...
The concept of an AC model for the triode is presented, and the equivalent circuit technique is described. Theoretical calculations for amplifier gain and frequency response are derived and compared to simulation results in the SPICE3 environment, showing good...
We use cookies to enhance your experience, analyze traffic, and serve personalized ads.
By clicking "Accept", you agree to our use of cookies.
Learn more