Sound Player Configuration

The examples show examples of how to set player parameters in the test config file.

Configuring players is now slighty different from previous versions. New configuration allows defining multiple sound players and virtual players. If parameter players is defined, the new format is used. If not, the old format used in previous versions is used. In the future, the new format will be default, and support for the old format may disappear completely in future GP versions.

The players parameter gives the names of players as a comma-separated list. In basic form for basic tests, it sound contain the default player 'player':

   # List of players
   players=player
An example about multiple players can been seen in the virtual players section.

Audio devices

On some systems there are multiple independent audio ports. On a O2 with the digital audio option card there are four output devices: Analog Out, Analog Out 2, ADAT Out and AES Out. Different devices may have different choices of sample rates, number of channels, number of bits or output connections. Use 'apanel' or 'apanel -print' to list the choices of devices on your system. Also read the manuals.

Choices of devices for O2, Octane and Onyx2 systems include:

Analog Out and Analog Out 2
Analog stereo outputs, 16-bit on O2, 18-bit on Octane an Onyx2. Nearly arbitrary sample rates from 4kHz to 48kHz.
ADAT Out
8-channel, 24-bit ADAT Optical output. Sample rates: 32kHz, 44.1kHz, 48kHz.
AES Out
Stereo AES3 24-bit digital output. Sample rates: 32kHz, 44.1kHz, 48kHz.
in addition the device name default can be used that selects the default output device selected with apanel. However, you should not use the defaults device.

Set the device of the player by setting the device parameter in the test config file. Example:

   # set output device
   players.player.device=ADAT Out

You should use a device that is not the same as the default device. The audio output of tools and programs (includes bells from the console and shells and window manager, web browsers, etc.) goes to the default device if output device is not specially set (usually isn't).

Multiple audio device support

The GP sound player can drive multiple audio devices at the same time. GP combines several devices as a single audio port. Multiple devices are synchronized.

Multiple audio device output can be selected by writing the names of the audio devices to use separated with the slash-character ('/') in the device player parameter. For example, to use ADAT cards:

   # set output device
   players.player.device=ADAT Out/ADAT Out 2
To the GP system, the output looks like a single 16-channel output port with channels 1-8 going to 'ADAT Out' device and channels 9-16 to 'ADAT Out 2' device. Any output devices can be used. Currently, maximum number of audio devices is four.

The same sample rate is used for all devices, so all devices must support the sample rate used.

The number of channels should be left undefined when using multiple devices. The sound player then automatically uses the maximum number of channels for each device.

Sample rate

The sample rates available depends on the audio devices that are used. For example, the analog devices in the O2 support all sample rates from 4kHz to 48kHz with 1Hz resolution. Digital ports only support 32/44.1/48 kHz.

Set sampling rate of the player by setting the rate parameter in the test config file. Example:

   # sampling rate of output
   players.player.rate=44100

The sample rate of the player and all the samples must be the same. If the sound player can not use some desired sample rate, samples should be converted to a rate supported by the device.

When using multiple devices, the same sample rate is used for all devices.

Channels

The maximum number of channels depends on the audio device that is used. Analog outputs usually support mono or stereo output. Digital outputs support up to 8 channels (depending on which digital port to use). If number of channels is not defined, the maximum number of channels supported by the device is automatically used. Specially, when using multiple devices, the number of channels should be left undefined (or defined as zero).

Set number of channels of the player by setting the channels parameter in the test config file. Example:

   # number of channels (0/1/2/4/8, etc.)
   players.player.channels=2

If a sample has more channels than there are output channels, extra channels in the sample are ignored.

Sound buffer length

The sound player mixes the output audio data in blocks (or buffer) of fixed size. The output is also double-buffered, the next block of data is calculated as the first is being written to the audio hardware. The buffering also means that an action (for example, the subject presses a button to play a sample) that is meant to take effect immediately will necessarily have a delay that roughly corresponds to two times the length of the buffer. The default buffer length is 4096 sample frames that will cause a delay of about 200ms (sample rate = 44.1kHz). It is possible to shorten the delay by shortening the buffer length. Shortening the buffer length reduces the delay but it also increases the risk of getting dropouts in sound if the buffer calculation didn't finish in time (other system activity and increased overhead caused by shorter blocks may cause problems, also audio files are loaded from disk on the fly).

The buffer length is set with the buflen parameter in the test config file. The length is in sample frames. The length of 44100 corresponds to one second with the sample rate of 44.1kHz. Example:

   # set mixing buffer length
   players.player.buflen=4096
Sets the buffer length to 4096 sample frames (roughly 93ms with sample rate 44.1kHz).

Note: If a command was scheduled beforehand to start at a certain point of time, no delay is observed (sub-millisecond accuracy).

Virtual players

Virtual players allow partitioning the output port the the GP into smaller sections. For example, an eight-channel ADAT output could be sectioned into four stereo-players. Virtual players behave the same way as real players except some restrictions. Currently, 16 virtual players can be defined.

Configuration is similar to the configuration shown earlier. Usually, the channels to use for the VP and the 'parent' player of the VP. For example:

   # List of players
   players=player,vp1,vp2,vp3

   # Main player
   players.player.device=ADAT Out
   players.player.rate=44100

   # Mono player, a single channel: channel 0
   players.vp1.channel=0
   players.vp1.parent=player

   # Stereo player, channel range: channels 1-2
   players.vp2.channels=1-2
   players.vp2.parent=player

   # 5-ch player, channel range: channels 3-7
   players.vp3.channels=3-7
   players.vp3.parent=player
The players parameter contains the list of players used for the test. First is the default player 'player'. Virtual players (vp1-3) are virtual players. Each must define the parent parameter that sets which real player's channels to use. The channels parameter defines which channels of the parent to use for this VP. For virtual players with more than one channels, a range of channels is specified. A single channel player (vp1) can be defined with the parameter channel. The index of the channel to use is given as the parameter. Note that for single channel, parameter channel is used, with more channels, parameter channels is used. Also note that the indexing of channel numbers starts from zero.

Multiple audio devices can also be used with virtual players. For example, to add another virtual player with 8 channels (only the changes and additions to the example above are shown):

   # List of players
   players=player,vp1,vp2,vp3,vp4

   # Use multiple audio devices
   players.player.device=ADAT Out/ADAT Out 2

   # ... parameters for VPs 1-3 ...

   # 8-ch player, channel range: channels 8-15
   players.vp4.channels=8-15
   players.vp4.parent=player

Special options

Additional special options can be passed to the GP sound player (via the audio player info structure). Options are written in the options parameter of the player. Multiple options can be given by separating the with a comma. Options can be either in form of a lone option name or a optname=value. The generic is thus like this:
   # Special options to player
   players.player.options=opt1name=opt1value,opt2name
GP's sound player recognizes two special options: rtpri and sndplaypath:
rtpri=priority
Set the real-time priority of the sndplay process. In IRIX >= 6.4, the default is 50. Larger values give more favourable scheduling for the process. Note, in IRIX < 6.4, the priority levels are different and lower values give more favourable scheduling for the process. Be very careful when using this option, if used incorrectly, you can easily botch the system. Consult IRIX documentation for real-time priorities.

sndplaypath=path
Sets the command name that is run as the sndplay program. The default is sndplay, the sndplay program in GP's bin-directory. If the path name is not absolute, the command is searched from the current path (GP adds the GP's bin-directory to the path automatically). Absolute pathname can be used also.

As an example, this option line sets both real-time priority and a non-default sndplay program:

   # Special options to player.  Set Real-time priority to 60 and
   # use command sndplay_nonrt instead of default player. 
   players.player.options=rtpri=60,sndplaypath=sndplay_nonrt
Note that these options only apply to the real or primary player. Virtual players ignore these options. Also, the newer form of player configuration supports additional options. Only one options-line is allowed per player, add multiple options by separating them with a comma.
· Tests index · Manual index ·

Last modified: Wed Jan 5 16:07:37 EET 2000