Documentation Center

  • Trials
  • Product Updates

Contents

BeagleBoard ALSA Audio Playback, Overo ALSA Audio Playback, PandaBoard ALSA Audio Playback, Raspberry Pi ALSA Audio Playback

Send audio to sound card for playback using ALSA

Library

Simulink Support Package for BeagleBoard Hardware

Simulink Support Package for Gumstix Overo Hardware

Simulink Support Package for PandaBoard Hardware

Simulink Support Package for Raspberry Pi Hardware

Description

Send audio to the sound card for playback using the Advanced Linux Sound Architecture (ALSA) driver framework. The dimensions of the block input, In, are N-by-2, where N is the number of samples per frame, and 2 is the number of audio channels. The data type of the block input must be int16. Use the Audio sampling frequency parameter to set the sampling rate in Hertz (Hz).

    Note:   When you use the software volume controls to lower the volume of one channel, crosstalk from the other channel may be audible.

Dialog

Device name

For Raspberry Pi™ hardware, leave this value set to 'hw:0,0'.

For other types of hardware, use the default ALSA device, or specify an audio input device by name.

To use the default sound device specified by the ALSA configuration file, leave this parameter set to 'default'.

To find out which sound device the ALSA configuration file specifies, connect to the board and open the /usr/share/alsa/alsa.conf file. In the following example, the alsa.conf file specifies device 2 on card 0 as the default device:

pcm.!default {
 type hw
 card 0
 device 2
}

    Note:   The contents of the alsa.conf file varies by type of target hardware and Linux® distribution.

To specify an audio input device by name, connect to the board and open the /proc/asound/cards file. In the following example, the cards file names two devices, VirMIDI and AudioPCI:

$ cat /proc/asound/cards 0 [Dummy  ]: Dummy - Dummy
     Dummy 1

1 [VirMIDI ]: VirMIDI - VirMIDI
     Virtual MIDI Card 1

2 [AudioPCI ]: ENS1371 - Ensoniq AudioPCI
     Ensoniq AudioPCI ENS1371 at 0xe400, irq 11

This parameter value defaults to 'default'.

Audio sampling frequency (Hz)

Enter the sample frequency of the ALSA Audio Playback (output) device.

By default, the sample frequency of ALSA Audio Playback is the same as the sample frequency of ALSA Audio Capture.

This parameter value defaults to 44100 Hz (44.1 kHz). The maximum rate equals the sampling rate of the audio capture device.

See Also

| |

External Web Sites

Was this topic helpful?