snd_cards_list()

Count the sound cards and list their card numbers in an array

Synopsis:

#include <sys/asoundlib.h>

int snd_cards_list( int *cards,
                    int card_array_size,
                    int *cards_over );

Arguments:

cards
An array in which snd_cards_list() stores the card numbers.
card_array_size
The number of card numbers that the array cards can hold.
cards_over
The number of cards that wouldn't fit in the cards array.

Library:

libasound.so

Use the -l asound option with qcc to link against this library.

Description:

The snd_cards_list() function returns the instantaneous number of sound cards that have running drivers. There's no guarantee that the sound cards have contiguous card numbers, and cards may be unmounted at any time.

You should use this function instead of snd_cards() because snd_cards_list() can fill in an array of card numbers. This overcomes the difficulties involved in hunting a (possibly) non-contiguous list of card numbers for active cards.

Returns:

The number of sound cards.

Classification:

QNX Neutrino

Safety:  
Cancellation point No
Interrupt handler No
Signal handler Yes
Thread Yes