Texas Instruments OMAP35 Series User Manual page 86

Evm linux psp
Hide thumbs Also See for OMAP35 Series:
Table of Contents

Advertisement

The most important ALSA interfaces to the PCM devices are the "plughw" and the
"hw" interface. If you use the "plughw" interface, you need not care much about
the sound hardware. If your soundcard does not support the sample rate or
sample format you specify, your data will be automatically converted. This also
applies to the access type and the number of channels. With the "hw" interface,
you have to check whether your hardware supports the configuration you would
like to use. Otherwise, user can use the default interface for playback by:
Now we can open the PCM device:
5.6.2.2. Setting the parameters of the device
Now we initialize the variables and allocate the hwparams structure:
64
int err;
short buf[BUFF_SIZE];
int rate = 44100; /* Sample rate */
unsigned int exact_rate;
/* Handle for the PCM device */
snd_pcm_t *playback_handle;
/* Playback stream */
snd_pcm_stream_t stream = SND_PCM_STREAM_PLAYBACK;
/* This structure contains information about
/* the hardware and can be used to specify the
/* configuration to be used for the PCM stream. */
snd_pcm_hw_params_t *hw_params;
/* Name of the PCM device, like plughw:0,0
/* The first number is the number of the soundcard, */
/* the second number is the number of the device.
static char *device = "default";
/* Open PCM. The last parameter of this function is the mode. */
if ((err = snd_pcm_open (&playback_handle,
fprintf (stderr, "cannot open audio device (%s)\n",
snd_strerror (err));
exit (1);
}
/* Allocate the snd_pcm_hw_params_t structure on the stack. */
if ((err = snd_pcm_hw_params_malloc (&hw_params)) < 0) {
fprintf (stderr, "cannot allocate hardware parameters (%s)\n",
snd_strerror (err));
exit (1);
}
Platform Support Products
/* Sample rate returned by */
/* playback device */
device, stream, 0)) < 0) {
Audio Driver
A minimal playback application
*/
*/
*/
*/
Version 02.01.01.08

Advertisement

Table of Contents
loading

This manual is also suitable for:

Omap3515Omap3525Omap3530

Table of Contents