Blame doc/README-maemo

Packit 675970
The Debian Package osso-dsp-plugin-alsa
Packit 675970
----------------------------
Packit 675970
Packit 675970
Comments regarding the Package
Packit 675970
Packit 675970
Eduardo Valentin <eduardo.valentin@indt.org.br>, Wed, 5 Apr 2006 10:28:06 +0300
Packit 675970
Packit 675970
Packit 675970
OSSO DSP SW  <--> ALSA DSP plugin
Packit 675970
========================
Packit 675970
Packit 675970
This plugin converts the ALSA API over PCM task nodes protocol. In this way,
Packit 675970
ALSA native applications can run over DSP Gateway and use DSP PCM task nodes.
Packit 675970
Packit 675970
This plugin provides the PCM type "alsa_dsp".  The typical configuration
Packit 675970
looks like below:
Packit 675970
Packit 675970
	# PCM
Packit 675970
	pcm.!default {
Packit 675970
	        type alsa_dsp
Packit 675970
        	playback_device_file ["/dev/dsptask/pcm2"]
Packit 675970
	        recording_device_file ["/dev/dsptask/pcm_rec"]
Packit 675970
	}
Packit 675970
Packit 675970
Put the above to ~/.asoundrc (or /etc/asound.conf or /usr/share/alsa/alsa.conf), 
Packit 675970
and use "default" PCM with your ALSA apps.  For example:
Packit 675970
Packit 675970
	% aplay -Ddefault foo.wav
Packit 675970
	% arecord -Ddefault foo.wav
Packit 675970
Packit 675970
The alsa_dsp plugin can have two options for pcm interface:
Packit 675970
a. playback_device_file: this is a list of PCM task node device files whose
Packit 675970
alsa_dsp plugin is allowed to use to do playback. For example: /dev/dsptask/pcm2.
Packit 675970
b. recording_device_file: this is a list of PCM task node device files whose
Packit 675970
alsa_dsp plugin is allowed to use to do recording. For example: /dev/dsptask/pcm_rec.
Packit 675970
Packit 675970
The alsa_dsp plugin will probe the dsp task node files you provide and 
Packit 675970
will use the first one whose dsp PCM task is in UNINITIALISED state.
Packit 675970
If no dsp PCM task node is usable, alsa_dsp plugin will return an ENODEV
Packit 675970
error code.
Packit 675970
Packit 675970
For the control interface, this plugin provides the CTL type "dsp_ctl". A
Packit 675970
typical configuration is:
Packit 675970
	# Mixer
Packit 675970
	ctl.!default {
Packit 675970
        	type dsp_ctl
Packit 675970
	        playback_devices ["/dev/dsptask/pcm2"]
Packit 675970
        	recording_devices ["/dev/dsptask/pcm_rec"]
Packit 675970
	}
Packit 675970
Packit 675970
Put the above to ~/.asoundrc (or /etc/asound.conf or /usr/share/alsa/alsa.conf), 
Packit 675970
and use "default" CTL with your ALSA apps.  For example:
Packit 675970
	% alsamixer -Ddefault 
Packit 675970
Packit 675970
The dsp_ctl plugin can have two options for ctl interface:
Packit 675970
a. playback_devices: this is a list of PCM task node device files whose
Packit 675970
dsp_ctl plugin is allowed to use to do volume control changing. These
Packit 675970
devices will be handled under the "PCM Playback Volume" and "PCM Playback Switch" 
Packit 675970
control names. 
Packit 675970
b. recording_devices: this is a list of PCM task node device files whose
Packit 675970
dsp_ctl plugin is allowed to use to do volume control changing. 
Packit 675970
These devices will be handled under the "Capture Switch" control name.
Packit 675970
Packit 675970
# Supported formats:
Packit 675970
Packit 675970
Playback: 
Packit 675970
	16-bit PCM formats: 
Packit 675970
		S16_LE	
Packit 675970
		S16_BE	
Packit 675970
		U16_LE	
Packit 675970
		U16_BE	
Packit 675970
	8-bit PCM formats:
Packit 675970
		A_LAW	
Packit 675970
		MU_LAW	
Packit 675970
		U8	
Packit 675970
		S8
Packit 675970
	Rates: 
Packit 675970
		8 KHz, 11.025 KHz, 12 KHz, 16 KHz, 
Packit 675970
		22.050 KHz, 24 KHz, 32 KHz, 44.1 KHz, 48 KHz
Packit 675970
	Channels: Mono and Stereo 
Packit 675970
Recording:
Packit 675970
	16-bit PCM formats: 
Packit 675970
		S16_LE	
Packit 675970
	8-bit PCM formats:
Packit 675970
		A_LAW	
Packit 675970
		MU_LAW	
Packit 675970
	Rates: 
Packit 675970
		8 KHz
Packit 675970
	Channels: Mono
Packit 675970
Packit 675970
# Compilation
Packit 675970
To cross-compile the plugin inside scratchbox environment, you will
Packit 675970
need a libasound2 version of binaries and header files installed.
Packit 675970
Pthreads is also required. The source directory provides a Makefile.
Packit 675970
If you just type:
Packit 675970
Packit 675970
	% make clean
Packit 675970
	% make 
Packit 675970
Packit 675970
under the source tree, it will generate the binaries under the
Packit 675970
"bin" sub-directory. Like:
Packit 675970
Packit 675970
libasound_module_ctl_dsp_ctl.so  and libasound_module_pcm_alsa_dsp.so
Packit 675970
Packit 675970
The libasound_module_ctl_dsp_ctl.so is currently a symbolic link to
Packit 675970
libasound_module_pcm_alsa_dsp.so. 
Packit 675970
Packit 675970
You can just copy then to your /usr/lib/alsa-lib/ directory inside your 
Packit 675970
target file system. 
Packit 675970
Packit 675970
You can also modify the behaviour of this plugin using macro definitions
Packit 675970
while compiling it. Here are macros whose can be used in CFLAGS (-D <macro>):
Packit 675970
	ERROR_DEBUG		It enables error debug output. You have to 
Packit 675970
				change in "debug.h" file. Default is to debug.
Packit 675970
	DEBUG 			It enables debug output. You have to change in
Packit 675970
				"debug.h" file. Default is not to debug.
Packit 675970
	NORMAL_DSP_TASK		It enables utilization of extended fields in
Packit 675970
				audio_status_info_t data structure (mute,
Packit 675970
				samples_played_high, samples_played_low).
Packit 675970
				You can change it in "Makefile". Default
Packit 675970
				is NORMAL_DSP_TASK enabled.
Packit 675970
	USE_RESOURCE_MANAGER	If set, the resource manager D-BUS interface
Packit 675970
				will be used for power management instead of
Packit 675970
				the sysfs file.
Packit 675970
	ERROR_ON_PM_FAILURE	It controls this plugin behaviour if it fails
Packit 675970
				while openning MIC power management file 
Packit 675970
				(/sys/devices/platform/audio-i2c/mic_enable)
Packit 675970
				or calling the resource manager request()
Packit 675970
				method (if USE_RESOURCE_MANAGER is set).
Packit 675970
				If you enable this macro, this plugin will 
Packit 675970
				return an error code. Otherwise, it will
Packit 675970
				just print a debug message, and will return
Packit 675970
				sucess. You can change it in Makefile. Default 
Packit 675970
				is ERROR_ON_PM_FAILURE disabled.
Packit 675970
Packit 675970
# Installation
Packit 675970
The plugin is installed in /usr/lib/alsa-lib directory as default,
Packit 675970
which is the default search path of additional plugins for alsa-lib.
Packit 675970
Packit 675970
This plugin is expected to be compatible with any standard ALSA application.
Packit 675970
The only requirement is you have to compile it against the same libasound2 you
Packit 675970
have installed in your target system. You have to enable the external plugins
Packit 675970
support in libasound2:
Packit 675970
Packit 675970
	% cd $LIB_ASOUND2_SRC
Packit 675970
	% ./configure --with-pcm-plugins=extplug
Packit 675970
Packit 675970
You can get the latest version of libasound2 in http://www.alsa-project.org.
Packit 675970
There you can find more instructions of how to compile libasound2. The cross-compilation
Packit 675970
for ARM architecture is straightforward inside the scratchbox environment.
Packit 675970
Packit 675970
Packit 675970
# Applications
Packit 675970
Packit 675970
Alsa-utils:
Packit 675970
Also from http://www.alsa-project.org, you can find alsa-utils package sources.
Packit 675970
This package constains standard ALSA application, like amixer, alsamixer and
Packit 675970
aplay/arecord.
Packit 675970
Packit 675970
The compilation of alsa-utils is also straightforward inside scratchbox environment.
Packit 675970
The only requirement is you will need to have libasound2 (and libncurses) installed 
Packit 675970
inside your scratchbox environment to be able to compile alsa-utils.
Packit 675970
Packit 675970
After compiling and installing applications on your target, you can
Packit 675970
use them with this plugin specifing the correct pcm device. For example,
Packit 675970
if you have installed alsaplayer on your target, you can specify an alsa pcm
Packit 675970
device with:
Packit 675970
	target # alsaplayer -d default
Packit 675970
Packit 675970
#Limitation
Packit 675970
Packit 675970
- While the plugin is using a pcm task node, another applications,
Packit 675970
for example gstreamer, can not use the same task node. This will cause
Packit 675970
unexpected behaviour.
Packit 675970
- If an application does not close alsa device properly, this plugin
Packit 675970
will not have chance to release all reserved resouces. One expected 
Packit 675970
behaviour in this case is to have -EBUSY error for following applications
Packit 675970
whose try to open the same alsa device. Partialy solved (version 0.6)
Packit 675970
with __attribute__((destructor)) functions. But if the application 
Packit 675970
receives an uncaught signal, resources may be kept unreleased.
Packit 675970
- If many requests to volume information read / write is done in the
Packit 675970
same alsa device while it is being used to do playback, this playback
Packit 675970
could be affected and some little stops can be heard.