Lines Matching full:frames
234 unsigned int pcm_frames_to_bytes(struct pcm *pcm, unsigned int frames)
236 return frames * pcm->config.channels *
312 unsigned int frames)
314 int size_bytes = pcm_frames_to_bytes(pcm, frames);
335 unsigned int pcm_offset, frames, count = 0;
338 frames = size;
339 pcm_mmap_begin(pcm, &pcm_areas, &pcm_offset, &frames);
340 pcm_areas_copy(pcm, pcm_offset, buf, offset, frames);
341 commit = pcm_mmap_commit(pcm, pcm_offset, frames);
343 oops(pcm, commit, "failed to commit %d frames\n", frames);
357 int frames;
378 frames = hw_ptr - pcm->mmap_control->appl_ptr;
380 frames = hw_ptr + pcm->buffer_size - pcm->mmap_control->appl_ptr;
382 if (frames < 0)
383 frames += pcm->boundary;
384 else if (frames > (int)pcm->boundary)
385 frames -= pcm->boundary;
387 *avail = (unsigned int)frames;
400 x.frames = count / (pcm->config.channels *
437 x.frames = count / (pcm->config.channels *
828 static void pcm_mmap_appl_forward(struct pcm *pcm, int frames)
831 appl_ptr += frames;
840 unsigned int *frames)
847 /* and the application offset in frames */
855 /* we can only copy frames if the are availabale and continuos */
856 copy_frames = *frames;
861 *frames = copy_frames;
866 int pcm_mmap_commit(struct pcm *pcm, unsigned int offset, unsigned int frames)
869 pcm_mmap_appl_forward(pcm, frames);
872 return frames;
942 int err = 0, frames, avail;
952 /* get the available space for writing new frames */
955 fprintf(stderr, "cannot determine available mmap frames");
972 /* sleep until we have space to write new frames */
974 /* enable waiting for avail_min threshold when less frames than we have to write
1003 frames = count;
1004 if (frames > avail)
1005 frames = avail;
1007 if (!frames)
1010 /* copy frames from buffer */
1011 frames = pcm_mmap_transfer_areas(pcm, (void *)buffer, offset, frames);
1012 if (frames < 0) {
1017 return frames;
1020 offset += frames;
1021 count -= frames;