[Previous] [Contents] [Next]

snd_pcm_close()

Free resources allocated with audio handle

Synopsis:

#include <sys/asoundlib.h>

int snd_pcm_close( snd_pcm_t * handle );

Library:

libasound.so

Description:

The snd_pcm_close() function frees all resources allocated with audio handle and closes the connection to the sound audio interface.

Returns:

Zero on success, or a negative value on error.

Errors:

-EBADF
Invalid file descriptor filedes.
-EINTR
The close() call was interrupted by a signal.
-EINVAL
Invalid handle argument.
-EIO
An I/O error occurred while updating the directory information.
-ENOSPC
A previous buffered write call has failed.

Examples:

See the Closing the audio device section in the Playing Audio Data chapter.

Classification:

ALSA

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

See also:

snd_pcm_open(), snd_pcm_open_preferred()


[Previous] [Contents] [Next]