| Contents | Index |
Embedded Coder/ Embedded Targets/ Operating Systems/ Embedded Linux (linuxlib)
Simulink Coder/ Desktop Targets/ Operating Systems/ Linux
This block takes a stream of audio data and sends it to the output jack of an ALSA audio device. The block input, In, takes the left and right channels of data as an [Nx2] frame of int16 values. N is the number of samples per frame.

Use the default ALSA device, or enter the name of a specific audio device.
Entering 'default' selects the ALSA device specified by an ALSA configuration file on your target Linux system.
One of the following ALSA configuration files defines the default device:
/etc/asound.conf, which defines system-wide options for all users
~/.asoundrc, which overrides /etc/asound.conf for the current user
The entry that specifies the default device looks like this hypothetical example:
pcm.!default {
type hw
card 0
device 2
}
To enter the name of an alternate audio device, consult the /proc/asound/cards file on your target Linux system. For example, if /proc/asound/cards contained the following hypothetical entries, you could set the value of Device to '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 11The default value for Device is 'default'.
Enter a value that matches the sample rate of the ALSA audio output.
By default, the sample rate of the ALSA output is the same as the output of the audio capture device. In this case, enter the sample rate of the audio capture device.
The /etc/asound.conf and ~/.asoundrc files can configure ALSA to downsample the signal from the audio capture device. In this case, enter the downsample rate specified by the configuration files. For example, if one of the configuration files contained the following hypothetical entry, you would set the value of Sample rate (Hz) to 16000 :
pcm_slave.sl3 {
pcm ens1371
format S16_LE
channels 1
rate 16000
}
pcm.complex_convert {
type plug
slave sl3
}
The default value for Sample rate (Hz) is 44100 Hz (44.1 kHz). The maximum rate is the sampling rate of the audio capture device.
Set the duration of the queue in seconds. This queue provides a software-based frame buffer between the ALSA audio device and this block. The queue prevents dropped data caused by temporary mismatches in the rate of data arriving and leaving the queue. Higher values can handle more significant mismatches, but increase signal latency and memory usage.
The default value for Queue duration (seconds) is 0.5 seconds.

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |