MOST ALSA Driver (based on the MOST Synchronous Driver)


Files

file  most-alsa.c
 ALSA Driver for MOST.
file  most-alsa.h
 Definitions for the ALSA driver for MOST.

Detailed Description

This is some kind of bridge between an ALSA sound application and MOST.

Features

Note:
The driver was tested with hw_?x_buffer_size=1000 and sw_?x_buffer_size=44100.

Design

Because the ALSA driver is only some kind of bridge between the MOST Synchronous Driver and ALSA applications, the implementation was done in a way so that not too much changes were necessary in the synchronous module. See MOST Synchronous Driver (non-realtime) for the description how to access the synchronous modules from other kernel module.

Basically, there were two alternatives keept in mind how the goal could be achieved:

  1. Using the silence and copy callbacks of ALSA. The disadvantage is that this is not mmap()able and both functions are not allowed to sleep. But the most_sync_write() and most_sync_read() can sleep, so it's a bad idea to use this function inside these callbacks.

    There were other drawbacks (such as how to implement the pointer callback cleanly) with this approach so that it was dropped.

  2. Using another buffer and copy the data from this buffer to the ring buffer in a separate kernel thread. This sounds "oh, just another buffer", but if you use mmap() in the ALSA application it doesn't use more buffers than the first approach.

    Using most_sync_read() and most_sync_write() in a kernel thread is possible and this kernel thread simulates the hardware so that keeping the pointer is easy.

So the second approach was used. Details in the code ... :)

Using the ALSA driver

To use the ALSA driver, you have to start a userspace program that configures the Routing Engine and that handles the NetServices. There are two programs provides with the sources:

These programs are located in the most-driver/drivertest directory. After these programs are running, any ALSA or OSS sound program can be used. The driver has been tested with

For the setting which synchronous frames are used see the kernel parameters in Loading the modules.


Generated on Fri Mar 9 14:48:58 2007 for MOST Linux Drivers (Linux and RTAI) by  doxygen 1.5.0