[Previous] [Contents] [Next]

snd_mixer_open()

Create a new connection and handle to the mixer device

Synopsis:

#include <sys/asoundlib.h>

int snd_mixer_open( void ** handle, 
                    int card, 
                    int device );

Library:

libasound.so

Description:

The snd_mixer_open() function creates a new connection and handle to the mixer device specified by the card and device number. This handle may be used by all snd_mixer_*() calls.

Returns:

Zero on success, or a negative value on error.

Errors:

-EACCES
Search permission is denied on a component of the path prefix, or the device exists and the permissions specified are denied.
-EINTR
The open() operation was interrupted by a signal.
-EMFILE
Too many file descriptors are currently in use by this process.
-ENFILE
Too many files are currently open in the system.
-ENOENT
The named device doesn't exist.
-ENOMEM
No memory available for data structure.
-SND_ERROR_INCOMPATIBLE_VERSION
The audio driver version is incompatible with the client library that the application uses.

Examples:

See the example in Opening the mixer in the Controlling volume and balance chapter.

Classification:

ALSA

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

See also:

snd_mixer_close(), snd_mixer_read()


[Previous] [Contents] [Next]