Skip Navigation Links | |
Exit Print View | |
man pages section 9: DDI and DKI Kernel Functions Oracle Solaris 11 Information Library |
csx_AccessConfigurationRegister(9F)
csx_Parse_CISTPL_BYTEORDER(9F)
csx_Parse_CISTPL_CFTABLE_ENTRY(9F)
csx_Parse_CISTPL_DEVICEGEO(9F)
csx_Parse_CISTPL_DEVICEGEO_A(9F)
csx_Parse_CISTPL_DEVICE_OA(9F)
csx_Parse_CISTPL_DEVICE_OC(9F)
csx_Parse_CISTPL_LINKTARGET(9F)
csx_Parse_CISTPL_LONGLINK_A(9F)
csx_Parse_CISTPL_LONGLINK_C(9F)
csx_Parse_CISTPL_LONGLINK_MFC(9F)
ddi_get_soft_iblock_cookie(9F)
ddi_intr_get_supported_types(9F)
ddi_prop_lookup_byte_array(9F)
ddi_prop_lookup_int64_array(9F)
ddi_prop_lookup_string_array(9F)
ddi_prop_update_byte_array(9F)
ddi_prop_update_int64_array(9F)
ddi_prop_update_string_array(9F)
ldi_prop_lookup_byte_array(9F)
ldi_prop_lookup_int64_array(9F)
ldi_prop_lookup_string_array(9F)
mac_prop_info_set_default_link_flowctrl(9F)
mac_prop_info_set_default_str(9F)
mac_prop_info_set_default_uint8(9F)
mac_prop_info_set_range_uint32(9F)
net_event_notify_unregister(9F)
net_instance_notify_register(9F)
net_instance_notify_unregister(9F)
net_instance_protocol_unregister(9F)
net_protocol_notify_register(9F)
nvlist_lookup_boolean_array(9F)
nvlist_lookup_boolean_value(9F)
nvlist_lookup_nvlist_array(9F)
nvlist_lookup_string_array(9F)
nvlist_lookup_uint16_array(9F)
nvlist_lookup_uint32_array(9F)
nvlist_lookup_uint64_array(9F)
nvpair_value_boolean_array(9F)
pci_plist_lookup_int16_array(9F)
pci_plist_lookup_int32_array(9F)
pci_plist_lookup_int64_array(9F)
pci_plist_lookup_int8_array(9F)
pci_plist_lookup_string_array(9F)
pci_plist_lookup_uint16_array(9F)
pci_plist_lookup_uint32_array(9F)
pci_plist_lookup_uint64_array(9F)
pci_plist_lookup_uint8_array(9F)
scsi_get_device_type_scsi_options(9F)
scsi_get_device_type_string(9F)
scsi_sense_cmdspecific_uint64(9F)
usb_get_current_frame_number(9F)
usb_get_max_pkts_per_isoc_request(9F)
usb_pipe_get_max_bulk_transfer_size(9F)
usb_pipe_stop_intr_polling(9F)
usb_pipe_stop_isoc_polling(9F)
- audio device control functions
#include <sys/audio/audio_driver.h> typedef int (*audio_ctrl_wr_t)(void *, uint64_t); typedef int (*audio_ctrl_rd_t)(void *, uint64_t *); audio_ctrl_t *audio_dev_add_control(audio_dev_t *adev, audio_ctrl_desc_t *desc, audio_ctrl_rd_t readfn, audio_ctrl_wr_t writefn, void *data);
void audio_dev_del_control(audio_ctrl_t *ctrl);
void audio_dev_update_controls(audio_dev_t *adev);
void audio_dev_add_soft_volume(audio_dev_t *adev);
int audio_control_read(audio_ctrl_t *ctrl, uint64_t *valuep);
int audio_control_write(audio_ctrl_t *ctrl, uint64_t value);
pointer to an audio device allocated with audio_dev_alloc(9F)
pointer to an structure describing the control. The structure has the following definition:
struct audio_ctrl_desc { const char *acd_name; /* Controls Mnemonic */ uint32_t acd_type; /* Entry type */ uint64_t acd_flags; /* Characteristics */ uint64_t acd_maxvalue; /* Max value control */ uint64_t acd_minvalue; /* Min value control */ const char *acd_enum[64]; /* Enum values */ };
pointer to a function used to read the value of the control
pointer to a function used to write the value of the control
driver private data pointer passed to read and write functions
opaque handle to audio control previously returned by audio_dev_add_control()
Solaris DDI specific (Solaris DDI)
Controls for audio devices are adjustable values that affect the operation of the device. The most common use of a control is to affect volume settings.
The audio_dev_add_control() function registers a control for the audio device and associates handlers with it.
The desc parameter describes the control in more detail. It has the following structure:
struct audio_ctrl_desc { const char *acd_name; /* Controls Mnemonic */ uint32_t acd_type; /* Entry type */ uint64_t acd_flags; /* Characteristics */ uint64_t acd_maxvalue; /* Max value control */ uint64_t acd_minvalue; /* Min value control */ const char *acd_enum[64]; /* Enum values */ };
The acd_name field is a simple ASCII string identifying the control. The convention is to follow the same naming rules as used for C identifiers.
The following predefined control names are available and should be used when possible. Other names may be used, but might not be presented consistently to all users in all locales, so they should be used with caution.
Master play back volume
Volume on the line out jack
Front speaker volume
Rear speaker volume
Headphone volume
Center speaker volume
Low-frequency effect volume
Built-in speaker volume
Microphone gain
CD input gain
Line input gain
Master record gain
Monitor gain
Record source
The acd_type field indicates the type of control. The following types are available:
A simple boolean on/off value
A stereophonic control. The value for the right channel is in the low order byte, and for the right channel is in the 2nd least significant byte.
A monophonic value
An enumeration
The acd_flags field is a bitmask that provides additional detail about the control. The following bits are defined; all other bits are reserved and must not be set by the driver:
Control readable
Control writable
Read/writable
Main analog volume control
PCM output volume
Record volume
Monitor volume
Control relates to playback
Control relates to recording
Control relates to monitoring
Enumeration is a bitmask that allows multiple selections
The acd_minvalue and acd_maxvalue fields constrain the values that the control can take. For boolean values, they should be 0 and 1. For monophonic and stereophonic controls, they are the values for one channel, and must not exceed 255. For enumerations, acd_minvalue indicates enumeration values that may be changed and acd_maxvalue indicates the full mask of possible options. It is nonsensical for acd_minvalue to have value different from acd_maxvalue if AUDIO_CTRL_FLAG_MULTI is not set. If a bit is present in acd_maxval but not in acd_minvalue, then the corresponding bit must always be set in the value.
The acd_enum field is used with AUDIO_CTRL_TYPE_ENUM and provides ASCII strings identifying each bit in the enumeration. The following definitions are available for use and should be used whenever possible.
|
The readfn() function takes the supplied driver private data as its first argument and a pointer to receive the controls current value as its second argument. It returns 0 on success, or an errno on failure. It may be called in interrupt context and must not block.
The writefn() function takes the supplied driver private data as its first argument and a new value to set for the control as its second argument. It return 0 on success or an errno on failure. It may be called in interrupt context and must not block.
The data argument is a pointer to driver private state passed as is to the readfn() and writefn() functions.
If a control with the supplied name is already present, the previously associated control is automatically removed and its resources released.
The audio_dev_del_control() function removes the supplied control from the audio device and frees any related resources.
The audio_dev_update_controls() function is called by the audio driver to indicate that the value for one or more of the controls on the audio device has changed asynchronously.
The audio_dev_add_soft_volume() function is used to create a synthetic volume control for the audio device. It can be used for audio devices that lack any physical volume control capability. The control is registered using AUDIO_CTRL_ID_VOLUME.
The audio_control_read() function is used by a driver to call the read function for the control. This can be useful when used with layered systems which override control functions.
The audio_control_write() function is used by a driver to call the write function for the control. This can be useful when used with layered systems that override control functions.
The audio_dev_add_control() function returns an opaque handle to the control.
The control read and write functions return 0 on success or an error number on failure.
The audio_dev_add_control(), audio_dev_del_control(), and audio_dev_add_soft_volume() functions may be called from user or kernel context only.
The audio_dev_update_controls(), audio_control_read(), and audio_control_write() functions can be called from user, kernel, or interrupt context.
See attributes(5) for descriptions of the following attributes:
|
attributes(5), audio(7D), audio_dev_alloc(9F), audio_dev_register(9F), audio_dev_suspend(9F)
The audio framework provides the following synchronization guarantees for audio controls:
Only one thread will be executing an audio control accessor function for a given audio device at any one time.
No threads will be executing any audio control accessor functions for a given audio device if that device is suspended. See audio_dev_suspend(9F).
Each control must have a unique name. An attempt to register a control with a name that is already in use will overwrite the previous control and return the same handle that was obtained originally. This can be used to reconfigure the settings of a control. However, care must be taken to ensure that the control is only deleted once during cleanup, or else a system crash will probably result.
Any controls added to an audio engine with audio_dev_add_control() must be destroyed with audio_dev_del_control() before the device itself is freed with audio_dev_free(9F).
If audio_dev_add_soft_volume() is performed for a device, the caller must ensure that no AUDIO_CTRL_ID_VOLUME controls are created for it using audio_dev_add_control(). Unlike other controls, the soft volume control is destroyed automatically during the execution of audio_dev_free().