Open Sound System |
Do you have problems with sound/audio application development? Don't panic! Click here for help! |
If you read this section carefully you will find about 50 different ioctl calls which permit controlling all aspects of the hardware. However this doesn't mean that there is any need to use more than 3 or 4 of them. OSS is designed to provide optimal default values for all parameters and it's very unlikely that any application can improve anything by changing the defaults.
Absolutely the most common reason to problems with audio programs is that their programmers have made unnecessary operations that make the device to fail. For best results you should start by reading the Audio fundamentals and the Some common types of audio programs sections of this manual.
Audio fundamentalsBelow is the full list of audio ioctl calls available in OSS 4.0. It's very important to understand that most of these calls are only necessary in extremely rare cases. Just 3 or 4 of the following calls are actually needed in most applications (SNDCTL_DSP_SETFMT, SNDCTL_DSP_CHANNELS, SNDCTL_DSP_SPEED and sometimes SNDCTL_DSP_SETFRAGMENT or alternatively SNDCTL_DSP_POLICY. The Audio input and output volumes and routings section explains some other ioctl calls that may be usefull in some applications. Most other ioctl calls are provided just for completeness of the API.
Source | Explanation |
SNDCTL_DSP_BIND_CHANNEL | Route stereo output to the specified channels (obsolete) |
SNDCTL_DSP_CHANNELS | Set the number of audio channels |
SNDCTL_DSP_COOKEDMODE | Disable/enable the "on fly" format conversions made by the OSS software |
SNDCTL_DSP_CURRENT_IPTR | Returns the current recording position |
SNDCTL_DSP_CURRENT_OPTR | Returns the current playback position |
SNDCTL_DSP_GETBLKSIZE | Get the current fragment size (obsolete) |
SNDCTL_DSP_GETCAPS | Returns the capabilities of an audio device |
SNDCTL_DSP_GETCHANNELMASK | Returns the bindings supported by the device (obsolete) |
SNDCTL_DSP_GET_CHNORDER | Get the channel ordering of a multi channel device |
SNDCTL_DSP_GETERROR | Returns audio device error information |
SNDCTL_DSP_GETFMTS | Returns a list of natively supported sample formats |
SNDCTL_DSP_GETIPEAKS | The peak levels for all recording channels |
SNDCTL_DSP_GETIPTR | Returns the current recording pointer (obsolete) |
SNDCTL_DSP_GETISPACE | Returns the amount of recorded data that can be read without blocking. |
SNDCTL_DSP_GETODELAY | Returns the playback buffering delay |
SNDCTL_DSP_GETOPEAKS | The peak levels for all playback channels |
SNDCTL_DSP_GETOPTR | Returns the current playback pointer (obsolete) |
SNDCTL_DSP_GETOSPACE | Returns the amount of playback data that can be written without blocking. |
SNDCTL_DSP_GET_PLAYTGT_NAMES | Returns labels for the currently available output routings |
SNDCTL_DSP_GET_PLAYTGT | Returns the current output routing |
SNDCTL_DSP_GETPLAYVOL | Returns the current audio playback volume |
SNDCTL_DSP_GET_RECSRC_NAMES | Returns labels for the currently available recording sources |
SNDCTL_DSP_GET_RECSRC | Returns the current recording source |
SNDCTL_DSP_GETRECVOL | Returns the current audio recording level |
SNDCTL_DSP_GETTRIGGER | Returns the current trigger bits (obsolete) |
SNDCTL_DSP_HALT_INPUT | Aborts audio recording operation |
SNDCTL_DSP_HALT_OUTPUT | Aborts audio playback operation |
SNDCTL_DSP_HALT | Aborts audio recording and/or playback operation |
SNDCTL_DSP_LOW_WATER | Sets the trigger treshold for select() |
SNDCTL_DSP_NONBLOCK | Force non-blocking mode |
SNDCTL_DSP_POLICY | Sets the timing policy of an audio device |
SNDCTL_DSP_POST | Forces audio playback to start (obsolete) |
SNDCTL_DSP_READCTL | Reads the S/PDIF interface status. |
SNDCTL_DSP_SAMPLESIZE | Sets the sample size (obsolete) |
SNDCTL_DSP_SETDUPLEX | Turns on the duplex mode |
SNDCTL_DSP_SETFMT | Select the sample format |
SNDCTL_DSP_SETFRAGMENT | Sets the buffer size hint |
SNDCTL_DSP_SET_PLAYTGT | Sets the current output routing |
SNDCTL_DSP_SETPLAYVOL | Changes the current audio playback volume |
SNDCTL_DSP_SET_RECSRC | Sets the current recording source |
SNDCTL_DSP_SETRECVOL | Changes the current audio recording level |
SNDCTL_DSP_SETSYNCRO | Slaves the audio device to the /dev/sequencer driver (obsolete) |
SNDCTL_DSP_SETTRIGGER | Starts audio recording and/or playback in sync |
SNDCTL_DSP_SILENCE | Clears the playback buffer with silence |
SNDCTL_DSP_SKIP | Discards all samples in the playback buffer |
SNDCTL_DSP_SPEED | Set the sampling rate |
SNDCTL_DSP_SUBDIVIDE | Requests the device to use smaller fragments (obsolete) |
SNDCTL_DSP_SYNCGROUP | Creates a synchronization group. |
SNDCTL_DSP_SYNC | Suspend the application until all samples have been played |
SNDCTL_DSP_SYNCSTART | Starts all devices added to a synchronization group. |
SNDCTL_DSP_WRITECTL | Alters the S/PDIF interface setup. |