ALSA project - the C library reference
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
pcm.h
Go to the documentation of this file.
1 
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 
43 #define SND_PCM_DLSYM_VERSION _dlsym_pcm_001
44 
46 typedef struct _snd_pcm_info snd_pcm_info_t;
47 
62 typedef struct _snd_pcm_hw_params snd_pcm_hw_params_t;
63 
65 typedef struct _snd_pcm_sw_params snd_pcm_sw_params_t;
67  typedef struct _snd_pcm_status snd_pcm_status_t;
69 typedef struct _snd_pcm_access_mask snd_pcm_access_mask_t;
71 typedef struct _snd_pcm_format_mask snd_pcm_format_mask_t;
73 typedef struct _snd_pcm_subformat_mask snd_pcm_subformat_mask_t;
74 
76 typedef enum _snd_pcm_class {
86  SND_PCM_CLASS_LAST = SND_PCM_CLASS_DIGITIZER
88 
90 typedef enum _snd_pcm_subclass {
95  SND_PCM_SUBCLASS_LAST = SND_PCM_SUBCLASS_MULTI_MIX
97 
99 typedef enum _snd_pcm_stream {
104  SND_PCM_STREAM_LAST = SND_PCM_STREAM_CAPTURE
106 
108 typedef enum _snd_pcm_access {
119  SND_PCM_ACCESS_LAST = SND_PCM_ACCESS_RW_NONINTERLEAVED
121 
123 typedef enum _snd_pcm_format {
202  /* G.723 (ADPCM) 24 kbit/s, 8 samples in 3 bytes */
203  SND_PCM_FORMAT_G723_24,
204  /* G.723 (ADPCM) 24 kbit/s, 1 sample in 1 byte */
205  SND_PCM_FORMAT_G723_24_1B,
206  /* G.723 (ADPCM) 40 kbit/s, 8 samples in 3 bytes */
207  SND_PCM_FORMAT_G723_40,
208  /* G.723 (ADPCM) 40 kbit/s, 1 sample in 1 byte */
209  SND_PCM_FORMAT_G723_40_1B,
210  /* Direct Stream Digital (DSD) in 1-byte samples (x8) */
211  SND_PCM_FORMAT_DSD_U8,
212  /* Direct Stream Digital (DSD) in 2-byte samples (x16) */
213  SND_PCM_FORMAT_DSD_U16_LE,
214  /* Direct Stream Digital (DSD) in 4-byte samples (x32) */
215  SND_PCM_FORMAT_DSD_U32_LE,
216  /* Direct Stream Digital (DSD) in 2-byte samples (x16) */
217  SND_PCM_FORMAT_DSD_U16_BE,
218  /* Direct Stream Digital (DSD) in 4-byte samples (x32) */
219  SND_PCM_FORMAT_DSD_U32_BE,
220  SND_PCM_FORMAT_LAST = SND_PCM_FORMAT_DSD_U32_BE,
221 
222 #if __BYTE_ORDER == __LITTLE_ENDIAN
223 
241 #elif __BYTE_ORDER == __BIG_ENDIAN
242 
260 #else
261 #error "Unknown endian"
262 #endif
264 
266 typedef enum _snd_pcm_subformat {
269  SND_PCM_SUBFORMAT_LAST = SND_PCM_SUBFORMAT_STD
271 
273 typedef enum _snd_pcm_state {
292  SND_PCM_STATE_LAST = SND_PCM_STATE_DISCONNECTED
294 
296 typedef enum _snd_pcm_start {
301  SND_PCM_START_LAST = SND_PCM_START_EXPLICIT
303 
305 typedef enum _snd_pcm_xrun {
310  SND_PCM_XRUN_LAST = SND_PCM_XRUN_STOP
312 
314 typedef enum _snd_pcm_tstamp {
323  SND_PCM_TSTAMP_LAST = SND_PCM_TSTAMP_ENABLE
325 
326 typedef enum _snd_pcm_tstamp_type {
327  SND_PCM_TSTAMP_TYPE_GETTIMEOFDAY = 0,
332 
334 typedef unsigned long snd_pcm_uframes_t;
336 typedef long snd_pcm_sframes_t;
337 
339 #define SND_PCM_NONBLOCK 0x00000001
340 
341 #define SND_PCM_ASYNC 0x00000002
342 
343 #define SND_PCM_ABORT 0x00008000
344 
345 #define SND_PCM_NO_AUTO_RESAMPLE 0x00010000
346 
347 #define SND_PCM_NO_AUTO_CHANNELS 0x00020000
348 
349 #define SND_PCM_NO_AUTO_FORMAT 0x00040000
350 
351 #define SND_PCM_NO_SOFTVOL 0x00080000
352 
354 typedef struct _snd_pcm snd_pcm_t;
355 
421  SND_PCM_TYPE_LAST = SND_PCM_TYPE_MMAP_EMUL
422 };
423 
426 
428 typedef struct _snd_pcm_channel_area {
430  void *addr;
432  unsigned int first;
434  unsigned int step;
436 
438 typedef union _snd_pcm_sync_id {
440  unsigned char id[16];
442  unsigned short id16[8];
444  unsigned int id32[4];
446 
448 typedef struct _snd_pcm_scope snd_pcm_scope_t;
449 
450 int snd_pcm_open(snd_pcm_t **pcm, const char *name,
451  snd_pcm_stream_t stream, int mode);
452 int snd_pcm_open_lconf(snd_pcm_t **pcm, const char *name,
453  snd_pcm_stream_t stream, int mode,
454  snd_config_t *lconf);
456  const char *name, const char *orig_name,
457  snd_pcm_stream_t stream, int mode);
458 
459 int snd_pcm_close(snd_pcm_t *pcm);
460 const char *snd_pcm_name(snd_pcm_t *pcm);
461 snd_pcm_type_t snd_pcm_type(snd_pcm_t *pcm);
464 int snd_pcm_poll_descriptors(snd_pcm_t *pcm, struct pollfd *pfds, unsigned int space);
465 int snd_pcm_poll_descriptors_revents(snd_pcm_t *pcm, struct pollfd *pfds, unsigned int nfds, unsigned short *revents);
466 int snd_pcm_nonblock(snd_pcm_t *pcm, int nonblock);
467 static __inline__ int snd_pcm_abort(snd_pcm_t *pcm) { return snd_pcm_nonblock(pcm, 2); }
469  snd_async_callback_t callback, void *private_data);
471 int snd_pcm_info(snd_pcm_t *pcm, snd_pcm_info_t *info);
474 int snd_pcm_hw_free(snd_pcm_t *pcm);
477 int snd_pcm_prepare(snd_pcm_t *pcm);
478 int snd_pcm_reset(snd_pcm_t *pcm);
479 int snd_pcm_status(snd_pcm_t *pcm, snd_pcm_status_t *status);
480 int snd_pcm_start(snd_pcm_t *pcm);
481 int snd_pcm_drop(snd_pcm_t *pcm);
482 int snd_pcm_drain(snd_pcm_t *pcm);
483 int snd_pcm_pause(snd_pcm_t *pcm, int enable);
485 int snd_pcm_hwsync(snd_pcm_t *pcm);
486 int snd_pcm_delay(snd_pcm_t *pcm, snd_pcm_sframes_t *delayp);
487 int snd_pcm_resume(snd_pcm_t *pcm);
488 int snd_pcm_htimestamp(snd_pcm_t *pcm, snd_pcm_uframes_t *avail, snd_htimestamp_t *tstamp);
489 snd_pcm_sframes_t snd_pcm_avail(snd_pcm_t *pcm);
490 snd_pcm_sframes_t snd_pcm_avail_update(snd_pcm_t *pcm);
491 int snd_pcm_avail_delay(snd_pcm_t *pcm, snd_pcm_sframes_t *availp, snd_pcm_sframes_t *delayp);
492 snd_pcm_sframes_t snd_pcm_rewindable(snd_pcm_t *pcm);
493 snd_pcm_sframes_t snd_pcm_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t frames);
494 snd_pcm_sframes_t snd_pcm_forwardable(snd_pcm_t *pcm);
495 snd_pcm_sframes_t snd_pcm_forward(snd_pcm_t *pcm, snd_pcm_uframes_t frames);
496 snd_pcm_sframes_t snd_pcm_writei(snd_pcm_t *pcm, const void *buffer, snd_pcm_uframes_t size);
497 snd_pcm_sframes_t snd_pcm_readi(snd_pcm_t *pcm, void *buffer, snd_pcm_uframes_t size);
498 snd_pcm_sframes_t snd_pcm_writen(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size);
499 snd_pcm_sframes_t snd_pcm_readn(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size);
500 int snd_pcm_wait(snd_pcm_t *pcm, int timeout);
501 
502 int snd_pcm_link(snd_pcm_t *pcm1, snd_pcm_t *pcm2);
503 int snd_pcm_unlink(snd_pcm_t *pcm);
504 
506 #define SND_CHMAP_API_VERSION ((1 << 16) | (0 << 8) | 1)
507 
510  SND_CHMAP_TYPE_NONE = 0,
515 };
516 
556  SND_CHMAP_LAST = SND_CHMAP_BRC,
557 };
558 
560 #define SND_CHMAP_POSITION_MASK 0xffff
561 
563 #define SND_CHMAP_PHASE_INVERSE (0x01 << 16)
564 
565 #define SND_CHMAP_DRIVER_SPEC (0x02 << 16)
566 
568 typedef struct snd_pcm_chmap {
569  unsigned int channels;
570  unsigned int pos[0];
572 
574 typedef struct snd_pcm_chmap_query {
575  enum snd_pcm_chmap_type type;
578 
579 
582  int subdev,
583  snd_pcm_stream_t stream);
586 int snd_pcm_set_chmap(snd_pcm_t *pcm, const snd_pcm_chmap_t *map);
587 
588 const char *snd_pcm_chmap_type_name(enum snd_pcm_chmap_type val);
589 const char *snd_pcm_chmap_name(enum snd_pcm_chmap_position val);
590 const char *snd_pcm_chmap_long_name(enum snd_pcm_chmap_position val);
591 int snd_pcm_chmap_print(const snd_pcm_chmap_t *map, size_t maxlen, char *buf);
592 unsigned int snd_pcm_chmap_from_string(const char *str);
594 
595 //int snd_pcm_mixer_element(snd_pcm_t *pcm, snd_mixer_t *mixer, snd_mixer_elem_t **elem);
596 
597 /*
598  * application helpers - these functions are implemented on top
599  * of the basic API
600  */
601 
602 int snd_pcm_recover(snd_pcm_t *pcm, int err, int silent);
604  snd_pcm_format_t format,
605  snd_pcm_access_t access,
606  unsigned int channels,
607  unsigned int rate,
608  int soft_resample,
609  unsigned int latency);
611  snd_pcm_uframes_t *buffer_size,
612  snd_pcm_uframes_t *period_size);
613 
623 size_t snd_pcm_info_sizeof(void);
628 #define snd_pcm_info_alloca(ptr) __snd_alloca(ptr, snd_pcm_info)
631 void snd_pcm_info_copy(snd_pcm_info_t *dst, const snd_pcm_info_t *src);
632 unsigned int snd_pcm_info_get_device(const snd_pcm_info_t *obj);
633 unsigned int snd_pcm_info_get_subdevice(const snd_pcm_info_t *obj);
635 int snd_pcm_info_get_card(const snd_pcm_info_t *obj);
636 const char *snd_pcm_info_get_id(const snd_pcm_info_t *obj);
637 const char *snd_pcm_info_get_name(const snd_pcm_info_t *obj);
638 const char *snd_pcm_info_get_subdevice_name(const snd_pcm_info_t *obj);
641 unsigned int snd_pcm_info_get_subdevices_count(const snd_pcm_info_t *obj);
642 unsigned int snd_pcm_info_get_subdevices_avail(const snd_pcm_info_t *obj);
644 void snd_pcm_info_set_device(snd_pcm_info_t *obj, unsigned int val);
645 void snd_pcm_info_set_subdevice(snd_pcm_info_t *obj, unsigned int val);
647 
658 
673  unsigned int *rate_num,
674  unsigned int *rate_den);
677 
678 #if 0
679 typedef struct _snd_pcm_hw_strategy snd_pcm_hw_strategy_t;
680 
681 /* choices need to be sorted on ascending badness */
682 typedef struct _snd_pcm_hw_strategy_simple_choices_list {
683  unsigned int value;
684  unsigned int badness;
685 } snd_pcm_hw_strategy_simple_choices_list_t;
686 
687 int snd_pcm_hw_params_strategy(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
688  const snd_pcm_hw_strategy_t *strategy,
689  unsigned int badness_min,
690  unsigned int badness_max);
691 
692 void snd_pcm_hw_strategy_free(snd_pcm_hw_strategy_t *strategy);
693 int snd_pcm_hw_strategy_simple(snd_pcm_hw_strategy_t **strategyp,
694  unsigned int badness_min,
695  unsigned int badness_max);
696 int snd_pcm_hw_params_try_explain_failure(snd_pcm_t *pcm,
697  snd_pcm_hw_params_t *fail,
698  snd_pcm_hw_params_t *success,
699  unsigned int depth,
700  snd_output_t *out);
701 
702 #endif
703 
704 size_t snd_pcm_hw_params_sizeof(void);
709 #define snd_pcm_hw_params_alloca(ptr) __snd_alloca(ptr, snd_pcm_hw_params)
713 
714 #if !defined(ALSA_LIBRARY_BUILD) && !defined(ALSA_PCM_OLD_HW_PARAMS_API)
715 
723 
731 
739 
740 int snd_pcm_hw_params_get_channels(const snd_pcm_hw_params_t *params, unsigned int *val);
741 int snd_pcm_hw_params_get_channels_min(const snd_pcm_hw_params_t *params, unsigned int *val);
742 int snd_pcm_hw_params_get_channels_max(const snd_pcm_hw_params_t *params, unsigned int *val);
743 int snd_pcm_hw_params_test_channels(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
744 int snd_pcm_hw_params_set_channels(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
745 int snd_pcm_hw_params_set_channels_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
746 int snd_pcm_hw_params_set_channels_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
747 int snd_pcm_hw_params_set_channels_minmax(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *min, unsigned int *max);
748 int snd_pcm_hw_params_set_channels_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
749 int snd_pcm_hw_params_set_channels_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
750 int snd_pcm_hw_params_set_channels_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
751 
752 int snd_pcm_hw_params_get_rate(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
753 int snd_pcm_hw_params_get_rate_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
754 int snd_pcm_hw_params_get_rate_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
755 int snd_pcm_hw_params_test_rate(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
756 int snd_pcm_hw_params_set_rate(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
757 int snd_pcm_hw_params_set_rate_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
758 int snd_pcm_hw_params_set_rate_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
759 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);
760 int snd_pcm_hw_params_set_rate_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
761 int snd_pcm_hw_params_set_rate_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
762 int snd_pcm_hw_params_set_rate_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
763 int snd_pcm_hw_params_set_rate_resample(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
764 int snd_pcm_hw_params_get_rate_resample(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
765 int snd_pcm_hw_params_set_export_buffer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
766 int snd_pcm_hw_params_get_export_buffer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
767 int snd_pcm_hw_params_set_period_wakeup(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
768 int snd_pcm_hw_params_get_period_wakeup(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
769 
770 int snd_pcm_hw_params_get_period_time(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
771 int snd_pcm_hw_params_get_period_time_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
772 int snd_pcm_hw_params_get_period_time_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
773 int snd_pcm_hw_params_test_period_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
774 int snd_pcm_hw_params_set_period_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
775 int snd_pcm_hw_params_set_period_time_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
776 int snd_pcm_hw_params_set_period_time_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
777 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);
778 int snd_pcm_hw_params_set_period_time_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
779 int snd_pcm_hw_params_set_period_time_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
780 int snd_pcm_hw_params_set_period_time_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
781 
782 int snd_pcm_hw_params_get_period_size(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *frames, int *dir);
783 int snd_pcm_hw_params_get_period_size_min(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *frames, int *dir);
784 int snd_pcm_hw_params_get_period_size_max(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *frames, int *dir);
785 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);
786 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);
787 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);
788 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);
789 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);
790 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);
791 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);
792 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);
794 
795 int snd_pcm_hw_params_get_periods(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
796 int snd_pcm_hw_params_get_periods_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
797 int snd_pcm_hw_params_get_periods_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
798 int snd_pcm_hw_params_test_periods(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
799 int snd_pcm_hw_params_set_periods(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
800 int snd_pcm_hw_params_set_periods_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
801 int snd_pcm_hw_params_set_periods_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
802 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);
803 int snd_pcm_hw_params_set_periods_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
804 int snd_pcm_hw_params_set_periods_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
805 int snd_pcm_hw_params_set_periods_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
807 
808 int snd_pcm_hw_params_get_buffer_time(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
809 int snd_pcm_hw_params_get_buffer_time_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
810 int snd_pcm_hw_params_get_buffer_time_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
811 int snd_pcm_hw_params_test_buffer_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
812 int snd_pcm_hw_params_set_buffer_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
813 int snd_pcm_hw_params_set_buffer_time_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
814 int snd_pcm_hw_params_set_buffer_time_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
815 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);
816 int snd_pcm_hw_params_set_buffer_time_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
817 int snd_pcm_hw_params_set_buffer_time_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
818 int snd_pcm_hw_params_set_buffer_time_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
819 
820 int snd_pcm_hw_params_get_buffer_size(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
821 int snd_pcm_hw_params_get_buffer_size_min(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
822 int snd_pcm_hw_params_get_buffer_size_max(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
823 int snd_pcm_hw_params_test_buffer_size(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t val);
824 int snd_pcm_hw_params_set_buffer_size(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t val);
825 int snd_pcm_hw_params_set_buffer_size_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
826 int snd_pcm_hw_params_set_buffer_size_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
827 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);
828 int snd_pcm_hw_params_set_buffer_size_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
829 int snd_pcm_hw_params_set_buffer_size_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
830 int snd_pcm_hw_params_set_buffer_size_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
831 
832 #endif /* !ALSA_LIBRARY_BUILD && !ALSA_PCM_OLD_HW_PARAMS_API */
833 
834 int snd_pcm_hw_params_get_min_align(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
835 
845 size_t snd_pcm_sw_params_sizeof(void);
850 #define snd_pcm_sw_params_alloca(ptr) __snd_alloca(ptr, snd_pcm_sw_params)
854 int snd_pcm_sw_params_get_boundary(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val);
855 
856 #if !defined(ALSA_LIBRARY_BUILD) && !defined(ALSA_PCM_OLD_SW_PARAMS_API)
857 
862 int snd_pcm_sw_params_set_avail_min(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
863 int snd_pcm_sw_params_get_avail_min(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val);
865 int snd_pcm_sw_params_get_period_event(const snd_pcm_sw_params_t *params, int *val);
866 int snd_pcm_sw_params_set_start_threshold(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
867 int snd_pcm_sw_params_get_start_threshold(const snd_pcm_sw_params_t *paramsm, snd_pcm_uframes_t *val);
868 int snd_pcm_sw_params_set_stop_threshold(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
869 int snd_pcm_sw_params_get_stop_threshold(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val);
870 int snd_pcm_sw_params_set_silence_threshold(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
871 int snd_pcm_sw_params_get_silence_threshold(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val);
872 int snd_pcm_sw_params_set_silence_size(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
873 int snd_pcm_sw_params_get_silence_size(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val);
874 
875 #endif /* !ALSA_LIBRARY_BUILD && !ALSA_PCM_OLD_SW_PARAMS_API */
876 
879 /* include old API */
880 #ifndef ALSA_LIBRARY_BUILD
881 #if defined(ALSA_PCM_OLD_HW_PARAMS_API) || defined(ALSA_PCM_OLD_SW_PARAMS_API)
882 #include "pcm_old.h"
883 #endif
884 #endif
885 
893 size_t snd_pcm_access_mask_sizeof(void);
898 #define snd_pcm_access_mask_alloca(ptr) __snd_alloca(ptr, snd_pcm_access_mask)
908 
918 size_t snd_pcm_format_mask_sizeof(void);
923 #define snd_pcm_format_mask_alloca(ptr) __snd_alloca(ptr, snd_pcm_format_mask)
933 
943 size_t snd_pcm_subformat_mask_sizeof(void);
948 #define snd_pcm_subformat_mask_alloca(ptr) __snd_alloca(ptr, snd_pcm_subformat_mask)
958 
968 size_t snd_pcm_status_sizeof(void);
973 #define snd_pcm_status_alloca(ptr) __snd_alloca(ptr, snd_pcm_status)
983 snd_pcm_sframes_t snd_pcm_status_get_delay(const snd_pcm_status_t *obj);
984 snd_pcm_uframes_t snd_pcm_status_get_avail(const snd_pcm_status_t *obj);
985 snd_pcm_uframes_t snd_pcm_status_get_avail_max(const snd_pcm_status_t *obj);
986 snd_pcm_uframes_t snd_pcm_status_get_overrange(const snd_pcm_status_t *obj);
987 
997 const char *snd_pcm_type_name(snd_pcm_type_t type);
998 const char *snd_pcm_stream_name(const snd_pcm_stream_t stream);
999 const char *snd_pcm_access_name(const snd_pcm_access_t _access);
1000 const char *snd_pcm_format_name(const snd_pcm_format_t format);
1001 const char *snd_pcm_format_description(const snd_pcm_format_t format);
1002 const char *snd_pcm_subformat_name(const snd_pcm_subformat_t subformat);
1003 const char *snd_pcm_subformat_description(const snd_pcm_subformat_t subformat);
1004 snd_pcm_format_t snd_pcm_format_value(const char* name);
1005 const char *snd_pcm_tstamp_mode_name(const snd_pcm_tstamp_t mode);
1006 const char *snd_pcm_state_name(const snd_pcm_state_t state);
1007 
1017 int snd_pcm_dump(snd_pcm_t *pcm, snd_output_t *out);
1020 int snd_pcm_dump_setup(snd_pcm_t *pcm, snd_output_t *out);
1024 
1034 int snd_pcm_mmap_begin(snd_pcm_t *pcm,
1035  const snd_pcm_channel_area_t **areas,
1036  snd_pcm_uframes_t *offset,
1037  snd_pcm_uframes_t *frames);
1038 snd_pcm_sframes_t snd_pcm_mmap_commit(snd_pcm_t *pcm,
1039  snd_pcm_uframes_t offset,
1040  snd_pcm_uframes_t frames);
1041 snd_pcm_sframes_t snd_pcm_mmap_writei(snd_pcm_t *pcm, const void *buffer, snd_pcm_uframes_t size);
1042 snd_pcm_sframes_t snd_pcm_mmap_readi(snd_pcm_t *pcm, void *buffer, snd_pcm_uframes_t size);
1043 snd_pcm_sframes_t snd_pcm_mmap_writen(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size);
1044 snd_pcm_sframes_t snd_pcm_mmap_readn(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size);
1045 
1062 int snd_pcm_format_width(snd_pcm_format_t format); /* in bits */
1063 int snd_pcm_format_physical_width(snd_pcm_format_t format); /* in bits */
1064 snd_pcm_format_t snd_pcm_build_linear_format(int width, int pwidth, int unsignd, int big_endian);
1065 ssize_t snd_pcm_format_size(snd_pcm_format_t format, size_t samples);
1066 u_int8_t snd_pcm_format_silence(snd_pcm_format_t format);
1070 int snd_pcm_format_set_silence(snd_pcm_format_t format, void *buf, unsigned int samples);
1071 
1072 snd_pcm_sframes_t snd_pcm_bytes_to_frames(snd_pcm_t *pcm, ssize_t bytes);
1073 ssize_t snd_pcm_frames_to_bytes(snd_pcm_t *pcm, snd_pcm_sframes_t frames);
1074 long snd_pcm_bytes_to_samples(snd_pcm_t *pcm, ssize_t bytes);
1075 ssize_t snd_pcm_samples_to_bytes(snd_pcm_t *pcm, long samples);
1076 
1077 int snd_pcm_area_silence(const snd_pcm_channel_area_t *dst_channel, snd_pcm_uframes_t dst_offset,
1078  unsigned int samples, snd_pcm_format_t format);
1079 int snd_pcm_areas_silence(const snd_pcm_channel_area_t *dst_channels, snd_pcm_uframes_t dst_offset,
1080  unsigned int channels, snd_pcm_uframes_t frames, snd_pcm_format_t format);
1081 int snd_pcm_area_copy(const snd_pcm_channel_area_t *dst_channel, snd_pcm_uframes_t dst_offset,
1082  const snd_pcm_channel_area_t *src_channel, snd_pcm_uframes_t src_offset,
1083  unsigned int samples, snd_pcm_format_t format);
1084 int snd_pcm_areas_copy(const snd_pcm_channel_area_t *dst_channels, snd_pcm_uframes_t dst_offset,
1085  const snd_pcm_channel_area_t *src_channels, snd_pcm_uframes_t src_offset,
1086  unsigned int channels, snd_pcm_uframes_t frames, snd_pcm_format_t format);
1087 
1098 typedef enum _snd_pcm_hook_type {
1099  SND_PCM_HOOK_TYPE_HW_PARAMS = 0,
1100  SND_PCM_HOOK_TYPE_HW_FREE,
1101  SND_PCM_HOOK_TYPE_CLOSE,
1102  SND_PCM_HOOK_TYPE_LAST = SND_PCM_HOOK_TYPE_CLOSE
1104 
1106 typedef struct _snd_pcm_hook snd_pcm_hook_t;
1108 typedef int (*snd_pcm_hook_func_t)(snd_pcm_hook_t *hook);
1111 void snd_pcm_hook_set_private(snd_pcm_hook_t *hook, void *private_data);
1112 int snd_pcm_hook_add(snd_pcm_hook_t **hookp, snd_pcm_t *pcm,
1113  snd_pcm_hook_type_t type,
1114  snd_pcm_hook_func_t func, void *private_data);
1116 
1127 typedef struct _snd_pcm_scope_ops {
1131  int (*enable)(snd_pcm_scope_t *scope);
1135  void (*disable)(snd_pcm_scope_t *scope);
1139  void (*start)(snd_pcm_scope_t *scope);
1143  void (*stop)(snd_pcm_scope_t *scope);
1147  void (*update)(snd_pcm_scope_t *scope);
1151  void (*reset)(snd_pcm_scope_t *scope);
1155  void (*close)(snd_pcm_scope_t *scope);
1157 
1158 snd_pcm_uframes_t snd_pcm_meter_get_bufsize(snd_pcm_t *pcm);
1159 unsigned int snd_pcm_meter_get_channels(snd_pcm_t *pcm);
1160 unsigned int snd_pcm_meter_get_rate(snd_pcm_t *pcm);
1161 snd_pcm_uframes_t snd_pcm_meter_get_now(snd_pcm_t *pcm);
1162 snd_pcm_uframes_t snd_pcm_meter_get_boundary(snd_pcm_t *pcm);
1164 snd_pcm_scope_t *snd_pcm_meter_search_scope(snd_pcm_t *pcm, const char *name);
1167  const snd_pcm_scope_ops_t *val);
1168 void snd_pcm_scope_set_name(snd_pcm_scope_t *scope, const char *val);
1169 const char *snd_pcm_scope_get_name(snd_pcm_scope_t *scope);
1171 void snd_pcm_scope_set_callback_private(snd_pcm_scope_t *scope, void *val);
1172 int snd_pcm_scope_s16_open(snd_pcm_t *pcm, const char *name,
1173  snd_pcm_scope_t **scopep);
1175  unsigned int channel);
1176 
1187 typedef enum _snd_spcm_latency {
1198 
1200 typedef enum _snd_spcm_xrun_type {
1206 
1208 typedef enum _snd_spcm_duplex_type {
1214 
1215 int snd_spcm_init(snd_pcm_t *pcm,
1216  unsigned int rate,
1217  unsigned int channels,
1218  snd_pcm_format_t format,
1219  snd_pcm_subformat_t subformat,
1220  snd_spcm_latency_t latency,
1221  snd_pcm_access_t _access,
1222  snd_spcm_xrun_type_t xrun_type);
1223 
1224 int snd_spcm_init_duplex(snd_pcm_t *playback_pcm,
1225  snd_pcm_t *capture_pcm,
1226  unsigned int rate,
1227  unsigned int channels,
1228  snd_pcm_format_t format,
1229  snd_pcm_subformat_t subformat,
1230  snd_spcm_latency_t latency,
1231  snd_pcm_access_t _access,
1232  snd_spcm_xrun_type_t xrun_type,
1233  snd_spcm_duplex_type_t duplex_type);
1234 
1236  unsigned int *rate,
1237  snd_pcm_uframes_t *buffer_size,
1238  snd_pcm_uframes_t *period_size);
1239 
1249 /* Deprecated functions, for compatibility */
1250 const char *snd_pcm_start_mode_name(snd_pcm_start_t mode) __attribute__((deprecated));
1251 const char *snd_pcm_xrun_mode_name(snd_pcm_xrun_t mode) __attribute__((deprecated));
1252 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));
1253 snd_pcm_start_t snd_pcm_sw_params_get_start_mode(const snd_pcm_sw_params_t *params) __attribute__((deprecated));
1254 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));
1255 snd_pcm_xrun_t snd_pcm_sw_params_get_xrun_mode(const snd_pcm_sw_params_t *params) __attribute__((deprecated));
1256 #if !defined(ALSA_LIBRARY_BUILD) && !defined(ALSA_PCM_OLD_SW_PARAMS_API)
1257 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));
1258 int snd_pcm_sw_params_get_xfer_align(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val) __attribute__((deprecated));
1259 int snd_pcm_sw_params_set_sleep_min(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, unsigned int val) __attribute__((deprecated));
1260 int snd_pcm_sw_params_get_sleep_min(const snd_pcm_sw_params_t *params, unsigned int *val) __attribute__((deprecated));
1261 #endif /* !ALSA_LIBRARY_BUILD && !ALSA_PCM_OLD_SW_PARAMS_API */
1262 #if !defined(ALSA_LIBRARY_BUILD) && !defined(ALSA_PCM_OLD_HW_PARAMS_API)
1263 int snd_pcm_hw_params_get_tick_time(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir) __attribute__((deprecated));
1264 int snd_pcm_hw_params_get_tick_time_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir) __attribute__((deprecated));
1265 int snd_pcm_hw_params_get_tick_time_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir) __attribute__((deprecated));
1266 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));
1267 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));
1268 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));
1269 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));
1270 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));
1271 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));
1272 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));
1273 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));
1274 #endif /* !ALSA_LIBRARY_BUILD && !ALSA_PCM_OLD_HW_PARAMS_API */
1275 
1278 #ifdef __cplusplus
1279 }
1280 #endif
1281 
1282 #endif /* __ALSA_PCM_H */
Definition: pcm.h:318
int snd_pcm_sw_params_get_avail_min(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val)
Get avail min from a software configuration container.
Definition: pcm.c:5947
int snd_pcm_sw_params_get_boundary(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val)
Get boundary for ring pointers from a software configuration container.
Definition: pcm.c:5706
int snd_pcm_hw_params_set_buffer_size_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val)
Restrict a configuration space to contain only its maximum buffer size.
Definition: pcm.c:5377
int snd_pcm_hw_params_get_buffer_size(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val)
Extract buffer size from a configuration space.
Definition: pcm.c:5199
int snd_pcm_hwsync(snd_pcm_t *pcm)
(DEPRECATED) Synchronize stream position with hardware
Definition: pcm.c:947
struct _snd_pcm_sw_params snd_pcm_sw_params_t
Definition: pcm.h:65
void snd_pcm_hw_params_get_subformat_mask(snd_pcm_hw_params_t *params, snd_pcm_subformat_mask_t *mask)
Get subformat mask from a configuration space.
Definition: pcm.c:3912
void snd_pcm_hook_set_private(snd_pcm_hook_t *hook, void *private_data)
Set callback function private data for a PCM hook.
Definition: pcm_hooks.c:582
int snd_spcm_init_get_params(snd_pcm_t *pcm, unsigned int *rate, snd_pcm_uframes_t *buffer_size, snd_pcm_uframes_t *period_size)
Get the set up of simple PCM.
Definition: pcm_simple.c:290
Definition: pcm.h:159
int snd_pcm_access_mask_empty(const snd_pcm_access_mask_t *mask)
test, if given a snd_pcm_access_mask_t is empty
Definition: pcm.c:3354
Definition: pcm.h:386
int snd_pcm_set_chmap(snd_pcm_t *pcm, const snd_pcm_chmap_t *map)
Definition: pcm.c:7485
snd_pcm_xrun_t
Definition: pcm.h:305
int snd_pcm_sw_params_dump(snd_pcm_sw_params_t *params, snd_output_t *out)
Dump a software configuration.
Definition: pcm.c:5643
int snd_pcm_hw_params_set_buffer_time_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
Restrict a configuration space to contain only its minimum buffer time.
Definition: pcm.c:5164
int snd_pcm_sw_params_get_xfer_align(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val) __attribute__((deprecated))
(DEPRECATED) Get xfer align from a software configuration container
Definition: pcm.c:6009
int snd_pcm_format_float(snd_pcm_format_t format)
Return float info for a PCM sample format.
Definition: pcm_misc.c:106
int snd_pcm_info(snd_pcm_t *pcm, snd_pcm_info_t *info)
Obtain general (static) information for PCM handle.
Definition: pcm.c:769
int snd_pcm_hw_params_get_period_size_min(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *frames, int *dir)
Extract minimum period size from a configuration space.
Definition: pcm.c:4598
int snd_pcm_hw_params_test_subformat(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_t subformat)
Verify if a subformat is available inside a configuration space for a PCM.
Definition: pcm.c:3846
int snd_pcm_hw_params_get_tick_time_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir) __attribute__((deprecated))
(DEPRECATED) Extract minimum tick time from a configuration space
Definition: pcm.c:5419
int snd_pcm_hw_params_get_rate_resample(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val)
Extract resample state from a configuration space.
Definition: pcm.c:4286
int snd_pcm_hw_params_set_rate_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
Restrict a configuration space to contain only its minimum rate.
Definition: pcm.c:4236
snd_pcm_start_t snd_pcm_sw_params_get_start_mode(const snd_pcm_sw_params_t *params) __attribute__((deprecated))
(DEPRECATED) Get start mode from a software configuration container
Definition: pcm.c:5746
int snd_pcm_hw_params_get_periods_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
Extract minimum periods count from a configuration space.
Definition: pcm.c:4831
Definition: pcm.h:554
snd_pcm_chmap_t map
Definition: pcm.h:576
Definition: pcm.h:268
int snd_pcm_hw_params_get_period_wakeup(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val)
Extract period wakeup flag from a configuration space.
Definition: pcm.c:4369
int snd_pcm_hw_params_get_export_buffer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val)
Extract buffer accessibility from a configuration space.
Definition: pcm.c:4318
const char * snd_pcm_start_mode_name(snd_pcm_start_t mode) __attribute__((deprecated))
(DEPRECATED) get name of PCM start mode setting
Definition: pcm.c:1803
size_t snd_pcm_info_sizeof(void)
get size of snd_pcm_info_t
Definition: pcm.c:6386
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))
(DEPRECATED) Verify if a tick time is available inside a configuration space for a PCM ...
Definition: pcm.c:5455
Definition: pcm.h:125
int snd_pcm_hw_params_get_periods(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
Extract periods from a configuration space.
Definition: pcm.c:4813
Definition: pcm.h:400
Definition: pcm.h:523
Definition: pcm.h:574
struct _snd_pcm_subformat_mask snd_pcm_subformat_mask_t
Definition: pcm.h:73
int16_t * snd_pcm_scope_s16_get_channel_buffer(snd_pcm_scope_t *scope, unsigned int channel)
Get s16 pseudo scope frames buffer for a channel.
Definition: pcm_meter.c:1208
Definition: pcm.h:110
Definition: pcm.h:145
Definition: pcm.h:539
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)
Restrict a configuration space to have buffer sizes in a given range.
Definition: pcm.c:5317
snd_pcm_state_t
Definition: pcm.h:273
int snd_pcm_status_malloc(snd_pcm_status_t **ptr)
allocate an invalid snd_pcm_status_t using standard malloc
Definition: pcm.c:6221
int snd_pcm_hw_params_set_periods_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
Restrict a configuration space with a minimum periods count.
Definition: pcm.c:4895
void snd_pcm_status_get_trigger_htstamp(const snd_pcm_status_t *obj, snd_htimestamp_t *ptr)
Get trigger hi-res timestamp from a PCM status container.
Definition: pcm.c:6289
Definition: pcm.h:1204
int snd_pcm_hw_params_test_buffer_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir)
Verify if a buffer time is available inside a configuration space for a PCM.
Definition: pcm.c:5065
snd_pcm_class_t
Definition: pcm.h:76
Definition: pcm.h:418
unsigned int snd_pcm_meter_get_channels(snd_pcm_t *pcm)
Get meter channels from a SND_PCM_TYPE_METER PCM.
Definition: pcm_meter.c:894
int snd_pcm_hw_params_set_buffer_size_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val)
Restrict a configuration space to have buffer size nearest to a target.
Definition: pcm.c:5337
int snd_pcm_hw_params_set_channels_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val)
Restrict a configuration space with a maximum channels count.
Definition: pcm.c:4006
int snd_pcm_areas_copy(const snd_pcm_channel_area_t *dst_channels, snd_pcm_uframes_t dst_offset, const snd_pcm_channel_area_t *src_channels, snd_pcm_uframes_t src_offset, unsigned int channels, snd_pcm_uframes_t frames, snd_pcm_format_t format)
Copy one or more areas.
Definition: pcm.c:2857
size_t snd_pcm_format_mask_sizeof(void)
get size of snd_pcm_format_mask_t
Definition: pcm.c:3383
int snd_pcm_drop(snd_pcm_t *pcm)
Stop a PCM dropping pending frames.
Definition: pcm.c:1098
Definition: pcm.h:520
int snd_pcm_status(snd_pcm_t *pcm, snd_pcm_status_t *status)
Obtain status (runtime) information for PCM handle.
Definition: pcm.c:918
int snd_pcm_poll_descriptors_count(snd_pcm_t *pcm)
get count of poll descriptors for PCM handle
Definition: pcm.c:1395
snd_pcm_uframes_t snd_pcm_status_get_avail_max(const snd_pcm_status_t *obj)
Get maximum number of frames available from a PCM status container after last snd_pcm_status call...
Definition: pcm.c:6366
Definition: pcm.h:541
void snd_pcm_format_mask_set(snd_pcm_format_mask_t *mask, snd_pcm_format_t val)
make a format present in a snd_pcm_format_mask_t
Definition: pcm.c:3466
Definition: pcm.h:289
Definition: pcm.h:551
Definition: pcm.h:428
void(* snd_async_callback_t)(snd_async_handler_t *handler)
Async notification callback.
Definition: global.h:121
Definition: pcm.h:374
Definition: pcm.h:228
Definition: pcm.h:552
Definition: pcm.h:412
Definition: pcm.h:141
int snd_pcm_format_set_silence(snd_pcm_format_t format, void *buf, unsigned int samples)
Silence a PCM samples buffer.
Definition: pcm_misc.c:577
int snd_pcm_hw_params_set_periods_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
Restrict a configuration space to contain only its minimum periods count.
Definition: pcm.c:4964
Definition: pcm.h:416
Definition: pcm.h:514
int snd_pcm_start(snd_pcm_t *pcm)
Start a PCM.
Definition: pcm.c:1077
snd_pcm_subformat_t
Definition: pcm.h:266
int snd_pcm_format_unsigned(snd_pcm_format_t format)
Return sign info for a PCM sample linear format.
Definition: pcm_misc.c:81
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)
Restrict a configuration space with a minimum period size.
Definition: pcm.c:4670
struct _snd_pcm_hw_params snd_pcm_hw_params_t
Definition: pcm.h:62
Definition: pcm.h:568
Definition: pcm.h:530
snd_pcm_type_t snd_pcm_type(snd_pcm_t *pcm)
get type of PCM handle
Definition: pcm.c:664
int snd_pcm_hw_params_set_access_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t *_access)
Restrict a configuration space to contain only its last access type.
Definition: pcm.c:3698
void * addr
Definition: pcm.h:430
struct _snd_pcm_status snd_pcm_status_t
Definition: pcm.h:67
struct _snd_pcm_info snd_pcm_info_t
Definition: pcm.h:46
Definition: pcm.h:129
const char * snd_pcm_chmap_name(enum snd_pcm_chmap_position val)
Definition: pcm.c:7544
int snd_pcm_hw_params_can_mmap_sample_resolution(const snd_pcm_hw_params_t *params)
Check if hardware supports sample-resolution mmap for given configuration.
Definition: pcm.c:2955
Definition: pcm.h:193
int snd_pcm_hw_params_set_period_time_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
Restrict a configuration space to contain only its minimum period time.
Definition: pcm.c:4540
void snd_pcm_format_mask_reset(snd_pcm_format_mask_t *mask, snd_pcm_format_t val)
make a format missing from a snd_pcm_format_mask_t
Definition: pcm.c:3476
Definition: pcm.h:133
Definition: pcm.h:137
void snd_pcm_hw_params_get_format_mask(snd_pcm_hw_params_t *params, snd_pcm_format_mask_t *mask)
Get format mask from a configuration space.
Definition: pcm.c:3818
int snd_pcm_hw_params_set_format_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t *format)
Restrict a configuration space to contain only its first format.
Definition: pcm.c:3779
Definition: pcm.h:388
_snd_pcm_type
Definition: pcm.h:357
Definition: pcm.h:167
int snd_pcm_hw_params_set_rate_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
Restrict a configuration space to have rate nearest to a target.
Definition: pcm.c:4217
Definition: pcm.h:513
snd_pcm_chmap_type
Definition: pcm.h:509
Definition: pcm.h:384
Definition: pcm.h:179
int snd_pcm_hw_params_is_joint_duplex(const snd_pcm_hw_params_t *params)
Check if hardware does joint-duplex (playback and capture are somewhat correlated) ...
Definition: pcm.c:3135
snd_pcm_subclass_t
Definition: pcm.h:90
int snd_pcm_delay(snd_pcm_t *pcm, snd_pcm_sframes_t *delayp)
Obtain delay for a running PCM handle.
Definition: pcm.c:988
Definition: pcm.h:131
int snd_pcm_hw_params_test_format(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t val)
Verify if a format is available inside a configuration space for a PCM.
Definition: pcm.c:3752
int snd_pcm_areas_silence(const snd_pcm_channel_area_t *dst_channels, snd_pcm_uframes_t dst_offset, unsigned int channels, snd_pcm_uframes_t frames, snd_pcm_format_t format)
Silence one or more areas.
Definition: pcm.c:2685
int snd_pcm_hw_params_get_buffer_size_max(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val)
Extract maximum buffer size from a configuration space.
Definition: pcm.c:5239
const char * snd_pcm_format_description(const snd_pcm_format_t format)
get description of PCM sample format
Definition: pcm.c:1740
Definition: pcm.h:368
int snd_pcm_wait(snd_pcm_t *pcm, int timeout)
Wait for a PCM to become ready.
Definition: pcm.c:2402
int snd_pcm_hook_remove(snd_pcm_hook_t *hook)
Remove a PCM hook.
Definition: pcm_hooks.c:628
snd_pcm_scope_t * snd_pcm_meter_search_scope(snd_pcm_t *pcm, const char *name)
Search an installed scope inside a SND_PCM_TYPE_METER PCM.
Definition: pcm_meter.c:860
int snd_pcm_hw_params_dump(snd_pcm_hw_params_t *params, snd_output_t *out)
Dump a PCM hardware configuration space.
Definition: pcm.c:2935
int snd_pcm_hw_params_get_tick_time_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir) __attribute__((deprecated))
(DEPRECATED) Extract maximum tick time from a configuration space
Definition: pcm.c:5438
int snd_pcm_hw_params_set_subformat_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_t *subformat)
Restrict a configuration space to contain only its last subformat.
Definition: pcm.c:3889
int snd_pcm_hw_params_is_block_transfer(const snd_pcm_hw_params_t *params)
Check if hardware does block transfers for samples for given configuration.
Definition: pcm.c:3015
void snd_pcm_access_mask_any(snd_pcm_access_mask_t *mask)
set all bits in a snd_pcm_access_mask_t
Definition: pcm.c:3333
int snd_pcm_hw_params_get_buffer_time(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
Extract buffer time from a configuration space.
Definition: pcm.c:5013
int snd_pcm_close(snd_pcm_t *pcm)
close PCM handle
Definition: pcm.c:691
const char * snd_pcm_info_get_subdevice_name(const snd_pcm_info_t *obj)
Get subdevice name from a PCM info container.
Definition: pcm.c:6496
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))
(DEPRECATED) Set xfer align inside a software configuration container
Definition: pcm.c:5994
Definition: pcm.h:540
Definition: pcm.h:143
void snd_pcm_subformat_mask_reset(snd_pcm_subformat_mask_t *mask, snd_pcm_subformat_t val)
make a subformat missing from a snd_pcm_subformat_mask_t
Definition: pcm.c:3579
Definition: pcm.h:378
int snd_pcm_hw_params_set_period_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir)
Restrict a configuration space to contain only one period time.
Definition: pcm.c:4455
void snd_pcm_subformat_mask_free(snd_pcm_subformat_mask_t *obj)
frees a previously allocated snd_pcm_subformat_mask_t
Definition: pcm.c:3509
int snd_pcm_sw_params_get_tstamp_mode(const snd_pcm_sw_params_t *params, snd_pcm_tstamp_t *val)
Get timestamp mode from a software configuration container.
Definition: pcm.c:5836
int snd_pcm_status_dump(snd_pcm_status_t *status, snd_output_t *out)
Dump status.
Definition: pcm.c:1959
Definition: pcm.h:376
int snd_pcm_hw_params_set_rate_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
Restrict a configuration space with a minimum rate.
Definition: pcm.c:4167
Definition: pcm.h:394
void snd_pcm_scope_set_name(snd_pcm_scope_t *scope, const char *val)
Set name of a SND_PCM_TYPE_METER PCM scope.
Definition: pcm_meter.c:950
Definition: pcm.h:380
Definition: pcm.h:240
Definition: pcm.h:1196
void snd_pcm_hw_params_copy(snd_pcm_hw_params_t *dst, const snd_pcm_hw_params_t *src)
copy one snd_pcm_hw_params_t to another
Definition: pcm.c:3622
snd_pcm_start_t
Definition: pcm.h:296
int snd_pcm_format_width(snd_pcm_format_t format)
Return nominal bits per a PCM sample.
Definition: pcm_misc.c:202
int snd_pcm_hw_params_can_pause(const snd_pcm_hw_params_t *params)
Check if hardware supports pause.
Definition: pcm.c:3075
int snd_pcm_hw_params_set_buffer_size(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t val)
Restrict a configuration space to contain only one buffer size.
Definition: pcm.c:5272
int snd_pcm_nonblock(snd_pcm_t *pcm, int nonblock)
set nonblock mode
Definition: pcm.c:722
void snd_pcm_status_get_tstamp(const snd_pcm_status_t *obj, snd_timestamp_t *ptr)
Get "now" timestamp from a PCM status container.
Definition: pcm.c:6302
void * snd_pcm_scope_get_callback_private(snd_pcm_scope_t *scope)
Get callbacks private value for a SND_PCM_TYPE_METER PCM scope.
Definition: pcm_meter.c:980
Definition: pcm.h:1202
size_t snd_pcm_status_sizeof(void)
get size of snd_pcm_status_t
Definition: pcm.c:6211
int snd_pcm_hw_params_set_format_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t *format)
Restrict a configuration space to contain only its last format.
Definition: pcm.c:3795
void snd_pcm_info_free(snd_pcm_info_t *obj)
frees a previously allocated snd_pcm_info_t
Definition: pcm.c:6409
Definition: pcm.h:1210
Definition: pcm.h:149
int snd_pcm_hw_params_get_period_size(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *frames, int *dir)
Extract period size from a configuration space.
Definition: pcm.c:4576
int snd_pcm_get_params(snd_pcm_t *pcm, snd_pcm_uframes_t *buffer_size, snd_pcm_uframes_t *period_size)
Get the transfer size parameters in a simple way.
Definition: pcm.c:8094
Definition: pcm.h:316
int snd_pcm_hw_params_malloc(snd_pcm_hw_params_t **ptr)
allocate an invalid snd_pcm_hw_params_t using standard malloc
Definition: pcm.c:3599
Definition: pcm.h:531
Definition: pcm.h:103
int snd_pcm_hw_params_get_rate_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
Extract maximum rate from a configuration space.
Definition: pcm.c:4121
Definition: pcm.h:549
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)
Restrict a configuration space with a maximum period size.
Definition: pcm.c:4689
int snd_pcm_chmap_print(const snd_pcm_chmap_t *map, size_t maxlen, char *buf)
Definition: pcm.c:7612
Definition: pcm.h:281
void snd_pcm_access_mask_free(snd_pcm_access_mask_t *obj)
frees a previously allocated snd_pcm_access_mask_t
Definition: pcm.c:3304
Definition: pcm.h:161
int snd_pcm_hw_params_set_subformat_mask(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_mask_t *mask)
Restrict a configuration space to contain only a set of subformats.
Definition: pcm.c:3902
void snd_pcm_format_mask_free(snd_pcm_format_mask_t *obj)
frees a previously allocated snd_pcm_format_mask_t
Definition: pcm.c:3406
int snd_pcm_subformat_mask_empty(const snd_pcm_subformat_mask_t *mask)
test, if given a snd_pcm_subformat_mask_t is empty
Definition: pcm.c:3559
const char * snd_pcm_xrun_mode_name(snd_pcm_xrun_t mode) __attribute__((deprecated))
(DEPRECATED) get name of PCM xrun mode setting
Definition: pcm.c:1819
int snd_pcm_hw_params_test_periods(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir)
Verify if a periods count is available inside a configuration space for a PCM.
Definition: pcm.c:4865
Definition: pcm.h:402
int snd_pcm_hw_params_set_periods_integer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
Restrict a configuration space to contain only integer periods counts.
Definition: pcm.c:4995
snd_pcm_uframes_t snd_pcm_meter_get_now(snd_pcm_t *pcm)
Get meter "now" frame pointer from a SND_PCM_TYPE_METER PCM.
Definition: pcm_meter.c:922
Definition: pcm.h:528
Definition: pcm.h:392
snd_pcm_format_t
Definition: pcm.h:123
const char * snd_pcm_chmap_long_name(enum snd_pcm_chmap_position val)
Definition: pcm.c:7597
long snd_pcm_sframes_t
Definition: pcm.h:336
Definition: pcm.h:279
Definition: pcm.h:153
int snd_pcm_hw_params_test_rate(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir)
Verify if a rate is available inside a configuration space for a PCM.
Definition: pcm.c:4137
Definition: pcm.h:366
Definition: pcm.h:535
int snd_pcm_hw_params_test_buffer_size(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t val)
Verify if a buffer size is available inside a configuration space for a PCM.
Definition: pcm.c:5258
Definition: pcm.h:195
Definition: pcm.h:173
int snd_pcm_open_lconf(snd_pcm_t **pcm, const char *name, snd_pcm_stream_t stream, int mode, snd_config_t *lconf)
Opens a PCM using local configuration.
Definition: pcm.c:2309
Definition: pcm.h:287
const char * snd_pcm_tstamp_mode_name(const snd_pcm_tstamp_t mode)
get name of PCM tstamp mode setting
Definition: pcm.c:1835
const char * snd_pcm_chmap_type_name(enum snd_pcm_chmap_type val)
Definition: pcm.c:7511
int snd_pcm_hw_params_get_channels_min(const snd_pcm_hw_params_t *params, unsigned int *val)
Extract minimum channels count from a configuration space.
Definition: pcm.c:3942
int snd_pcm_mmap_begin(snd_pcm_t *pcm, const snd_pcm_channel_area_t **areas, snd_pcm_uframes_t *offset, snd_pcm_uframes_t *frames)
Application request to access a portion of direct (mmap) area.
Definition: pcm.c:6610
int snd_pcm_meter_add_scope(snd_pcm_t *pcm, snd_pcm_scope_t *scope)
Add a scope to a SND_PCM_TYPE_METER PCM.
Definition: pcm_meter.c:845
Definition: pcm.h:550
Definition: pcm.h:234
void snd_pcm_format_mask_none(snd_pcm_format_mask_t *mask)
reset all bits in a snd_pcm_format_mask_t
Definition: pcm.c:3426
void snd_pcm_hw_params_free(snd_pcm_hw_params_t *obj)
frees a previously allocated snd_pcm_hw_params_t
Definition: pcm.c:3612
int snd_pcm_hw_params_get_access(const snd_pcm_hw_params_t *params, snd_pcm_access_t *_access)
Extract access type from a configuration space.
Definition: pcm.c:3638
int snd_pcm_hw_params_set_subformat(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_t subformat)
Restrict a configuration space to contain only one subformat.
Definition: pcm.c:3858
void snd_pcm_access_mask_copy(snd_pcm_access_mask_t *dst, const snd_pcm_access_mask_t *src)
copy one snd_pcm_access_mask_t to another
Definition: pcm.c:3314
Definition: pcm.h:232
void snd_pcm_info_set_stream(snd_pcm_info_t *obj, snd_pcm_stream_t val)
Set wanted stream inside a PCM info container (see snd_ctl_pcm_info)
Definition: pcm.c:6586
struct _snd_pcm_scope snd_pcm_scope_t
Definition: pcm.h:448
size_t snd_pcm_hw_params_sizeof(void)
get size of snd_pcm_hw_params_t
Definition: pcm.c:3589
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))
(DEPRECATED) Restrict a configuration space to have tick time nearest to a target ...
Definition: pcm.c:5535
int snd_pcm_hw_params_get_rate_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
Extract minimum rate from a configuration space.
Definition: pcm.c:4103
snd_pcm_sframes_t snd_pcm_avail(snd_pcm_t *pcm)
Return number of frames ready to be read (capture) / written (playback)
Definition: pcm.c:2524
int snd_pcm_sw_params_set_avail_min(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val)
Set avail min inside a software configuration container.
Definition: pcm.c:5924
Definition: pcm.h:359
void snd_pcm_info_set_device(snd_pcm_info_t *obj, unsigned int val)
Set wanted device inside a PCM info container (see snd_ctl_pcm_info)
Definition: pcm.c:6564
int snd_pcm_hw_params_set_rate_resample(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val)
Restrict a configuration space to contain only real hardware rates.
Definition: pcm.c:4268
Definition: pcm.h:538
int snd_pcm_hw_params_set_channels_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val)
Restrict a configuration space to contain only its maximum channels count.
Definition: pcm.c:4066
const char * snd_pcm_scope_get_name(snd_pcm_scope_t *scope)
Get name of a SND_PCM_TYPE_METER PCM scope.
Definition: pcm_meter.c:960
int snd_pcm_scope_s16_open(snd_pcm_t *pcm, const char *name, snd_pcm_scope_t **scopep)
Add a s16 pseudo scope to a SND_PCM_TYPE_METER PCM.
Definition: pcm_meter.c:1176
Definition: pcm.h:543
unsigned int snd_pcm_info_get_subdevice(const snd_pcm_info_t *obj)
Get subdevice from a PCM info container.
Definition: pcm.c:6441
Definition: pcm.h:177
int snd_pcm_hw_params_set_period_time_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
Restrict a configuration space with a minimum period time.
Definition: pcm.c:4471
unsigned int snd_pcm_info_get_subdevices_count(const snd_pcm_info_t *obj)
Get subdevices count from a PCM info container.
Definition: pcm.c:6529
Definition: pcm.h:548
int snd_pcm_hw_params_get_period_time(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
Extract period time from a configuration space.
Definition: pcm.c:4388
const char * snd_pcm_info_get_id(const snd_pcm_info_t *obj)
Get id from a PCM info container.
Definition: pcm.c:6474
int snd_pcm_hw_params_get_tick_time(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir) __attribute__((deprecated))
(DEPRECATED) Extract tick time from a configuration space
Definition: pcm.c:5400
int snd_pcm_hw_params_get_fifo_size(const snd_pcm_hw_params_t *params)
Get hardware FIFO size info from a configuration space.
Definition: pcm.c:3253
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)
Restrict a configuration space to have period sizes in a given range.
Definition: pcm.c:4710
snd_pcm_state_t snd_pcm_status_get_state(const snd_pcm_status_t *obj)
Get state from a PCM status container (see snd_pcm_state)
Definition: pcm.c:6255
int snd_pcm_sw_params_set_stop_threshold(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val)
Set stop threshold inside a software configuration container.
Definition: pcm.c:6073
Definition: pcm.h:414
void snd_pcm_subformat_mask_any(snd_pcm_subformat_mask_t *mask)
set all bits in a snd_pcm_subformat_mask_t
Definition: pcm.c:3538
Definition: pcm.h:370
Definition: pcm.h:81
Definition: pcm.h:171
struct _snd_output snd_output_t
Internal structure for an output object.
Definition: output.h:54
struct timespec snd_htimestamp_t
Definition: global.h:153
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))
(DEPRECATED) Set xrun mode inside a software configuration container
Definition: pcm.c:5767
void snd_pcm_free_chmaps(snd_pcm_chmap_query_t **maps)
Definition: pcm.c:7455
int snd_pcm_hw_params_set_format(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t val)
Restrict a configuration space to contain only one format.
Definition: pcm.c:3764
void snd_pcm_status_get_htstamp(const snd_pcm_status_t *obj, snd_htimestamp_t *ptr)
Get "now" hi-res timestamp from a PCM status container.
Definition: pcm.c:6317
size_t snd_pcm_access_mask_sizeof(void)
get size of snd_pcm_access_mask_t
Definition: pcm.c:3281
int snd_pcm_hw_params_set_channels(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val)
Restrict a configuration space to contain only one channels count.
Definition: pcm.c:3982
snd_pcm_sframes_t snd_pcm_mmap_readi(snd_pcm_t *pcm, void *buffer, snd_pcm_uframes_t size)
Read interleaved frames from a PCM using direct buffer (mmap)
Definition: pcm_mmap.c:232
snd_pcm_uframes_t snd_pcm_meter_get_bufsize(snd_pcm_t *pcm)
Get meter buffer size from a SND_PCM_TYPE_METER PCM.
Definition: pcm_meter.c:880
void snd_pcm_subformat_mask_copy(snd_pcm_subformat_mask_t *dst, const snd_pcm_subformat_mask_t *src)
copy one snd_pcm_subformat_mask_t to another
Definition: pcm.c:3519
Definition: pcm.h:1212
int snd_pcm_hw_params_set_buffer_time_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
Restrict a configuration space with a maximum buffer time.
Definition: pcm.c:5110
void snd_pcm_scope_set_ops(snd_pcm_scope_t *scope, const snd_pcm_scope_ops_t *val)
Set callbacks for a SND_PCM_TYPE_METER PCM scope.
Definition: pcm_meter.c:970
void snd_pcm_subformat_mask_set(snd_pcm_subformat_mask_t *mask, snd_pcm_subformat_t val)
make a subformat present in a snd_pcm_subformat_mask_t
Definition: pcm.c:3569
Definition: pcm.h:139
Definition: pcm.h:527
Definition: pcm.h:199
Definition: pcm.h:181
int snd_pcm_hw_params_is_half_duplex(const snd_pcm_hw_params_t *params)
Check if hardware does half-duplex only.
Definition: pcm.c:3115
Definition: pcm.h:85
Definition: pcm.h:300
void snd_pcm_format_mask_any(snd_pcm_format_mask_t *mask)
set all bits in a snd_pcm_format_mask_t
Definition: pcm.c:3435
int snd_pcm_hw_params_set_period_wakeup(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val)
Restrict a configuration space to settings without period wakeups.
Definition: pcm.c:4347
Definition: pcm.h:545
snd_pcm_sframes_t snd_pcm_readn(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size)
Read non interleaved frames to a PCM.
Definition: pcm.c:1345
void snd_pcm_status_get_trigger_tstamp(const snd_pcm_status_t *obj, snd_timestamp_t *ptr)
Get trigger timestamp from a PCM status container.
Definition: pcm.c:6270
int snd_pcm_hw_params_get_rate_numden(const snd_pcm_hw_params_t *params, unsigned int *rate_num, unsigned int *rate_den)
Get rate exact info from a configuration space.
Definition: pcm.c:3212
Definition: pcm.h:410
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))
(DEPRECATED) Restrict a configuration space with a maximum tick time
Definition: pcm.c:5500
Definition: pcm.h:533
Definition: pcm.h:291
snd_spcm_xrun_type_t
Definition: pcm.h:1200
int snd_pcm_hw_params_set_access_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t *_access)
Restrict a configuration space to contain only its first access type.
Definition: pcm.c:3682
Definition: pcm.h:201
int snd_pcm_sw_params_set_sleep_min(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, unsigned int val) __attribute__((deprecated))
(DEPRECATED) Set minimum number of ticks to sleep inside a software configuration container ...
Definition: pcm.c:5885
snd_pcm_hook_type_t
Definition: pcm.h:1098
snd_pcm_sframes_t snd_pcm_mmap_writei(snd_pcm_t *pcm, const void *buffer, snd_pcm_uframes_t size)
Write interleaved frames to a PCM using direct buffer (mmap)
Definition: pcm_mmap.c:182
int snd_pcm_dump_setup(snd_pcm_t *pcm, snd_output_t *out)
Dump current setup (hardware and software) for PCM.
Definition: pcm.c:1946
snd_pcm_stream_t snd_pcm_stream(snd_pcm_t *pcm)
get stream for a PCM handle
Definition: pcm.c:677
Definition: pcm.h:1193
Definition: pcm.h:519
snd_pcm_sframes_t snd_pcm_avail_update(snd_pcm_t *pcm)
Return number of frames ready to be read (capture) / written (playback)
Definition: pcm.c:2507
snd_pcm_sync_id_t snd_pcm_info_get_sync(const snd_pcm_info_t *obj)
Get hardware synchronization ID from a PCM info container.
Definition: pcm.c:6551
Definition: pcm.h:226
Definition: pcm.h:361
Definition: pcm.h:277
int snd_pcm_hw_params_set_export_buffer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val)
Restrict a configuration space to allow the buffer to be accessible from outside. ...
Definition: pcm.c:4300
Definition: pcm.h:183
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))
(DEPRECATED) Restrict a configuration space to contain only one tick time
Definition: pcm.c:5470
snd_pcm_t * snd_pcm_hook_get_pcm(snd_pcm_hook_t *hook)
Get PCM handle for a PCM hook.
Definition: pcm_hooks.c:560
snd_pcm_chmap_query_t ** snd_pcm_query_chmaps(snd_pcm_t *pcm)
Definition: pcm.c:7444
snd_pcm_subclass_t snd_pcm_info_get_subclass(const snd_pcm_info_t *obj)
Get subclass from a PCM info container.
Definition: pcm.c:6518
snd_spcm_duplex_type_t
Definition: pcm.h:1208
snd_pcm_class_t snd_pcm_info_get_class(const snd_pcm_info_t *obj)
Get class from a PCM info container.
Definition: pcm.c:6507
int snd_pcm_sw_params_set_tstamp_mode(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_tstamp_t val)
Set timestamp mode inside a software configuration container.
Definition: pcm.c:5815
Definition: pcm.h:398
void snd_pcm_access_mask_none(snd_pcm_access_mask_t *mask)
reset all bits in a snd_pcm_access_mask_t
Definition: pcm.c:3324
struct _snd_pcm_access_mask snd_pcm_access_mask_t
Definition: pcm.h:69
Definition: pcm.h:236
int snd_pcm_set_params(snd_pcm_t *pcm, snd_pcm_format_t format, snd_pcm_access_t access, unsigned int channels, unsigned int rate, int soft_resample, unsigned int latency)
Set the hardware and software parameters in a simple way.
Definition: pcm.c:7940
size_t snd_pcm_subformat_mask_sizeof(void)
get size of snd_pcm_subformat_mask_t
Definition: pcm.c:3486
int snd_pcm_htimestamp(snd_pcm_t *pcm, snd_pcm_uframes_t *avail, snd_htimestamp_t *tstamp)
Obtain last position update hi-res timestamp.
Definition: pcm.c:1030
void * snd_pcm_hook_get_private(snd_pcm_hook_t *hook)
Get callback function private data for a PCM hook.
Definition: pcm_hooks.c:571
int snd_pcm_scope_malloc(snd_pcm_scope_t **ptr)
allocate an invalid snd_pcm_scope_t using standard malloc
Definition: pcm_meter.c:1227
Definition: pcm.h:406
const char * snd_pcm_type_name(snd_pcm_type_t type)
get name of PCM type
Definition: pcm.c:1874
snd_pcm_sframes_t snd_pcm_rewindable(snd_pcm_t *pcm)
Get safe count of frames which can be rewinded.
Definition: pcm.c:1160
snd_pcm_sframes_t snd_pcm_bytes_to_frames(snd_pcm_t *pcm, ssize_t bytes)
Convert bytes in frames for a PCM.
Definition: pcm.c:1993
void snd_pcm_access_mask_set(snd_pcm_access_mask_t *mask, snd_pcm_access_t val)
make an access type present in a snd_pcm_access_mask_t
Definition: pcm.c:3364
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))
(DEPRECATED) Restrict a configuration space to contain only its minimum tick time ...
Definition: pcm.c:5554
const char * snd_pcm_stream_name(const snd_pcm_stream_t stream)
get name of PCM stream type
Definition: pcm.c:1704
snd_pcm_stream_t snd_pcm_info_get_stream(const snd_pcm_info_t *obj)
Get stream (direction) from a PCM info container.
Definition: pcm.c:6452
struct _snd_pcm_hook snd_pcm_hook_t
Definition: pcm.h:1106
void snd_pcm_status_free(snd_pcm_status_t *obj)
frees a previously allocated snd_pcm_status_t
Definition: pcm.c:6234
snd_pcm_sframes_t snd_pcm_forwardable(snd_pcm_t *pcm)
Get safe count of frames which can be forwarded.
Definition: pcm.c:1198
int snd_pcm_sw_params_get_tstamp_type(const snd_pcm_sw_params_t *params, snd_pcm_tstamp_type_t *val)
Get timestamp type from a software configuration container.
Definition: pcm.c:5868
int snd_pcm_hw_params_get_rate(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
Extract rate from a configuration space.
Definition: pcm.c:4085
u_int32_t snd_pcm_format_silence_32(snd_pcm_format_t format)
Return 32 bit expressing silence for a PCM sample format.
Definition: pcm_misc.c:542
int snd_pcm_dump_hw_setup(snd_pcm_t *pcm, snd_output_t *out)
Dump current hardware setup for PCM.
Definition: pcm.c:1889
ssize_t snd_pcm_format_size(snd_pcm_format_t format, size_t samples)
Return bytes needed to store a quantity of PCM sample.
Definition: pcm_misc.c:326
int snd_pcm_hw_params_can_sync_start(const snd_pcm_hw_params_t *params)
Check if hardware supports synchronized start with sample resolution.
Definition: pcm.c:3155
Definition: pcm.h:101
const char * snd_pcm_name(snd_pcm_t *pcm)
get identifier of PCM handle
Definition: pcm.c:651
int snd_pcm_hw_params_set_access_mask(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_mask_t *mask)
Restrict a configuration space to contain only a set of access types.
Definition: pcm.c:3711
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))
(DEPRECATED) Restrict a configuration space to have tick times in a given range
Definition: pcm.c:5517
Definition: pcm.h:185
int snd_pcm_sw_params_get_stop_threshold(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val)
Get stop threshold from a software configuration container.
Definition: pcm.c:6095
long snd_pcm_bytes_to_samples(snd_pcm_t *pcm, ssize_t bytes)
Convert bytes in samples for a PCM.
Definition: pcm.c:2025
int snd_pcm_hw_params_set_buffer_size_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val)
Restrict a configuration space with a minimum buffer size.
Definition: pcm.c:5284
int snd_pcm_hw_params_test_access(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t _access)
Verify if an access type is available inside a configuration space for a PCM.
Definition: pcm.c:3655
int snd_pcm_hw_params_get_buffer_time_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
Extract maximum buffer time from a configuration space.
Definition: pcm.c:5049
Definition: pcm.h:372
int snd_pcm_hw_params_can_resume(const snd_pcm_hw_params_t *params)
Check if hardware supports resume.
Definition: pcm.c:3095
Definition: pcm.h:283
snd_pcm_state_t snd_pcm_state(snd_pcm_t *pcm)
Return PCM state.
Definition: pcm.c:932
snd_pcm_tstamp_type_t
Definition: pcm.h:326
int snd_pcm_hw_params_get_subformat(const snd_pcm_hw_params_t *params, snd_pcm_subformat_t *subformat)
Extract subformat from a configuration space.
Definition: pcm.c:3833
int snd_pcm_hw_params_set_buffer_size_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val)
Restrict a configuration space to contain only its minimum buffer size.
Definition: pcm.c:5357
snd_pcm_uframes_t snd_pcm_status_get_overrange(const snd_pcm_status_t *obj)
Get count of ADC overrange detections since last call.
Definition: pcm.c:6376
Definition: pcm.h:404
int snd_pcm_sw_params_current(snd_pcm_t *pcm, snd_pcm_sw_params_t *params)
Return current software configuration for a PCM.
Definition: pcm.c:5614
Definition: pcm.h:224
Definition: pcm.h:79
int snd_pcm_resume(snd_pcm_t *pcm)
Resume from suspend, no samples are lost.
Definition: pcm.c:1010
int snd_pcm_format_mask_malloc(snd_pcm_format_mask_t **ptr)
allocate an empty snd_pcm_format_mask_t using standard malloc
Definition: pcm.c:3393
snd_pcm_sframes_t snd_pcm_writen(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size)
Write non interleaved frames to a PCM.
Definition: pcm.c:1281
u_int16_t snd_pcm_format_silence_16(snd_pcm_format_t format)
Return 16 bit expressing silence for a PCM sample format.
Definition: pcm_misc.c:553
int snd_pcm_format_signed(snd_pcm_format_t format)
Return sign info for a PCM sample linear format.
Definition: pcm_misc.c:35
int snd_pcm_hw_params_set_rate_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
Restrict a configuration space with a maximum rate.
Definition: pcm.c:4182
int snd_pcm_hw_params_set_rate_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
Restrict a configuration space to contain only its maximum rate.
Definition: pcm.c:4255
Definition: pcm.h:542
snd_pcm_t * snd_async_handler_get_pcm(snd_async_handler_t *handler)
Return PCM handle related to an async handler.
Definition: pcm.c:2091
int snd_pcm_prepare(snd_pcm_t *pcm)
Prepare PCM for use.
Definition: pcm.c:1045
Definition: pcm.h:390
int snd_pcm_info_get_card(const snd_pcm_info_t *obj)
Get card from a PCM info container.
Definition: pcm.c:6463
Definition: pcm.h:151
snd_pcm_uframes_t snd_pcm_meter_get_boundary(snd_pcm_t *pcm)
Get boundary for frame pointers from a SND_PCM_TYPE_METER PCM.
Definition: pcm_meter.c:936
Definition: pcm.h:285
Definition: pcm.h:116
int snd_spcm_init(snd_pcm_t *pcm, unsigned int rate, unsigned int channels, snd_pcm_format_t format, snd_pcm_subformat_t subformat, snd_spcm_latency_t latency, snd_pcm_access_t _access, snd_spcm_xrun_type_t xrun_type)
Set up a simple PCM.
Definition: pcm_simple.c:157
struct _snd_async_handler snd_async_handler_t
Internal structure for an async notification client handler.
Definition: global.h:114
int snd_pcm_format_cpu_endian(snd_pcm_format_t format)
Return endian info for a PCM sample format.
Definition: pcm_misc.c:188
Definition: pcm.h:189
int snd_pcm_drain(snd_pcm_t *pcm)
Stop a PCM preserving pending frames.
Definition: pcm.c:1121
Definition: pcm.h:230
Definition: pcm.h:83
void snd_pcm_sw_params_free(snd_pcm_sw_params_t *obj)
frees a previously allocated snd_pcm_sw_params_t
Definition: pcm.c:5684
int snd_pcm_hw_params_set_periods_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
Restrict a configuration space to contain only its maximum periods count.
Definition: pcm.c:4983
struct timeval snd_timestamp_t
Definition: global.h:151
int snd_pcm_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
Install one PCM hardware configuration chosen from a configuration space and snd_pcm_prepare it...
Definition: pcm.c:831
int snd_pcm_format_physical_width(snd_pcm_format_t format)
Return bits needed to store a PCM sample.
Definition: pcm_misc.c:265
int snd_pcm_hw_params_test_period_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir)
Verify if a period time is available inside a configuration space for a PCM.
Definition: pcm.c:4440
Definition: pcm.h:525
Definition: pcm.h:92
int snd_pcm_hw_params_set_periods_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
Restrict a configuration space with a maximum periods count.
Definition: pcm.c:4910
Definition: pcm.h:169
Definition: pcm.h:546
int(* snd_pcm_hook_func_t)(snd_pcm_hook_t *hook)
Definition: pcm.h:1108
int snd_pcm_pause(snd_pcm_t *pcm, int enable)
Pause/resume PCM.
Definition: pcm.c:1141
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)
Restrict a configuration space to have buffer times in a given range.
Definition: pcm.c:5127
int snd_pcm_hw_params_set_buffer_size_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val)
Restrict a configuration space with a maximum buffer size.
Definition: pcm.c:5300
int snd_pcm_hw_free(snd_pcm_t *pcm)
Remove PCM hardware configuration and free associated resources.
Definition: pcm.c:846
int snd_pcm_sw_params(snd_pcm_t *pcm, snd_pcm_sw_params_t *params)
Install PCM software configuration defined by params.
Definition: pcm.c:874
int snd_pcm_subformat_mask_malloc(snd_pcm_subformat_mask_t **ptr)
allocate an empty snd_pcm_subformat_mask_t using standard malloc
Definition: pcm.c:3496
unsigned int step
Definition: pcm.h:434
Definition: pcm.h:147
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)
Restrict a configuration space to have periods counts in a given range.
Definition: pcm.c:4927
int snd_pcm_dump(snd_pcm_t *pcm, snd_output_t *out)
Dump PCM info.
Definition: pcm.c:1979
unsigned int snd_pcm_chmap_from_string(const char *str)
Definition: pcm.c:7690
unsigned int snd_pcm_info_get_device(const snd_pcm_info_t *obj)
Get device from a PCM info container.
Definition: pcm.c:6430
int snd_pcm_hw_params_set_period_size_integer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
Restrict a configuration space to contain only integer period sizes.
Definition: pcm.c:4795
int snd_pcm_link(snd_pcm_t *pcm1, snd_pcm_t *pcm2)
Link two PCMs.
Definition: pcm.c:1368
int snd_pcm_hw_params_set_buffer_time_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
Restrict a configuration space to have buffer time nearest to a target.
Definition: pcm.c:5145
Definition: pcm.h:191
const char * snd_pcm_access_name(const snd_pcm_access_t _access)
get name of PCM access type
Definition: pcm.c:1716
Definition: pcm.h:187
Definition: pcm.h:529
const char * snd_pcm_subformat_name(const snd_pcm_subformat_t subformat)
get name of PCM sample subformat
Definition: pcm.c:1779
int snd_pcm_hw_params_set_buffer_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir)
Restrict a configuration space to contain only one buffer time.
Definition: pcm.c:5080
int snd_pcm_subformat_mask_test(const snd_pcm_subformat_mask_t *mask, snd_pcm_subformat_t val)
test the presence of a subformat in a snd_pcm_subformat_mask_t
Definition: pcm.c:3548
Definition: pcm.h:364
int snd_pcm_unlink(snd_pcm_t *pcm)
Remove a PCM from a linked group.
Definition: pcm.c:1382
int snd_pcm_reset(snd_pcm_t *pcm)
Reset PCM position.
Definition: pcm.c:1062
void snd_pcm_sw_params_copy(snd_pcm_sw_params_t *dst, const snd_pcm_sw_params_t *src)
copy one snd_pcm_sw_params_t to another
Definition: pcm.c:5694
Definition: pcm.h:420
int snd_pcm_info_malloc(snd_pcm_info_t **ptr)
allocate an invalid snd_pcm_info_t using standard malloc
Definition: pcm.c:6396
snd_pcm_chmap_t * snd_pcm_chmap_parse_string(const char *str)
Definition: pcm.c:7702
Definition: pcm.h:553
snd_pcm_sframes_t snd_pcm_mmap_readn(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size)
Read non interleaved frames to a PCM using direct buffer (mmap)
Definition: pcm_mmap.c:257
int snd_pcm_hw_params_get_period_time_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
Extract maximum period time from a configuration space.
Definition: pcm.c:4424
int snd_pcm_hw_params_set_period_time_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
Restrict a configuration space with a maximum period time.
Definition: pcm.c:4486
Definition: pcm.h:438
const char * snd_pcm_format_name(const snd_pcm_format_t format)
get name of PCM sample format
Definition: pcm.c:1728
int snd_pcm_hw_params_set_channels_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val)
Restrict a configuration space with a minimum channels count.
Definition: pcm.c:3994
int snd_pcm_hw_params_get_format(const snd_pcm_hw_params_t *params, snd_pcm_format_t *val)
Extract format from a configuration space.
Definition: pcm.c:3739
snd_pcm_format_t snd_pcm_build_linear_format(int width, int pwidth, int unsignd, int big_endian)
Compose a PCM sample linear format.
Definition: pcm_misc.c:684
void snd_pcm_status_copy(snd_pcm_status_t *dst, const snd_pcm_status_t *src)
copy one snd_pcm_status_t to another
Definition: pcm.c:6244
int snd_pcm_hook_add(snd_pcm_hook_t **hookp, snd_pcm_t *pcm, snd_pcm_hook_type_t type, snd_pcm_hook_func_t func, void *private_data)
Add a PCM hook at end of hooks chain.
Definition: pcm_hooks.c:600
int snd_pcm_hw_params_can_overrange(const snd_pcm_hw_params_t *params)
Check if hardware supports overrange detection.
Definition: pcm.c:3055
Definition: pcm.h:298
int snd_pcm_hw_params_is_batch(const snd_pcm_hw_params_t *params)
Check if hardware does double buffering for data transfers for given configuration.
Definition: pcm.c:2995
Definition: pcm.h:155
int snd_pcm_hw_params_get_min_align(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val)
Get the minimum transfer align value in samples.
Definition: pcm.c:5585
int snd_async_add_pcm_handler(snd_async_handler_t **handler, snd_pcm_t *pcm, snd_async_callback_t callback, void *private_data)
Add an async handler for a PCM.
Definition: pcm.c:2061
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))
(DEPRECATED) Restrict a configuration space with a minimum tick time
Definition: pcm.c:5485
Definition: pcm.h:522
unsigned int snd_pcm_info_get_subdevices_avail(const snd_pcm_info_t *obj)
Get available subdevices count from a PCM info container.
Definition: pcm.c:6540
int snd_pcm_format_mask_empty(const snd_pcm_format_mask_t *mask)
test, if given a snd_pcm_format_mask_t is empty
Definition: pcm.c:3456
int snd_pcm_recover(snd_pcm_t *pcm, int err, int silent)
Recover the stream state from an error or suspend.
Definition: pcm.c:7892
snd_pcm_tstamp_t
Definition: pcm.h:314
int snd_spcm_init_duplex(snd_pcm_t *playback_pcm, snd_pcm_t *capture_pcm, unsigned int rate, unsigned int channels, snd_pcm_format_t format, snd_pcm_subformat_t subformat, snd_spcm_latency_t latency, snd_pcm_access_t _access, snd_spcm_xrun_type_t xrun_type, snd_spcm_duplex_type_t duplex_type)
Initialize simple PCMs in the duplex mode.
Definition: pcm_simple.c:212
int snd_pcm_hw_params_set_periods_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
Restrict a configuration space to have periods count nearest to a target.
Definition: pcm.c:4945
snd_pcm_chmap_position
Definition: pcm.h:518
struct _snd_pcm_format_mask snd_pcm_format_mask_t
Definition: pcm.h:71
unsigned int first
Definition: pcm.h:432
int snd_pcm_hw_params_set_channels_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val)
Restrict a configuration space to contain only its minimum channels count.
Definition: pcm.c:4050
int snd_pcm_hw_params_set_buffer_time_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
Restrict a configuration space with a minimum buffer time.
Definition: pcm.c:5095
struct _snd_config snd_config_t
Internal structure for a configuration node object.
Definition: conf.h:69
int snd_pcm_hw_params_set_periods(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir)
Restrict a configuration space to contain only one periods count.
Definition: pcm.c:4880
int snd_pcm_hw_params_any(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
Fill params with a full configuration space for a PCM.
Definition: pcm.c:3271
void snd_pcm_scope_set_callback_private(snd_pcm_scope_t *scope, void *val)
Get callbacks private value for a SND_PCM_TYPE_METER PCM scope.
Definition: pcm_meter.c:990
int snd_pcm_hw_params_get_period_time_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
Extract minimum period time from a configuration space.
Definition: pcm.c:4406
Definition: pcm.h:322
void snd_pcm_subformat_mask_none(snd_pcm_subformat_mask_t *mask)
reset all bits in a snd_pcm_subformat_mask_t
Definition: pcm.c:3529
int snd_pcm_sw_params_set_silence_size(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val)
Set silence size inside a software configuration container.
Definition: pcm.c:6172
Definition: pcm.h:328
snd_pcm_sframes_t snd_pcm_forward(snd_pcm_t *pcm, snd_pcm_uframes_t frames)
Move application frame position forward.
Definition: pcm.c:1218
Definition: pcm.h:197
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)
Restrict a configuration space to contain only its maximum period size.
Definition: pcm.c:4779
int snd_pcm_sw_params_get_sleep_min(const snd_pcm_sw_params_t *params, unsigned int *val) __attribute__((deprecated))
(DEPRECATED) Get minimum numbers of ticks to sleep from a software configuration container ...
Definition: pcm.c:5900
Definition: pcm.h:532
u_int8_t snd_pcm_format_silence(snd_pcm_format_t format)
Return 8 bit expressing silence for a PCM sample format.
Definition: pcm_misc.c:564
Definition: pcm.h:396
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))
(DEPRECATED) Set start mode inside a software configuration container
Definition: pcm.c:5720
ssize_t snd_pcm_frames_to_bytes(snd_pcm_t *pcm, snd_pcm_sframes_t frames)
Convert frames in bytes for a PCM.
Definition: pcm.c:2009
int snd_pcm_sw_params_set_silence_threshold(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val)
Set silence threshold inside a software configuration container.
Definition: pcm.c:6118
Definition: pcm.h:512
int snd_pcm_hw_params_set_format_mask(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_mask_t *mask)
Restrict a configuration space to contain only a set of formats.
Definition: pcm.c:3808
Definition: pcm.h:307
int snd_pcm_hw_params_set_period_time_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
Restrict a configuration space to have period time nearest to a target.
Definition: pcm.c:4521
int snd_pcm_hw_params_set_access(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t _access)
Restrict a configuration space to contain only one access type.
Definition: pcm.c:3667
int snd_pcm_sw_params_get_period_event(const snd_pcm_sw_params_t *params, int *val)
Get period event from a software configuration container.
Definition: pcm.c:5977
int snd_pcm_hw_params_test_channels(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val)
Verify if a channels count is available inside a configuration space for a PCM.
Definition: pcm.c:3970
unsigned int snd_pcm_meter_get_rate(snd_pcm_t *pcm)
Get meter rate from a SND_PCM_TYPE_METER PCM.
Definition: pcm_meter.c:908
int snd_pcm_hw_params_set_channels_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val)
Restrict a configuration space to have channels count nearest to a target.
Definition: pcm.c:4034
int snd_pcm_hw_params_get_sbits(const snd_pcm_hw_params_t *params)
Get sample resolution info from a configuration space.
Definition: pcm.c:3234
int snd_pcm_area_silence(const snd_pcm_channel_area_t *dst_channel, snd_pcm_uframes_t dst_offset, unsigned int samples, snd_pcm_format_t format)
Silence an area.
Definition: pcm.c:2581
int snd_pcm_hw_params_set_period_time_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
Restrict a configuration space to contain only its maximum period time.
Definition: pcm.c:4557
const char * snd_pcm_info_get_name(const snd_pcm_info_t *obj)
Get name from a PCM info container.
Definition: pcm.c:6485
snd_spcm_latency_t
Definition: pcm.h:1187
Definition: pcm.h:135
int snd_pcm_open(snd_pcm_t **pcm, const char *name, snd_pcm_stream_t stream, int mode)
Opens a PCM.
Definition: pcm.c:2289
int snd_pcm_poll_descriptors(snd_pcm_t *pcm, struct pollfd *pfds, unsigned int space)
get poll descriptors
Definition: pcm.c:1430
Definition: pcm.h:544
int snd_pcm_sw_params_set_start_threshold(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val)
Set start threshold inside a software configuration container.
Definition: pcm.c:6029
Definition: pcm.h:275
void snd_pcm_access_mask_reset(snd_pcm_access_mask_t *mask, snd_pcm_access_t val)
make an access type missing from a snd_pcm_access_mask_t
Definition: pcm.c:3374
Definition: pcm.h:330
int snd_pcm_hw_params_get_channels_max(const snd_pcm_hw_params_t *params, unsigned int *val)
Extract maximum channels count from a configuration space.
Definition: pcm.c:3957
int snd_pcm_access_mask_test(const snd_pcm_access_mask_t *mask, snd_pcm_access_t val)
test the presence of an access type in a snd_pcm_access_mask_t
Definition: pcm.c:3343
snd_pcm_sframes_t snd_pcm_writei(snd_pcm_t *pcm, const void *buffer, snd_pcm_uframes_t size)
Write interleaved frames to a PCM.
Definition: pcm.c:1249
int snd_pcm_hw_params_get_buffer_size_min(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val)
Extract minimum buffer size from a configuration space.
Definition: pcm.c:5218
int snd_pcm_hw_params_is_monotonic(const snd_pcm_hw_params_t *params)
Check if timestamps are monotonic for given configuration.
Definition: pcm.c:3035
Definition: pcm.h:511
void snd_pcm_status_get_audio_htstamp(const snd_pcm_status_t *obj, snd_htimestamp_t *ptr)
Get "now" hi-res audio timestamp from a PCM status container.
Definition: pcm.c:6330
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)
Restrict a configuration space to have rates in a given range.
Definition: pcm.c:4199
u_int64_t snd_pcm_format_silence_64(snd_pcm_format_t format)
Return 64 bit expressing silence for a PCM sample format.
Definition: pcm_misc.c:390
int snd_pcm_sw_params_get_silence_size(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val)
Get silence size from a software configuration container.
Definition: pcm.c:6198
snd_pcm_sframes_t snd_pcm_mmap_commit(snd_pcm_t *pcm, snd_pcm_uframes_t offset, snd_pcm_uframes_t frames)
Application has completed the access to area requested with snd_pcm_mmap_begin.
Definition: pcm.c:6690
int snd_pcm_format_little_endian(snd_pcm_format_t format)
Return endian info for a PCM sample format.
Definition: pcm_misc.c:124
int snd_pcm_hw_params_current(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
Retreive current PCM hardware configuration chosen with snd_pcm_hw_params.
Definition: pcm.c:780
unsigned long snd_pcm_uframes_t
Definition: pcm.h:334
snd_pcm_uframes_t snd_pcm_status_get_avail(const snd_pcm_status_t *obj)
Get number of frames available from a PCM status container (see snd_pcm_avail_update) ...
Definition: pcm.c:6356
snd_pcm_chmap_t * snd_pcm_get_chmap(snd_pcm_t *pcm)
Definition: pcm.c:7472
int snd_pcm_format_mask_test(const snd_pcm_format_mask_t *mask, snd_pcm_format_t val)
test the presence of a format in a snd_pcm_format_mask_t
Definition: pcm.c:3445
snd_pcm_sframes_t snd_pcm_mmap_writen(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size)
Write non interleaved frames to a PCM using direct buffer (mmap)
Definition: pcm_mmap.c:207
Definition: pcm.h:536
Definition: pcm.h:309
int snd_pcm_hw_params_set_channels_minmax(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *min, unsigned int *max)
Restrict a configuration space to have channels counts in a given range.
Definition: pcm.c:4019
int snd_pcm_hw_params_get_period_size_max(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *frames, int *dir)
Extract maximum period size from a configuration space.
Definition: pcm.c:4620
Definition: pcm.h:127
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)
Restrict a configuration space to have period times in a given range.
Definition: pcm.c:4503
int snd_pcm_hw_params_get_channels(const snd_pcm_hw_params_t *params, unsigned int *val)
Extract channels from a configuration space.
Definition: pcm.c:3927
const char * snd_pcm_subformat_description(const snd_pcm_subformat_t subformat)
get description of PCM sample subformat
Definition: pcm.c:1791
snd_pcm_chmap_query_t ** snd_pcm_query_chmaps_from_hw(int card, int dev, int subdev, snd_pcm_stream_t stream)
Definition: pcm_hw.c:1074
void * ptr
Definition: seq_event.h:199
int snd_pcm_hw_params_is_double(const snd_pcm_hw_params_t *params)
Check if hardware does double buffering for start/stop for given configuration.
Definition: pcm.c:2975
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))
(DEPRECATED) Restrict a configuration space to contain only its maximum tick time ...
Definition: pcm.c:5573
int snd_pcm_sw_params_get_silence_threshold(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val)
Get silence threshold from a software configuration container.
Definition: pcm.c:6144
int snd_pcm_avail_delay(snd_pcm_t *pcm, snd_pcm_sframes_t *availp, snd_pcm_sframes_t *delayp)
Combine snd_pcm_avail and snd_pcm_delay functions.
Definition: pcm.c:2548
int snd_pcm_hw_params_get_periods_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
Extract maximum periods count from a configuration space.
Definition: pcm.c:4849
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)
Restrict a configuration space to have period size nearest to a target.
Definition: pcm.c:4733
int snd_pcm_poll_descriptors_revents(snd_pcm_t *pcm, struct pollfd *pfds, unsigned int nfds, unsigned short *revents)
get returned events from poll descriptors
Definition: pcm.c:1467
Definition: pcm.h:94
snd_pcm_sframes_t snd_pcm_readi(snd_pcm_t *pcm, void *buffer, snd_pcm_uframes_t size)
Read interleaved frames from a PCM.
Definition: pcm.c:1313
int snd_pcm_dump_sw_setup(snd_pcm_t *pcm, snd_output_t *out)
Dump current software setup for PCM.
Definition: pcm.c:1919
void snd_pcm_format_mask_copy(snd_pcm_format_mask_t *dst, const snd_pcm_format_mask_t *src)
copy one snd_pcm_format_mask_t to another
Definition: pcm.c:3416
int snd_pcm_hw_params_set_rate(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir)
Restrict a configuration space to contain only one rate.
Definition: pcm.c:4152
snd_pcm_format_t snd_pcm_format_value(const char *name)
get PCM sample format from name
Definition: pcm.c:1752
Definition: pcm.h:238
Definition: pcm.h:521
snd_pcm_stream_t
Definition: pcm.h:99
int snd_pcm_sw_params_set_period_event(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, int val)
Set period event inside a software configuration container.
Definition: pcm.c:5964
int snd_pcm_sw_params_set_tstamp_type(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_tstamp_type_t val)
Set timestamp type inside a software configuration container.
Definition: pcm.c:5851
int snd_pcm_format_big_endian(snd_pcm_format_t format)
Return endian info for a PCM sample format.
Definition: pcm_misc.c:173
int snd_pcm_open_fallback(snd_pcm_t **pcm, snd_config_t *root, const char *name, const char *orig_name, snd_pcm_stream_t stream, int mode)
Opens a fallback PCM.
Definition: pcm.c:2327
Definition: pcm.h:175
int snd_pcm_hw_params_set_subformat_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_t *subformat)
Restrict a configuration space to contain only its first subformat.
Definition: pcm.c:3873
int snd_pcm_hw_params_set_buffer_time_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
Restrict a configuration space to contain only its maximum buffered time.
Definition: pcm.c:5183
Definition: pcm.h:524
Definition: pcm.h:555
Definition: pcm.h:526
int snd_pcm_hw_params_can_disable_period_wakeup(const snd_pcm_hw_params_t *params)
Check if hardware can disable period wakeups.
Definition: pcm.c:3171
Definition: pcm.h:408
enum _snd_pcm_type snd_pcm_type_t
Definition: pcm.h:425
Definition: pcm.h:547
Definition: pcm.h:1127
Definition: pcm.h:1190
void snd_pcm_info_copy(snd_pcm_info_t *dst, const snd_pcm_info_t *src)
copy one snd_pcm_info_t to another
Definition: pcm.c:6419
size_t snd_pcm_sw_params_sizeof(void)
get size of snd_pcm_sw_params_t
Definition: pcm.c:5661
int snd_pcm_area_copy(const snd_pcm_channel_area_t *dst_channel, snd_pcm_uframes_t dst_offset, const snd_pcm_channel_area_t *src_channel, snd_pcm_uframes_t src_offset, unsigned int samples, snd_pcm_format_t format)
Copy an area.
Definition: pcm.c:2736
void snd_pcm_info_set_subdevice(snd_pcm_info_t *obj, unsigned int val)
Set wanted subdevice inside a PCM info container (see snd_ctl_pcm_info)
Definition: pcm.c:6575
Definition: pcm.h:534
int snd_pcm_hw_params_supports_audio_wallclock_ts(const snd_pcm_hw_params_t *params)
Check if hardware supports audio wallclock timestamps.
Definition: pcm.c:3191
Definition: pcm.h:537
struct _snd_pcm snd_pcm_t
Definition: pcm.h:354
int snd_pcm_hw_params_get_buffer_time_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
Extract minimum buffer time from a configuration space.
Definition: pcm.c:5031
int snd_pcm_hw_params_get_access_mask(snd_pcm_hw_params_t *params, snd_pcm_access_mask_t *mask)
Get access mask from a configuration space.
Definition: pcm.c:3721
ssize_t snd_pcm_samples_to_bytes(snd_pcm_t *pcm, long samples)
Convert samples in bytes for a PCM.
Definition: pcm.c:2041
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)
Verify if a period size is available inside a configuration space for a PCM.
Definition: pcm.c:4640
unsigned int channels
Definition: pcm.h:569
snd_pcm_sframes_t snd_pcm_status_get_delay(const snd_pcm_status_t *obj)
Get delay from a PCM status container (see snd_pcm_delay)
Definition: pcm.c:6346
snd_pcm_sframes_t snd_pcm_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t frames)
Move application frame position backward.
Definition: pcm.c:1177
snd_pcm_xrun_t snd_pcm_sw_params_get_xrun_mode(const snd_pcm_sw_params_t *params) __attribute__((deprecated))
(DEPRECATED) Get xrun mode from a software configuration container
Definition: pcm.c:5794
int snd_pcm_access_mask_malloc(snd_pcm_access_mask_t **ptr)
allocate an empty snd_pcm_access_mask_t using standard malloc
Definition: pcm.c:3291
Definition: pcm.h:157
int snd_pcm_format_linear(snd_pcm_format_t format)
Return linear info for a PCM sample format.
Definition: pcm_misc.c:96
int snd_pcm_sw_params_malloc(snd_pcm_sw_params_t **ptr)
allocate an invalid snd_pcm_sw_params_t using standard malloc
Definition: pcm.c:5671
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)
Restrict a configuration space to contain only one period size.
Definition: pcm.c:4655
snd_pcm_access_t
Definition: pcm.h:108
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)
Restrict a configuration space to contain only its minimum period size.
Definition: pcm.c:4756
Definition: pcm.h:114
int snd_pcm_sw_params_get_start_threshold(const snd_pcm_sw_params_t *paramsm, snd_pcm_uframes_t *val)
Get start threshold from a software configuration container.
Definition: pcm.c:6049
Definition: pcm.h:382
const char * snd_pcm_state_name(const snd_pcm_state_t state)
get name of PCM state
Definition: pcm.c:1859