Device driver |
Modules | |
group | PCM conversion |
convert PCM from and to internal format. | |
group | Sub-devices |
Common to read/write opened device. | |
Data Structures | |
struct | _liso_t |
lisodsp info structure. More... | |
Init functions | |
int | liso_device_init (liso_t *lisodsp) |
Init device driver. | |
int | liso_device_shutdown (liso_t *lisodsp) |
Shutdown device driver. | |
Wake up functions | |
void | liso_wakeup_writers (liso_t *lisodsp) |
Wake up sleepy writers. | |
void | liso_wakeup_reader (liso_t *lisodsp) |
Wake up sleepy reader. | |
Timer functions | |
start/stop device timer.
The timer is used to simulate the device reader by flushing out PCM silently at a given rate. It allows user process to keep time synchronizing themself with the write() function by assuming it is blocking. The PCM-fragment size depends directly on Linux timer granularity (as defined by the HZ constant in linux source) in a manner that the time to play a fragment must be a multiple of the timer period (1/HZ second). | |
int | liso_timer_start (liso_t *lisodsp, unsigned int offset, void(*task)(void *)) |
Start the timer. | |
int | liso_timer_stop (liso_t *lisodsp) |
Stop the timer. | |
Defines | |
#define | LISO_MAX_SUBDEV (sizeof(int)<<3) |
Maximum number of sub-device. | |
#define | LISO_MAX_CHANNEL (LISO_MAX_SUBDEV-1) |
Maximum number of mixed channel (device writer). | |
#define | LISO_DEF_CHANNEL 8 |
Default maximum number of mixed channel. | |
#define | LISO_RD_CHANNEL LISO_MAX_CHANNEL |
Channel id reserved for reader. | |
#define | LISO_RD_MASK (1<<LISO_RD_CHANNEL) |
Bit mask for reader. | |
#define | LISO_DEF_SAMPLING 44100 |
Maximal sampling rate. | |
#define | LISO_MAX_SAMPLING 48000 |
Maximal sampling rate. | |
#define | LISO_MIN_SAMPLING (LISO_MAX_SAMPLING/10) |
Minimal sampling rate. | |
#define | LISO_DEF_FORMAT_STR "S2WN" |
Default format string ([S]igned [2]-channel [W]ord [N]ative-endian). | |
#define | LISO_MIXER_FIX 14 |
Mixer scale factor fixed point bit. | |
Functions | |
int | liso_device_update_active (liso_t *const lisodsp) |
Check active status for all sub-devices. | |
int | liso_device_active_writers (const liso_t *const lisodsp) |
Get current active writers. | |
Variables | |
liso_t | g_lisodsp |
The global lisodsp object. | |
int | liso_volume [] |
Attenuation factors. |
|
Maximum number of sub-device. Because of the status bit implementation the very limit is fixed to the number of bit per integer. |
|
Maximum number of mixed channel (device writer). Since the last device is reserved for the unique reader the very maximum number of channel is fixed to LISO_MAX_SUBDEV-1. |
|
Mixer scale factor fixed point bit.
|
|
Check active status for all sub-devices. This function updates the lisodsp::active_devices bitfield. Each bit weight match the status of the corresponding sub-devices with a 1 if this sub-device is active.
|
|
Get current active writers.
|
|
Wake up sleepy writers.
|
|
Wake up sleepy reader.
|
|
Start the timer. This function reset the timer and starts it at a virtual rate of sampling/frag_size Hz.
|
|
Stop the timer.
|
|
The global lisodsp object. Currently the only reason for having this variable in the global scope is that the Linux kernel function register_sound_dsp() does not allow to have a private data (or may be I just dunno how). Currently this module provides only one lisodsp device so more esthetic consideration than a real issue. |
|
Attenuation factors. Table of attenuation factors for a given number of mixed channel. It is initialized at module startup with a very empiric formula which aims to prevent saturation when many channels are mixed but trying to keep each voice at a high enought level to prevent hearable attenuations. Let:
Attenuation factor is:
|
|
lisodsp developer documentation version 0.5.0 |
Generated on June 2004 by doxygen 1.3.7 |