Sub-devices |
Modules | |
group | PCM fragments |
PCM fragment definitions. | |
Data Structures | |
struct | liso_subdev_t |
Sub-Device info. More... | |
Sub-device status bits. | |
#define | LISO_DEVICE_USED 0 |
0:device-used 1:device-free | |
#define | LISO_DEVICE_IDLE 1 |
0:device-ready 1:device-idle | |
#define | LISO_DEVICE_DEAD 2 |
0:device-ok 1:device-dead | |
#define | LISO_DEVICE_SLEEP 3 |
0:device-awake 1:device-asleep | |
#define | LISO_DEVICE_ALERT 4 |
0:No Alert 1:Alert (really awaited) | |
#define | LISO_DEVICE_USED_MSK (1<<LISO_DEVICE_USED) |
Useful bit mask combinaisons. | |
#define | LISO_DEVICE_IDLE_MSK (1<<LISO_DEVICE_IDLE) |
0:device-used 1:device-free | |
#define | LISO_DEVICE_DEAD_MSK (1<<LISO_DEVICE_DEAD) |
0:device-used 1:device-free | |
#define | LISO_DEVICE_UD_MSK (LISO_DEVICE_USED_MSK|LISO_DEVICE_DEAD_MSK) |
0:device-used 1:device-free | |
#define | LISO_DEVICE_UID_MSK (LISO_DEVICE_IDLE_MSK|LISO_DEVICE_UD_MSK) |
0:device-used 1:device-free | |
Setup functions | |
void | liso_subdev_preinit (liso_subdev_t *const sd, liso_t *const lisodsp, int chn) |
Pre-init sub-device. | |
int | liso_subdev_init (liso_subdev_t *const sd) |
Init sub-device. | |
int | liso_subdev_set_format (liso_subdev_t *const sd) |
Commit requested format. | |
void | liso_subdev_set_cur_frag (liso_subdev_t *const sd) |
Copy current format information for the next frag to process. | |
Status functions. | |
const char * | liso_subdev_status (const liso_subdev_t *const sd) |
Get device status description string. | |
void | liso_subdev_asleep (liso_subdev_t *const sd) |
Make sub-device sleep. | |
void | liso_subdev_wakeup_partner (liso_subdev_t *const sd) |
Wake up partner sub-device(s). | |
int | liso_subdev_has_sleepy_partner (liso_subdev_t *const sd) |
Test for partner to wake up. | |
int | liso_subdev_is_reader (const liso_subdev_t *const sd) |
Test if sub-device is a reader. | |
int | liso_subdev_is_writer (const liso_subdev_t *const sd) |
Test if sub-device is a writer. | |
int | liso_subdev_is_active (const liso_subdev_t *const sd) |
Test if sub-device is active. | |
int | liso_subdev_is_valid (const liso_subdev_t *const sd) |
Test if sub-device is valid. | |
Locking functions | |
int | liso_subdev_lock (liso_subdev_t *sd) |
Lock sub-device. | |
int | liso_subdev_trylock (liso_subdev_t *sd) |
Try lock sub-device. | |
int | liso_subdev_xlock (liso_subdev_t *sd, const int nonblock) |
Extended lock of sub-device. | |
void | liso_subdev_unlock (liso_subdev_t *sd) |
Unlock sub-device. | |
Filesystem functions | |
int | liso_writer_open (struct inode *inode, struct file *filp) |
Open file operation for writer sub-devices. | |
int | liso_reader_open (struct inode *inode, struct file *filp) |
Open file operation for reader sub-devices. | |
int | liso_subdev_release (struct inode *inode, struct file *filp) |
Release sub-device. | |
int | liso_subdev_ioctl (struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg) |
ioctl file operation for sub-devices. | |
unsigned int | liso_subdevice_poll (struct file *filp, poll_table *wait) |
Poll file operation for sub-devices. | |
Synchronize functions | |
int | liso_subdev_wait_idx (liso_subdev_t *const sd, const int idx) |
Wait until reader reach a given idx. | |
int | liso_subdev_synchronize (liso_subdev_t *const sd, const int lock) |
Synchromize writer device with the reader. | |
void | liso_writer_synchronize (liso_subdev_t *const writer) |
Synchronize a writer device. | |
void | liso_reader_synchronize (liso_subdev_t *const reader) |
Synchronize a reader device. | |
int | liso_writer_flush (liso_subdev_t *const writer) |
Flush writer buffer. |
|
Pre-init sub-device. Must be call once before using sub-device. The function assumed that the liso_subdev_t memory have been previously zeroed.
|
|
Init sub-device. Performs most initializations needed at device open time such as setting default format, resetting counters, allocating memory ... ...
|
|
Commit requested format. Update liso_subdev_t::fmt structure with the info currently stored in the liso_subdev_t::req_fmt structure. The fmt.ok is setted and all fields in the liso_subdev_t::req_fmt structure are filled with special ``no change'' values. The liso_subdev_t::frags siz field is modified as well to match the new sampling rate.
|
|
Copy current format information for the next frag to process.
|
|
Get device status description string. The returned string is a 3 chars long string composed with the characters 'D','I','U' respectively DEAD,IDLE,USED status bit. An uppercase value means ON and a lower case means OFF.
|
|
Make sub-device sleep.
|
|
Wake up partner sub-device(s).
|
|
Test for partner to wake up.
|
|
Test if sub-device is a reader.
|
|
Test if sub-device is a writer.
|
|
Test if sub-device is active.
|
|
Test if sub-device is valid.
|
|
Lock sub-device.
|
|
Try lock sub-device.
|
|
Extended lock of sub-device. The extended lock functions call either liso_subdev_lock() or liso_subdev_trylock() function repectively for block and non-block mode and returns appropriate error-code if it fails (respectively -ERESTARTSYS and -EAGAIN).
|
|
Unlock sub-device.
|
|
Open file operation for writer sub-devices. Call by the lisodsp device open file operation if open mode is WR_ONLY. It is call after the resource has been reserved. This function alters the file operation and the private data in the file struct pointed by filp.
|
|
Open file operation for reader sub-devices. Call by the lisodsp device open file operation if open mode is RD_ONLY. It is call after the resource has been reserved. This function alters the file operation and the private data in the file struct pointed by filp.
|
|
Release sub-device.
|
|
ioctl file operation for sub-devices.
|
|
Poll file operation for sub-devices.
|
|
Wait until reader reach a given idx. This function waits until the reader reaches (at least) a given idx. The sub-device should not be locked.
|
|
Synchromize writer device with the reader. This function will call the liso_reader_synchronize() or liso_writer_synchronize() respectively for a reader or a writer sub-device. If the lock parameter is non zero the function will process between a liso_subdevice_trylock() and liso_subdevice_unlock() calls else the device is assumed to be already locked.
|
|
Synchronize a writer device. Synchronizing a writer device means flushing out all frags older than the current reader device index. The function will set the LISO_DEVICE_IDLE status bit if neccessary and will increment liso_subdev_t::lost_frags accordingly. The device is assumed to be already locked.
|
|
Synchronize a reader device. Synchronizing reader means to try to mix all writer devices avalaible frags and checks if some frags seems ready for reading (all required writer mixed). As this function is going to free some writer frag it is in charge to wake-up the writers. The device is assumed to be already locked.
|
|
Flush writer buffer. Waiting for all writer buffers being read and set idle. It involves both frag buffer and temporary buffer. If the temporary buffer has data but not enougth to complete a frag it is filled with null pcm value.
|
|
lisodsp developer documentation version 0.5.0 |
Generated on June 2004 by doxygen 1.3.7 |