pcm.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386
  1. /*
  2. * Copyright (c) 2019-2025 Allwinner Technology Co., Ltd. ALL rights reserved.
  3. *
  4. * Allwinner is a trademark of Allwinner Technology Co.,Ltd., registered in
  5. * the the people's Republic of China and other countries.
  6. * All Allwinner Technology Co.,Ltd. trademarks are used with permission.
  7. *
  8. * DISCLAIMER
  9. * THIRD PARTY LICENCES MAY BE REQUIRED TO IMPLEMENT THE SOLUTION/PRODUCT.
  10. * IF YOU NEED TO INTEGRATE THIRD PARTY’S TECHNOLOGY (SONY, DTS, DOLBY, AVS OR MPEGLA, ETC.)
  11. * IN ALLWINNERS’SDK OR PRODUCTS, YOU SHALL BE SOLELY RESPONSIBLE TO OBTAIN
  12. * ALL APPROPRIATELY REQUIRED THIRD PARTY LICENCES.
  13. * ALLWINNER SHALL HAVE NO WARRANTY, INDEMNITY OR OTHER OBLIGATIONS WITH RESPECT TO MATTERS
  14. * COVERED UNDER ANY REQUIRED THIRD PARTY LICENSE.
  15. * YOU ARE SOLELY RESPONSIBLE FOR YOUR USAGE OF THIRD PARTY’S TECHNOLOGY.
  16. *
  17. *
  18. * THIS SOFTWARE IS PROVIDED BY ALLWINNER"AS IS" AND TO THE MAXIMUM EXTENT
  19. * PERMITTED BY LAW, ALLWINNER EXPRESSLY DISCLAIMS ALL WARRANTIES OF ANY KIND,
  20. * WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING WITHOUT LIMITATION REGARDING
  21. * THE TITLE, NON-INFRINGEMENT, ACCURACY, CONDITION, COMPLETENESS, PERFORMANCE
  22. * OR MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  23. * IN NO EVENT SHALL ALLWINNER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  24. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  25. * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  26. * LOSS OF USE, DATA, OR PROFITS, OR BUSINESS INTERRUPTION)
  27. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  28. * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  29. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
  30. * OF THE POSSIBILITY OF SUCH DAMAGE.
  31. */
  32. #ifndef __AW_ALSA_PCM_H
  33. #define __AW_ALSA_PCM_H
  34. #ifdef __cplusplus
  35. extern "C" {
  36. #endif
  37. #include <sound/ksound.h>
  38. #include <sound/card.h>
  39. #include <sound/pcm_common.h>
  40. #include <alloca.h>
  41. #include <string.h>
  42. #include <sys/types.h>
  43. #include <hal_mutex.h>
  44. #ifndef snd_malloc
  45. #define snd_malloc(size) calloc(size, 1)
  46. #endif
  47. #ifndef snd_free
  48. #define snd_free(ptr) free(ptr)
  49. #endif
  50. /* debug option */
  51. #define AW_ALSA_LOG_COLOR_NONE "\e[0m"
  52. #define AW_ALSA_LOG_COLOR_RED "\e[31m"
  53. #define AW_ALSA_LOG_COLOR_GREEN "\e[32m"
  54. #define AW_ALSA_LOG_COLOR_YELLOW "\e[33m"
  55. #define AW_ALSA_LOG_COLOR_BLUE "\e[34m"
  56. //#define AW_ALSA_DEBUG
  57. #ifdef AW_ALSA_DEBUG
  58. #define awalsa_debug(fmt, args...) \
  59. printf(AW_ALSA_LOG_COLOR_GREEN "[AWALSA_DEBUG][%s:%u]" fmt \
  60. AW_ALSA_LOG_COLOR_NONE, __FUNCTION__, __LINE__, ##args)
  61. #else
  62. #define awalsa_debug(fmt, args...)
  63. #endif
  64. //#define AW_ALSA_PRINT
  65. #ifdef AW_ALSA_PRINT
  66. #define awalsa_print(fmt, args...) \
  67. printf("[AWALSA_PRINT][%s:%u]" fmt, \
  68. __FUNCTION__, __LINE__, ##args)
  69. #else
  70. #define awalsa_print(fmt, args...)
  71. #endif
  72. #define awalsa_info(fmt, args...) \
  73. printf(AW_ALSA_LOG_COLOR_BLUE "[AWALSA_INFO][%s:%u]" fmt \
  74. AW_ALSA_LOG_COLOR_NONE, __FUNCTION__, __LINE__, ##args)
  75. #define awalsa_err(fmt, args...) \
  76. printf(AW_ALSA_LOG_COLOR_RED "[AWALSA_ERR][%s:%u]" fmt \
  77. AW_ALSA_LOG_COLOR_NONE, __FUNCTION__, __LINE__, ##args)
  78. /* end debug option */
  79. /** Non blocking mode (flag for open mode) \hideinitializer */
  80. //#define SND_PCM_NONBLOCK 0x00000001
  81. /** Async notification (flag for open mode) \hideinitializer */
  82. //#define SND_PCM_ASYNC 0x00000002
  83. /** In an abort state (internal, not allowed for open) */
  84. //#define SND_PCM_ABORT 0x00008000
  85. /** Disable automatic (but not forced!) rate resamplinig */
  86. #define SND_PCM_NO_AUTO_RESAMPLE 0x00010000
  87. /** Disable automatic (but not forced!) channel conversion */
  88. #define SND_PCM_NO_AUTO_CHANNELS 0x00020000
  89. /** Disable automatic (but not forced!) format conversion */
  90. #define SND_PCM_NO_AUTO_FORMAT 0x00040000
  91. /** Disable soft volume control */
  92. //#define SND_PCM_NO_SOFTVOL 0x00080000
  93. typedef struct _snd_pcm snd_pcm_t;
  94. enum _snd_pcm_type {
  95. /** Kernel level PCM */
  96. SND_PCM_TYPE_HW = 0,
  97. /** One or more linked PCM with exclusive access to selected
  98. channels */
  99. SND_PCM_TYPE_MULTI,
  100. /** File writing plugin */
  101. SND_PCM_TYPE_FILE,
  102. /** Linear format conversion PCM */
  103. SND_PCM_TYPE_LINEAR,
  104. /** Rate conversion PCM */
  105. SND_PCM_TYPE_RATE,
  106. /** Attenuated static route PCM */
  107. SND_PCM_TYPE_ROUTE,
  108. /** Format adjusted PCM */
  109. SND_PCM_TYPE_PLUG,
  110. /** Direct Mixing plugin */
  111. SND_PCM_TYPE_DMIX,
  112. /** Direct Snooping plugin */
  113. SND_PCM_TYPE_DSNOOP,
  114. /** Soft volume plugin */
  115. SND_PCM_TYPE_SOFTVOL,
  116. /** External filter plugin */
  117. SND_PCM_TYPE_EXTPLUG,
  118. SND_PCM_TYPE_LAST = SND_PCM_TYPE_EXTPLUG
  119. };
  120. /** PCM type */
  121. typedef enum _snd_pcm_type snd_pcm_type_t;
  122. /** PCM state */
  123. typedef enum _snd_pcm_state {
  124. /** Open */
  125. SND_PCM_STATE_OPEN = 0,
  126. /** Setup installed */
  127. SND_PCM_STATE_SETUP,
  128. /** Ready to start */
  129. SND_PCM_STATE_PREPARED,
  130. /** Running */
  131. SND_PCM_STATE_RUNNING,
  132. /** Stopped: underrun (playback) or overrun (capture) detected */
  133. SND_PCM_STATE_XRUN,
  134. /** Draining: running (playback) or stopped (capture) */
  135. SND_PCM_STATE_DRAINING,
  136. /** Paused */
  137. SND_PCM_STATE_PAUSED,
  138. /** Hardware is suspended */
  139. SND_PCM_STATE_SUSPENDED,
  140. /** Hardware is disconnected */
  141. SND_PCM_STATE_DISCONNECTED,
  142. SND_PCM_STATE_LAST = 1024,
  143. } snd_pcm_state_t;
  144. /** PCM stream (direction) */
  145. typedef enum _snd_pcm_stream {
  146. /** Playback stream */
  147. SND_PCM_STREAM_PLAYBACK = 0,
  148. /** Capture stream */
  149. SND_PCM_STREAM_CAPTURE,
  150. SND_PCM_STREAM_LAST = SND_PCM_STREAM_CAPTURE
  151. } snd_pcm_stream_t;
  152. /** PCM area specification */
  153. typedef struct _snd_pcm_channel_area {
  154. /** base address of channel samples */
  155. void *addr;
  156. /** offset to first sample in bits */
  157. unsigned int first;
  158. /** samples distance in bits */
  159. unsigned int step;
  160. } snd_pcm_channel_area_t;
  161. int snd_pcm_open(snd_pcm_t **pcm, const char *name,
  162. snd_pcm_stream_t stream, int mode);
  163. int snd_pcm_close(snd_pcm_t *pcm);
  164. int snd_pcm_hw_params_malloc(snd_pcm_hw_params_t **ptr);
  165. void snd_pcm_hw_params_free(snd_pcm_hw_params_t *obj);
  166. int snd_pcm_hw_refine(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
  167. int snd_pcm_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
  168. int snd_pcm_hw_free(snd_pcm_t *pcm);
  169. int snd_pcm_reset(snd_pcm_t *pcm);
  170. int snd_pcm_start(snd_pcm_t *pcm);
  171. int snd_pcm_prepare(snd_pcm_t *pcm);
  172. int snd_pcm_drop(snd_pcm_t *pcm);
  173. int snd_pcm_drain(snd_pcm_t *pcm);
  174. int snd_pcm_pause(snd_pcm_t *pcm, int enable);
  175. int snd_pcm_recover(snd_pcm_t *pcm, int err, int silent);
  176. int snd_pcm_resume(snd_pcm_t *pcm);
  177. snd_pcm_state_t snd_pcm_state(snd_pcm_t *pcm);
  178. snd_pcm_stream_t snd_pcm_stream(snd_pcm_t *pcm);
  179. int snd_pcm_hwsync(snd_pcm_t *pcm);
  180. int snd_pcm_delay(snd_pcm_t *pcm, snd_pcm_sframes_t *delayp);
  181. snd_pcm_sframes_t snd_pcm_avail_update(snd_pcm_t *pcm);
  182. int snd_pcm_hw_params_can_pause(const snd_pcm_hw_params_t *params);
  183. snd_pcm_sframes_t snd_pcm_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t frames);
  184. int snd_pcm_link(snd_pcm_t *pcm1, snd_pcm_t *pcm2);
  185. int snd_pcm_unlink(snd_pcm_t *pcm);
  186. snd_pcm_sframes_t snd_pcm_writei(snd_pcm_t *pcm, const void *buffer, snd_pcm_uframes_t size);
  187. snd_pcm_sframes_t snd_pcm_readi(snd_pcm_t *pcm, void *buffer, snd_pcm_uframes_t size);
  188. int snd_pcm_wait(snd_pcm_t *pcm, int timeout);
  189. int snd_pcm_dump(snd_pcm_t *pcm);
  190. int snd_pcm_dump_setup(snd_pcm_t *pcm);
  191. int snd_pcm_dump_hw_setup(snd_pcm_t *pcm);
  192. int snd_pcm_dump_sw_setup(snd_pcm_t *pcm);
  193. int snd_pcm_hw_params_dump(snd_pcm_hw_params_t *params);
  194. /** channel positions */
  195. enum snd_pcm_chmap_position {
  196. SND_CHMAP_UNKNOWN = 0, /**< unspecified */
  197. SND_CHMAP_NA, /**< N/A, silent */
  198. SND_CHMAP_MONO, /**< mono stream */
  199. SND_CHMAP_FL, /**< front left */
  200. SND_CHMAP_FR, /**< front right */
  201. SND_CHMAP_RL, /**< rear left */
  202. SND_CHMAP_RR, /**< rear right */
  203. SND_CHMAP_FC, /**< front center */
  204. SND_CHMAP_LFE, /**< LFE */
  205. SND_CHMAP_SL, /**< side left */
  206. SND_CHMAP_SR, /**< side right */
  207. SND_CHMAP_RC, /**< rear center */
  208. SND_CHMAP_FLC, /**< front left center */
  209. SND_CHMAP_FRC, /**< front right center */
  210. SND_CHMAP_RLC, /**< rear left center */
  211. SND_CHMAP_RRC, /**< rear right center */
  212. SND_CHMAP_FLW, /**< front left wide */
  213. SND_CHMAP_FRW, /**< front right wide */
  214. SND_CHMAP_FLH, /**< front left high */
  215. SND_CHMAP_FCH, /**< front center high */
  216. SND_CHMAP_FRH, /**< front right high */
  217. SND_CHMAP_TC, /**< top center */
  218. SND_CHMAP_TFL, /**< top front left */
  219. SND_CHMAP_TFR, /**< top front right */
  220. SND_CHMAP_TFC, /**< top front center */
  221. SND_CHMAP_TRL, /**< top rear left */
  222. SND_CHMAP_TRR, /**< top rear right */
  223. SND_CHMAP_TRC, /**< top rear center */
  224. SND_CHMAP_TFLC, /**< top front left center */
  225. SND_CHMAP_TFRC, /**< top front right center */
  226. SND_CHMAP_TSL, /**< top side left */
  227. SND_CHMAP_TSR, /**< top side right */
  228. SND_CHMAP_LLFE, /**< left LFE */
  229. SND_CHMAP_RLFE, /**< right LFE */
  230. SND_CHMAP_BC, /**< bottom center */
  231. SND_CHMAP_BLC, /**< bottom left center */
  232. SND_CHMAP_BRC, /**< bottom right center */
  233. SND_CHMAP_LAST = SND_CHMAP_BRC,
  234. };
  235. /** channel map list type */
  236. enum snd_pcm_chmap_type {
  237. SND_CHMAP_TYPE_NONE = 0,/**< unspecified channel position */
  238. SND_CHMAP_TYPE_FIXED, /**< fixed channel position */
  239. SND_CHMAP_TYPE_VAR, /**< freely swappable channel position */
  240. SND_CHMAP_TYPE_PAIRED, /**< pair-wise swappable channel position */
  241. SND_CHMAP_TYPE_LAST = SND_CHMAP_TYPE_PAIRED, /**< last entry */
  242. };
  243. /** the channel map header */
  244. typedef struct snd_pcm_chmap {
  245. unsigned int channels; /**< number of channels */
  246. unsigned int pos[0]; /**< channel position array */
  247. } snd_pcm_chmap_t;
  248. /** the header of array items returned from snd_pcm_query_chmaps() */
  249. typedef struct snd_pcm_chmap_query {
  250. enum snd_pcm_chmap_type type; /**< channel map type */
  251. snd_pcm_chmap_t map; /**< available channel map */
  252. } snd_pcm_chmap_query_t;
  253. snd_pcm_chmap_query_t **snd_pcm_query_chmaps(snd_pcm_t *pcm);
  254. void snd_pcm_free_chmaps(snd_pcm_chmap_query_t **maps);
  255. snd_pcm_chmap_t *snd_pcm_get_chmap(snd_pcm_t *pcm);
  256. int snd_pcm_set_chmap(snd_pcm_t *pcm, const snd_pcm_chmap_t *map);
  257. /* for pthread mutex lock */
  258. typedef hal_mutex_t snd_pcm_mutex_t;
  259. snd_pcm_mutex_t snd_thread_mutex_init(void);
  260. int snd_thread_mutex_lock_timeout(snd_pcm_mutex_t mutex, long ms);
  261. int snd_thread_mutex_lock(snd_pcm_mutex_t mutex);
  262. int snd_thread_mutex_unlock(snd_pcm_mutex_t mutex);
  263. void snd_thread_mutex_destroy(snd_pcm_mutex_t mutex);
  264. size_t snd_pcm_hw_params_sizeof(void);
  265. size_t snd_pcm_sw_params_sizeof(void);
  266. #define __snd_alloca(ptr,type) do { *ptr = (type##_t *) alloca(type##_sizeof()); memset(*ptr, 0, type##_sizeof()); } while (0)
  267. #define snd_pcm_hw_params_alloca(ptr) __snd_alloca(ptr, snd_pcm_hw_params)
  268. int snd_pcm_hw_params_any(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
  269. int snd_pcm_hw_params_set_format(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t val);
  270. int snd_pcm_hw_params_get_format(const snd_pcm_hw_params_t *params, snd_pcm_format_t *format);
  271. int snd_pcm_hw_params_set_channels(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
  272. int snd_pcm_hw_params_get_channels(const snd_pcm_hw_params_t *params, unsigned int *val);
  273. int snd_pcm_hw_params_set_rate(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
  274. int snd_pcm_hw_params_get_rate(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
  275. int snd_pcm_hw_params_set_period_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int us, int dir);
  276. int snd_pcm_hw_params_set_period_time_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
  277. int snd_pcm_hw_params_get_period_time(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
  278. 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);
  279. 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);
  280. int snd_pcm_hw_params_get_period_size(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val, int *dir);
  281. int snd_pcm_hw_params_set_periods(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
  282. int snd_pcm_hw_params_set_periods_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
  283. int snd_pcm_hw_params_get_periods(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
  284. int snd_pcm_hw_params_set_buffer_size(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t val);
  285. int snd_pcm_hw_params_set_buffer_size_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
  286. int snd_pcm_hw_params_get_buffer_size(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
  287. int snd_pcm_hw_params_set_buffer_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int us);
  288. int snd_pcm_hw_params_set_buffer_time_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
  289. int snd_pcm_hw_params_set_access(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t access);
  290. int snd_pcm_hw_params_get_access(const snd_pcm_hw_params_t *params, snd_pcm_access_t *access);
  291. #define snd_pcm_sw_params_alloca(ptr) __snd_alloca(ptr, snd_pcm_sw_params)
  292. int snd_pcm_sw_params_current(snd_pcm_t *pcm, snd_pcm_sw_params_t *params);
  293. int snd_pcm_sw_params_set_start_threshold(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
  294. int snd_pcm_sw_params_get_start_threshold(snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val);
  295. int snd_pcm_sw_params_set_stop_threshold(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
  296. int snd_pcm_sw_params_get_stop_threshold(snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val);
  297. int snd_pcm_sw_params_set_silence_size(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
  298. int snd_pcm_sw_params_get_silence_size(snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val);
  299. int snd_pcm_sw_params_set_avail_min(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
  300. int snd_pcm_sw_params_get_avail_min(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val);
  301. int snd_pcm_sw_params_get_boundary(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val);
  302. int snd_pcm_sw_params(snd_pcm_t *pcm, snd_pcm_sw_params_t *params);
  303. ssize_t snd_pcm_format_size(snd_pcm_format_t format, size_t samples);
  304. snd_pcm_sframes_t snd_pcm_bytes_to_frames(snd_pcm_t *pcm, ssize_t bytes);
  305. ssize_t snd_pcm_frames_to_bytes(snd_pcm_t *pcm, snd_pcm_sframes_t frames);
  306. snd_pcm_type_t snd_pcm_type(snd_pcm_t *pcm);
  307. const char *snd_pcm_type_name(snd_pcm_type_t type);
  308. const char *snd_pcm_stream_name(snd_pcm_stream_t stream);
  309. const char *snd_pcm_access_name(const snd_pcm_access_t _access);
  310. const char *snd_pcm_format_name(const snd_pcm_format_t format);
  311. const char *snd_pcm_state_name(const snd_pcm_state_t state);
  312. /* Direct Access (MMAP) functions */
  313. int snd_pcm_mmap_begin(snd_pcm_t *pcm,
  314. const snd_pcm_channel_area_t **areas,
  315. snd_pcm_uframes_t *offset,
  316. snd_pcm_uframes_t *frames);
  317. snd_pcm_sframes_t snd_pcm_mmap_commit(snd_pcm_t *pcm,
  318. snd_pcm_uframes_t offset,
  319. snd_pcm_uframes_t frames);
  320. snd_pcm_sframes_t snd_pcm_mmap_writei(snd_pcm_t *pcm, const void *buffer, snd_pcm_uframes_t size);
  321. snd_pcm_sframes_t snd_pcm_mmap_readi(snd_pcm_t *pcm, void *buffer, snd_pcm_uframes_t size);
  322. int snd_pcm_area_silence(const snd_pcm_channel_area_t *dst_channel, snd_pcm_uframes_t dst_offset,
  323. unsigned int samples, snd_pcm_format_t format);
  324. int snd_pcm_areas_silence(const snd_pcm_channel_area_t *dst_channels, snd_pcm_uframes_t dst_offset,
  325. unsigned int channels, snd_pcm_uframes_t frames, snd_pcm_format_t format);
  326. int snd_pcm_area_copy(const snd_pcm_channel_area_t *dst_channel, snd_pcm_uframes_t dst_offset,
  327. const snd_pcm_channel_area_t *src_channel, snd_pcm_uframes_t src_offset,
  328. unsigned int samples, snd_pcm_format_t format);
  329. int snd_pcm_areas_copy(const snd_pcm_channel_area_t *dst_channels, snd_pcm_uframes_t dst_offset,
  330. const snd_pcm_channel_area_t *src_channels, snd_pcm_uframes_t src_offset,
  331. unsigned int channels, snd_pcm_uframes_t frames, snd_pcm_format_t format);
  332. #ifdef __cplusplus
  333. }
  334. #endif
  335. #endif /* __AW_ALSA_PCM_H */