ALSA project - the C library reference
Loading...
Searching...
No Matches
pcm_hw.c File Reference

PCM HW Plugin Interface. More...

Macros

#define hw_param_mask(params, var)
 

Enumerations

enum  { CHMAP_CTL_QUERY , CHMAP_CTL_GET , CHMAP_CTL_SET }
 

Functions

snd_pcm_chmap_query_t ** snd_pcm_query_chmaps_from_hw (int card, int dev, int subdev, snd_pcm_stream_t stream)
 
int snd_pcm_hw_open_fd (snd_pcm_t **pcmp, const char *name, int fd, int sync_ptr_ioctl)
 Creates a new hw PCM.
 
int snd_pcm_hw_open (snd_pcm_t **pcmp, const char *name, int card, int device, int subdevice, snd_pcm_stream_t stream, int mode, int mmap_emulation, int sync_ptr_ioctl)
 Creates a new hw PCM.
 
int _snd_pcm_hw_open (snd_pcm_t **pcmp, const char *name, snd_config_t *root, snd_config_t *conf, snd_pcm_stream_t stream, int mode)
 Creates a new hw PCM.
 

Detailed Description

PCM HW Plugin Interface.

Author
Abramo Bagnara abram.nosp@m.o@al.nosp@m.sa-pr.nosp@m.ojec.nosp@m.t.org
Jaroslav Kysela perex.nosp@m.@per.nosp@m.ex.cz
Date
2000-2001

Macro Definition Documentation

◆ hw_param_mask

#define hw_param_mask ( params,
var )
Value:
&((params)->masks[(var) - SND_PCM_HW_PARAM_FIRST_MASK])

Function Documentation

◆ _snd_pcm_hw_open()

int _snd_pcm_hw_open ( snd_pcm_t ** pcmp,
const char * name,
snd_config_t * root,
snd_config_t * conf,
snd_pcm_stream_t stream,
int mode )

Creates a new hw PCM.

Parameters
pcmpReturns created PCM handle
nameName of PCM
rootRoot configuration node
confConfiguration node with hw PCM description
streamPCM Stream
modePCM Mode
Warning
Using of this function might be dangerous in the sense of compatibility reasons. The prototype might be freely changed in future.

◆ snd_pcm_hw_open()

int snd_pcm_hw_open ( snd_pcm_t ** pcmp,
const char * name,
int card,
int device,
int subdevice,
snd_pcm_stream_t stream,
int mode,
int mmap_emulation,
int sync_ptr_ioctl )

Creates a new hw PCM.

Parameters
pcmpReturns created PCM handle
nameName of PCM
cardNumber of card
deviceNumber of device
subdeviceNumber of subdevice
streamPCM Stream
modePCM Mode
mmap_emulationObsoleted parameter
sync_ptr_ioctlUse SYNC_PTR ioctl rather than mmap for control structures
Return values
zeroon success otherwise a negative error code
Warning
Using of this function might be dangerous in the sense of compatibility reasons. The prototype might be freely changed in future.

◆ snd_pcm_hw_open_fd()

int snd_pcm_hw_open_fd ( snd_pcm_t ** pcmp,
const char * name,
int fd,
int sync_ptr_ioctl )

Creates a new hw PCM.

Parameters
pcmpReturns created PCM handle
nameName of PCM
fdFile descriptor
sync_ptr_ioctlBoolean flag for sync_ptr ioctl
Return values
zeroon success otherwise a negative error code
Warning
Using of this function might be dangerous in the sense of compatibility reasons. The prototype might be freely changed in future.

◆ snd_pcm_query_chmaps_from_hw()

snd_pcm_chmap_query_t ** snd_pcm_query_chmaps_from_hw ( int card,
int dev,
int subdev,
snd_pcm_stream_t stream )

!brief Query the available channel maps

Parameters
cardthe card number
devthe PCM device number
subdevthe PCM substream index
streamthe direction of PCM stream
Returns
the NULL-terminated array of integer pointers, or NULL at error.

This function works like snd_pcm_query_chmaps() but it takes the card, device, substream and stream numbers instead of the already opened snd_pcm_t instance, so that you can query available channel maps of a PCM before actually opening it.

As the parameters stand, the query is performed only to the hw PCM devices, not the abstracted PCM object in alsa-lib.