Lines Matching defs:frames

9  * PCM Interface is designed to write or read digital audio frames. A
12 * 44100 you'll hear 44100 frames per second. The size in bytes of a
65 <P>One digital value is called sample. More samples are collected to frames
69 recorded at same time). Digital audio stream contains collection of frames
355 \par Minimum available count of frames
357 This parameter controls the wakeup point. If the count of available frames
379 wants to read count of frames equal or greater then the stream will be started.
381 greater than the ring buffer size (in frames). For that simply using a large
387 the running stream, when the available frames crosses this boundary.
393 The silence threshold specifies the count of frames before an underrun when the
394 buffer gets filled with frames of silence according to the silence size parameter
406 pointer update #snd_pcm_status_get_tstamp(), delay in frames -
407 #snd_pcm_status_get_delay(), available count in frames -
408 #snd_pcm_status_get_avail(), maximum available frames -
410 frames - #snd_pcm_status_get_overrange(). The last two
418 available count of frames for writing (playback) or filled frames for
431 The function #snd_pcm_delay() returns the delay in frames.
432 For playback, it means count of frames in the ring buffer before
433 the next frames will be sent to DAC. For capture, it means count of frames
434 in the ring buffer before the next frames will be captured from ADC. It works
1125 * \param delayp Returned delay in frames
1201 * \param avail Number of available frames when timestamp was grabbed
1309 * \brief Stop a PCM dropping pending frames
1344 * \brief Stop a PCM preserving pending frames
1349 * For playback wait for all pending frames to be played and then stop
1351 * For capture stop PCM permitting to retrieve residual frames.
1414 * \brief Get safe count of frames which can be rewinded
1416 * \return a positive number of frames or negative error code
1449 * \param frames wanted displacement in frames
1455 snd_pcm_sframes_t snd_pcm_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t frames)
1465 if (frames == 0)
1472 result = pcm->fast_ops->rewind(pcm->fast_op_arg, frames);
1480 * \brief Get safe count of frames which can be forwarded
1482 * \return a positive number of frames or negative error code
1515 * \param frames wanted skip in frames
1522 EXPORT_SYMBOL snd_pcm_sframes_t INTERNAL(snd_pcm_forward)(snd_pcm_t *pcm, snd_pcm_uframes_t frames)
1524 snd_pcm_sframes_t snd_pcm_forward(snd_pcm_t *pcm, snd_pcm_uframes_t frames)
1535 if (frames == 0)
1542 result = pcm->fast_ops->forward(pcm->fast_op_arg, frames);
1551 * \brief Write interleaved frames to a PCM
1553 * \param buffer frames containing buffer
1554 * \param size frames to be written
1555 * \return a positive number of frames actually written otherwise a
1562 * all requested frames are played or put to the playback ring buffer.
1563 * The returned number of frames can be less only if a signal or underrun occurred.
1590 * \brief Write non interleaved frames to a PCM
1592 * \param bufs frames containing buffers (one for each channel)
1593 * \param size frames to be written
1594 * \return a positive number of frames actually written otherwise a
1601 * all requested frames are played or put to the playback ring buffer.
1602 * The returned number of frames can be less only if a signal or underrun occurred.
1629 * \brief Read interleaved frames from a PCM
1631 * \param buffer frames containing buffer
1632 * \param size frames to be read
1633 * \return a positive number of frames actually read otherwise a
1640 * all requested frames are filled. The returned number of frames can be less only
1668 * \brief Read non interleaved frames to a PCM
1670 * \param bufs frames containing buffers (one for each channel)
1671 * \param size frames to be read
1672 * \return a positive number of frames actually read otherwise a
1679 * all requested frames are filled. The returned number of frames can be less only
2443 * \brief Convert bytes in frames for a PCM
2446 * \return quantity expressed in frames
2459 * \brief Convert frames in bytes for a PCM
2461 * \param frames quantity in frames
2464 ssize_t snd_pcm_frames_to_bytes(snd_pcm_t *pcm, snd_pcm_sframes_t frames)
2471 return frames * pcm->frame_bits / 8;
3028 * \brief Return number of frames ready to be read (capture) / written (playback)
3030 * \return a positive number of frames ready otherwise a negative
3034 * level all the ready frames across underlying layers.
3061 * \brief Return number of frames ready to be read (capture) / written (playback)
3063 * \return a positive number of frames ready otherwise a negative
3067 * level all the ready frames across underlying layers.
3097 * \param availp Number of available frames in the ring buffer
3098 * \param delayp Total I/O latency in frames
3139 * \param dst_offset offset in frames inside area
3253 * \param dst_offset offset in frames inside area
3255 * \param frames frames to silence
3260 unsigned int channels, snd_pcm_uframes_t frames, snd_pcm_format_t format)
3286 err = snd_pcm_area_silence(&d, dst_offset * chns, frames * chns, format);
3289 err = snd_pcm_area_silence(begin, dst_offset, frames, format);
3303 * \param dst_offset offset in frames inside destination area
3305 * \param src_offset offset in frames inside source area
3423 * \param dst_offset offset in frames inside destination area
3425 * \param src_offset offset in frames inside source area
3427 * \param frames frames to copy
3433 unsigned int channels, snd_pcm_uframes_t frames, snd_pcm_format_t format)
3442 if (! frames) {
3443 SNDMSG("invalid frames %ld", frames);
3481 frames * chns, format);
3487 frames, format);
3499 * \param dst_offset offset in frames inside destination area
3500 * \param dst_size size in frames of the destination buffer
3502 * \param src_offset offset in frames inside source area
3503 * \param src_size size in frames of the source buffer
3505 * \param frames frames to copy
3516 snd_pcm_uframes_t frames,
3519 while (frames > 0) {
3521 snd_pcm_uframes_t xfer = frames;
3539 frames -= xfer;
3935 * \return FIFO size in frames otherwise a negative error code if the info is not available
5297 * \param val Returned approximate period size in frames
5319 * \param val approximate minimum period size in frames
5341 * \param val approximate minimum period size in frames
5364 * \param val approximate period size in frames
5379 * \param val approximate period size in frames
5394 * \param val approximate minimum period size in frames (on return filled with actual minimum)
5413 * \param val approximate maximum period size in frames (on return filled with actual maximum)
5432 * \param min approximate minimum period size in frames (on return filled with actual minimum)
5434 * \param max approximate maximum period size in frames (on return filled with actual maximum)
5454 * \param val approximate target period size in frames / returned chosen approximate target period size
5477 * \param val Returned maximum approximate period size in frames
5500 * \param val Returned maximum approximate period size in frames
5923 * \param val Returned buffer size in frames
5942 * \param val Returned approximate minimum buffer size in frames
5961 * \param val Returned approximate maximum buffer size in frames
5983 * \param val buffer size in frames
5997 * \param val buffer size in frames
6011 * \param val approximate minimum buffer size in frames (on return filled with actual minimum)
6027 * \param val approximate maximum buffer size in frames (on return filled with actual maximum)
6043 * \param min approximate minimum buffer size in frames (on return filled with actual minimum)
6044 * \param max approximate maximum buffer size in frames (on return filled with actual maximum)
6061 * \param val approximate target buffer size in frames / returned chosen approximate target buffer size in frames
6081 * \param val Returned minimum buffer size in frames
6082 * \return buffer size in frames
6101 * \param val Returned maximum buffer size in frames
6444 * \param val Returned boundary in frames
6652 * \param val Minimum avail frames to consider PCM ready
6682 * \param val returned minimum available frames to consider PCM ready
6732 * \param val Chunk size (frames are attempted to be transferred in chunks)
6747 * \param val returned chunk size (frames are attempted to be transferred in chunks)
6764 * \param val Start threshold in frames
6767 * PCM is automatically started when playback frames available to PCM
6768 * are >= threshold or when requested capture frames are >= threshold
6784 * \param val Returned start threshold in frames
6787 * PCM is automatically started when playback frames available to PCM
6788 * are >= threshold or when requested capture frames are >= threshold
6806 * \param val Stop threshold in frames
6810 * frames is >= threshold. If the stop threshold is equal to boundary (also
6828 * \param val Returned stop threshold in frames
6832 * frames is >= threshold. If the stop threshold is equal to boundary (also
6852 * \param val Silence threshold in frames
6878 * \param val Returned silence threshold in frames
6901 * \param val Silence size in frames (0 for disabled)
6936 * \param val Returned silence size in frames (0 for disabled)
7124 * \return Delay in frames
7139 * \brief Get number of frames available from a PCM status container (see #snd_pcm_avail_update)
7140 * \return Number of frames ready to be read/written
7149 * \brief Get maximum number of frames available from a PCM status container after last #snd_pcm_status call
7150 * \return Maximum number of frames ready to be read/written
7152 * This value returns the peak for the available frames between #snd_pcm_status calls.
7384 * \param offset Returned mmap area offset in area steps (== frames)
7385 * \param frames mmap area portion size in frames (wanted on entry, contiguous available on exit)
7389 * this call. Otherwise, this function can return a wrong count of available frames.
7392 * The resulting size parameter is always less or equal to the input count of frames
7393 * and can be zero, if no frames can be processed (the ring buffer is full).
7403 snd_pcm_uframes_t *frames)
7411 err = __snd_pcm_mmap_begin(pcm, areas, offset, frames);
7418 snd_pcm_uframes_t *offset, snd_pcm_uframes_t *frames)
7425 assert(pcm && areas && offset && frames);
7437 f = *frames;
7442 *frames = f;
7448 snd_pcm_uframes_t *offset, snd_pcm_uframes_t *frames)
7450 assert(pcm && areas && offset && frames);
7453 return pcm->fast_ops->mmap_begin(pcm->fast_op_arg, areas, offset, frames);
7455 return __snd_pcm_mmap_begin_generic(pcm, areas, offset, frames);
7462 * \param offset area offset in area steps (== frames)
7463 * \param frames area portion size in frames
7464 * \return count of transferred frames otherwise a negative error code
7467 * snd_pcm_mmap_begin() returned. The frames parameter should hold the
7468 * number of frames you have written or read to/from the audio
7469 * buffer. The frames parameter must never exceed the contiguous frames
7478 snd_pcm_uframes_t offset, frames;
7484 // at this point, we can transfer at least 'avail' frames
7486 // we want to process frames in chunks (period_size)
7492 frames = size;
7494 err = snd_pcm_mmap_begin(pcm_handle, &areas, &offset, &frames);
7497 // this function fills the areas from offset with count of frames
7498 generate_sine(areas, offset, frames, &phase);
7499 commitres = snd_pcm_mmap_commit(pcm_handle, offset, frames);
7500 if (commitres < 0 || commitres != frames)
7503 size -= frames;
7515 snd_pcm_uframes_t frames)
7524 result = __snd_pcm_mmap_commit(pcm, offset, frames);
7533 snd_pcm_uframes_t frames)
7541 if (CHECK_SANITY(frames > snd_pcm_mmap_avail(pcm))) {
7542 SNDMSG("commit frames (%ld) overflow (avail = %ld)", frames,
7547 return pcm->fast_ops->mmap_commit(pcm->fast_op_arg, offset, frames);
7603 snd_pcm_uframes_t frames;
7646 frames = size;
7647 if (frames > (snd_pcm_uframes_t) avail)
7648 frames = avail;
7649 if (! frames)
7651 err = func(pcm, areas, offset, frames);
7654 frames = err;
7655 offset += frames;
7656 size -= frames;
7657 xfer += frames;
7677 snd_pcm_uframes_t frames;
7723 frames = size;
7724 if (frames > (snd_pcm_uframes_t) avail)
7725 frames = avail;
7726 if (! frames)
7728 err = func(pcm, areas, offset, frames);
7731 frames = err;
7734 hw_avail += frames;
7745 offset += frames;
7746 size -= frames;
7747 xfer += frames;
8970 * \param buffer_size PCM ring buffer size in frames
8971 * \param period_size PCM period size in frames