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