MOST ALSA Driver (based on the MOST Synchronous Driver)
Detailed Description
This is some kind of bridge between an ALSA sound application and MOST.
- little endian and big endian
- once playback process and one capture process
- 16-bit stereo
- 44.1 kHz sample rate
- other sample formats through hwplug (see ALSA documentation)
- Note:
- The driver was tested with
hw_?x_buffer_size=1000
and sw_?x_buffer_size=44100
.
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:
- 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.
- 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 ... :)
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:
sync-alsa-tx
is used for transmission (playback)sync-alsa-rx
is used for reception (capture)
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
- XMMS (ALSA Plugin)
- MOC -- Music on Console (both ALSA and OSS emulation)
- aplay and arecord (uses ALSA)
- sox: play and rec (uses OSS emulation)
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
1.5.0