home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / alsa / pcm.h < prev    next >
Encoding:
C/C++ Source or Header  |  2008-09-18  |  50.1 KB  |  1,137 lines

  1. /**
  2.  * \file include/pcm.h
  3.  * \brief Application interface library for the ALSA driver
  4.  * \author Jaroslav Kysela <perex@perex.cz>
  5.  * \author Abramo Bagnara <abramo@alsa-project.org>
  6.  * \author Takashi Iwai <tiwai@suse.de>
  7.  * \date 1998-2001
  8.  *
  9.  * Application interface library for the ALSA driver.
  10.  * See the \ref pcm page for more details.
  11.  */
  12. /*
  13.  *   This library is free software; you can redistribute it and/or modify
  14.  *   it under the terms of the GNU Lesser General Public License as
  15.  *   published by the Free Software Foundation; either version 2.1 of
  16.  *   the License, or (at your option) any later version.
  17.  *
  18.  *   This program is distributed in the hope that it will be useful,
  19.  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
  20.  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  21.  *   GNU Lesser General Public License for more details.
  22.  *
  23.  *   You should have received a copy of the GNU Lesser General Public
  24.  *   License along with this library; if not, write to the Free Software
  25.  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  26.  *
  27.  */
  28.  
  29. #ifndef __ALSA_PCM_H
  30. #define __ALSA_PCM_H
  31.  
  32. #ifdef __cplusplus
  33. extern "C" {
  34. #endif
  35.  
  36. /**
  37.  *  \defgroup PCM PCM Interface
  38.  *  See the \ref pcm page for more details.
  39.  *  \{
  40.  */
  41.  
  42. /** dlsym version for interface entry callback */
  43. #define SND_PCM_DLSYM_VERSION        _dlsym_pcm_001
  44.  
  45. /** PCM generic info container */
  46. typedef struct _snd_pcm_info snd_pcm_info_t;
  47. /** PCM hardware configuration space container */
  48. typedef struct _snd_pcm_hw_params snd_pcm_hw_params_t;
  49. /** PCM software configuration container */
  50. typedef struct _snd_pcm_sw_params snd_pcm_sw_params_t;
  51. /** PCM status container */
  52.  typedef struct _snd_pcm_status snd_pcm_status_t;
  53. /** PCM access types mask */
  54. typedef struct _snd_pcm_access_mask snd_pcm_access_mask_t;
  55. /** PCM formats mask */
  56. typedef struct _snd_pcm_format_mask snd_pcm_format_mask_t;
  57. /** PCM subformats mask */
  58. typedef struct _snd_pcm_subformat_mask snd_pcm_subformat_mask_t;
  59.  
  60. /** PCM class */
  61. typedef enum _snd_pcm_class {
  62.     /** standard device */
  63.  
  64.     SND_PCM_CLASS_GENERIC = 0,
  65.     /** multichannel device */
  66.     SND_PCM_CLASS_MULTI,
  67.     /** software modem device */
  68.     SND_PCM_CLASS_MODEM,
  69.     /** digitizer device */
  70.     SND_PCM_CLASS_DIGITIZER,
  71.     SND_PCM_CLASS_LAST = SND_PCM_CLASS_DIGITIZER
  72. } snd_pcm_class_t;
  73.  
  74. /** PCM subclass */
  75. typedef enum _snd_pcm_subclass {
  76.     /** subdevices are mixed together */
  77.     SND_PCM_SUBCLASS_GENERIC_MIX = 0,
  78.     /** multichannel subdevices are mixed together */
  79.     SND_PCM_SUBCLASS_MULTI_MIX,
  80.     SND_PCM_SUBCLASS_LAST = SND_PCM_SUBCLASS_MULTI_MIX
  81. } snd_pcm_subclass_t;
  82.  
  83. /** PCM stream (direction) */
  84. typedef enum _snd_pcm_stream {
  85.     /** Playback stream */
  86.     SND_PCM_STREAM_PLAYBACK = 0,
  87.     /** Capture stream */
  88.     SND_PCM_STREAM_CAPTURE,
  89.     SND_PCM_STREAM_LAST = SND_PCM_STREAM_CAPTURE
  90. } snd_pcm_stream_t;
  91.  
  92. /** PCM access type */
  93. typedef enum _snd_pcm_access {
  94.     /** mmap access with simple interleaved channels */
  95.     SND_PCM_ACCESS_MMAP_INTERLEAVED = 0,
  96.     /** mmap access with simple non interleaved channels */
  97.     SND_PCM_ACCESS_MMAP_NONINTERLEAVED,
  98.     /** mmap access with complex placement */
  99.     SND_PCM_ACCESS_MMAP_COMPLEX,
  100.     /** snd_pcm_readi/snd_pcm_writei access */
  101.     SND_PCM_ACCESS_RW_INTERLEAVED,
  102.     /** snd_pcm_readn/snd_pcm_writen access */
  103.     SND_PCM_ACCESS_RW_NONINTERLEAVED,
  104.     SND_PCM_ACCESS_LAST = SND_PCM_ACCESS_RW_NONINTERLEAVED
  105. } snd_pcm_access_t;
  106.  
  107. /** PCM sample format */
  108. typedef enum _snd_pcm_format {
  109.     /** Unknown */
  110.     SND_PCM_FORMAT_UNKNOWN = -1,
  111.     /** Signed 8 bit */
  112.     SND_PCM_FORMAT_S8 = 0,
  113.     /** Unsigned 8 bit */
  114.     SND_PCM_FORMAT_U8,
  115.     /** Signed 16 bit Little Endian */
  116.     SND_PCM_FORMAT_S16_LE,
  117.     /** Signed 16 bit Big Endian */
  118.     SND_PCM_FORMAT_S16_BE,
  119.     /** Unsigned 16 bit Little Endian */
  120.     SND_PCM_FORMAT_U16_LE,
  121.     /** Unsigned 16 bit Big Endian */
  122.     SND_PCM_FORMAT_U16_BE,
  123.     /** Signed 24 bit Little Endian using low three bytes in 32-bit word */
  124.     SND_PCM_FORMAT_S24_LE,
  125.     /** Signed 24 bit Big Endian using low three bytes in 32-bit word */
  126.     SND_PCM_FORMAT_S24_BE,
  127.     /** Unsigned 24 bit Little Endian using low three bytes in 32-bit word */
  128.     SND_PCM_FORMAT_U24_LE,
  129.     /** Unsigned 24 bit Big Endian using low three bytes in 32-bit word */
  130.     SND_PCM_FORMAT_U24_BE,
  131.     /** Signed 32 bit Little Endian */
  132.     SND_PCM_FORMAT_S32_LE,
  133.     /** Signed 32 bit Big Endian */
  134.     SND_PCM_FORMAT_S32_BE,
  135.     /** Unsigned 32 bit Little Endian */
  136.     SND_PCM_FORMAT_U32_LE,
  137.     /** Unsigned 32 bit Big Endian */
  138.     SND_PCM_FORMAT_U32_BE,
  139.     /** Float 32 bit Little Endian, Range -1.0 to 1.0 */
  140.     SND_PCM_FORMAT_FLOAT_LE,
  141.     /** Float 32 bit Big Endian, Range -1.0 to 1.0 */
  142.     SND_PCM_FORMAT_FLOAT_BE,
  143.     /** Float 64 bit Little Endian, Range -1.0 to 1.0 */
  144.     SND_PCM_FORMAT_FLOAT64_LE,
  145.     /** Float 64 bit Big Endian, Range -1.0 to 1.0 */
  146.     SND_PCM_FORMAT_FLOAT64_BE,
  147.     /** IEC-958 Little Endian */
  148.     SND_PCM_FORMAT_IEC958_SUBFRAME_LE,
  149.     /** IEC-958 Big Endian */
  150.     SND_PCM_FORMAT_IEC958_SUBFRAME_BE,
  151.     /** Mu-Law */
  152.     SND_PCM_FORMAT_MU_LAW,
  153.     /** A-Law */
  154.     SND_PCM_FORMAT_A_LAW,
  155.     /** Ima-ADPCM */
  156.     SND_PCM_FORMAT_IMA_ADPCM,
  157.     /** MPEG */
  158.     SND_PCM_FORMAT_MPEG,
  159.     /** GSM */
  160.     SND_PCM_FORMAT_GSM,
  161.     /** Special */
  162.     SND_PCM_FORMAT_SPECIAL = 31,
  163.     /** Signed 24bit Little Endian in 3bytes format */
  164.     SND_PCM_FORMAT_S24_3LE = 32,
  165.     /** Signed 24bit Big Endian in 3bytes format */
  166.     SND_PCM_FORMAT_S24_3BE,
  167.     /** Unsigned 24bit Little Endian in 3bytes format */
  168.     SND_PCM_FORMAT_U24_3LE,
  169.     /** Unsigned 24bit Big Endian in 3bytes format */
  170.     SND_PCM_FORMAT_U24_3BE,
  171.     /** Signed 20bit Little Endian in 3bytes format */
  172.     SND_PCM_FORMAT_S20_3LE,
  173.     /** Signed 20bit Big Endian in 3bytes format */
  174.     SND_PCM_FORMAT_S20_3BE,
  175.     /** Unsigned 20bit Little Endian in 3bytes format */
  176.     SND_PCM_FORMAT_U20_3LE,
  177.     /** Unsigned 20bit Big Endian in 3bytes format */
  178.     SND_PCM_FORMAT_U20_3BE,
  179.     /** Signed 18bit Little Endian in 3bytes format */
  180.     SND_PCM_FORMAT_S18_3LE,
  181.     /** Signed 18bit Big Endian in 3bytes format */
  182.     SND_PCM_FORMAT_S18_3BE,
  183.     /** Unsigned 18bit Little Endian in 3bytes format */
  184.     SND_PCM_FORMAT_U18_3LE,
  185.     /** Unsigned 18bit Big Endian in 3bytes format */
  186.     SND_PCM_FORMAT_U18_3BE,
  187.     SND_PCM_FORMAT_LAST = SND_PCM_FORMAT_U18_3BE,
  188.  
  189. #if __BYTE_ORDER == __LITTLE_ENDIAN
  190.     /** Signed 16 bit CPU endian */
  191.     SND_PCM_FORMAT_S16 = SND_PCM_FORMAT_S16_LE,
  192.     /** Unsigned 16 bit CPU endian */
  193.     SND_PCM_FORMAT_U16 = SND_PCM_FORMAT_U16_LE,
  194.     /** Signed 24 bit CPU endian */
  195.     SND_PCM_FORMAT_S24 = SND_PCM_FORMAT_S24_LE,
  196.     /** Unsigned 24 bit CPU endian */
  197.     SND_PCM_FORMAT_U24 = SND_PCM_FORMAT_U24_LE,
  198.     /** Signed 32 bit CPU endian */
  199.     SND_PCM_FORMAT_S32 = SND_PCM_FORMAT_S32_LE,
  200.     /** Unsigned 32 bit CPU endian */
  201.     SND_PCM_FORMAT_U32 = SND_PCM_FORMAT_U32_LE,
  202.     /** Float 32 bit CPU endian */
  203.     SND_PCM_FORMAT_FLOAT = SND_PCM_FORMAT_FLOAT_LE,
  204.     /** Float 64 bit CPU endian */
  205.     SND_PCM_FORMAT_FLOAT64 = SND_PCM_FORMAT_FLOAT64_LE,
  206.     /** IEC-958 CPU Endian */
  207.     SND_PCM_FORMAT_IEC958_SUBFRAME = SND_PCM_FORMAT_IEC958_SUBFRAME_LE
  208. #elif __BYTE_ORDER == __BIG_ENDIAN
  209.     /** Signed 16 bit CPU endian */
  210.     SND_PCM_FORMAT_S16 = SND_PCM_FORMAT_S16_BE,
  211.     /** Unsigned 16 bit CPU endian */
  212.     SND_PCM_FORMAT_U16 = SND_PCM_FORMAT_U16_BE,
  213.     /** Signed 24 bit CPU endian */
  214.     SND_PCM_FORMAT_S24 = SND_PCM_FORMAT_S24_BE,
  215.     /** Unsigned 24 bit CPU endian */
  216.     SND_PCM_FORMAT_U24 = SND_PCM_FORMAT_U24_BE,
  217.     /** Signed 32 bit CPU endian */
  218.     SND_PCM_FORMAT_S32 = SND_PCM_FORMAT_S32_BE,
  219.     /** Unsigned 32 bit CPU endian */
  220.     SND_PCM_FORMAT_U32 = SND_PCM_FORMAT_U32_BE,
  221.     /** Float 32 bit CPU endian */
  222.     SND_PCM_FORMAT_FLOAT = SND_PCM_FORMAT_FLOAT_BE,
  223.     /** Float 64 bit CPU endian */
  224.     SND_PCM_FORMAT_FLOAT64 = SND_PCM_FORMAT_FLOAT64_BE,
  225.     /** IEC-958 CPU Endian */
  226.     SND_PCM_FORMAT_IEC958_SUBFRAME = SND_PCM_FORMAT_IEC958_SUBFRAME_BE
  227. #else
  228. #error "Unknown endian"
  229. #endif
  230. } snd_pcm_format_t;
  231.  
  232. /** PCM sample subformat */
  233. typedef enum _snd_pcm_subformat {
  234.     /** Standard */
  235.     SND_PCM_SUBFORMAT_STD = 0,
  236.     SND_PCM_SUBFORMAT_LAST = SND_PCM_SUBFORMAT_STD
  237. } snd_pcm_subformat_t;
  238.  
  239. /** PCM state */
  240. typedef enum _snd_pcm_state {
  241.     /** Open */
  242.     SND_PCM_STATE_OPEN = 0,
  243.     /** Setup installed */ 
  244.     SND_PCM_STATE_SETUP,
  245.     /** Ready to start */
  246.     SND_PCM_STATE_PREPARED,
  247.     /** Running */
  248.     SND_PCM_STATE_RUNNING,
  249.     /** Stopped: underrun (playback) or overrun (capture) detected */
  250.     SND_PCM_STATE_XRUN,
  251.     /** Draining: running (playback) or stopped (capture) */
  252.     SND_PCM_STATE_DRAINING,
  253.     /** Paused */
  254.     SND_PCM_STATE_PAUSED,
  255.     /** Hardware is suspended */
  256.     SND_PCM_STATE_SUSPENDED,
  257.     /** Hardware is disconnected */
  258.     SND_PCM_STATE_DISCONNECTED,
  259.     SND_PCM_STATE_LAST = SND_PCM_STATE_DISCONNECTED
  260. } snd_pcm_state_t;
  261.  
  262. /** PCM start mode */
  263. typedef enum _snd_pcm_start {
  264.     /** Automatic start on data read/write */
  265.     SND_PCM_START_DATA = 0,
  266.     /** Explicit start */
  267.     SND_PCM_START_EXPLICIT,
  268.     SND_PCM_START_LAST = SND_PCM_START_EXPLICIT
  269. } snd_pcm_start_t;
  270.  
  271. /** PCM xrun mode */
  272. typedef enum _snd_pcm_xrun {
  273.     /** Xrun detection disabled */
  274.     SND_PCM_XRUN_NONE = 0,
  275.     /** Stop on xrun detection */
  276.     SND_PCM_XRUN_STOP,
  277.     SND_PCM_XRUN_LAST = SND_PCM_XRUN_STOP
  278. } snd_pcm_xrun_t;
  279.  
  280. /** PCM timestamp mode */
  281. typedef enum _snd_pcm_tstamp {
  282.     /** No timestamp */
  283.     SND_PCM_TSTAMP_NONE = 0,
  284.     /** Update timestamp at every hardware position update */
  285.     SND_PCM_TSTAMP_ENABLE,
  286.     /** Equivalent with #SND_PCM_TSTAMP_ENABLE,
  287.      * just for compatibility with older versions
  288.      */
  289.     SND_PCM_TSTAMP_MMAP = SND_PCM_TSTAMP_ENABLE,
  290.     SND_PCM_TSTAMP_LAST = SND_PCM_TSTAMP_ENABLE
  291. } snd_pcm_tstamp_t;
  292.  
  293. /** Unsigned frames quantity */
  294. typedef unsigned long snd_pcm_uframes_t;
  295. /** Signed frames quantity */
  296. typedef long snd_pcm_sframes_t;
  297.  
  298. /** Non blocking mode (flag for open mode) \hideinitializer */
  299. #define SND_PCM_NONBLOCK        0x00000001
  300. /** Async notification (flag for open mode) \hideinitializer */
  301. #define SND_PCM_ASYNC            0x00000002
  302. /** Disable automatic (but not forced!) rate resamplinig */
  303. #define SND_PCM_NO_AUTO_RESAMPLE    0x00010000
  304. /** Disable automatic (but not forced!) channel conversion */
  305. #define SND_PCM_NO_AUTO_CHANNELS    0x00020000
  306. /** Disable automatic (but not forced!) format conversion */
  307. #define SND_PCM_NO_AUTO_FORMAT        0x00040000
  308. /** Disable soft volume control */
  309. #define SND_PCM_NO_SOFTVOL        0x00080000
  310.  
  311. /** PCM handle */
  312. typedef struct _snd_pcm snd_pcm_t;
  313.  
  314. /** PCM type */
  315. enum _snd_pcm_type {
  316.     /** Kernel level PCM */
  317.     SND_PCM_TYPE_HW = 0,
  318.     /** Hooked PCM */
  319.     SND_PCM_TYPE_HOOKS,
  320.     /** One or more linked PCM with exclusive access to selected
  321.         channels */
  322.     SND_PCM_TYPE_MULTI,
  323.     /** File writing plugin */
  324.     SND_PCM_TYPE_FILE,
  325.     /** Null endpoint PCM */
  326.     SND_PCM_TYPE_NULL,
  327.     /** Shared memory client PCM */
  328.     SND_PCM_TYPE_SHM,
  329.     /** INET client PCM (not yet implemented) */
  330.     SND_PCM_TYPE_INET,
  331.     /** Copying plugin */
  332.     SND_PCM_TYPE_COPY,
  333.     /** Linear format conversion PCM */
  334.     SND_PCM_TYPE_LINEAR,
  335.     /** A-Law format conversion PCM */
  336.     SND_PCM_TYPE_ALAW,
  337.     /** Mu-Law format conversion PCM */
  338.     SND_PCM_TYPE_MULAW,
  339.     /** IMA-ADPCM format conversion PCM */
  340.     SND_PCM_TYPE_ADPCM,
  341.     /** Rate conversion PCM */
  342.     SND_PCM_TYPE_RATE,
  343.     /** Attenuated static route PCM */
  344.     SND_PCM_TYPE_ROUTE,
  345.     /** Format adjusted PCM */
  346.     SND_PCM_TYPE_PLUG,
  347.     /** Sharing PCM */
  348.     SND_PCM_TYPE_SHARE,
  349.     /** Meter plugin */
  350.     SND_PCM_TYPE_METER,
  351.     /** Mixing PCM */
  352.     SND_PCM_TYPE_MIX,
  353.     /** Attenuated dynamic route PCM (not yet implemented) */
  354.     SND_PCM_TYPE_DROUTE,
  355.     /** Loopback server plugin (not yet implemented) */
  356.     SND_PCM_TYPE_LBSERVER,
  357.     /** Linear Integer <-> Linear Float format conversion PCM */
  358.     SND_PCM_TYPE_LINEAR_FLOAT,
  359.     /** LADSPA integration plugin */
  360.     SND_PCM_TYPE_LADSPA,
  361.     /** Direct Mixing plugin */
  362.     SND_PCM_TYPE_DMIX,
  363.     /** Jack Audio Connection Kit plugin */
  364.     SND_PCM_TYPE_JACK,
  365.     /** Direct Snooping plugin */
  366.     SND_PCM_TYPE_DSNOOP,
  367.     /** Direct Sharing plugin */
  368.     SND_PCM_TYPE_DSHARE,
  369.     /** IEC958 subframe plugin */
  370.     SND_PCM_TYPE_IEC958,
  371.     /** Soft volume plugin */
  372.     SND_PCM_TYPE_SOFTVOL,
  373.     /** External I/O plugin */
  374.     SND_PCM_TYPE_IOPLUG,
  375.     /** External filter plugin */
  376.     SND_PCM_TYPE_EXTPLUG,
  377.     /** Mmap-emulation plugin */
  378.     SND_PCM_TYPE_MMAP_EMUL,
  379.     SND_PCM_TYPE_LAST = SND_PCM_TYPE_MMAP_EMUL
  380. };
  381.  
  382. /** PCM type */
  383. typedef enum _snd_pcm_type snd_pcm_type_t;
  384.  
  385. /** PCM area specification */
  386. typedef struct _snd_pcm_channel_area {
  387.     /** base address of channel samples */
  388.     void *addr;
  389.     /** offset to first sample in bits */
  390.     unsigned int first;
  391.     /** samples distance in bits */
  392.     unsigned int step;
  393. } snd_pcm_channel_area_t;
  394.  
  395. /** PCM synchronization ID */
  396. typedef union _snd_pcm_sync_id {
  397.     /** 8-bit ID */
  398.     unsigned char id[16];
  399.     /** 16-bit ID */
  400.     unsigned short id16[8];
  401.     /** 32-bit ID */
  402.     unsigned int id32[4];
  403. } snd_pcm_sync_id_t;
  404.  
  405. /** #SND_PCM_TYPE_METER scope handle */
  406. typedef struct _snd_pcm_scope snd_pcm_scope_t;
  407.  
  408. int snd_pcm_open(snd_pcm_t **pcm, const char *name, 
  409.          snd_pcm_stream_t stream, int mode);
  410. int snd_pcm_open_lconf(snd_pcm_t **pcm, const char *name, 
  411.                snd_pcm_stream_t stream, int mode,
  412.                snd_config_t *lconf);
  413.  
  414. int snd_pcm_close(snd_pcm_t *pcm);
  415. const char *snd_pcm_name(snd_pcm_t *pcm);
  416. snd_pcm_type_t snd_pcm_type(snd_pcm_t *pcm);
  417. snd_pcm_stream_t snd_pcm_stream(snd_pcm_t *pcm);
  418. int snd_pcm_poll_descriptors_count(snd_pcm_t *pcm);
  419. int snd_pcm_poll_descriptors(snd_pcm_t *pcm, struct pollfd *pfds, unsigned int space);
  420. int snd_pcm_poll_descriptors_revents(snd_pcm_t *pcm, struct pollfd *pfds, unsigned int nfds, unsigned short *revents);
  421. int snd_pcm_nonblock(snd_pcm_t *pcm, int nonblock);
  422. int snd_async_add_pcm_handler(snd_async_handler_t **handler, snd_pcm_t *pcm, 
  423.                   snd_async_callback_t callback, void *private_data);
  424. snd_pcm_t *snd_async_handler_get_pcm(snd_async_handler_t *handler);
  425. int snd_pcm_info(snd_pcm_t *pcm, snd_pcm_info_t *info);
  426. int snd_pcm_hw_params_current(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
  427. int snd_pcm_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
  428. int snd_pcm_hw_free(snd_pcm_t *pcm);
  429. int snd_pcm_sw_params_current(snd_pcm_t *pcm, snd_pcm_sw_params_t *params);
  430. int snd_pcm_sw_params(snd_pcm_t *pcm, snd_pcm_sw_params_t *params);
  431. int snd_pcm_prepare(snd_pcm_t *pcm);
  432. int snd_pcm_reset(snd_pcm_t *pcm);
  433. int snd_pcm_status(snd_pcm_t *pcm, snd_pcm_status_t *status);
  434. int snd_pcm_start(snd_pcm_t *pcm);
  435. int snd_pcm_drop(snd_pcm_t *pcm);
  436. int snd_pcm_drain(snd_pcm_t *pcm);
  437. int snd_pcm_pause(snd_pcm_t *pcm, int enable);
  438. snd_pcm_state_t snd_pcm_state(snd_pcm_t *pcm);
  439. int snd_pcm_hwsync(snd_pcm_t *pcm);
  440. int snd_pcm_delay(snd_pcm_t *pcm, snd_pcm_sframes_t *delayp);
  441. int snd_pcm_resume(snd_pcm_t *pcm);
  442. int snd_pcm_htimestamp(snd_pcm_t *pcm, snd_pcm_uframes_t *avail, snd_htimestamp_t *tstamp);
  443. snd_pcm_sframes_t snd_pcm_avail_update(snd_pcm_t *pcm);
  444. snd_pcm_sframes_t snd_pcm_rewindable(snd_pcm_t *pcm);
  445. snd_pcm_sframes_t snd_pcm_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t frames);
  446. snd_pcm_sframes_t snd_pcm_forwardable(snd_pcm_t *pcm);
  447. snd_pcm_sframes_t snd_pcm_forward(snd_pcm_t *pcm, snd_pcm_uframes_t frames);
  448. snd_pcm_sframes_t snd_pcm_writei(snd_pcm_t *pcm, const void *buffer, snd_pcm_uframes_t size);
  449. snd_pcm_sframes_t snd_pcm_readi(snd_pcm_t *pcm, void *buffer, snd_pcm_uframes_t size);
  450. snd_pcm_sframes_t snd_pcm_writen(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size);
  451. snd_pcm_sframes_t snd_pcm_readn(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size);
  452. int snd_pcm_wait(snd_pcm_t *pcm, int timeout);
  453.  
  454. int snd_pcm_link(snd_pcm_t *pcm1, snd_pcm_t *pcm2);
  455. int snd_pcm_unlink(snd_pcm_t *pcm);
  456.  
  457. /*
  458.  * application helpers - these functions are implemented on top
  459.  * of the basic API
  460.  */
  461.  
  462. int snd_pcm_recover(snd_pcm_t *pcm, int err, int silent);
  463. int snd_pcm_set_params(snd_pcm_t *pcm,
  464.                        snd_pcm_format_t format,
  465.                        snd_pcm_access_t access,
  466.                        unsigned int channels,
  467.                        unsigned int rate,
  468.                        int soft_resample,
  469.                        unsigned int latency);
  470. int snd_pcm_get_params(snd_pcm_t *pcm,
  471.                        snd_pcm_uframes_t *buffer_size,
  472.                        snd_pcm_uframes_t *period_size);
  473.  
  474. /** \} */
  475.  
  476. /**
  477.  * \defgroup PCM_Info Stream Information
  478.  * \ingroup PCM
  479.  * See the \ref pcm page for more details.
  480.  * \{
  481.  */
  482.  
  483. size_t snd_pcm_info_sizeof(void);
  484. /** \hideinitializer
  485.  * \brief allocate an invalid #snd_pcm_info_t using standard alloca
  486.  * \param ptr returned pointer
  487.  */
  488. #define snd_pcm_info_alloca(ptr) __snd_alloca(ptr, snd_pcm_info)
  489. int snd_pcm_info_malloc(snd_pcm_info_t **ptr);
  490. void snd_pcm_info_free(snd_pcm_info_t *obj);
  491. void snd_pcm_info_copy(snd_pcm_info_t *dst, const snd_pcm_info_t *src);
  492. unsigned int snd_pcm_info_get_device(const snd_pcm_info_t *obj);
  493. unsigned int snd_pcm_info_get_subdevice(const snd_pcm_info_t *obj);
  494. snd_pcm_stream_t snd_pcm_info_get_stream(const snd_pcm_info_t *obj);
  495. int snd_pcm_info_get_card(const snd_pcm_info_t *obj);
  496. const char *snd_pcm_info_get_id(const snd_pcm_info_t *obj);
  497. const char *snd_pcm_info_get_name(const snd_pcm_info_t *obj);
  498. const char *snd_pcm_info_get_subdevice_name(const snd_pcm_info_t *obj);
  499. snd_pcm_class_t snd_pcm_info_get_class(const snd_pcm_info_t *obj);
  500. snd_pcm_subclass_t snd_pcm_info_get_subclass(const snd_pcm_info_t *obj);
  501. unsigned int snd_pcm_info_get_subdevices_count(const snd_pcm_info_t *obj);
  502. unsigned int snd_pcm_info_get_subdevices_avail(const snd_pcm_info_t *obj);
  503. snd_pcm_sync_id_t snd_pcm_info_get_sync(const snd_pcm_info_t *obj);
  504. void snd_pcm_info_set_device(snd_pcm_info_t *obj, unsigned int val);
  505. void snd_pcm_info_set_subdevice(snd_pcm_info_t *obj, unsigned int val);
  506. void snd_pcm_info_set_stream(snd_pcm_info_t *obj, snd_pcm_stream_t val);
  507.  
  508. /** \} */
  509.  
  510. /**
  511.  * \defgroup PCM_HW_Params Hardware Parameters
  512.  * \ingroup PCM
  513.  * See the \ref pcm page for more details.
  514.  * \{
  515.  */
  516.  
  517. int snd_pcm_hw_params_any(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
  518.  
  519. int snd_pcm_hw_params_can_mmap_sample_resolution(const snd_pcm_hw_params_t *params);
  520. int snd_pcm_hw_params_is_double(const snd_pcm_hw_params_t *params);
  521. int snd_pcm_hw_params_is_batch(const snd_pcm_hw_params_t *params);
  522. int snd_pcm_hw_params_is_block_transfer(const snd_pcm_hw_params_t *params);
  523. int snd_pcm_hw_params_is_monotonic(const snd_pcm_hw_params_t *params);
  524. int snd_pcm_hw_params_can_overrange(const snd_pcm_hw_params_t *params);
  525. int snd_pcm_hw_params_can_forward(const snd_pcm_hw_params_t *params);
  526. int snd_pcm_hw_params_can_rewind(const snd_pcm_hw_params_t *params);
  527. int snd_pcm_hw_params_can_pause(const snd_pcm_hw_params_t *params);
  528. int snd_pcm_hw_params_can_resume(const snd_pcm_hw_params_t *params);
  529. int snd_pcm_hw_params_is_half_duplex(const snd_pcm_hw_params_t *params);
  530. int snd_pcm_hw_params_is_joint_duplex(const snd_pcm_hw_params_t *params);
  531. int snd_pcm_hw_params_can_sync_start(const snd_pcm_hw_params_t *params);
  532. int snd_pcm_hw_params_get_rate_numden(const snd_pcm_hw_params_t *params,
  533.                       unsigned int *rate_num,
  534.                       unsigned int *rate_den);
  535. int snd_pcm_hw_params_get_sbits(const snd_pcm_hw_params_t *params);
  536. int snd_pcm_hw_params_get_fifo_size(const snd_pcm_hw_params_t *params);
  537.  
  538. #if 0
  539. typedef struct _snd_pcm_hw_strategy snd_pcm_hw_strategy_t;
  540.  
  541. /* choices need to be sorted on ascending badness */
  542. typedef struct _snd_pcm_hw_strategy_simple_choices_list {
  543.     unsigned int value;
  544.     unsigned int badness;
  545. } snd_pcm_hw_strategy_simple_choices_list_t;
  546.  
  547. int snd_pcm_hw_params_strategy(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
  548.                    const snd_pcm_hw_strategy_t *strategy,
  549.                    unsigned int badness_min,
  550.                    unsigned int badness_max);
  551.  
  552. void snd_pcm_hw_strategy_free(snd_pcm_hw_strategy_t *strategy);
  553. int snd_pcm_hw_strategy_simple(snd_pcm_hw_strategy_t **strategyp,
  554.                    unsigned int badness_min,
  555.                    unsigned int badness_max);
  556. int snd_pcm_hw_params_try_explain_failure(snd_pcm_t *pcm,
  557.                       snd_pcm_hw_params_t *fail,
  558.                       snd_pcm_hw_params_t *success,
  559.                       unsigned int depth,
  560.                       snd_output_t *out);
  561.  
  562. #endif
  563.  
  564. size_t snd_pcm_hw_params_sizeof(void);
  565. /** \hideinitializer
  566.  * \brief allocate an invalid #snd_pcm_hw_params_t using standard alloca
  567.  * \param ptr returned pointer
  568.  */
  569. #define snd_pcm_hw_params_alloca(ptr) __snd_alloca(ptr, snd_pcm_hw_params)
  570. int snd_pcm_hw_params_malloc(snd_pcm_hw_params_t **ptr);
  571. void snd_pcm_hw_params_free(snd_pcm_hw_params_t *obj);
  572. void snd_pcm_hw_params_copy(snd_pcm_hw_params_t *dst, const snd_pcm_hw_params_t *src);
  573.  
  574. #if !defined(ALSA_LIBRARY_BUILD) && !defined(ALSA_PCM_OLD_HW_PARAMS_API)
  575.  
  576. int snd_pcm_hw_params_get_access(const snd_pcm_hw_params_t *params, snd_pcm_access_t *_access);
  577. int snd_pcm_hw_params_test_access(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t _access);
  578. int snd_pcm_hw_params_set_access(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t _access);
  579. int snd_pcm_hw_params_set_access_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t *_access);
  580. int snd_pcm_hw_params_set_access_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t *_access);
  581. int snd_pcm_hw_params_set_access_mask(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_mask_t *mask);
  582. int snd_pcm_hw_params_get_access_mask(snd_pcm_hw_params_t *params, snd_pcm_access_mask_t *mask);
  583.  
  584. int snd_pcm_hw_params_get_format(const snd_pcm_hw_params_t *params, snd_pcm_format_t *val);
  585. int snd_pcm_hw_params_test_format(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t val);
  586. int snd_pcm_hw_params_set_format(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t val);
  587. int snd_pcm_hw_params_set_format_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t *format);
  588. int snd_pcm_hw_params_set_format_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t *format);
  589. int snd_pcm_hw_params_set_format_mask(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_mask_t *mask);
  590. void snd_pcm_hw_params_get_format_mask(snd_pcm_hw_params_t *params, snd_pcm_format_mask_t *mask);
  591.  
  592. int snd_pcm_hw_params_get_subformat(const snd_pcm_hw_params_t *params, snd_pcm_subformat_t *subformat);
  593. int snd_pcm_hw_params_test_subformat(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_t subformat);
  594. int snd_pcm_hw_params_set_subformat(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_t subformat);
  595. int snd_pcm_hw_params_set_subformat_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_t *subformat);
  596. int snd_pcm_hw_params_set_subformat_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_t *subformat);
  597. int snd_pcm_hw_params_set_subformat_mask(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_mask_t *mask);
  598. void snd_pcm_hw_params_get_subformat_mask(snd_pcm_hw_params_t *params, snd_pcm_subformat_mask_t *mask);
  599.  
  600. int snd_pcm_hw_params_get_channels(const snd_pcm_hw_params_t *params, unsigned int *val);
  601. int snd_pcm_hw_params_get_channels_min(const snd_pcm_hw_params_t *params, unsigned int *val);
  602. int snd_pcm_hw_params_get_channels_max(const snd_pcm_hw_params_t *params, unsigned int *val);
  603. int snd_pcm_hw_params_test_channels(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
  604. int snd_pcm_hw_params_set_channels(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
  605. int snd_pcm_hw_params_set_channels_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
  606. int snd_pcm_hw_params_set_channels_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
  607. int snd_pcm_hw_params_set_channels_minmax(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *min, unsigned int *max);
  608. int snd_pcm_hw_params_set_channels_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
  609. int snd_pcm_hw_params_set_channels_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
  610. int snd_pcm_hw_params_set_channels_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
  611.  
  612. int snd_pcm_hw_params_get_rate(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
  613. int snd_pcm_hw_params_get_rate_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
  614. int snd_pcm_hw_params_get_rate_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
  615. int snd_pcm_hw_params_test_rate(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
  616. int snd_pcm_hw_params_set_rate(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
  617. int snd_pcm_hw_params_set_rate_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
  618. int snd_pcm_hw_params_set_rate_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
  619. int snd_pcm_hw_params_set_rate_minmax(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *min, int *mindir, unsigned int *max, int *maxdir);
  620. int snd_pcm_hw_params_set_rate_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
  621. int snd_pcm_hw_params_set_rate_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
  622. int snd_pcm_hw_params_set_rate_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
  623. int snd_pcm_hw_params_set_rate_resample(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
  624. int snd_pcm_hw_params_get_rate_resample(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
  625. int snd_pcm_hw_params_set_export_buffer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
  626. int snd_pcm_hw_params_get_export_buffer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
  627.  
  628. int snd_pcm_hw_params_get_period_time(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
  629. int snd_pcm_hw_params_get_period_time_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
  630. int snd_pcm_hw_params_get_period_time_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
  631. int snd_pcm_hw_params_test_period_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
  632. int snd_pcm_hw_params_set_period_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
  633. int snd_pcm_hw_params_set_period_time_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
  634. int snd_pcm_hw_params_set_period_time_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
  635. int snd_pcm_hw_params_set_period_time_minmax(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *min, int *mindir, unsigned int *max, int *maxdir);
  636. int snd_pcm_hw_params_set_period_time_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
  637. int snd_pcm_hw_params_set_period_time_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
  638. int snd_pcm_hw_params_set_period_time_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
  639.  
  640. int snd_pcm_hw_params_get_period_size(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *frames, int *dir);
  641. int snd_pcm_hw_params_get_period_size_min(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *frames, int *dir);
  642. int snd_pcm_hw_params_get_period_size_max(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *frames, int *dir);
  643. int snd_pcm_hw_params_test_period_size(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t val, int dir);
  644. int snd_pcm_hw_params_set_period_size(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t val, int dir);
  645. int snd_pcm_hw_params_set_period_size_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val, int *dir);
  646. int snd_pcm_hw_params_set_period_size_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val, int *dir);
  647. int snd_pcm_hw_params_set_period_size_minmax(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *min, int *mindir, snd_pcm_uframes_t *max, int *maxdir);
  648. int snd_pcm_hw_params_set_period_size_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val, int *dir);
  649. int snd_pcm_hw_params_set_period_size_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val, int *dir);
  650. int snd_pcm_hw_params_set_period_size_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val, int *dir);
  651. int snd_pcm_hw_params_set_period_size_integer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
  652.  
  653. int snd_pcm_hw_params_get_periods(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
  654. int snd_pcm_hw_params_get_periods_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
  655. int snd_pcm_hw_params_get_periods_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
  656. int snd_pcm_hw_params_test_periods(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
  657. int snd_pcm_hw_params_set_periods(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
  658. int snd_pcm_hw_params_set_periods_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
  659. int snd_pcm_hw_params_set_periods_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
  660. int snd_pcm_hw_params_set_periods_minmax(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *min, int *mindir, unsigned int *max, int *maxdir);
  661. int snd_pcm_hw_params_set_periods_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
  662. int snd_pcm_hw_params_set_periods_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
  663. int snd_pcm_hw_params_set_periods_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
  664. int snd_pcm_hw_params_set_periods_integer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
  665.  
  666. int snd_pcm_hw_params_get_buffer_time(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
  667. int snd_pcm_hw_params_get_buffer_time_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
  668. int snd_pcm_hw_params_get_buffer_time_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
  669. int snd_pcm_hw_params_test_buffer_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
  670. int snd_pcm_hw_params_set_buffer_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
  671. int snd_pcm_hw_params_set_buffer_time_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
  672. int snd_pcm_hw_params_set_buffer_time_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
  673. int snd_pcm_hw_params_set_buffer_time_minmax(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *min, int *mindir, unsigned int *max, int *maxdir);
  674. int snd_pcm_hw_params_set_buffer_time_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
  675. int snd_pcm_hw_params_set_buffer_time_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
  676. int snd_pcm_hw_params_set_buffer_time_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
  677.  
  678. int snd_pcm_hw_params_get_buffer_size(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
  679. int snd_pcm_hw_params_get_buffer_size_min(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
  680. int snd_pcm_hw_params_get_buffer_size_max(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
  681. int snd_pcm_hw_params_test_buffer_size(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t val);
  682. int snd_pcm_hw_params_set_buffer_size(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t val);
  683. int snd_pcm_hw_params_set_buffer_size_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
  684. int snd_pcm_hw_params_set_buffer_size_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
  685. int snd_pcm_hw_params_set_buffer_size_minmax(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *min, snd_pcm_uframes_t *max);
  686. int snd_pcm_hw_params_set_buffer_size_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
  687. int snd_pcm_hw_params_set_buffer_size_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
  688. int snd_pcm_hw_params_set_buffer_size_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
  689.  
  690. #endif /* !ALSA_LIBRARY_BUILD && !ALSA_PCM_OLD_HW_PARAMS_API */
  691.  
  692. int snd_pcm_hw_params_get_min_align(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
  693.  
  694. /** \} */
  695.  
  696. /**
  697.  * \defgroup PCM_SW_Params Software Parameters
  698.  * \ingroup PCM
  699.  * See the \ref pcm page for more details.
  700.  * \{
  701.  */
  702.  
  703. size_t snd_pcm_sw_params_sizeof(void);
  704. /** \hideinitializer
  705.  * \brief allocate an invalid #snd_pcm_sw_params_t using standard alloca
  706.  * \param ptr returned pointer
  707.  */
  708. #define snd_pcm_sw_params_alloca(ptr) __snd_alloca(ptr, snd_pcm_sw_params)
  709. int snd_pcm_sw_params_malloc(snd_pcm_sw_params_t **ptr);
  710. void snd_pcm_sw_params_free(snd_pcm_sw_params_t *obj);
  711. void snd_pcm_sw_params_copy(snd_pcm_sw_params_t *dst, const snd_pcm_sw_params_t *src);
  712. int snd_pcm_sw_params_get_boundary(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val);
  713.  
  714. #if !defined(ALSA_LIBRARY_BUILD) && !defined(ALSA_PCM_OLD_SW_PARAMS_API)
  715.  
  716. int snd_pcm_sw_params_set_tstamp_mode(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_tstamp_t val);
  717. int snd_pcm_sw_params_get_tstamp_mode(const snd_pcm_sw_params_t *params, snd_pcm_tstamp_t *val);
  718. int snd_pcm_sw_params_set_avail_min(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
  719. int snd_pcm_sw_params_get_avail_min(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val);
  720. int snd_pcm_sw_params_set_period_event(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, int val);
  721. int snd_pcm_sw_params_get_period_event(const snd_pcm_sw_params_t *params, int *val);
  722. int snd_pcm_sw_params_set_start_threshold(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
  723. int snd_pcm_sw_params_get_start_threshold(const snd_pcm_sw_params_t *paramsm, snd_pcm_uframes_t *val);
  724. int snd_pcm_sw_params_set_stop_threshold(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
  725. int snd_pcm_sw_params_get_stop_threshold(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val);
  726. int snd_pcm_sw_params_set_silence_threshold(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
  727. int snd_pcm_sw_params_get_silence_threshold(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val);
  728. int snd_pcm_sw_params_set_silence_size(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
  729. int snd_pcm_sw_params_get_silence_size(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val);
  730.  
  731. #endif /* !ALSA_LIBRARY_BUILD && !ALSA_PCM_OLD_SW_PARAMS_API */
  732.  
  733. /** \} */
  734.  
  735. /* include old API */
  736. #ifndef ALSA_LIBRARY_BUILD
  737. #if defined(ALSA_PCM_OLD_HW_PARAMS_API) || defined(ALSA_PCM_OLD_SW_PARAMS_API)
  738. #include "pcm_old.h"
  739. #endif
  740. #endif
  741.  
  742. /**
  743.  * \defgroup PCM_Access Access Mask Functions
  744.  * \ingroup PCM
  745.  * See the \ref pcm page for more details.
  746.  * \{
  747.  */
  748.  
  749. size_t snd_pcm_access_mask_sizeof(void);
  750. /** \hideinitializer
  751.  * \brief allocate an empty #snd_pcm_access_mask_t using standard alloca
  752.  * \param ptr returned pointer
  753.  */
  754. #define snd_pcm_access_mask_alloca(ptr) __snd_alloca(ptr, snd_pcm_access_mask)
  755. int snd_pcm_access_mask_malloc(snd_pcm_access_mask_t **ptr);
  756. void snd_pcm_access_mask_free(snd_pcm_access_mask_t *obj);
  757. void snd_pcm_access_mask_copy(snd_pcm_access_mask_t *dst, const snd_pcm_access_mask_t *src);
  758. void snd_pcm_access_mask_none(snd_pcm_access_mask_t *mask);
  759. void snd_pcm_access_mask_any(snd_pcm_access_mask_t *mask);
  760. int snd_pcm_access_mask_test(const snd_pcm_access_mask_t *mask, snd_pcm_access_t val);
  761. int snd_pcm_access_mask_empty(const snd_pcm_access_mask_t *mask);
  762. void snd_pcm_access_mask_set(snd_pcm_access_mask_t *mask, snd_pcm_access_t val);
  763. void snd_pcm_access_mask_reset(snd_pcm_access_mask_t *mask, snd_pcm_access_t val);
  764.  
  765. /** \} */
  766.  
  767. /**
  768.  * \defgroup PCM_Format Format Mask Functions
  769.  * \ingroup PCM
  770.  * See the \ref pcm page for more details.
  771.  * \{
  772.  */
  773.  
  774. size_t snd_pcm_format_mask_sizeof(void);
  775. /** \hideinitializer
  776.  * \brief allocate an empty #snd_pcm_format_mask_t using standard alloca
  777.  * \param ptr returned pointer
  778.  */
  779. #define snd_pcm_format_mask_alloca(ptr) __snd_alloca(ptr, snd_pcm_format_mask)
  780. int snd_pcm_format_mask_malloc(snd_pcm_format_mask_t **ptr);
  781. void snd_pcm_format_mask_free(snd_pcm_format_mask_t *obj);
  782. void snd_pcm_format_mask_copy(snd_pcm_format_mask_t *dst, const snd_pcm_format_mask_t *src);
  783. void snd_pcm_format_mask_none(snd_pcm_format_mask_t *mask);
  784. void snd_pcm_format_mask_any(snd_pcm_format_mask_t *mask);
  785. int snd_pcm_format_mask_test(const snd_pcm_format_mask_t *mask, snd_pcm_format_t val);
  786. int snd_pcm_format_mask_empty(const snd_pcm_format_mask_t *mask);
  787. void snd_pcm_format_mask_set(snd_pcm_format_mask_t *mask, snd_pcm_format_t val);
  788. void snd_pcm_format_mask_reset(snd_pcm_format_mask_t *mask, snd_pcm_format_t val);
  789.  
  790. /** \} */
  791.  
  792. /**
  793.  * \defgroup PCM_SubFormat Subformat Mask Functions
  794.  * \ingroup PCM
  795.  * See the \ref pcm page for more details.
  796.  * \{
  797.  */
  798.  
  799. size_t snd_pcm_subformat_mask_sizeof(void);
  800. /** \hideinitializer
  801.  * \brief allocate an empty #snd_pcm_subformat_mask_t using standard alloca
  802.  * \param ptr returned pointer
  803.  */
  804. #define snd_pcm_subformat_mask_alloca(ptr) __snd_alloca(ptr, snd_pcm_subformat_mask)
  805. int snd_pcm_subformat_mask_malloc(snd_pcm_subformat_mask_t **ptr);
  806. void snd_pcm_subformat_mask_free(snd_pcm_subformat_mask_t *obj);
  807. void snd_pcm_subformat_mask_copy(snd_pcm_subformat_mask_t *dst, const snd_pcm_subformat_mask_t *src);
  808. void snd_pcm_subformat_mask_none(snd_pcm_subformat_mask_t *mask);
  809. void snd_pcm_subformat_mask_any(snd_pcm_subformat_mask_t *mask);
  810. int snd_pcm_subformat_mask_test(const snd_pcm_subformat_mask_t *mask, snd_pcm_subformat_t val);
  811. int snd_pcm_subformat_mask_empty(const snd_pcm_subformat_mask_t *mask);
  812. void snd_pcm_subformat_mask_set(snd_pcm_subformat_mask_t *mask, snd_pcm_subformat_t val);
  813. void snd_pcm_subformat_mask_reset(snd_pcm_subformat_mask_t *mask, snd_pcm_subformat_t val);
  814.  
  815. /** \} */
  816.  
  817. /**
  818.  * \defgroup PCM_Status Status Functions
  819.  * \ingroup PCM
  820.  * See the \ref pcm page for more details.
  821.  * \{
  822.  */
  823.  
  824. size_t snd_pcm_status_sizeof(void);
  825. /** \hideinitializer
  826.  * \brief allocate an invalid #snd_pcm_status_t using standard alloca
  827.  * \param ptr returned pointer
  828.  */
  829. #define snd_pcm_status_alloca(ptr) __snd_alloca(ptr, snd_pcm_status)
  830. int snd_pcm_status_malloc(snd_pcm_status_t **ptr);
  831. void snd_pcm_status_free(snd_pcm_status_t *obj);
  832. void snd_pcm_status_copy(snd_pcm_status_t *dst, const snd_pcm_status_t *src);
  833. snd_pcm_state_t snd_pcm_status_get_state(const snd_pcm_status_t *obj);
  834. void snd_pcm_status_get_trigger_tstamp(const snd_pcm_status_t *obj, snd_timestamp_t *ptr);
  835. void snd_pcm_status_get_trigger_htstamp(const snd_pcm_status_t *obj, snd_htimestamp_t *ptr);
  836. void snd_pcm_status_get_tstamp(const snd_pcm_status_t *obj, snd_timestamp_t *ptr);
  837. void snd_pcm_status_get_htstamp(const snd_pcm_status_t *obj, snd_htimestamp_t *ptr);
  838. snd_pcm_sframes_t snd_pcm_status_get_delay(const snd_pcm_status_t *obj);
  839. snd_pcm_uframes_t snd_pcm_status_get_avail(const snd_pcm_status_t *obj);
  840. snd_pcm_uframes_t snd_pcm_status_get_avail_max(const snd_pcm_status_t *obj);
  841. snd_pcm_uframes_t snd_pcm_status_get_overrange(const snd_pcm_status_t *obj);
  842.  
  843. /** \} */
  844.  
  845. /**
  846.  * \defgroup PCM_Description Description Functions
  847.  * \ingroup PCM
  848.  * See the \ref pcm page for more details.
  849.  * \{
  850.  */
  851.  
  852. const char *snd_pcm_type_name(snd_pcm_type_t type);
  853. const char *snd_pcm_stream_name(const snd_pcm_stream_t stream);
  854. const char *snd_pcm_access_name(const snd_pcm_access_t _access);
  855. const char *snd_pcm_format_name(const snd_pcm_format_t format);
  856. const char *snd_pcm_format_description(const snd_pcm_format_t format);
  857. const char *snd_pcm_subformat_name(const snd_pcm_subformat_t subformat);
  858. const char *snd_pcm_subformat_description(const snd_pcm_subformat_t subformat);
  859. snd_pcm_format_t snd_pcm_format_value(const char* name);
  860. const char *snd_pcm_tstamp_mode_name(const snd_pcm_tstamp_t mode);
  861. const char *snd_pcm_state_name(const snd_pcm_state_t state);
  862.  
  863. /** \} */
  864.  
  865. /**
  866.  * \defgroup PCM_Dump Debug Functions
  867.  * \ingroup PCM
  868.  * See the \ref pcm page for more details.
  869.  * \{
  870.  */
  871.  
  872. int snd_pcm_dump(snd_pcm_t *pcm, snd_output_t *out);
  873. int snd_pcm_dump_hw_setup(snd_pcm_t *pcm, snd_output_t *out);
  874. int snd_pcm_dump_sw_setup(snd_pcm_t *pcm, snd_output_t *out);
  875. int snd_pcm_dump_setup(snd_pcm_t *pcm, snd_output_t *out);
  876. int snd_pcm_hw_params_dump(snd_pcm_hw_params_t *params, snd_output_t *out);
  877. int snd_pcm_sw_params_dump(snd_pcm_sw_params_t *params, snd_output_t *out);
  878. int snd_pcm_status_dump(snd_pcm_status_t *status, snd_output_t *out);
  879.  
  880. /** \} */
  881.  
  882. /**
  883.  * \defgroup PCM_Direct Direct Access (MMAP) Functions
  884.  * \ingroup PCM
  885.  * See the \ref pcm page for more details.
  886.  * \{
  887.  */
  888.  
  889. int snd_pcm_mmap_begin(snd_pcm_t *pcm,
  890.                const snd_pcm_channel_area_t **areas,
  891.                snd_pcm_uframes_t *offset,
  892.                snd_pcm_uframes_t *frames);
  893. snd_pcm_sframes_t snd_pcm_mmap_commit(snd_pcm_t *pcm,
  894.                       snd_pcm_uframes_t offset,
  895.                       snd_pcm_uframes_t frames);
  896. snd_pcm_sframes_t snd_pcm_mmap_writei(snd_pcm_t *pcm, const void *buffer, snd_pcm_uframes_t size);
  897. snd_pcm_sframes_t snd_pcm_mmap_readi(snd_pcm_t *pcm, void *buffer, snd_pcm_uframes_t size);
  898. snd_pcm_sframes_t snd_pcm_mmap_writen(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size);
  899. snd_pcm_sframes_t snd_pcm_mmap_readn(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size);                                                                
  900.  
  901. /** \} */
  902.  
  903. /**
  904.  * \defgroup PCM_Helpers Helper Functions
  905.  * \ingroup PCM
  906.  * See the \ref pcm page for more details.
  907.  * \{
  908.  */
  909.  
  910. int snd_pcm_format_signed(snd_pcm_format_t format);
  911. int snd_pcm_format_unsigned(snd_pcm_format_t format);
  912. int snd_pcm_format_linear(snd_pcm_format_t format);
  913. int snd_pcm_format_float(snd_pcm_format_t format);
  914. int snd_pcm_format_little_endian(snd_pcm_format_t format);
  915. int snd_pcm_format_big_endian(snd_pcm_format_t format);
  916. int snd_pcm_format_cpu_endian(snd_pcm_format_t format);
  917. int snd_pcm_format_width(snd_pcm_format_t format);            /* in bits */
  918. int snd_pcm_format_physical_width(snd_pcm_format_t format);        /* in bits */
  919. snd_pcm_format_t snd_pcm_build_linear_format(int width, int pwidth, int unsignd, int big_endian);
  920. ssize_t snd_pcm_format_size(snd_pcm_format_t format, size_t samples);
  921. u_int8_t snd_pcm_format_silence(snd_pcm_format_t format);
  922. u_int16_t snd_pcm_format_silence_16(snd_pcm_format_t format);
  923. u_int32_t snd_pcm_format_silence_32(snd_pcm_format_t format);
  924. u_int64_t snd_pcm_format_silence_64(snd_pcm_format_t format);
  925. int snd_pcm_format_set_silence(snd_pcm_format_t format, void *buf, unsigned int samples);
  926.  
  927. snd_pcm_sframes_t snd_pcm_bytes_to_frames(snd_pcm_t *pcm, ssize_t bytes);
  928. ssize_t snd_pcm_frames_to_bytes(snd_pcm_t *pcm, snd_pcm_sframes_t frames);
  929. long snd_pcm_bytes_to_samples(snd_pcm_t *pcm, ssize_t bytes);
  930. ssize_t snd_pcm_samples_to_bytes(snd_pcm_t *pcm, long samples);
  931.  
  932. int snd_pcm_area_silence(const snd_pcm_channel_area_t *dst_channel, snd_pcm_uframes_t dst_offset,
  933.              unsigned int samples, snd_pcm_format_t format);
  934. int snd_pcm_areas_silence(const snd_pcm_channel_area_t *dst_channels, snd_pcm_uframes_t dst_offset,
  935.               unsigned int channels, snd_pcm_uframes_t frames, snd_pcm_format_t format);
  936. int snd_pcm_area_copy(const snd_pcm_channel_area_t *dst_channel, snd_pcm_uframes_t dst_offset,
  937.               const snd_pcm_channel_area_t *src_channel, snd_pcm_uframes_t src_offset,
  938.               unsigned int samples, snd_pcm_format_t format);
  939. int snd_pcm_areas_copy(const snd_pcm_channel_area_t *dst_channels, snd_pcm_uframes_t dst_offset,
  940.                const snd_pcm_channel_area_t *src_channels, snd_pcm_uframes_t src_offset,
  941.                unsigned int channels, snd_pcm_uframes_t frames, snd_pcm_format_t format);
  942.  
  943. /** \} */
  944.  
  945. /**
  946.  * \defgroup PCM_Hook Hook Extension
  947.  * \ingroup PCM
  948.  * See the \ref pcm page for more details.
  949.  * \{
  950.  */
  951.  
  952. /** type of pcm hook */
  953. typedef enum _snd_pcm_hook_type {
  954.     SND_PCM_HOOK_TYPE_HW_PARAMS = 0,
  955.     SND_PCM_HOOK_TYPE_HW_FREE,
  956.     SND_PCM_HOOK_TYPE_CLOSE,
  957.     SND_PCM_HOOK_TYPE_LAST = SND_PCM_HOOK_TYPE_CLOSE
  958. } snd_pcm_hook_type_t;
  959.  
  960. /** PCM hook container */
  961. typedef struct _snd_pcm_hook snd_pcm_hook_t;
  962. /** PCM hook callback function */
  963. typedef int (*snd_pcm_hook_func_t)(snd_pcm_hook_t *hook);
  964. snd_pcm_t *snd_pcm_hook_get_pcm(snd_pcm_hook_t *hook);
  965. void *snd_pcm_hook_get_private(snd_pcm_hook_t *hook);
  966. void snd_pcm_hook_set_private(snd_pcm_hook_t *hook, void *private_data);
  967. int snd_pcm_hook_add(snd_pcm_hook_t **hookp, snd_pcm_t *pcm,
  968.              snd_pcm_hook_type_t type,
  969.              snd_pcm_hook_func_t func, void *private_data);
  970. int snd_pcm_hook_remove(snd_pcm_hook_t *hook);
  971.  
  972. /** \} */
  973.  
  974. /**
  975.  * \defgroup PCM_Scope Scope Plugin Extension
  976.  * \ingroup PCM
  977.  * See the \ref pcm page for more details.
  978.  * \{
  979.  */
  980.  
  981. /** #SND_PCM_TYPE_METER scope functions */
  982. typedef struct _snd_pcm_scope_ops {
  983.     /** \brief Enable and prepare it using current params
  984.      * \param scope scope handle
  985.      */
  986.     int (*enable)(snd_pcm_scope_t *scope);
  987.     /** \brief Disable
  988.      * \param scope scope handle
  989.      */
  990.     void (*disable)(snd_pcm_scope_t *scope);
  991.     /** \brief PCM has been started
  992.      * \param scope scope handle
  993.      */
  994.     void (*start)(snd_pcm_scope_t *scope);
  995.     /** \brief PCM has been stopped
  996.      * \param scope scope handle
  997.      */
  998.     void (*stop)(snd_pcm_scope_t *scope);
  999.     /** \brief New frames are present
  1000.      * \param scope scope handle
  1001.      */
  1002.     void (*update)(snd_pcm_scope_t *scope);
  1003.     /** \brief Reset status
  1004.      * \param scope scope handle
  1005.      */
  1006.     void (*reset)(snd_pcm_scope_t *scope);
  1007.     /** \brief PCM is closing
  1008.      * \param scope scope handle
  1009.      */
  1010.     void (*close)(snd_pcm_scope_t *scope);
  1011. } snd_pcm_scope_ops_t;
  1012.  
  1013. snd_pcm_uframes_t snd_pcm_meter_get_bufsize(snd_pcm_t *pcm);
  1014. unsigned int snd_pcm_meter_get_channels(snd_pcm_t *pcm);
  1015. unsigned int snd_pcm_meter_get_rate(snd_pcm_t *pcm);
  1016. snd_pcm_uframes_t snd_pcm_meter_get_now(snd_pcm_t *pcm);
  1017. snd_pcm_uframes_t snd_pcm_meter_get_boundary(snd_pcm_t *pcm);
  1018. int snd_pcm_meter_add_scope(snd_pcm_t *pcm, snd_pcm_scope_t *scope);
  1019. snd_pcm_scope_t *snd_pcm_meter_search_scope(snd_pcm_t *pcm, const char *name);
  1020. int snd_pcm_scope_malloc(snd_pcm_scope_t **ptr);
  1021. void snd_pcm_scope_set_ops(snd_pcm_scope_t *scope, snd_pcm_scope_ops_t *val);
  1022. void snd_pcm_scope_set_name(snd_pcm_scope_t *scope, const char *val);
  1023. const char *snd_pcm_scope_get_name(snd_pcm_scope_t *scope);
  1024. void *snd_pcm_scope_get_callback_private(snd_pcm_scope_t *scope);
  1025. void snd_pcm_scope_set_callback_private(snd_pcm_scope_t *scope, void *val);
  1026. int snd_pcm_scope_s16_open(snd_pcm_t *pcm, const char *name,
  1027.                snd_pcm_scope_t **scopep);
  1028. int16_t *snd_pcm_scope_s16_get_channel_buffer(snd_pcm_scope_t *scope,
  1029.                           unsigned int channel);
  1030.  
  1031. /** \} */
  1032.  
  1033. /**
  1034.  * \defgroup PCM_Simple Simple setup functions
  1035.  * \ingroup PCM
  1036.  * See the \ref pcm page for more details.
  1037.  * \{
  1038.  */
  1039.  
  1040. /** Simple PCM latency type */
  1041. typedef enum _snd_spcm_latency {
  1042.     /** standard latency - for standard playback or capture
  1043.             (estimated latency in one direction 350ms) */
  1044.     SND_SPCM_LATENCY_STANDARD = 0,
  1045.     /** medium latency - software phones etc.
  1046.         (estimated latency in one direction maximally 25ms */
  1047.     SND_SPCM_LATENCY_MEDIUM,
  1048.     /** realtime latency - realtime applications (effect processors etc.)
  1049.         (estimated latency in one direction 5ms and better) */
  1050.     SND_SPCM_LATENCY_REALTIME
  1051. } snd_spcm_latency_t;
  1052.  
  1053. /** Simple PCM xrun type */
  1054. typedef enum _snd_spcm_xrun_type {
  1055.     /** driver / library will ignore all xruns, the stream runs forever */
  1056.     SND_SPCM_XRUN_IGNORE = 0,
  1057.     /** driver / library stops the stream when an xrun occurs */
  1058.     SND_SPCM_XRUN_STOP
  1059. } snd_spcm_xrun_type_t;
  1060.  
  1061. /** Simple PCM duplex type */
  1062. typedef enum _snd_spcm_duplex_type {
  1063.     /** liberal duplex - the buffer and period sizes might not match */
  1064.     SND_SPCM_DUPLEX_LIBERAL = 0,
  1065.     /** pedantic duplex - the buffer and period sizes MUST match */
  1066.     SND_SPCM_DUPLEX_PEDANTIC
  1067. } snd_spcm_duplex_type_t;
  1068.  
  1069. int snd_spcm_init(snd_pcm_t *pcm,
  1070.           unsigned int rate,
  1071.           unsigned int channels,
  1072.           snd_pcm_format_t format,
  1073.           snd_pcm_subformat_t subformat,
  1074.           snd_spcm_latency_t latency,
  1075.           snd_pcm_access_t _access,
  1076.           snd_spcm_xrun_type_t xrun_type);
  1077.  
  1078. int snd_spcm_init_duplex(snd_pcm_t *playback_pcm,
  1079.              snd_pcm_t *capture_pcm,
  1080.              unsigned int rate,
  1081.              unsigned int channels,
  1082.              snd_pcm_format_t format,
  1083.              snd_pcm_subformat_t subformat,
  1084.              snd_spcm_latency_t latency,
  1085.              snd_pcm_access_t _access,
  1086.              snd_spcm_xrun_type_t xrun_type,
  1087.              snd_spcm_duplex_type_t duplex_type);
  1088.  
  1089. int snd_spcm_init_get_params(snd_pcm_t *pcm,
  1090.                  unsigned int *rate,
  1091.                  snd_pcm_uframes_t *buffer_size,
  1092.                  snd_pcm_uframes_t *period_size);
  1093.  
  1094. /** \} */
  1095.  
  1096. /**
  1097.  * \defgroup PCM_Deprecated Deprecated Functions
  1098.  * \ingroup PCM
  1099.  * See the \ref pcm page for more details.
  1100.  * \{
  1101.  */
  1102.  
  1103. /* Deprecated functions, for compatibility */
  1104. const char *snd_pcm_start_mode_name(snd_pcm_start_t mode) __attribute__((deprecated));
  1105. const char *snd_pcm_xrun_mode_name(snd_pcm_xrun_t mode) __attribute__((deprecated));
  1106. int snd_pcm_sw_params_set_start_mode(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_start_t val) __attribute__((deprecated));
  1107. snd_pcm_start_t snd_pcm_sw_params_get_start_mode(const snd_pcm_sw_params_t *params) __attribute__((deprecated));
  1108. int snd_pcm_sw_params_set_xrun_mode(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_xrun_t val) __attribute__((deprecated));
  1109. snd_pcm_xrun_t snd_pcm_sw_params_get_xrun_mode(const snd_pcm_sw_params_t *params) __attribute__((deprecated));
  1110. #if !defined(ALSA_LIBRARY_BUILD) && !defined(ALSA_PCM_OLD_SW_PARAMS_API)
  1111. int snd_pcm_sw_params_set_xfer_align(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val) __attribute__((deprecated));
  1112. int snd_pcm_sw_params_get_xfer_align(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val) __attribute__((deprecated));
  1113. int snd_pcm_sw_params_set_sleep_min(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, unsigned int val) __attribute__((deprecated));
  1114. int snd_pcm_sw_params_get_sleep_min(const snd_pcm_sw_params_t *params, unsigned int *val) __attribute__((deprecated));
  1115. #endif /* !ALSA_LIBRARY_BUILD && !ALSA_PCM_OLD_SW_PARAMS_API */
  1116. #if !defined(ALSA_LIBRARY_BUILD) && !defined(ALSA_PCM_OLD_HW_PARAMS_API)
  1117. int snd_pcm_hw_params_get_tick_time(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir) __attribute__((deprecated));
  1118. int snd_pcm_hw_params_get_tick_time_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir) __attribute__((deprecated));
  1119. int snd_pcm_hw_params_get_tick_time_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir) __attribute__((deprecated));
  1120. int snd_pcm_hw_params_test_tick_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir) __attribute__((deprecated));
  1121. int snd_pcm_hw_params_set_tick_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir) __attribute__((deprecated));
  1122. int snd_pcm_hw_params_set_tick_time_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir) __attribute__((deprecated));
  1123. int snd_pcm_hw_params_set_tick_time_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir) __attribute__((deprecated));
  1124. int snd_pcm_hw_params_set_tick_time_minmax(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *min, int *mindir, unsigned int *max, int *maxdir) __attribute__((deprecated));
  1125. int snd_pcm_hw_params_set_tick_time_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir) __attribute__((deprecated));
  1126. int snd_pcm_hw_params_set_tick_time_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir) __attribute__((deprecated));
  1127. int snd_pcm_hw_params_set_tick_time_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir) __attribute__((deprecated));
  1128. #endif /* !ALSA_LIBRARY_BUILD && !ALSA_PCM_OLD_HW_PARAMS_API */
  1129.  
  1130. /** \} */
  1131.  
  1132. #ifdef __cplusplus
  1133. }
  1134. #endif
  1135.  
  1136. #endif /* __ALSA_PCM_H */
  1137.