ALSA project - the C library reference
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups 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  SND_PCM_FORMAT_LAST = SND_PCM_FORMAT_U18_3BE,
203 
204 #if __BYTE_ORDER == __LITTLE_ENDIAN
205 
223 #elif __BYTE_ORDER == __BIG_ENDIAN
224 
242 #else
243 #error "Unknown endian"
244 #endif
246 
248 typedef enum _snd_pcm_subformat {
251  SND_PCM_SUBFORMAT_LAST = SND_PCM_SUBFORMAT_STD
253 
255 typedef enum _snd_pcm_state {
274  SND_PCM_STATE_LAST = SND_PCM_STATE_DISCONNECTED
276 
278 typedef enum _snd_pcm_start {
283  SND_PCM_START_LAST = SND_PCM_START_EXPLICIT
285 
287 typedef enum _snd_pcm_xrun {
292  SND_PCM_XRUN_LAST = SND_PCM_XRUN_STOP
294 
296 typedef enum _snd_pcm_tstamp {
305  SND_PCM_TSTAMP_LAST = SND_PCM_TSTAMP_ENABLE
307 
309 typedef unsigned long snd_pcm_uframes_t;
311 typedef long snd_pcm_sframes_t;
312 
314 #define SND_PCM_NONBLOCK 0x00000001
315 
316 #define SND_PCM_ASYNC 0x00000002
317 
318 #define SND_PCM_NO_AUTO_RESAMPLE 0x00010000
319 
320 #define SND_PCM_NO_AUTO_CHANNELS 0x00020000
321 
322 #define SND_PCM_NO_AUTO_FORMAT 0x00040000
323 
324 #define SND_PCM_NO_SOFTVOL 0x00080000
325 
327 typedef struct _snd_pcm snd_pcm_t;
328 
394  SND_PCM_TYPE_LAST = SND_PCM_TYPE_MMAP_EMUL
395 };
396 
399 
401 typedef struct _snd_pcm_channel_area {
403  void *addr;
405  unsigned int first;
407  unsigned int step;
409 
411 typedef union _snd_pcm_sync_id {
413  unsigned char id[16];
415  unsigned short id16[8];
417  unsigned int id32[4];
419 
421 typedef struct _snd_pcm_scope snd_pcm_scope_t;
422 
423 int snd_pcm_open(snd_pcm_t **pcm, const char *name,
424  snd_pcm_stream_t stream, int mode);
425 int snd_pcm_open_lconf(snd_pcm_t **pcm, const char *name,
426  snd_pcm_stream_t stream, int mode,
427  snd_config_t *lconf);
429  const char *name, const char *orig_name,
430  snd_pcm_stream_t stream, int mode);
431 
432 int snd_pcm_close(snd_pcm_t *pcm);
433 const char *snd_pcm_name(snd_pcm_t *pcm);
434 snd_pcm_type_t snd_pcm_type(snd_pcm_t *pcm);
437 int snd_pcm_poll_descriptors(snd_pcm_t *pcm, struct pollfd *pfds, unsigned int space);
438 int snd_pcm_poll_descriptors_revents(snd_pcm_t *pcm, struct pollfd *pfds, unsigned int nfds, unsigned short *revents);
439 int snd_pcm_nonblock(snd_pcm_t *pcm, int nonblock);
441  snd_async_callback_t callback, void *private_data);
443 int snd_pcm_info(snd_pcm_t *pcm, snd_pcm_info_t *info);
446 int snd_pcm_hw_free(snd_pcm_t *pcm);
449 int snd_pcm_prepare(snd_pcm_t *pcm);
450 int snd_pcm_reset(snd_pcm_t *pcm);
451 int snd_pcm_status(snd_pcm_t *pcm, snd_pcm_status_t *status);
452 int snd_pcm_start(snd_pcm_t *pcm);
453 int snd_pcm_drop(snd_pcm_t *pcm);
454 int snd_pcm_drain(snd_pcm_t *pcm);
455 int snd_pcm_pause(snd_pcm_t *pcm, int enable);
457 int snd_pcm_hwsync(snd_pcm_t *pcm);
458 int snd_pcm_delay(snd_pcm_t *pcm, snd_pcm_sframes_t *delayp);
459 int snd_pcm_resume(snd_pcm_t *pcm);
460 int snd_pcm_htimestamp(snd_pcm_t *pcm, snd_pcm_uframes_t *avail, snd_htimestamp_t *tstamp);
461 snd_pcm_sframes_t snd_pcm_avail(snd_pcm_t *pcm);
462 snd_pcm_sframes_t snd_pcm_avail_update(snd_pcm_t *pcm);
463 int snd_pcm_avail_delay(snd_pcm_t *pcm, snd_pcm_sframes_t *availp, snd_pcm_sframes_t *delayp);
464 snd_pcm_sframes_t snd_pcm_rewindable(snd_pcm_t *pcm);
465 snd_pcm_sframes_t snd_pcm_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t frames);
466 snd_pcm_sframes_t snd_pcm_forwardable(snd_pcm_t *pcm);
467 snd_pcm_sframes_t snd_pcm_forward(snd_pcm_t *pcm, snd_pcm_uframes_t frames);
468 snd_pcm_sframes_t snd_pcm_writei(snd_pcm_t *pcm, const void *buffer, snd_pcm_uframes_t size);
469 snd_pcm_sframes_t snd_pcm_readi(snd_pcm_t *pcm, void *buffer, snd_pcm_uframes_t size);
470 snd_pcm_sframes_t snd_pcm_writen(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size);
471 snd_pcm_sframes_t snd_pcm_readn(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size);
472 int snd_pcm_wait(snd_pcm_t *pcm, int timeout);
473 
474 int snd_pcm_link(snd_pcm_t *pcm1, snd_pcm_t *pcm2);
475 int snd_pcm_unlink(snd_pcm_t *pcm);
476 
477 //int snd_pcm_mixer_element(snd_pcm_t *pcm, snd_mixer_t *mixer, snd_mixer_elem_t **elem);
478 
479 /*
480  * application helpers - these functions are implemented on top
481  * of the basic API
482  */
483 
484 int snd_pcm_recover(snd_pcm_t *pcm, int err, int silent);
486  snd_pcm_format_t format,
487  snd_pcm_access_t access,
488  unsigned int channels,
489  unsigned int rate,
490  int soft_resample,
491  unsigned int latency);
493  snd_pcm_uframes_t *buffer_size,
494  snd_pcm_uframes_t *period_size);
495 
505 size_t snd_pcm_info_sizeof(void);
510 #define snd_pcm_info_alloca(ptr) __snd_alloca(ptr, snd_pcm_info)
513 void snd_pcm_info_copy(snd_pcm_info_t *dst, const snd_pcm_info_t *src);
514 unsigned int snd_pcm_info_get_device(const snd_pcm_info_t *obj);
515 unsigned int snd_pcm_info_get_subdevice(const snd_pcm_info_t *obj);
517 int snd_pcm_info_get_card(const snd_pcm_info_t *obj);
518 const char *snd_pcm_info_get_id(const snd_pcm_info_t *obj);
519 const char *snd_pcm_info_get_name(const snd_pcm_info_t *obj);
520 const char *snd_pcm_info_get_subdevice_name(const snd_pcm_info_t *obj);
523 unsigned int snd_pcm_info_get_subdevices_count(const snd_pcm_info_t *obj);
524 unsigned int snd_pcm_info_get_subdevices_avail(const snd_pcm_info_t *obj);
526 void snd_pcm_info_set_device(snd_pcm_info_t *obj, unsigned int val);
527 void snd_pcm_info_set_subdevice(snd_pcm_info_t *obj, unsigned int val);
529 
540 
554  unsigned int *rate_num,
555  unsigned int *rate_den);
558 
559 #if 0
560 typedef struct _snd_pcm_hw_strategy snd_pcm_hw_strategy_t;
561 
562 /* choices need to be sorted on ascending badness */
563 typedef struct _snd_pcm_hw_strategy_simple_choices_list {
564  unsigned int value;
565  unsigned int badness;
566 } snd_pcm_hw_strategy_simple_choices_list_t;
567 
568 int snd_pcm_hw_params_strategy(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
569  const snd_pcm_hw_strategy_t *strategy,
570  unsigned int badness_min,
571  unsigned int badness_max);
572 
573 void snd_pcm_hw_strategy_free(snd_pcm_hw_strategy_t *strategy);
574 int snd_pcm_hw_strategy_simple(snd_pcm_hw_strategy_t **strategyp,
575  unsigned int badness_min,
576  unsigned int badness_max);
577 int snd_pcm_hw_params_try_explain_failure(snd_pcm_t *pcm,
578  snd_pcm_hw_params_t *fail,
579  snd_pcm_hw_params_t *success,
580  unsigned int depth,
581  snd_output_t *out);
582 
583 #endif
584 
585 size_t snd_pcm_hw_params_sizeof(void);
590 #define snd_pcm_hw_params_alloca(ptr) __snd_alloca(ptr, snd_pcm_hw_params)
594 
595 #if !defined(ALSA_LIBRARY_BUILD) && !defined(ALSA_PCM_OLD_HW_PARAMS_API)
596 
604 
612 
620 
621 int snd_pcm_hw_params_get_channels(const snd_pcm_hw_params_t *params, unsigned int *val);
622 int snd_pcm_hw_params_get_channels_min(const snd_pcm_hw_params_t *params, unsigned int *val);
623 int snd_pcm_hw_params_get_channels_max(const snd_pcm_hw_params_t *params, unsigned int *val);
624 int snd_pcm_hw_params_test_channels(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
625 int snd_pcm_hw_params_set_channels(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
626 int snd_pcm_hw_params_set_channels_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
627 int snd_pcm_hw_params_set_channels_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
628 int snd_pcm_hw_params_set_channels_minmax(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *min, unsigned int *max);
629 int snd_pcm_hw_params_set_channels_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
630 int snd_pcm_hw_params_set_channels_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
631 int snd_pcm_hw_params_set_channels_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
632 
633 int snd_pcm_hw_params_get_rate(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
634 int snd_pcm_hw_params_get_rate_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
635 int snd_pcm_hw_params_get_rate_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
636 int snd_pcm_hw_params_test_rate(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
637 int snd_pcm_hw_params_set_rate(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
638 int snd_pcm_hw_params_set_rate_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
639 int snd_pcm_hw_params_set_rate_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
640 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);
641 int snd_pcm_hw_params_set_rate_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
642 int snd_pcm_hw_params_set_rate_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
643 int snd_pcm_hw_params_set_rate_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
644 int snd_pcm_hw_params_set_rate_resample(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
645 int snd_pcm_hw_params_get_rate_resample(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
646 int snd_pcm_hw_params_set_export_buffer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
647 int snd_pcm_hw_params_get_export_buffer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
648 int snd_pcm_hw_params_set_period_wakeup(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
649 int snd_pcm_hw_params_get_period_wakeup(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
650 
651 int snd_pcm_hw_params_get_period_time(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
652 int snd_pcm_hw_params_get_period_time_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
653 int snd_pcm_hw_params_get_period_time_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
654 int snd_pcm_hw_params_test_period_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
655 int snd_pcm_hw_params_set_period_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
656 int snd_pcm_hw_params_set_period_time_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
657 int snd_pcm_hw_params_set_period_time_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
658 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);
659 int snd_pcm_hw_params_set_period_time_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
660 int snd_pcm_hw_params_set_period_time_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
661 int snd_pcm_hw_params_set_period_time_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
662 
663 int snd_pcm_hw_params_get_period_size(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *frames, int *dir);
664 int snd_pcm_hw_params_get_period_size_min(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *frames, int *dir);
665 int snd_pcm_hw_params_get_period_size_max(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *frames, int *dir);
666 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);
667 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);
668 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);
669 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);
670 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);
671 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);
672 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);
673 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);
675 
676 int snd_pcm_hw_params_get_periods(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
677 int snd_pcm_hw_params_get_periods_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
678 int snd_pcm_hw_params_get_periods_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
679 int snd_pcm_hw_params_test_periods(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
680 int snd_pcm_hw_params_set_periods(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
681 int snd_pcm_hw_params_set_periods_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
682 int snd_pcm_hw_params_set_periods_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
683 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);
684 int snd_pcm_hw_params_set_periods_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
685 int snd_pcm_hw_params_set_periods_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
686 int snd_pcm_hw_params_set_periods_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
688 
689 int snd_pcm_hw_params_get_buffer_time(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
690 int snd_pcm_hw_params_get_buffer_time_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
691 int snd_pcm_hw_params_get_buffer_time_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
692 int snd_pcm_hw_params_test_buffer_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
693 int snd_pcm_hw_params_set_buffer_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
694 int snd_pcm_hw_params_set_buffer_time_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
695 int snd_pcm_hw_params_set_buffer_time_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
696 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);
697 int snd_pcm_hw_params_set_buffer_time_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
698 int snd_pcm_hw_params_set_buffer_time_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
699 int snd_pcm_hw_params_set_buffer_time_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
700 
701 int snd_pcm_hw_params_get_buffer_size(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
702 int snd_pcm_hw_params_get_buffer_size_min(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
703 int snd_pcm_hw_params_get_buffer_size_max(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
704 int snd_pcm_hw_params_test_buffer_size(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t val);
705 int snd_pcm_hw_params_set_buffer_size(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t val);
706 int snd_pcm_hw_params_set_buffer_size_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
707 int snd_pcm_hw_params_set_buffer_size_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
708 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);
709 int snd_pcm_hw_params_set_buffer_size_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
710 int snd_pcm_hw_params_set_buffer_size_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
711 int snd_pcm_hw_params_set_buffer_size_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
712 
713 #endif /* !ALSA_LIBRARY_BUILD && !ALSA_PCM_OLD_HW_PARAMS_API */
714 
715 int snd_pcm_hw_params_get_min_align(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
716 
726 size_t snd_pcm_sw_params_sizeof(void);
731 #define snd_pcm_sw_params_alloca(ptr) __snd_alloca(ptr, snd_pcm_sw_params)
735 int snd_pcm_sw_params_get_boundary(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val);
736 
737 #if !defined(ALSA_LIBRARY_BUILD) && !defined(ALSA_PCM_OLD_SW_PARAMS_API)
738 
741 int snd_pcm_sw_params_set_avail_min(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
742 int snd_pcm_sw_params_get_avail_min(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val);
744 int snd_pcm_sw_params_get_period_event(const snd_pcm_sw_params_t *params, int *val);
745 int snd_pcm_sw_params_set_start_threshold(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
746 int snd_pcm_sw_params_get_start_threshold(const snd_pcm_sw_params_t *paramsm, snd_pcm_uframes_t *val);
747 int snd_pcm_sw_params_set_stop_threshold(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
748 int snd_pcm_sw_params_get_stop_threshold(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val);
749 int snd_pcm_sw_params_set_silence_threshold(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
750 int snd_pcm_sw_params_get_silence_threshold(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val);
751 int snd_pcm_sw_params_set_silence_size(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
752 int snd_pcm_sw_params_get_silence_size(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val);
753 
754 #endif /* !ALSA_LIBRARY_BUILD && !ALSA_PCM_OLD_SW_PARAMS_API */
755 
758 /* include old API */
759 #ifndef ALSA_LIBRARY_BUILD
760 #if defined(ALSA_PCM_OLD_HW_PARAMS_API) || defined(ALSA_PCM_OLD_SW_PARAMS_API)
761 #include "pcm_old.h"
762 #endif
763 #endif
764 
772 size_t snd_pcm_access_mask_sizeof(void);
777 #define snd_pcm_access_mask_alloca(ptr) __snd_alloca(ptr, snd_pcm_access_mask)
787 
797 size_t snd_pcm_format_mask_sizeof(void);
802 #define snd_pcm_format_mask_alloca(ptr) __snd_alloca(ptr, snd_pcm_format_mask)
812 
822 size_t snd_pcm_subformat_mask_sizeof(void);
827 #define snd_pcm_subformat_mask_alloca(ptr) __snd_alloca(ptr, snd_pcm_subformat_mask)
837 
847 size_t snd_pcm_status_sizeof(void);
852 #define snd_pcm_status_alloca(ptr) __snd_alloca(ptr, snd_pcm_status)
861 snd_pcm_sframes_t snd_pcm_status_get_delay(const snd_pcm_status_t *obj);
862 snd_pcm_uframes_t snd_pcm_status_get_avail(const snd_pcm_status_t *obj);
863 snd_pcm_uframes_t snd_pcm_status_get_avail_max(const snd_pcm_status_t *obj);
864 snd_pcm_uframes_t snd_pcm_status_get_overrange(const snd_pcm_status_t *obj);
865 
875 const char *snd_pcm_type_name(snd_pcm_type_t type);
876 const char *snd_pcm_stream_name(const snd_pcm_stream_t stream);
877 const char *snd_pcm_access_name(const snd_pcm_access_t _access);
878 const char *snd_pcm_format_name(const snd_pcm_format_t format);
879 const char *snd_pcm_format_description(const snd_pcm_format_t format);
880 const char *snd_pcm_subformat_name(const snd_pcm_subformat_t subformat);
881 const char *snd_pcm_subformat_description(const snd_pcm_subformat_t subformat);
882 snd_pcm_format_t snd_pcm_format_value(const char* name);
883 const char *snd_pcm_tstamp_mode_name(const snd_pcm_tstamp_t mode);
884 const char *snd_pcm_state_name(const snd_pcm_state_t state);
885 
895 int snd_pcm_dump(snd_pcm_t *pcm, snd_output_t *out);
902 
913  const snd_pcm_channel_area_t **areas,
914  snd_pcm_uframes_t *offset,
915  snd_pcm_uframes_t *frames);
916 snd_pcm_sframes_t snd_pcm_mmap_commit(snd_pcm_t *pcm,
917  snd_pcm_uframes_t offset,
918  snd_pcm_uframes_t frames);
919 snd_pcm_sframes_t snd_pcm_mmap_writei(snd_pcm_t *pcm, const void *buffer, snd_pcm_uframes_t size);
920 snd_pcm_sframes_t snd_pcm_mmap_readi(snd_pcm_t *pcm, void *buffer, snd_pcm_uframes_t size);
921 snd_pcm_sframes_t snd_pcm_mmap_writen(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size);
922 snd_pcm_sframes_t snd_pcm_mmap_readn(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size);
923 
940 int snd_pcm_format_width(snd_pcm_format_t format); /* in bits */
941 int snd_pcm_format_physical_width(snd_pcm_format_t format); /* in bits */
942 snd_pcm_format_t snd_pcm_build_linear_format(int width, int pwidth, int unsignd, int big_endian);
943 ssize_t snd_pcm_format_size(snd_pcm_format_t format, size_t samples);
948 int snd_pcm_format_set_silence(snd_pcm_format_t format, void *buf, unsigned int samples);
949 
950 snd_pcm_sframes_t snd_pcm_bytes_to_frames(snd_pcm_t *pcm, ssize_t bytes);
951 ssize_t snd_pcm_frames_to_bytes(snd_pcm_t *pcm, snd_pcm_sframes_t frames);
952 long snd_pcm_bytes_to_samples(snd_pcm_t *pcm, ssize_t bytes);
953 ssize_t snd_pcm_samples_to_bytes(snd_pcm_t *pcm, long samples);
954 
955 int snd_pcm_area_silence(const snd_pcm_channel_area_t *dst_channel, snd_pcm_uframes_t dst_offset,
956  unsigned int samples, snd_pcm_format_t format);
957 int snd_pcm_areas_silence(const snd_pcm_channel_area_t *dst_channels, snd_pcm_uframes_t dst_offset,
958  unsigned int channels, snd_pcm_uframes_t frames, snd_pcm_format_t format);
959 int snd_pcm_area_copy(const snd_pcm_channel_area_t *dst_channel, snd_pcm_uframes_t dst_offset,
960  const snd_pcm_channel_area_t *src_channel, snd_pcm_uframes_t src_offset,
961  unsigned int samples, snd_pcm_format_t format);
962 int snd_pcm_areas_copy(const snd_pcm_channel_area_t *dst_channels, snd_pcm_uframes_t dst_offset,
963  const snd_pcm_channel_area_t *src_channels, snd_pcm_uframes_t src_offset,
964  unsigned int channels, snd_pcm_uframes_t frames, snd_pcm_format_t format);
965 
976 typedef enum _snd_pcm_hook_type {
977  SND_PCM_HOOK_TYPE_HW_PARAMS = 0,
978  SND_PCM_HOOK_TYPE_HW_FREE,
979  SND_PCM_HOOK_TYPE_CLOSE,
980  SND_PCM_HOOK_TYPE_LAST = SND_PCM_HOOK_TYPE_CLOSE
982 
984 typedef struct _snd_pcm_hook snd_pcm_hook_t;
986 typedef int (*snd_pcm_hook_func_t)(snd_pcm_hook_t *hook);
989 void snd_pcm_hook_set_private(snd_pcm_hook_t *hook, void *private_data);
990 int snd_pcm_hook_add(snd_pcm_hook_t **hookp, snd_pcm_t *pcm,
991  snd_pcm_hook_type_t type,
992  snd_pcm_hook_func_t func, void *private_data);
994 
1005 typedef struct _snd_pcm_scope_ops {
1009  int (*enable)(snd_pcm_scope_t *scope);
1013  void (*disable)(snd_pcm_scope_t *scope);
1017  void (*start)(snd_pcm_scope_t *scope);
1021  void (*stop)(snd_pcm_scope_t *scope);
1025  void (*update)(snd_pcm_scope_t *scope);
1029  void (*reset)(snd_pcm_scope_t *scope);
1033  void (*close)(snd_pcm_scope_t *scope);
1035 
1036 snd_pcm_uframes_t snd_pcm_meter_get_bufsize(snd_pcm_t *pcm);
1037 unsigned int snd_pcm_meter_get_channels(snd_pcm_t *pcm);
1038 unsigned int snd_pcm_meter_get_rate(snd_pcm_t *pcm);
1039 snd_pcm_uframes_t snd_pcm_meter_get_now(snd_pcm_t *pcm);
1040 snd_pcm_uframes_t snd_pcm_meter_get_boundary(snd_pcm_t *pcm);
1042 snd_pcm_scope_t *snd_pcm_meter_search_scope(snd_pcm_t *pcm, const char *name);
1045  const snd_pcm_scope_ops_t *val);
1046 void snd_pcm_scope_set_name(snd_pcm_scope_t *scope, const char *val);
1047 const char *snd_pcm_scope_get_name(snd_pcm_scope_t *scope);
1049 void snd_pcm_scope_set_callback_private(snd_pcm_scope_t *scope, void *val);
1050 int snd_pcm_scope_s16_open(snd_pcm_t *pcm, const char *name,
1051  snd_pcm_scope_t **scopep);
1053  unsigned int channel);
1054 
1065 typedef enum _snd_spcm_latency {
1076 
1078 typedef enum _snd_spcm_xrun_type {
1084 
1086 typedef enum _snd_spcm_duplex_type {
1092 
1093 int snd_spcm_init(snd_pcm_t *pcm,
1094  unsigned int rate,
1095  unsigned int channels,
1096  snd_pcm_format_t format,
1097  snd_pcm_subformat_t subformat,
1098  snd_spcm_latency_t latency,
1099  snd_pcm_access_t _access,
1100  snd_spcm_xrun_type_t xrun_type);
1101 
1102 int snd_spcm_init_duplex(snd_pcm_t *playback_pcm,
1103  snd_pcm_t *capture_pcm,
1104  unsigned int rate,
1105  unsigned int channels,
1106  snd_pcm_format_t format,
1107  snd_pcm_subformat_t subformat,
1108  snd_spcm_latency_t latency,
1109  snd_pcm_access_t _access,
1110  snd_spcm_xrun_type_t xrun_type,
1111  snd_spcm_duplex_type_t duplex_type);
1112 
1114  unsigned int *rate,
1115  snd_pcm_uframes_t *buffer_size,
1116  snd_pcm_uframes_t *period_size);
1117 
1127 /* Deprecated functions, for compatibility */
1128 const char *snd_pcm_start_mode_name(snd_pcm_start_t mode) __attribute__((deprecated));
1129 const char *snd_pcm_xrun_mode_name(snd_pcm_xrun_t mode) __attribute__((deprecated));
1134 #if !defined(ALSA_LIBRARY_BUILD) && !defined(ALSA_PCM_OLD_SW_PARAMS_API)
1135 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));
1136 int snd_pcm_sw_params_get_xfer_align(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val) __attribute__((deprecated));
1137 int snd_pcm_sw_params_set_sleep_min(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, unsigned int val) __attribute__((deprecated));
1138 int snd_pcm_sw_params_get_sleep_min(const snd_pcm_sw_params_t *params, unsigned int *val) __attribute__((deprecated));
1139 #endif /* !ALSA_LIBRARY_BUILD && !ALSA_PCM_OLD_SW_PARAMS_API */
1140 #if !defined(ALSA_LIBRARY_BUILD) && !defined(ALSA_PCM_OLD_HW_PARAMS_API)
1141 int snd_pcm_hw_params_get_tick_time(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir) __attribute__((deprecated));
1142 int snd_pcm_hw_params_get_tick_time_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir) __attribute__((deprecated));
1143 int snd_pcm_hw_params_get_tick_time_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir) __attribute__((deprecated));
1144 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));
1145 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));
1146 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));
1147 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));
1148 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));
1149 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));
1150 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));
1151 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));
1152 #endif /* !ALSA_LIBRARY_BUILD && !ALSA_PCM_OLD_HW_PARAMS_API */
1153 
1156 #ifdef __cplusplus
1157 }
1158 #endif
1159 
1160 #endif /* __ALSA_PCM_H */
struct snd_seq_ev_ext __attribute__((packed)) snd_seq_ev_ext_t
Definition: pcm.h:300
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:5837
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:5627
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:5301
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:5123
int snd_pcm_hwsync(snd_pcm_t *pcm)
(DEPRECATED) Synchronize stream position with hardware
Definition: pcm.c:941
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:3836
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:577
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:3278
Definition: pcm.h:359
snd_pcm_xrun_t
Definition: pcm.h:287
int snd_pcm_sw_params_dump(snd_pcm_sw_params_t *params, snd_output_t *out)
Dump a software configuration.
Definition: pcm.c:5565
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:5088
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:5899
int snd_pcm_format_float(snd_pcm_format_t format)
Return float info for a PCM sample format.
Definition: pcm_misc.c:101
int snd_pcm_info(snd_pcm_t *pcm, snd_pcm_info_t *info)
Obtain general (static) information for PCM handle.
Definition: pcm.c:764
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:4522
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:3770
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:5343
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:4210
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:4160
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:5667
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:4755
Definition: pcm.h:250
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:4293
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:4242
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:1772
size_t snd_pcm_info_sizeof(void)
get size of snd_pcm_info_t
Definition: pcm.c:6265
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:5379
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:4737
Definition: pcm.h:373
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:1201
Definition: pcm.h:110
Definition: pcm.h:145
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:5241
snd_pcm_state_t
Definition: pcm.h:255
int snd_pcm_status_malloc(snd_pcm_status_t **ptr)
allocate an invalid snd_pcm_status_t using standard malloc
Definition: pcm.c:6111
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:4819
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:6179
Definition: pcm.h:1082
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:4989
snd_pcm_class_t
Definition: pcm.h:76
Definition: pcm.h:391
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:887
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:5261
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:3930
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:2805
size_t snd_pcm_format_mask_sizeof(void)
get size of snd_pcm_format_mask_t
Definition: pcm.c:3307
int snd_pcm_drop(snd_pcm_t *pcm)
Stop a PCM dropping pending frames.
Definition: pcm.c:1092
int snd_pcm_status(snd_pcm_t *pcm, snd_pcm_status_t *status)
Obtain status (runtime) information for PCM handle.
Definition: pcm.c:912
int snd_pcm_poll_descriptors_count(snd_pcm_t *pcm)
get count of poll descriptors for PCM handle
Definition: pcm.c:1389
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:6245
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:3390
Definition: pcm.h:271
Definition: pcm.h:401
void(* snd_async_callback_t)(snd_async_handler_t *handler)
Async notification callback.
Definition: global.h:121
Definition: pcm.h:347
Definition: pcm.h:210
Definition: pcm.h:385
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:547
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:4888
Definition: pcm.h:389
int snd_pcm_start(snd_pcm_t *pcm)
Start a PCM.
Definition: pcm.c:1071
snd_pcm_subformat_t
Definition: pcm.h:248
int snd_pcm_format_unsigned(snd_pcm_format_t format)
Return sign info for a PCM sample linear format.
Definition: pcm_misc.c:76
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:4594
struct _snd_pcm_hw_params snd_pcm_hw_params_t
Definition: pcm.h:62
snd_pcm_type_t snd_pcm_type(snd_pcm_t *pcm)
get type of PCM handle
Definition: pcm.c:663
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:3622
void * addr
Definition: pcm.h:403
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
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:2899
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:4464
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:3400
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:3742
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:3703
Definition: pcm.h:361
_snd_pcm_type
Definition: pcm.h:330
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:4141
Definition: pcm.h:357
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:3079
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:982
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:3676
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:2635
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:5163
const char * snd_pcm_format_description(const snd_pcm_format_t format)
get description of PCM sample format
Definition: pcm.c:1709
Definition: pcm.h:341
int snd_pcm_wait(snd_pcm_t *pcm, int timeout)
Wait for a PCM to become ready.
Definition: pcm.c:2352
int snd_pcm_hook_remove(snd_pcm_hook_t *hook)
Remove a PCM hook.
Definition: pcm_hooks.c:623
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:853
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:2879
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:5362
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:3813
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:2959
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:3257
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:4937
int snd_pcm_close(snd_pcm_t *pcm)
close PCM handle
Definition: pcm.c:690
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:6375
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:5884
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:3503
Definition: pcm.h:351
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:4379
void snd_pcm_subformat_mask_free(snd_pcm_subformat_mask_t *obj)
frees a previously allocated snd_pcm_subformat_mask_t
Definition: pcm.c:3433
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:5757
int snd_pcm_status_dump(snd_pcm_status_t *status, snd_output_t *out)
Dump status.
Definition: pcm.c:1915
Definition: pcm.h:349
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:4091
Definition: pcm.h:367
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:943
Definition: pcm.h:353
Definition: pcm.h:222
Definition: pcm.h:1074
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:3546
snd_pcm_start_t
Definition: pcm.h:278
int snd_pcm_format_width(snd_pcm_format_t format)
Return nominal bits per a PCM sample.
Definition: pcm_misc.c:193
int snd_pcm_hw_params_can_pause(const snd_pcm_hw_params_t *params)
Check if hardware supports pause.
Definition: pcm.c:3019
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:5196
int snd_pcm_nonblock(snd_pcm_t *pcm, int nonblock)
set nonblock mode
Definition: pcm.c:721
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:6192
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:973
Definition: pcm.h:1080
size_t snd_pcm_status_sizeof(void)
get size of snd_pcm_status_t
Definition: pcm.c:6101
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:3719
void snd_pcm_info_free(snd_pcm_info_t *obj)
frees a previously allocated snd_pcm_info_t
Definition: pcm.c:6288
Definition: pcm.h:1088
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:4500
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:7528
Definition: pcm.h:298
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:3523
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:4045
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:4613
Definition: pcm.h:263
void snd_pcm_access_mask_free(snd_pcm_access_mask_t *obj)
frees a previously allocated snd_pcm_access_mask_t
Definition: pcm.c:3228
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:3826
void snd_pcm_format_mask_free(snd_pcm_format_mask_t *obj)
frees a previously allocated snd_pcm_format_mask_t
Definition: pcm.c:3330
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:3483
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:1788
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:4789
Definition: pcm.h:375
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:4919
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:915
Definition: pcm.h:365
snd_pcm_format_t
Definition: pcm.h:123
long snd_pcm_sframes_t
Definition: pcm.h:311
Definition: pcm.h:261
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:4061
Definition: pcm.h:339
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:5182
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:2259
Definition: pcm.h:269
const char * snd_pcm_tstamp_mode_name(const snd_pcm_tstamp_t mode)
get name of PCM tstamp mode setting
Definition: pcm.c:1804
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:3866
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:6489
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:838
Definition: pcm.h:216
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:3350
void snd_pcm_hw_params_free(snd_pcm_hw_params_t *obj)
frees a previously allocated snd_pcm_hw_params_t
Definition: pcm.c:3536
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:3562
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:3782
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:3238
Definition: pcm.h:214
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:6465
struct _snd_pcm_scope snd_pcm_scope_t
Definition: pcm.h:421
size_t snd_pcm_hw_params_sizeof(void)
get size of snd_pcm_hw_params_t
Definition: pcm.c:3513
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:5459
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:4027
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:2474
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:5814
Definition: pcm.h:332
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:6443
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:4192
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:3990
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:953
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:1169
unsigned int snd_pcm_info_get_subdevice(const snd_pcm_info_t *obj)
Get subdevice from a PCM info container.
Definition: pcm.c:6320
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:4395
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:6408
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:4312
const char * snd_pcm_info_get_id(const snd_pcm_info_t *obj)
Get id from a PCM info container.
Definition: pcm.c:6353
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:5324
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:3177
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:4634
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:6145
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:5963
Definition: pcm.h:387
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:3462
Definition: pcm.h:343
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:151
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:5688
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:3688
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:6207
size_t snd_pcm_access_mask_sizeof(void)
get size of snd_pcm_access_mask_t
Definition: pcm.c:3205
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:3906
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:873
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:3443
Definition: pcm.h:1090
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:5034
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:963
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:3493
Definition: pcm.h:139
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:3059
Definition: pcm.h:85
Definition: pcm.h:282
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:3359
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:4271
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:1339
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:6160
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:3136
Definition: pcm.h:383
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:5424
Definition: pcm.h:273
snd_spcm_xrun_type_t
Definition: pcm.h:1078
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:3606
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:5775
snd_pcm_hook_type_t
Definition: pcm.h:976
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:1902
snd_pcm_stream_t snd_pcm_stream(snd_pcm_t *pcm)
get stream for a PCM handle
Definition: pcm.c:676
Definition: pcm.h:1071
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:2457
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:6430
Definition: pcm.h:208
Definition: pcm.h:334
Definition: pcm.h:259
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:4224
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:5394
snd_pcm_t * snd_pcm_hook_get_pcm(snd_pcm_hook_t *hook)
Get PCM handle for a PCM hook.
Definition: pcm_hooks.c:555
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:6397
snd_spcm_duplex_type_t
Definition: pcm.h:1086
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:6386
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:5736
Definition: pcm.h:371
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:3248
struct _snd_pcm_access_mask snd_pcm_access_mask_t
Definition: pcm.h:69
Definition: pcm.h:218
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:7374
size_t snd_pcm_subformat_mask_sizeof(void)
get size of snd_pcm_subformat_mask_t
Definition: pcm.c:3410
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:1024
void * snd_pcm_hook_get_private(snd_pcm_hook_t *hook)
Get callback function private data for a PCM hook.
Definition: pcm_hooks.c:566
int snd_pcm_scope_malloc(snd_pcm_scope_t **ptr)
allocate an invalid snd_pcm_scope_t using standard malloc
Definition: pcm_meter.c:1220
Definition: pcm.h:379
const char * snd_pcm_type_name(snd_pcm_type_t type)
get name of PCM type
Definition: pcm.c:1831
snd_pcm_sframes_t snd_pcm_rewindable(snd_pcm_t *pcm)
Get safe count of frames which can be rewinded.
Definition: pcm.c:1154
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:1949
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:3288
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:5478
const char * snd_pcm_stream_name(const snd_pcm_stream_t stream)
get name of PCM stream type
Definition: pcm.c:1673
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:6331
struct _snd_pcm_hook snd_pcm_hook_t
Definition: pcm.h:984
void snd_pcm_status_free(snd_pcm_status_t *obj)
frees a previously allocated snd_pcm_status_t
Definition: pcm.c:6124
snd_pcm_sframes_t snd_pcm_forwardable(snd_pcm_t *pcm)
Get safe count of frames which can be forwarded.
Definition: pcm.c:1192
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:4009
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:512
int snd_pcm_dump_hw_setup(snd_pcm_t *pcm, snd_output_t *out)
Dump current hardware setup for PCM.
Definition: pcm.c:1846
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:307
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:3099
Definition: pcm.h:101
const char * snd_pcm_name(snd_pcm_t *pcm)
get identifier of PCM handle
Definition: pcm.c:650
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:3635
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:5441
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:5985
long snd_pcm_bytes_to_samples(snd_pcm_t *pcm, ssize_t bytes)
Convert bytes in samples for a PCM.
Definition: pcm.c:1981
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:5208
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:3579
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:4973
Definition: pcm.h:345
int snd_pcm_hw_params_can_resume(const snd_pcm_hw_params_t *params)
Check if hardware supports resume.
Definition: pcm.c:3039
Definition: pcm.h:265
snd_pcm_state_t snd_pcm_state(snd_pcm_t *pcm)
Return PCM state.
Definition: pcm.c:926
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:3757
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:5281
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:6255
Definition: pcm.h:377
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:5538
Definition: pcm.h:206
Definition: pcm.h:79
int snd_pcm_resume(snd_pcm_t *pcm)
Resume from suspend, no samples are lost.
Definition: pcm.c:1004
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:3317
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:1275
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:523
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:4106
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:4179
snd_pcm_t * snd_async_handler_get_pcm(snd_async_handler_t *handler)
Return PCM handle related to an async handler.
Definition: pcm.c:2047
int snd_pcm_prepare(snd_pcm_t *pcm)
Prepare PCM for use.
Definition: pcm.c:1039
Definition: pcm.h:363
int snd_pcm_info_get_card(const snd_pcm_info_t *obj)
Get card from a PCM info container.
Definition: pcm.c:6342
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:929
Definition: pcm.h:267
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:179
Definition: pcm.h:189
int snd_pcm_drain(snd_pcm_t *pcm)
Stop a PCM preserving pending frames.
Definition: pcm.c:1115
Definition: pcm.h:212
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:5605
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:4907
struct timeval snd_timestamp_t
Definition: global.h:149
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:826
int snd_pcm_format_physical_width(snd_pcm_format_t format)
Return bits needed to store a PCM sample.
Definition: pcm_misc.c:251
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:4364
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:4834
Definition: pcm.h:169
int(* snd_pcm_hook_func_t)(snd_pcm_hook_t *hook)
Definition: pcm.h:986
int snd_pcm_pause(snd_pcm_t *pcm, int enable)
Pause/resume PCM.
Definition: pcm.c:1135
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:5051
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:5224
int snd_pcm_hw_free(snd_pcm_t *pcm)
Remove PCM hardware configuration and free associated resources.
Definition: pcm.c:841
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:869
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:3420
unsigned int step
Definition: pcm.h:407
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:4851
int snd_pcm_dump(snd_pcm_t *pcm, snd_output_t *out)
Dump PCM info.
Definition: pcm.c:1935
unsigned int snd_pcm_info_get_device(const snd_pcm_info_t *obj)
Get device from a PCM info container.
Definition: pcm.c:6309
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:4719
int snd_pcm_link(snd_pcm_t *pcm1, snd_pcm_t *pcm2)
Link two PCMs.
Definition: pcm.c:1362
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:5069
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:1685
Definition: pcm.h:187
const char * snd_pcm_subformat_name(const snd_pcm_subformat_t subformat)
get name of PCM sample subformat
Definition: pcm.c:1748
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:5004
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:3472
Definition: pcm.h:337
int snd_pcm_unlink(snd_pcm_t *pcm)
Remove a PCM from a linked group.
Definition: pcm.c:1376
int snd_pcm_reset(snd_pcm_t *pcm)
Reset PCM position.
Definition: pcm.c:1056
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:5615
Definition: pcm.h:393
int snd_pcm_info_malloc(snd_pcm_info_t **ptr)
allocate an invalid snd_pcm_info_t using standard malloc
Definition: pcm.c:6275
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:4348
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:4410
Definition: pcm.h:411
const char * snd_pcm_format_name(const snd_pcm_format_t format)
get name of PCM sample format
Definition: pcm.c:1697
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:3918
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:3663
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:654
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:6134
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:595
int snd_pcm_hw_params_can_overrange(const snd_pcm_hw_params_t *params)
Check if hardware supports overrange detection.
Definition: pcm.c:2999
Definition: pcm.h:280
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:2939
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:5509
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:2017
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:5409
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:6419
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:3380
int snd_pcm_recover(snd_pcm_t *pcm, int err, int silent)
Recover the stream state from an error or suspend.
Definition: pcm.c:7326
snd_pcm_tstamp_t
Definition: pcm.h:296
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:4869
struct _snd_pcm_format_mask snd_pcm_format_mask_t
Definition: pcm.h:71
unsigned int first
Definition: pcm.h:405
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:3974
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:5019
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:4804
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:3195
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:983
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:4330
Definition: pcm.h:304
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:3453
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:6062
snd_pcm_sframes_t snd_pcm_forward(snd_pcm_t *pcm, snd_pcm_uframes_t frames)
Move application frame position forward.
Definition: pcm.c:1212
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:4703
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:5790
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:534
Definition: pcm.h:369
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:5641
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:1965
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:6008
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:3732
Definition: pcm.h:289
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:4445
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:3591
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:5867
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:3894
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:901
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:3958
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:3158
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:2531
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:4481
const char * snd_pcm_info_get_name(const snd_pcm_info_t *obj)
Get name from a PCM info container.
Definition: pcm.c:6364
snd_spcm_latency_t
Definition: pcm.h:1065
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:2239
int snd_pcm_poll_descriptors(snd_pcm_t *pcm, struct pollfd *pfds, unsigned int space)
get poll descriptors
Definition: pcm.c:1424
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:5919
Definition: pcm.h:257
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:3298
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:3881
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:3267
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:1243
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:5142
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:2979
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:4123
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:366
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:6088
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:6569
int snd_pcm_format_little_endian(snd_pcm_format_t format)
Return endian info for a PCM sample format.
Definition: pcm_misc.c:119
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:775
unsigned long snd_pcm_uframes_t
Definition: pcm.h:309
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:6235
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:3369
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:291
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:3943
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:4544
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:4427
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:3851
const char * snd_pcm_subformat_description(const snd_pcm_subformat_t subformat)
get description of PCM sample subformat
Definition: pcm.c:1760
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:2919
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:5497
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:6034
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:2498
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:4773
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:4657
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:1461
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:1307
int snd_pcm_dump_sw_setup(snd_pcm_t *pcm, snd_output_t *out)
Dump current software setup for PCM.
Definition: pcm.c:1876
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:3340
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:4076
snd_pcm_format_t snd_pcm_format_value(const char *name)
get PCM sample format from name
Definition: pcm.c:1721
Definition: pcm.h:220
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:5854
int snd_pcm_format_big_endian(snd_pcm_format_t format)
Return endian info for a PCM sample format.
Definition: pcm_misc.c:164
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:2277
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:3797
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:5107
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:3115
Definition: pcm.h:381
enum _snd_pcm_type snd_pcm_type_t
Definition: pcm.h:398
Definition: pcm.h:1005
Definition: pcm.h:1068
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:6298
size_t snd_pcm_sw_params_sizeof(void)
get size of snd_pcm_sw_params_t
Definition: pcm.c:5582
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:2686
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:6454
struct _snd_pcm snd_pcm_t
Definition: pcm.h:327
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:4955
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:3645
ssize_t snd_pcm_samples_to_bytes(snd_pcm_t *pcm, long samples)
Convert samples in bytes for a PCM.
Definition: pcm.c:1997
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:4564
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:6225
snd_pcm_sframes_t snd_pcm_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t frames)
Move application frame position backward.
Definition: pcm.c:1171
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:5715
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:3215
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:91
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:5592
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:4579
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:4680
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:5939
Definition: pcm.h:355
const char * snd_pcm_state_name(const snd_pcm_state_t state)
get name of PCM state
Definition: pcm.c:1816