Go to main content

man pages section 9: DDI and DKI Kernel Functions

Exit Print View

Updated: July 2017
 
 

audio_dev_alloc(9F)

Name

audio_dev_alloc, audio_dev_free - allocate or free an audio device

Synopsis

#include <sys/audio/audio_driver.h>

audio_dev_t *audio_dev_alloc(dev_info_t *dip, int devno);
void audio_dev_free(audio_dev_t *adev);

Parameters

dip

the device instance structure for the device

devno

an integer representing the “logical device” number of the device. If 0 is supplied, the instance number returned from ddi_get_instance(9F) is used instead.

adev

pointer to an audio device allocated with audio_dev_alloc()

Interface Level

Solaris DDI specific (Solaris DDI)

Description

The audio_dev_alloc() function allocates a structure representing a logical audio device. Normally, there is one such audio device per dev_info_t. Some devices, however, may support the notion of multiple logical devices, where different audio devices with completely independent configurations can be supported. These devices will usually have completely independent physical ports as well. In such cases, the driver may supply a non-zero value for the devno.

If devno is used, it is the responsibility of the driver to ensure that all values of devno are unique for that particular driver, and a devno must be supplied for all hardware instances in the system to avoid collisions with device instance numbers.

An audio device (audio_dev_t) may have multiple DMA or PIO engines “streams”, but generally all of these engines are subject to the same set of controllable parameters (such as gain, port selection, etc.)

The audio_dev_free() function frees a previously allocated audio device handle and releases any resources associated with it.

Return Values

The audio_dev_alloc() function returns an opaque handle for the audio device. It always succeeds.

Context

The audio_dev_alloc() and audio_dev_free() functions may be called from user or kernel context only.

Attributes

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Interface Stability
Committed

See Also

attributes(5), audio(7D), audio_add_control(9F), audio_add_engine(9F) , audio_dev_register(9F), audio_set_description (9F), audio_dev_suspend(9F)

Writing Device Drivers for Oracle Solaris 11.3