Documentation Center

  • Trial Software
  • Product Updates

Contents

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

Capture audio from sound card 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

Capture the left and right audio channels from the AUDIO IN connector or a stereo sound device using the Advanced Linux Sound Architecture (ALSA) driver framework. The block output, Out, emits an N-by-2 frame of int16 values. The width of the frame, 2, corresponds to the left and right audio channels. To determine the sample rate of the block output, divide the Frame size (N) by the Audio sampling frequency (Hz). For example, if Frame size (N) is 4410 and Audio sampling frequency (Hz) is 44100, then the sample rate is 0.1 seconds.

Dialog

Device name

For Raspberry Pi™ hardware, leave this value set to 'hw:1,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 sampling frequency of the ALSA Audio Capture (input) device.

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

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

Frame size (N)

Enter the number of samples this block will output to your model. This parameter value defaults to 4410.

See Also

| |

External Web Sites

Was this topic helpful?