ALSA project - the C library reference
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
26  *
27  */
28 
29 #ifndef __ALSA_PCM_H
30 #define __ALSA_PCM_H
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 #include <stdint.h>
37 
45 #define SND_PCM_DLSYM_VERSION _dlsym_pcm_001
46 
48 typedef struct _snd_pcm_info snd_pcm_info_t;
49 
64 typedef struct _snd_pcm_hw_params snd_pcm_hw_params_t;
65 
67 typedef struct _snd_pcm_sw_params snd_pcm_sw_params_t;
69  typedef struct _snd_pcm_status snd_pcm_status_t;
71 typedef struct _snd_pcm_access_mask snd_pcm_access_mask_t;
73 typedef struct _snd_pcm_format_mask snd_pcm_format_mask_t;
75 typedef struct _snd_pcm_subformat_mask snd_pcm_subformat_mask_t;
76 
78 typedef enum _snd_pcm_class {
88  SND_PCM_CLASS_LAST = SND_PCM_CLASS_DIGITIZER
90 
92 typedef enum _snd_pcm_subclass {
97  SND_PCM_SUBCLASS_LAST = SND_PCM_SUBCLASS_MULTI_MIX
99 
101 typedef enum _snd_pcm_stream {
106  SND_PCM_STREAM_LAST = SND_PCM_STREAM_CAPTURE
108 
110 typedef enum _snd_pcm_access {
121  SND_PCM_ACCESS_LAST = SND_PCM_ACCESS_RW_NONINTERLEAVED
123 
125 typedef enum _snd_pcm_format {
212  /* G.723 (ADPCM) 24 kbit/s, 8 samples in 3 bytes */
213  SND_PCM_FORMAT_G723_24,
214  /* G.723 (ADPCM) 24 kbit/s, 1 sample in 1 byte */
215  SND_PCM_FORMAT_G723_24_1B,
216  /* G.723 (ADPCM) 40 kbit/s, 8 samples in 3 bytes */
217  SND_PCM_FORMAT_G723_40,
218  /* G.723 (ADPCM) 40 kbit/s, 1 sample in 1 byte */
219  SND_PCM_FORMAT_G723_40_1B,
220  /* Direct Stream Digital (DSD) in 1-byte samples (x8) */
221  SND_PCM_FORMAT_DSD_U8,
222  /* Direct Stream Digital (DSD) in 2-byte samples (x16) */
223  SND_PCM_FORMAT_DSD_U16_LE,
224  /* Direct Stream Digital (DSD) in 4-byte samples (x32) */
225  SND_PCM_FORMAT_DSD_U32_LE,
226  /* Direct Stream Digital (DSD) in 2-byte samples (x16) */
227  SND_PCM_FORMAT_DSD_U16_BE,
228  /* Direct Stream Digital (DSD) in 4-byte samples (x32) */
229  SND_PCM_FORMAT_DSD_U32_BE,
230  SND_PCM_FORMAT_LAST = SND_PCM_FORMAT_DSD_U32_BE,
231 
232 #if __BYTE_ORDER == __LITTLE_ENDIAN
233 
255 #elif __BYTE_ORDER == __BIG_ENDIAN
256 
278 #else
279 #error "Unknown endian"
280 #endif
282 
284 typedef enum _snd_pcm_subformat {
287  SND_PCM_SUBFORMAT_LAST = SND_PCM_SUBFORMAT_STD
289 
291 typedef enum _snd_pcm_state {
310  SND_PCM_STATE_LAST = SND_PCM_STATE_DISCONNECTED,
314 
316 typedef enum _snd_pcm_start {
321  SND_PCM_START_LAST = SND_PCM_START_EXPLICIT
323 
325 typedef enum _snd_pcm_xrun {
330  SND_PCM_XRUN_LAST = SND_PCM_XRUN_STOP
332 
334 typedef enum _snd_pcm_tstamp {
343  SND_PCM_TSTAMP_LAST = SND_PCM_TSTAMP_ENABLE
345 
346 typedef enum _snd_pcm_tstamp_type {
350  SND_PCM_TSTAMP_TYPE_LAST = SND_PCM_TSTAMP_TYPE_MONOTONIC_RAW,
352 
353 typedef enum _snd_pcm_audio_tstamp_type {
364  SND_PCM_AUDIO_TSTAMP_TYPE_LAST = SND_PCM_AUDIO_TSTAMP_TYPE_LINK_SYNCHRONIZED
366 
367 typedef struct _snd_pcm_audio_tstamp_config {
368  /* 5 of max 16 bits used */
369  unsigned int type_requested:4;
370  unsigned int report_delay:1; /* add total delay to A/D or D/A */
372 
373 typedef struct _snd_pcm_audio_tstamp_report {
374  /* 6 of max 16 bits used for bit-fields */
375 
376  /* for backwards compatibility */
377  unsigned int valid:1;
378 
379  /* actual type if hardware could not support requested timestamp */
380  unsigned int actual_type:4;
381 
382  /* accuracy represented in ns units */
383  unsigned int accuracy_report:1; /* 0 if accuracy unknown, 1 if accuracy field is valid */
384  unsigned int accuracy; /* up to 4.29s, will be packed in separate field */
386 
388 typedef unsigned long snd_pcm_uframes_t;
390 typedef long snd_pcm_sframes_t;
391 
393 #define SND_PCM_NONBLOCK 0x00000001
394 
395 #define SND_PCM_ASYNC 0x00000002
396 
397 #define SND_PCM_EINTR 0x00000080
398 
399 #define SND_PCM_ABORT 0x00008000
400 
401 #define SND_PCM_NO_AUTO_RESAMPLE 0x00010000
402 
403 #define SND_PCM_NO_AUTO_CHANNELS 0x00020000
404 
405 #define SND_PCM_NO_AUTO_FORMAT 0x00040000
406 
407 #define SND_PCM_NO_SOFTVOL 0x00080000
408 
410 typedef struct _snd_pcm snd_pcm_t;
411 
477  SND_PCM_TYPE_LAST = SND_PCM_TYPE_MMAP_EMUL
478 };
479 
482 
484 typedef struct _snd_pcm_channel_area {
486  void *addr;
488  unsigned int first;
490  unsigned int step;
492 
494 typedef union _snd_pcm_sync_id {
496  unsigned char id[16];
498  unsigned short id16[8];
500  unsigned int id32[4];
502 
504 #define SND_PCM_WAIT_INFINITE (-1)
505 
506 #define SND_PCM_WAIT_IO (-10001)
507 
508 #define SND_PCM_WAIT_DRAIN (-10002)
509 
511 typedef struct _snd_pcm_scope snd_pcm_scope_t;
512 
513 int snd_pcm_open(snd_pcm_t **pcm, const char *name,
514  snd_pcm_stream_t stream, int mode);
515 int snd_pcm_open_lconf(snd_pcm_t **pcm, const char *name,
516  snd_pcm_stream_t stream, int mode,
517  snd_config_t *lconf);
519  const char *name, const char *orig_name,
520  snd_pcm_stream_t stream, int mode);
521 
522 int snd_pcm_close(snd_pcm_t *pcm);
523 const char *snd_pcm_name(snd_pcm_t *pcm);
527 int snd_pcm_poll_descriptors(snd_pcm_t *pcm, struct pollfd *pfds, unsigned int space);
528 int snd_pcm_poll_descriptors_revents(snd_pcm_t *pcm, struct pollfd *pfds, unsigned int nfds, unsigned short *revents);
529 int snd_pcm_nonblock(snd_pcm_t *pcm, int nonblock);
530 static __inline__ int snd_pcm_abort(snd_pcm_t *pcm) { return snd_pcm_nonblock(pcm, 2); }
532  snd_async_callback_t callback, void *private_data);
534 int snd_pcm_info(snd_pcm_t *pcm, snd_pcm_info_t *info);
537 int snd_pcm_hw_free(snd_pcm_t *pcm);
540 int snd_pcm_prepare(snd_pcm_t *pcm);
541 int snd_pcm_reset(snd_pcm_t *pcm);
542 int snd_pcm_status(snd_pcm_t *pcm, snd_pcm_status_t *status);
543 int snd_pcm_start(snd_pcm_t *pcm);
544 int snd_pcm_drop(snd_pcm_t *pcm);
545 int snd_pcm_drain(snd_pcm_t *pcm);
546 int snd_pcm_pause(snd_pcm_t *pcm, int enable);
548 int snd_pcm_hwsync(snd_pcm_t *pcm);
549 int snd_pcm_delay(snd_pcm_t *pcm, snd_pcm_sframes_t *delayp);
550 int snd_pcm_resume(snd_pcm_t *pcm);
559 snd_pcm_sframes_t snd_pcm_writei(snd_pcm_t *pcm, const void *buffer, snd_pcm_uframes_t size);
563 int snd_pcm_wait(snd_pcm_t *pcm, int timeout);
564 
565 int snd_pcm_link(snd_pcm_t *pcm1, snd_pcm_t *pcm2);
566 int snd_pcm_unlink(snd_pcm_t *pcm);
567 
569 #define SND_CHMAP_API_VERSION ((1 << 16) | (0 << 8) | 1)
570 
578 };
579 
619  SND_CHMAP_LAST = SND_CHMAP_BRC,
620 };
621 
623 #define SND_CHMAP_POSITION_MASK 0xffff
624 
626 #define SND_CHMAP_PHASE_INVERSE (0x01 << 16)
627 
628 #define SND_CHMAP_DRIVER_SPEC (0x02 << 16)
629 
631 typedef struct snd_pcm_chmap {
632  unsigned int channels;
633  unsigned int pos[0];
635 
637 typedef struct snd_pcm_chmap_query {
638  enum snd_pcm_chmap_type type;
641 
642 
645  int subdev,
646  snd_pcm_stream_t stream);
649 int snd_pcm_set_chmap(snd_pcm_t *pcm, const snd_pcm_chmap_t *map);
650 
651 const char *snd_pcm_chmap_type_name(enum snd_pcm_chmap_type val);
652 const char *snd_pcm_chmap_name(enum snd_pcm_chmap_position val);
653 const char *snd_pcm_chmap_long_name(enum snd_pcm_chmap_position val);
654 int snd_pcm_chmap_print(const snd_pcm_chmap_t *map, size_t maxlen, char *buf);
655 unsigned int snd_pcm_chmap_from_string(const char *str);
657 
658 //int snd_pcm_mixer_element(snd_pcm_t *pcm, snd_mixer_t *mixer, snd_mixer_elem_t **elem);
659 
660 /*
661  * application helpers - these functions are implemented on top
662  * of the basic API
663  */
664 
665 int snd_pcm_recover(snd_pcm_t *pcm, int err, int silent);
667  snd_pcm_format_t format,
668  snd_pcm_access_t access,
669  unsigned int channels,
670  unsigned int rate,
671  int soft_resample,
672  unsigned int latency);
674  snd_pcm_uframes_t *buffer_size,
675  snd_pcm_uframes_t *period_size);
676 
686 size_t snd_pcm_info_sizeof(void);
691 #define snd_pcm_info_alloca(ptr) __snd_alloca(ptr, snd_pcm_info)
694 void snd_pcm_info_copy(snd_pcm_info_t *dst, const snd_pcm_info_t *src);
695 unsigned int snd_pcm_info_get_device(const snd_pcm_info_t *obj);
696 unsigned int snd_pcm_info_get_subdevice(const snd_pcm_info_t *obj);
698 int snd_pcm_info_get_card(const snd_pcm_info_t *obj);
699 const char *snd_pcm_info_get_id(const snd_pcm_info_t *obj);
700 const char *snd_pcm_info_get_name(const snd_pcm_info_t *obj);
701 const char *snd_pcm_info_get_subdevice_name(const snd_pcm_info_t *obj);
704 unsigned int snd_pcm_info_get_subdevices_count(const snd_pcm_info_t *obj);
705 unsigned int snd_pcm_info_get_subdevices_avail(const snd_pcm_info_t *obj);
707 void snd_pcm_info_set_device(snd_pcm_info_t *obj, unsigned int val);
708 void snd_pcm_info_set_subdevice(snd_pcm_info_t *obj, unsigned int val);
710 
721 
735 int snd_pcm_hw_params_supports_audio_wallclock_ts(const snd_pcm_hw_params_t *params); /* deprecated, use audio_ts_type */
738  unsigned int *rate_num,
739  unsigned int *rate_den);
742 
743 #if 0
744 typedef struct _snd_pcm_hw_strategy snd_pcm_hw_strategy_t;
745 
746 /* choices need to be sorted on ascending badness */
747 typedef struct _snd_pcm_hw_strategy_simple_choices_list {
748  unsigned int value;
749  unsigned int badness;
750 } snd_pcm_hw_strategy_simple_choices_list_t;
751 
752 int snd_pcm_hw_params_strategy(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
753  const snd_pcm_hw_strategy_t *strategy,
754  unsigned int badness_min,
755  unsigned int badness_max);
756 
757 void snd_pcm_hw_strategy_free(snd_pcm_hw_strategy_t *strategy);
758 int snd_pcm_hw_strategy_simple(snd_pcm_hw_strategy_t **strategyp,
759  unsigned int badness_min,
760  unsigned int badness_max);
761 int snd_pcm_hw_params_try_explain_failure(snd_pcm_t *pcm,
762  snd_pcm_hw_params_t *fail,
763  snd_pcm_hw_params_t *success,
764  unsigned int depth,
765  snd_output_t *out);
766 
767 #endif
768 
769 size_t snd_pcm_hw_params_sizeof(void);
774 #define snd_pcm_hw_params_alloca(ptr) __snd_alloca(ptr, snd_pcm_hw_params)
778 
779 #if !defined(ALSA_LIBRARY_BUILD) && !defined(ALSA_PCM_OLD_HW_PARAMS_API)
780 
788 
796 
804 
805 int snd_pcm_hw_params_get_channels(const snd_pcm_hw_params_t *params, unsigned int *val);
806 int snd_pcm_hw_params_get_channels_min(const snd_pcm_hw_params_t *params, unsigned int *val);
807 int snd_pcm_hw_params_get_channels_max(const snd_pcm_hw_params_t *params, unsigned int *val);
808 int snd_pcm_hw_params_test_channels(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
809 int snd_pcm_hw_params_set_channels(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
810 int snd_pcm_hw_params_set_channels_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
811 int snd_pcm_hw_params_set_channels_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
812 int snd_pcm_hw_params_set_channels_minmax(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *min, unsigned int *max);
813 int snd_pcm_hw_params_set_channels_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
814 int snd_pcm_hw_params_set_channels_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
815 int snd_pcm_hw_params_set_channels_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
816 
817 int snd_pcm_hw_params_get_rate(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
818 int snd_pcm_hw_params_get_rate_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
819 int snd_pcm_hw_params_get_rate_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
820 int snd_pcm_hw_params_test_rate(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
821 int snd_pcm_hw_params_set_rate(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
822 int snd_pcm_hw_params_set_rate_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
823 int snd_pcm_hw_params_set_rate_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
824 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);
825 int snd_pcm_hw_params_set_rate_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
826 int snd_pcm_hw_params_set_rate_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
827 int snd_pcm_hw_params_set_rate_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
828 int snd_pcm_hw_params_set_rate_resample(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
829 int snd_pcm_hw_params_get_rate_resample(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
830 int snd_pcm_hw_params_set_export_buffer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
831 int snd_pcm_hw_params_get_export_buffer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
832 int snd_pcm_hw_params_set_period_wakeup(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
833 int snd_pcm_hw_params_get_period_wakeup(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
834 int snd_pcm_hw_params_set_drain_silence(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
835 int snd_pcm_hw_params_get_drain_silence(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
836 
837 int snd_pcm_hw_params_get_period_time(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
838 int snd_pcm_hw_params_get_period_time_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
839 int snd_pcm_hw_params_get_period_time_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
840 int snd_pcm_hw_params_test_period_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
841 int snd_pcm_hw_params_set_period_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
842 int snd_pcm_hw_params_set_period_time_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
843 int snd_pcm_hw_params_set_period_time_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
844 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);
845 int snd_pcm_hw_params_set_period_time_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
846 int snd_pcm_hw_params_set_period_time_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
847 int snd_pcm_hw_params_set_period_time_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
848 
849 int snd_pcm_hw_params_get_period_size(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *frames, int *dir);
856 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);
861 
862 int snd_pcm_hw_params_get_periods(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
863 int snd_pcm_hw_params_get_periods_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
864 int snd_pcm_hw_params_get_periods_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
865 int snd_pcm_hw_params_test_periods(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
866 int snd_pcm_hw_params_set_periods(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
867 int snd_pcm_hw_params_set_periods_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
868 int snd_pcm_hw_params_set_periods_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
869 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);
870 int snd_pcm_hw_params_set_periods_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
871 int snd_pcm_hw_params_set_periods_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
872 int snd_pcm_hw_params_set_periods_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
874 
875 int snd_pcm_hw_params_get_buffer_time(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
876 int snd_pcm_hw_params_get_buffer_time_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
877 int snd_pcm_hw_params_get_buffer_time_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
878 int snd_pcm_hw_params_test_buffer_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
879 int snd_pcm_hw_params_set_buffer_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
880 int snd_pcm_hw_params_set_buffer_time_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
881 int snd_pcm_hw_params_set_buffer_time_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
882 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);
883 int snd_pcm_hw_params_set_buffer_time_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
884 int snd_pcm_hw_params_set_buffer_time_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
885 int snd_pcm_hw_params_set_buffer_time_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
886 
898 
899 #endif /* !ALSA_LIBRARY_BUILD && !ALSA_PCM_OLD_HW_PARAMS_API */
900 
902 
912 size_t snd_pcm_sw_params_sizeof(void);
917 #define snd_pcm_sw_params_alloca(ptr) __snd_alloca(ptr, snd_pcm_sw_params)
922 
923 #if !defined(ALSA_LIBRARY_BUILD) && !defined(ALSA_PCM_OLD_SW_PARAMS_API)
924 
932 int snd_pcm_sw_params_get_period_event(const snd_pcm_sw_params_t *params, int *val);
941 
942 #endif /* !ALSA_LIBRARY_BUILD && !ALSA_PCM_OLD_SW_PARAMS_API */
943 
946 /* include old API */
947 #ifndef ALSA_LIBRARY_BUILD
948 #if defined(ALSA_PCM_OLD_HW_PARAMS_API) || defined(ALSA_PCM_OLD_SW_PARAMS_API)
949 #include "pcm_old.h"
950 #endif
951 #endif
952 
960 size_t snd_pcm_access_mask_sizeof(void);
965 #define snd_pcm_access_mask_alloca(ptr) __snd_alloca(ptr, snd_pcm_access_mask)
975 
985 size_t snd_pcm_format_mask_sizeof(void);
990 #define snd_pcm_format_mask_alloca(ptr) __snd_alloca(ptr, snd_pcm_format_mask)
1000 
1010 size_t snd_pcm_subformat_mask_sizeof(void);
1015 #define snd_pcm_subformat_mask_alloca(ptr) __snd_alloca(ptr, snd_pcm_subformat_mask)
1025 
1035 size_t snd_pcm_status_sizeof(void);
1040 #define snd_pcm_status_alloca(ptr) __snd_alloca(ptr, snd_pcm_status)
1052  snd_pcm_audio_tstamp_report_t *audio_tstamp_report);
1054  snd_pcm_audio_tstamp_config_t *audio_tstamp_config);
1055 
1056 static inline void snd_pcm_pack_audio_tstamp_config(unsigned int *data,
1058 {
1059  *data = config->report_delay;
1060  *data <<= 4;
1061  *data |= config->type_requested;
1062 }
1063 
1064 static inline void snd_pcm_unpack_audio_tstamp_report(unsigned int data, unsigned int accuracy,
1066 {
1067  data >>= 16;
1068  report->valid = data & 1;
1069  report->actual_type = (data >> 1) & 0xF;
1070  report->accuracy_report = (data >> 5) & 1;
1071  report->accuracy = accuracy;
1072 }
1073 
1078 
1088 const char *snd_pcm_type_name(snd_pcm_type_t type);
1089 const char *snd_pcm_stream_name(const snd_pcm_stream_t stream);
1090 const char *snd_pcm_access_name(const snd_pcm_access_t _access);
1091 const char *snd_pcm_format_name(const snd_pcm_format_t format);
1092 const char *snd_pcm_format_description(const snd_pcm_format_t format);
1093 const char *snd_pcm_subformat_name(const snd_pcm_subformat_t subformat);
1094 const char *snd_pcm_subformat_description(const snd_pcm_subformat_t subformat);
1095 snd_pcm_format_t snd_pcm_format_value(const char* name);
1096 const char *snd_pcm_tstamp_mode_name(const snd_pcm_tstamp_t mode);
1097 const char *snd_pcm_state_name(const snd_pcm_state_t state);
1098 
1108 int snd_pcm_dump(snd_pcm_t *pcm, snd_output_t *out);
1111 int snd_pcm_dump_setup(snd_pcm_t *pcm, snd_output_t *out);
1115 
1125 int snd_pcm_mmap_begin(snd_pcm_t *pcm,
1126  const snd_pcm_channel_area_t **areas,
1127  snd_pcm_uframes_t *offset,
1128  snd_pcm_uframes_t *frames);
1130  snd_pcm_uframes_t offset,
1131  snd_pcm_uframes_t frames);
1132 snd_pcm_sframes_t snd_pcm_mmap_writei(snd_pcm_t *pcm, const void *buffer, snd_pcm_uframes_t size);
1136 
1153 int snd_pcm_format_width(snd_pcm_format_t format); /* in bits */
1154 int snd_pcm_format_physical_width(snd_pcm_format_t format); /* in bits */
1155 snd_pcm_format_t snd_pcm_build_linear_format(int width, int pwidth, int unsignd, int big_endian);
1156 ssize_t snd_pcm_format_size(snd_pcm_format_t format, size_t samples);
1161 int snd_pcm_format_set_silence(snd_pcm_format_t format, void *buf, unsigned int samples);
1162 
1165 long snd_pcm_bytes_to_samples(snd_pcm_t *pcm, ssize_t bytes);
1166 ssize_t snd_pcm_samples_to_bytes(snd_pcm_t *pcm, long samples);
1167 
1168 int snd_pcm_area_silence(const snd_pcm_channel_area_t *dst_channel, snd_pcm_uframes_t dst_offset,
1169  unsigned int samples, snd_pcm_format_t format);
1170 int snd_pcm_areas_silence(const snd_pcm_channel_area_t *dst_channels, snd_pcm_uframes_t dst_offset,
1171  unsigned int channels, snd_pcm_uframes_t frames, snd_pcm_format_t format);
1172 int snd_pcm_area_copy(const snd_pcm_channel_area_t *dst_channel, snd_pcm_uframes_t dst_offset,
1173  const snd_pcm_channel_area_t *src_channel, snd_pcm_uframes_t src_offset,
1174  unsigned int samples, snd_pcm_format_t format);
1175 int snd_pcm_areas_copy(const snd_pcm_channel_area_t *dst_channels, snd_pcm_uframes_t dst_offset,
1176  const snd_pcm_channel_area_t *src_channels, snd_pcm_uframes_t src_offset,
1177  unsigned int channels, snd_pcm_uframes_t frames, snd_pcm_format_t format);
1178 int snd_pcm_areas_copy_wrap(const snd_pcm_channel_area_t *dst_channels,
1179  snd_pcm_uframes_t dst_offset,
1180  const snd_pcm_uframes_t dst_size,
1181  const snd_pcm_channel_area_t *src_channels,
1182  snd_pcm_uframes_t src_offset,
1183  const snd_pcm_uframes_t src_size,
1184  const unsigned int channels,
1185  snd_pcm_uframes_t frames,
1186  const snd_pcm_format_t format);
1187 
1195 static inline void *snd_pcm_channel_area_addr(const snd_pcm_channel_area_t *area, snd_pcm_uframes_t offset)
1196 {
1197  return (char *)area->addr + (area->first + area->step * offset) / 8;
1198 }
1199 
1206 static inline unsigned int snd_pcm_channel_area_step(const snd_pcm_channel_area_t *area)
1207 {
1208  return area->step / 8;
1209 }
1210 
1221 typedef enum _snd_pcm_hook_type {
1222  SND_PCM_HOOK_TYPE_HW_PARAMS = 0,
1223  SND_PCM_HOOK_TYPE_HW_FREE,
1224  SND_PCM_HOOK_TYPE_CLOSE,
1225  SND_PCM_HOOK_TYPE_LAST = SND_PCM_HOOK_TYPE_CLOSE
1227 
1229 typedef struct _snd_pcm_hook snd_pcm_hook_t;
1231 typedef int (*snd_pcm_hook_func_t)(snd_pcm_hook_t *hook);
1234 void snd_pcm_hook_set_private(snd_pcm_hook_t *hook, void *private_data);
1235 int snd_pcm_hook_add(snd_pcm_hook_t **hookp, snd_pcm_t *pcm,
1236  snd_pcm_hook_type_t type,
1237  snd_pcm_hook_func_t func, void *private_data);
1239 
1250 typedef struct _snd_pcm_scope_ops {
1254  int (*enable)(snd_pcm_scope_t *scope);
1258  void (*disable)(snd_pcm_scope_t *scope);
1262  void (*start)(snd_pcm_scope_t *scope);
1266  void (*stop)(snd_pcm_scope_t *scope);
1270  void (*update)(snd_pcm_scope_t *scope);
1274  void (*reset)(snd_pcm_scope_t *scope);
1278  void (*close)(snd_pcm_scope_t *scope);
1280 
1282 unsigned int snd_pcm_meter_get_channels(snd_pcm_t *pcm);
1283 unsigned int snd_pcm_meter_get_rate(snd_pcm_t *pcm);
1287 snd_pcm_scope_t *snd_pcm_meter_search_scope(snd_pcm_t *pcm, const char *name);
1290  const snd_pcm_scope_ops_t *val);
1291 void snd_pcm_scope_set_name(snd_pcm_scope_t *scope, const char *val);
1292 const char *snd_pcm_scope_get_name(snd_pcm_scope_t *scope);
1294 void snd_pcm_scope_set_callback_private(snd_pcm_scope_t *scope, void *val);
1295 int snd_pcm_scope_s16_open(snd_pcm_t *pcm, const char *name,
1296  snd_pcm_scope_t **scopep);
1298  unsigned int channel);
1299 
1310 typedef enum _snd_spcm_latency {
1321 
1323 typedef enum _snd_spcm_xrun_type {
1329 
1331 typedef enum _snd_spcm_duplex_type {
1337 
1338 int snd_spcm_init(snd_pcm_t *pcm,
1339  unsigned int rate,
1340  unsigned int channels,
1341  snd_pcm_format_t format,
1342  snd_pcm_subformat_t subformat,
1343  snd_spcm_latency_t latency,
1344  snd_pcm_access_t _access,
1345  snd_spcm_xrun_type_t xrun_type);
1346 
1347 int snd_spcm_init_duplex(snd_pcm_t *playback_pcm,
1348  snd_pcm_t *capture_pcm,
1349  unsigned int rate,
1350  unsigned int channels,
1351  snd_pcm_format_t format,
1352  snd_pcm_subformat_t subformat,
1353  snd_spcm_latency_t latency,
1354  snd_pcm_access_t _access,
1355  snd_spcm_xrun_type_t xrun_type,
1356  snd_spcm_duplex_type_t duplex_type);
1357 
1359  unsigned int *rate,
1360  snd_pcm_uframes_t *buffer_size,
1361  snd_pcm_uframes_t *period_size);
1362 
1372 /* Deprecated functions, for compatibility */
1373 const char *snd_pcm_start_mode_name(snd_pcm_start_t mode) __attribute__((deprecated));
1374 const char *snd_pcm_xrun_mode_name(snd_pcm_xrun_t mode) __attribute__((deprecated));
1375 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));
1376 snd_pcm_start_t snd_pcm_sw_params_get_start_mode(const snd_pcm_sw_params_t *params) __attribute__((deprecated));
1377 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));
1378 snd_pcm_xrun_t snd_pcm_sw_params_get_xrun_mode(const snd_pcm_sw_params_t *params) __attribute__((deprecated));
1379 #if !defined(ALSA_LIBRARY_BUILD) && !defined(ALSA_PCM_OLD_SW_PARAMS_API)
1380 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));
1381 int snd_pcm_sw_params_get_xfer_align(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val) __attribute__((deprecated));
1382 int snd_pcm_sw_params_set_sleep_min(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, unsigned int val) __attribute__((deprecated));
1383 int snd_pcm_sw_params_get_sleep_min(const snd_pcm_sw_params_t *params, unsigned int *val) __attribute__((deprecated));
1384 #endif /* !ALSA_LIBRARY_BUILD && !ALSA_PCM_OLD_SW_PARAMS_API */
1385 #if !defined(ALSA_LIBRARY_BUILD) && !defined(ALSA_PCM_OLD_HW_PARAMS_API)
1386 int snd_pcm_hw_params_get_tick_time(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir) __attribute__((deprecated));
1387 int snd_pcm_hw_params_get_tick_time_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir) __attribute__((deprecated));
1388 int snd_pcm_hw_params_get_tick_time_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir) __attribute__((deprecated));
1389 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));
1390 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));
1391 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));
1392 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));
1393 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));
1394 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));
1395 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));
1396 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));
1397 #endif /* !ALSA_LIBRARY_BUILD && !ALSA_PCM_OLD_HW_PARAMS_API */
1398 
1401 #ifdef __cplusplus
1402 }
1403 #endif
1404 
1405 #endif /* __ALSA_PCM_H */
Definition: pcm.h:338
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:6621
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:6377
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:6037
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:5859
int snd_pcm_hwsync(snd_pcm_t *pcm)
(DEPRECATED) Synchronize stream position with hardware
Definition: pcm.c:1094
struct _snd_pcm_sw_params snd_pcm_sw_params_t
Definition: pcm.h:67
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:4535
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:284
Definition: pcm.h:161
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:3977
Definition: pcm.h:442
int snd_pcm_set_chmap(snd_pcm_t *pcm, const snd_pcm_chmap_t *map)
Definition: pcm.c:8249
snd_pcm_xrun_t
Definition: pcm.h:325
int snd_pcm_sw_params_dump(snd_pcm_sw_params_t *params, snd_output_t *out)
Dump a software configuration.
Definition: pcm.c:6314
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:5824
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:6683
int snd_pcm_format_float(snd_pcm_format_t format)
Return float info for a PCM sample format.
Definition: pcm_misc.c:110
int snd_pcm_info(snd_pcm_t *pcm, snd_pcm_info_t *info)
Obtain general (static) information for PCM handle.
Definition: pcm.c:872
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:5258
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:4469
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:6079
uint64_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:410
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:4909
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:4859
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:6417
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:5491
Definition: pcm.h:617
snd_pcm_chmap_t map
Definition: pcm.h:639
Definition: pcm.h:286
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:4992
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:4941
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:2196
size_t snd_pcm_info_sizeof(void)
get size of snd_pcm_info_t
Definition: pcm.c:7100
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:6115
Definition: pcm.h:127
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:5473
Definition: pcm.h:456
Definition: pcm.h:586
Definition: pcm.h:637
struct _snd_pcm_subformat_mask snd_pcm_subformat_mask_t
Definition: pcm.h:75
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:1211
Definition: pcm.h:112
Definition: pcm.h:147
Definition: pcm.h:602
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:5977
snd_pcm_state_t
Definition: pcm.h:291
int snd_pcm_status_malloc(snd_pcm_status_t **ptr)
allocate an invalid snd_pcm_status_t using standard malloc
Definition: pcm.c:6895
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:5555
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:6963
Definition: pcm.h:1327
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:5725
snd_pcm_class_t
Definition: pcm.h:78
Definition: pcm.h:474
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:895
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:5997
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:4629
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:3375
size_t snd_pcm_format_mask_sizeof(void)
get size of snd_pcm_format_mask_t
Definition: pcm.c:4006
int snd_pcm_drop(snd_pcm_t *pcm)
Stop a PCM dropping pending frames.
Definition: pcm.c:1308
Definition: pcm.h:583
int snd_pcm_status(snd_pcm_t *pcm, snd_pcm_status_t *status)
Obtain status (runtime) information for PCM handle.
Definition: pcm.c:1041
int snd_pcm_poll_descriptors_count(snd_pcm_t *pcm)
get count of poll descriptors for PCM handle
Definition: pcm.c:1746
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:7080
Definition: pcm.h:604
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:4089
Definition: pcm.h:307
Definition: pcm.h:614
Definition: pcm.h:484
Definition: pcm.h:430
Definition: pcm.h:238
Definition: pcm.h:615
Definition: pcm.h:468
Definition: pcm.h:143
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:607
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:5624
Definition: pcm.h:472
Definition: pcm.h:577
int snd_pcm_start(snd_pcm_t *pcm)
Start a PCM.
Definition: pcm.c:1277
snd_pcm_subformat_t
Definition: pcm.h:284
int snd_pcm_format_unsigned(snd_pcm_format_t format)
Return sign info for a PCM sample linear format.
Definition: pcm_misc.c:85
Definition: pcm.h:312
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:5330
Definition: pcm.h:360
struct _snd_pcm_hw_params snd_pcm_hw_params_t
Definition: pcm.h:64
Definition: pcm.h:631
Definition: pcm.h:593
int snd_pcm_hw_params_supports_audio_ts_type(const snd_pcm_hw_params_t *params, int type)
Check if hardware supports type of audio timestamps.
Definition: pcm.c:3799
snd_pcm_type_t snd_pcm_type(snd_pcm_t *pcm)
get type of PCM handle
Definition: pcm.c:739
int snd_pcm_areas_copy_wrap(const snd_pcm_channel_area_t *dst_channels, snd_pcm_uframes_t dst_offset, const snd_pcm_uframes_t dst_size, const snd_pcm_channel_area_t *src_channels, snd_pcm_uframes_t src_offset, const snd_pcm_uframes_t src_size, const unsigned int channels, snd_pcm_uframes_t frames, const snd_pcm_format_t format)
Copy one or more areas.
Definition: pcm.c:3453
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:4321
void * addr
Definition: pcm.h:486
struct _snd_pcm_status snd_pcm_status_t
Definition: pcm.h:69
struct _snd_pcm_info snd_pcm_info_t
Definition: pcm.h:48
Definition: pcm.h:131
const char * snd_pcm_chmap_name(enum snd_pcm_chmap_position val)
Definition: pcm.c:8313
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:3522
Definition: pcm.h:203
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:5200
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:4099
Definition: pcm.h:135
Definition: pcm.h:139
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:4441
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:4402
Definition: pcm.h:444
_snd_pcm_type
Definition: pcm.h:413
Definition: pcm.h:169
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:4840
Definition: pcm.h:576
snd_pcm_chmap_type
Definition: pcm.h:572
int(* snd_pcm_hook_func_t)(snd_pcm_hook_t *hook)
Definition: pcm.h:1231
Definition: pcm.h:440
Definition: pcm.h:189
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:3702
snd_pcm_subclass_t
Definition: pcm.h:92
int snd_pcm_delay(snd_pcm_t *pcm, snd_pcm_sframes_t *delayp)
Obtain delay for a running PCM handle.
Definition: pcm.c:1139
Definition: pcm.h:133
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:4375
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:3203
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:5899
void(* snd_async_callback_t)(snd_async_handler_t *handler)
Async notification callback.
Definition: global.h:122
const char * snd_pcm_format_description(const snd_pcm_format_t format)
get description of PCM sample format
Definition: pcm.c:2133
Definition: pcm.h:424
int snd_pcm_wait(snd_pcm_t *pcm, int timeout)
Wait for a PCM to become ready.
Definition: pcm.c:2847
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:861
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:3502
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:6098
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:4512
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:3582
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:3956
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:5673
int snd_pcm_close(snd_pcm_t *pcm)
close PCM handle
Definition: pcm.c:766
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:7210
void snd_pcm_status_get_driver_htstamp(const snd_pcm_status_t *obj, snd_htimestamp_t *ptr)
Get "now" hi-res driver timestamp from a PCM status container. Defines when the status was generated ...
Definition: pcm.c:7016
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:6668
Definition: pcm.h:603
Definition: pcm.h:145
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:4202
Definition: pcm.h:573
Definition: pcm.h:434
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:5115
void snd_pcm_subformat_mask_free(snd_pcm_subformat_mask_t *obj)
frees a previously allocated snd_pcm_subformat_mask_t
Definition: pcm.c:4132
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:6507
int snd_pcm_status_dump(snd_pcm_status_t *status, snd_output_t *out)
Dump status.
Definition: pcm.c:2352
Definition: pcm.h:432
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:4790
Definition: pcm.h:450
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:951
Definition: pcm.h:436
Definition: pcm.h:250
Definition: pcm.h:1319
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:4245
snd_pcm_start_t
Definition: pcm.h:316
int snd_pcm_format_width(snd_pcm_format_t format)
Return nominal bits per a PCM sample.
Definition: pcm_misc.c:210
int snd_pcm_hw_params_can_pause(const snd_pcm_hw_params_t *params)
Check if hardware supports pause.
Definition: pcm.c:3642
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:5932
int snd_pcm_nonblock(snd_pcm_t *pcm, int nonblock)
set nonblock mode
Definition: pcm.c:802
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:6976
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:981
Definition: pcm.h:1325
size_t snd_pcm_status_sizeof(void)
get size of snd_pcm_status_t
Definition: pcm.c:6885
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:4418
void snd_pcm_info_free(snd_pcm_info_t *obj)
frees a previously allocated snd_pcm_info_t
Definition: pcm.c:7123
Definition: pcm.h:1333
Definition: pcm.h:151
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:5236
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:8899
Definition: pcm.h:336
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:4222
Definition: pcm.h:594
Definition: pcm.h:105
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:4744
Definition: pcm.h:612
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:5349
int snd_pcm_chmap_print(const snd_pcm_chmap_t *map, size_t maxlen, char *buf)
Definition: pcm.c:8381
Definition: pcm.h:299
void snd_pcm_access_mask_free(snd_pcm_access_mask_t *obj)
frees a previously allocated snd_pcm_access_mask_t
Definition: pcm.c:3927
Definition: pcm.h:163
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:4525
void snd_pcm_format_mask_free(snd_pcm_format_mask_t *obj)
frees a previously allocated snd_pcm_format_mask_t
Definition: pcm.c:4029
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:4182
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:2212
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:5525
Definition: pcm.h:458
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:5655
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:923
Definition: pcm.h:591
Definition: pcm.h:448
snd_pcm_format_t
Definition: pcm.h:125
const char * snd_pcm_chmap_long_name(enum snd_pcm_chmap_position val)
Definition: pcm.c:8366
long snd_pcm_sframes_t
Definition: pcm.h:390
Definition: pcm.h:297
Definition: pcm.h:155
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:4760
Definition: pcm.h:422
Definition: pcm.h:598
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:5918
Definition: pcm.h:205
Definition: pcm.h:175
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:2718
Definition: pcm.h:305
const char * snd_pcm_tstamp_mode_name(const snd_pcm_tstamp_t mode)
get name of PCM tstamp mode setting
Definition: pcm.c:2228
const char * snd_pcm_chmap_type_name(enum snd_pcm_chmap_type val)
Definition: pcm.c:8280
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:4565
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:7326
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:846
Definition: pcm.h:613
Definition: pcm.h:244
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:4049
void snd_pcm_hw_params_free(snd_pcm_hw_params_t *obj)
frees a previously allocated snd_pcm_hw_params_t
Definition: pcm.c:4235
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:4261
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:4481
Definition: pcm.h:367
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:3937
Definition: pcm.h:242
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:7300
struct _snd_pcm_scope snd_pcm_scope_t
Definition: pcm.h:511
size_t snd_pcm_hw_params_sizeof(void)
get size of snd_pcm_hw_params_t
Definition: pcm.c:4212
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:6195
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:4726
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:3018
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:6595
Definition: pcm.h:415
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:7278
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:4891
Definition: pcm.h:601
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:4689
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:961
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:1179
Definition: pcm.h:606
unsigned int snd_pcm_info_get_subdevice(const snd_pcm_info_t *obj)
Get subdevice from a PCM info container.
Definition: pcm.c:7155
Definition: pcm.h:187
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:5131
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:7243
Definition: pcm.h:611
int snd_pcm_hw_params_get_drain_silence(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val)
Extract drain with the filling of silence samples from a configuration space.
Definition: pcm.c:5029
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:5048
const char * snd_pcm_info_get_id(const snd_pcm_info_t *obj)
Get id from a PCM info container.
Definition: pcm.c:7188
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:6060
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:3876
uint8_t snd_pcm_format_silence(snd_pcm_format_t format)
Return 8 bit expressing silence for a PCM sample format.
Definition: pcm_misc.c:594
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:5370
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:6929
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:6747
Definition: pcm.h:470
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:4161
Definition: pcm.h:426
Definition: pcm.h:83
Definition: pcm.h:173
struct _snd_output snd_output_t
Internal structure for an output object.
Definition: output.h:56
struct timespec snd_htimestamp_t
Definition: global.h:154
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:6438
uint32_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:572
void snd_pcm_free_chmaps(snd_pcm_chmap_query_t **maps)
Definition: pcm.c:8219
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:4387
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:6991
size_t snd_pcm_access_mask_sizeof(void)
get size of snd_pcm_access_mask_t
Definition: pcm.c:3904
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:4605
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:201
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:881
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:4142
Definition: pcm.h:1335
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:5770
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:971
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:4192
Definition: pcm.h:141
Definition: pcm.h:590
Definition: pcm.h:209
Definition: pcm.h:191
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:3682
Definition: pcm.h:87
Definition: pcm.h:320
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:4058
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:4970
Definition: pcm.h:608
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:1673
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:6944
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:3835
Definition: pcm.h:466
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:6160
Definition: pcm.h:596
Definition: pcm.h:309
snd_spcm_xrun_type_t
Definition: pcm.h:1323
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:4305
Definition: pcm.h:211
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:6556
snd_pcm_hook_type_t
Definition: pcm.h:1221
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:151
int snd_pcm_dump_setup(snd_pcm_t *pcm, snd_output_t *out)
Dump current setup (hardware and software) for PCM.
Definition: pcm.c:2339
snd_pcm_stream_t snd_pcm_stream(snd_pcm_t *pcm)
get stream for a PCM handle
Definition: pcm.c:752
Definition: pcm.h:1316
Definition: pcm.h:582
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:2994
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:7265
Definition: pcm.h:236
Definition: pcm.h:417
Definition: pcm.h:295
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:4923
Definition: pcm.h:193
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:6130
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:8208
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:7232
snd_spcm_duplex_type_t
Definition: pcm.h:1331
Definition: pcm.h:252
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:7221
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:6486
Definition: pcm.h:454
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:3947
struct _snd_pcm_access_mask snd_pcm_access_mask_t
Definition: pcm.h:71
Definition: pcm.h:246
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:8710
size_t snd_pcm_subformat_mask_sizeof(void)
get size of snd_pcm_subformat_mask_t
Definition: pcm.c:4109
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:1197
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:1230
Definition: pcm.h:462
const char * snd_pcm_type_name(snd_pcm_type_t type)
get name of PCM type
Definition: pcm.c:2267
snd_pcm_sframes_t snd_pcm_rewindable(snd_pcm_t *pcm)
Get safe count of frames which can be rewinded.
Definition: pcm.c:1411
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:2392
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:3987
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:6214
const char * snd_pcm_stream_name(const snd_pcm_stream_t stream)
get name of PCM stream type
Definition: pcm.c:2097
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:7166
struct _snd_pcm_hook snd_pcm_hook_t
Definition: pcm.h:1229
void snd_pcm_status_free(snd_pcm_status_t *obj)
frees a previously allocated snd_pcm_status_t
Definition: pcm.c:6908
snd_pcm_sframes_t snd_pcm_forwardable(snd_pcm_t *pcm)
Get safe count of frames which can be forwarded.
Definition: pcm.c:1477
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:6539
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:4708
int snd_pcm_dump_hw_setup(snd_pcm_t *pcm, snd_output_t *out)
Dump current hardware setup for PCM.
Definition: pcm.c:2282
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:342
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:3722
Definition: pcm.h:103
const char * snd_pcm_name(snd_pcm_t *pcm)
get identifier of PCM handle
Definition: pcm.c:726
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:4334
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:6177
Definition: pcm.h:195
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:6769
uint16_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:583
long snd_pcm_bytes_to_samples(snd_pcm_t *pcm, ssize_t bytes)
Convert bytes in samples for a PCM.
Definition: pcm.c:2424
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:5944
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:4278
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:5709
Definition: pcm.h:428
int snd_pcm_hw_params_set_drain_silence(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val)
Restrict a configuration space to fill the end of playback stream with silence when drain() is invoke...
Definition: pcm.c:5011
int snd_pcm_hw_params_can_resume(const snd_pcm_hw_params_t *params)
Check if hardware supports resume.
Definition: pcm.c:3662
Definition: pcm.h:301
snd_pcm_state_t snd_pcm_state(snd_pcm_t *pcm)
Return PCM state.
Definition: pcm.c:1070
snd_pcm_tstamp_type_t
Definition: pcm.h:346
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:4456
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:6017
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:7090
Definition: pcm.h:179
Definition: pcm.h:460
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:6295
Definition: pcm.h:234
Definition: pcm.h:81
int snd_pcm_resume(snd_pcm_t *pcm)
Resume from suspend, no samples are lost.
Definition: pcm.c:1168
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:4016
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:1595
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:4805
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:4878
Definition: pcm.h:605
snd_pcm_t * snd_async_handler_get_pcm(snd_async_handler_t *handler)
Return PCM handle related to an async handler.
Definition: pcm.c:2490
int snd_pcm_prepare(snd_pcm_t *pcm)
Prepare PCM for use.
Definition: pcm.c:1222
Definition: pcm.h:446
int snd_pcm_info_get_card(const snd_pcm_info_t *obj)
Get card from a PCM info container.
Definition: pcm.c:7177
Definition: pcm.h:153
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:937
Definition: pcm.h:303
Definition: pcm.h:118
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:115
int snd_pcm_format_cpu_endian(snd_pcm_format_t format)
Return endian info for a PCM sample format.
Definition: pcm_misc.c:196
Definition: pcm.h:199
int snd_pcm_drain(snd_pcm_t *pcm)
Stop a PCM preserving pending frames.
Definition: pcm.c:1345
Definition: pcm.h:240
Definition: pcm.h:85
void snd_pcm_sw_params_free(snd_pcm_sw_params_t *obj)
frees a previously allocated snd_pcm_sw_params_t
Definition: pcm.c:6355
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:5643
struct timeval snd_timestamp_t
Definition: global.h:152
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:940
int snd_pcm_format_physical_width(snd_pcm_format_t format)
Return bits needed to store a PCM sample.
Definition: pcm_misc.c:277
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:5100
Definition: pcm.h:588
Definition: pcm.h:94
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:5570
Definition: pcm.h:171
Definition: pcm.h:609
int snd_pcm_pause(snd_pcm_t *pcm, int enable)
Pause/resume PCM.
Definition: pcm.c:1379
Definition: pcm.h:373
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:5787
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:5960
int snd_pcm_hw_free(snd_pcm_t *pcm)
Remove PCM hardware configuration and free associated resources.
Definition: pcm.c:955
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:988
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:4119
unsigned int step
Definition: pcm.h:490
Definition: pcm.h:149
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:5587
int snd_pcm_dump(snd_pcm_t *pcm, snd_output_t *out)
Dump PCM info.
Definition: pcm.c:2373
unsigned int snd_pcm_chmap_from_string(const char *str)
Definition: pcm.c:8459
unsigned int snd_pcm_info_get_device(const snd_pcm_info_t *obj)
Get device from a PCM info container.
Definition: pcm.c:7144
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:5455
int snd_pcm_link(snd_pcm_t *pcm1, snd_pcm_t *pcm2)
Link two PCMs.
Definition: pcm.c:1701
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:5805
Definition: pcm.h:201
const char * snd_pcm_access_name(const snd_pcm_access_t _access)
get name of PCM access type
Definition: pcm.c:2109
Definition: pcm.h:197
Definition: pcm.h:592
const char * snd_pcm_subformat_name(const snd_pcm_subformat_t subformat)
get name of PCM sample subformat
Definition: pcm.c:2172
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:5740
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:4171
Definition: pcm.h:420
int snd_pcm_unlink(snd_pcm_t *pcm)
Remove a PCM from a linked group.
Definition: pcm.c:1719
int snd_pcm_reset(snd_pcm_t *pcm)
Reset PCM position.
Definition: pcm.c:1252
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:6365
Definition: pcm.h:476
int snd_pcm_info_malloc(snd_pcm_info_t **ptr)
allocate an invalid snd_pcm_info_t using standard malloc
Definition: pcm.c:7110
snd_pcm_chmap_t * snd_pcm_chmap_parse_string(const char *str)
Definition: pcm.c:8471
Definition: pcm.h:616
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:226
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:5084
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:5146
Definition: pcm.h:494
const char * snd_pcm_format_name(const snd_pcm_format_t format)
get name of PCM sample format
Definition: pcm.c:2121
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:4617
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:4362
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:716
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:6918
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:3622
Definition: pcm.h:318
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:3562
Definition: pcm.h:157
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:6245
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:2460
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:6145
Definition: pcm.h:585
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:7254
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:4079
int snd_pcm_recover(snd_pcm_t *pcm, int err, int silent)
Recover the stream state from an error or suspend.
Definition: pcm.c:8662
snd_pcm_tstamp_t
Definition: pcm.h:334
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:209
Definition: pcm.h:181
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:5605
snd_pcm_chmap_position
Definition: pcm.h:581
struct _snd_pcm_format_mask snd_pcm_format_mask_t
Definition: pcm.h:73
Definition: pcm.h:254
unsigned int first
Definition: pcm.h:488
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:4673
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:5755
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:5540
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:3894
int snd_pcm_hw_params_is_perfect_drain(const snd_pcm_hw_params_t *params)
Check if hardware is capable of perfect drain.
Definition: pcm.c:3761
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:991
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:5066
Definition: pcm.h:342
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:4152
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:6846
Definition: pcm.h:348
snd_pcm_sframes_t snd_pcm_forward(snd_pcm_t *pcm, snd_pcm_uframes_t frames)
Move application frame position forward.
Definition: pcm.c:1511
snd_pcm_audio_tstamp_type_t
Definition: pcm.h:353
Definition: pcm.h:207
Definition: pcm.h:183
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:5439
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:6571
Definition: pcm.h:595
Definition: pcm.h:452
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:6391
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:2408
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:6792
Definition: pcm.h:575
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:4431
Definition: pcm.h:327
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:5181
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:4290
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:6651
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:4593
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:909
void snd_pcm_status_set_audio_htstamp_config(snd_pcm_status_t *obj, snd_pcm_audio_tstamp_config_t *audio_tstamp_config)
set audio_tstamp_config from a PCM status container
Definition: pcm.c:7041
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:4657
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:3857
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:3088
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:5217
const char * snd_pcm_info_get_name(const snd_pcm_info_t *obj)
Get name from a PCM info container.
Definition: pcm.c:7199
snd_spcm_latency_t
Definition: pcm.h:1310
Definition: pcm.h:137
int snd_pcm_open(snd_pcm_t **pcm, const char *name, snd_pcm_stream_t stream, int mode)
Opens a PCM.
Definition: pcm.c:2688
int snd_pcm_poll_descriptors(snd_pcm_t *pcm, struct pollfd *pfds, unsigned int space)
get poll descriptors
Definition: pcm.c:1804
Definition: pcm.h:607
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:6703
Definition: pcm.h:185
Definition: pcm.h:293
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:3997
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:4580
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:3966
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:1556
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:5878
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:3602
Definition: pcm.h:574
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:7004
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:4822
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:6872
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:7439
int snd_pcm_format_little_endian(snd_pcm_format_t format)
Return endian info for a PCM sample format.
Definition: pcm_misc.c:128
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:889
unsigned long snd_pcm_uframes_t
Definition: pcm.h:388
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:7068
snd_pcm_chmap_t * snd_pcm_get_chmap(snd_pcm_t *pcm)
Definition: pcm.c:8236
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:4068
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:176
Definition: pcm.h:599
Definition: pcm.h:329
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:4642
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:5280
Definition: pcm.h:129
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:5163
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:4550
const char * snd_pcm_subformat_description(const snd_pcm_subformat_t subformat)
get description of PCM sample subformat
Definition: pcm.c:2184
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:1267
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:3542
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:6233
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:6818
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:3049
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:5509
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:5393
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:1839
Definition: pcm.h:96
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:1634
int snd_pcm_dump_sw_setup(snd_pcm_t *pcm, snd_output_t *out)
Dump current software setup for PCM.
Definition: pcm.c:2312
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:4039
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:4775
snd_pcm_format_t snd_pcm_format_value(const char *name)
get PCM sample format from name
Definition: pcm.c:2145
Definition: pcm.h:248
Definition: pcm.h:584
snd_pcm_stream_t
Definition: pcm.h:101
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:6638
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:6522
int snd_pcm_format_big_endian(snd_pcm_format_t format)
Return endian info for a PCM sample format.
Definition: pcm_misc.c:181
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:2736
Definition: pcm.h:177
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:4496
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:5843
Definition: pcm.h:587
Definition: pcm.h:618
Definition: pcm.h:589
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:3738
Definition: pcm.h:464
enum _snd_pcm_type snd_pcm_type_t
Definition: pcm.h:481
Definition: pcm.h:610
Definition: pcm.h:1250
Definition: pcm.h:1313
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:7133
size_t snd_pcm_sw_params_sizeof(void)
get size of snd_pcm_sw_params_t
Definition: pcm.c:6332
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:3254
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:7289
Definition: pcm.h:597
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:3781
Definition: pcm.h:600
struct _snd_pcm snd_pcm_t
Definition: pcm.h:410
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:5691
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:4344
ssize_t snd_pcm_samples_to_bytes(snd_pcm_t *pcm, long samples)
Convert samples in bytes for a PCM.
Definition: pcm.c:2440
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:5300
unsigned int channels
Definition: pcm.h:632
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:7058
void snd_pcm_status_get_audio_htstamp_report(const snd_pcm_status_t *obj, snd_pcm_audio_tstamp_report_t *audio_tstamp_report)
Get audio_tstamp_report from a PCM status container.
Definition: pcm.c:7027
snd_pcm_sframes_t snd_pcm_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t frames)
Move application frame position backward.
Definition: pcm.c:1442
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:6465
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:3914
Definition: pcm.h:159
int snd_pcm_format_linear(snd_pcm_format_t format)
Return linear info for a PCM sample format.
Definition: pcm_misc.c:100
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:6342
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:5315
snd_pcm_access_t
Definition: pcm.h:110
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:5416
Definition: pcm.h:116
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:6723
Definition: pcm.h:438
const char * snd_pcm_state_name(const snd_pcm_state_t state)
get name of PCM state
Definition: pcm.c:2252