Novell SuSE Linux Professional 9.2 Upgrade [Strong Encryption 128 Bit] 00662644457260 ユーザーズマニュアル

製品コード
00662644457260
ページ / 324
15.4
Buffering and Latencies
This section explains how uninterrupted audio playback can be ensured. This
problem is by no means limited to Linux, but is inherent in all multitasking op-
erating systems. In a multitasking operating system, several processes usually
run concurrently. As the processor can only handle one process at a time, each
process is assigned a certain amount of time by the operating system’s scheduler.
The switching action between processes normally happens so quickly that the
user does not notice it.
However, during audio playback, even brief interruptions are noticeable in the
form of clicks. Therefore, audio programs use a buffer for the playback, enabling
the audio data in the buffer to be emitted continuously by the sound card even
when the audio program is interrupted by the scheduler. Accordingly, the play-
back is click-free if the buffer is large enough to bridge the longest possible inter-
ruption.
However, the buffer size also determines the reaction time (latency) of the pro-
gram. Therefore, the buffer size is kept as small as possible especially for interac-
tive applications, such as real-time synthesizers and DJ mixer consoles. Basically,
the length of the interruptions depends on the system load and the priority of the
process. Consequently, the size of the buffer required for click-free playback can
be reduced by increasing the priority of the audio program or by switching to a
real-time scheduler. For this reason, many audio programs attempt to switch their
processes to a real-time scheduler, but switching a process to another scheduler is
only possible with
root
privileges. The application setpriority in the
rtstools
package is required for this task.
For example, proceed as follows to run the application timidity with the FIFO
scheduler:
1. Start timidity
2. Open a
root
console session.
3. Use
pidof timidity
to find the process ID of timidity.
4. Change the scheduler with the command
setpriority <processID>
fifo 10
.
You can use the following command in a
root
shell to speed up this procedure:
186
15.4. Buffering and Latencies