Open Sound System OSS 4.x Programmer's Guide

SNDCTL_SYSINFO

Return information about OSS and the devices

Usage

oss_sysinfo si;
ioctl(fd, OSS_SYSINFO, &si);

The above code fragment lacks all error checks for clarity. Real world applications must always check for the errors and handle them as described below. Also most OSS ioctl calls will return information in the argument variable and it's usually necessary to check it too.

Description

This call was earlier called as OSS_SYSINFO. Some older programs may still use the old name. However new applications should use SNDCTL_SYSINFO instead.

This ioctl calls can be used to obtain information about the OSS version installed in the system as well as to get the number of various devices available in the system. This information is mostly static but certain fields may change while OSS is being loaded.

This ioctl call is supported by all OSS devices, including audio, mixer and MIDI devices.

The oss_sysinfo structure

The oss_sysinfo structure has the following fields.

Field

Purpose

product

A string containing the name of the OSS implementation. For example "OSS/Linux".

version

A string that returns the current OSS version number. For example "4.0.0a". This is the version of the OSS implementation that is currently running.

license

License of the current OSS version (for example "GPL" or "CDDL"). Empty string means commercial license.

versionnum

The API version number in numeric format. For example 0x040000 means version 4.0.0. However this version is the version of the soundcard.h file used to compile the OSS software. It's usually not the same than the version field.

options

Reserved for future use.

numaudios

The number of audio device files currently configured in the system.

numaudioenginess

The number of audio engines currently configured in the system.

openedaudio

A bit mask which tells the audio devices that are currently busy (OBSOLETE).

numsynths

Number of synth devices. Obsolete.

nummidis

Number of MIDI port devices available in the system.

numtimers

Number of (MIDI) timer devices in the system.

nummixers

Number of mixer devices available in the system.

numcards

Number of sound cards detected in the system. See SNDCTL_CARDINFO for more info.

openedmidi

A bit mask that tells which MIDI devices are currently busy.

Related ioctl calls

OSS ioctl return values

The return value from the OSS ioctl calls will be -1 if a fatal error occurred. Other values mean that the ioctl call was more or less successful. However in most cases the application must check the value returned in the argument to see what was the accepted value.