Lines Matching refs:frames
896 static ssize_t read_frames(struct stream_in *in, void *buffer, ssize_t frames);
901 size_t frames,
906 /* read frames available in kernel driver buffer */
936 " delay_ns: [%d] , frames:[%zd]",
937 buffer->time_stamp.tv_sec , buffer->time_stamp.tv_nsec, kernel_frames, buffer->delay_ns, frames);
941 size_t frames,
945 /* read frames available in kernel driver buffer */
965 /* read frames available in audio HAL input buffer
966 * add number of frames being read as we want the capture time of first sample
968 /* frames in in->read_buf are at driver sampling rate while frames in in->proc_buf are
987 "in->read_buf_frames:[%zd], in->proc_buf_frames:[%zd], frames:[%zd]",
990 in->read_buf_frames, in->proc_buf_frames, frames);
993 static int32_t update_echo_reference(struct stream_in *in, size_t frames)
1003 ALOGVV("update_echo_reference, in->config.channels(%d), frames = [%zd], in->ref_buf_frames = [%zd], "
1005 in->config.channels, frames, in->ref_buf_frames, frames - in->ref_buf_frames);
1006 if (in->ref_buf_frames < frames) {
1007 if (in->ref_buf_size < frames) {
1008 in->ref_buf_size = frames;
1009 in->ref_buf = (int16_t *)realloc(in->ref_buf, pcm_frames_to_bytes(pcm_device->pcm, frames));
1013 in->ref_buf, pcm_frames_to_bytes(pcm_device->pcm, frames));
1015 b.frame_count = frames - in->ref_buf_frames;
1018 get_capture_delay(in, frames, &b);
1024 "in->ref_buf_size:[%zd], frames:[%zd], b.frame_count:[%zd]",
1025 in->ref_buf_frames, in->ref_buf_size, frames, b.frame_count);
1028 ALOGW("update_echo_reference(): NOT enough frames to read ref buffer");
1069 static void push_echo_reference(struct stream_in *in, size_t frames)
1072 /* read frames from echo reference buffer and update echo delay
1073 * in->ref_buf_frames is updated with frames available in in->ref_buf */
1075 int32_t delay_us = update_echo_reference(in, frames)/1000;
1080 if (in->ref_buf_frames < frames)
1081 frames = in->ref_buf_frames;
1083 buf.frameCount = frames;
1215 size_t frames,
1241 buffer->delay_ns = (long)(((int64_t)(kernel_frames + frames)* 1000000000)/
1543 static ssize_t read_and_process_frames(struct stream_in *in, void* buffer, ssize_t frames)
1578 /* since all the processing below is done in frames and using the config.channels
1580 while (frames_wr < frames) {
1581 /* first reload enough frames at the end of process input buffer */
1582 if (in->proc_buf_frames < (size_t)frames) {
1584 if (in->proc_buf_size < (size_t)frames) {
1585 size_t size_in_bytes = pcm_frames_to_bytes(pcm_device->pcm, frames);
1586 in->proc_buf_size = (size_t)frames;
1600 frames - in->proc_buf_frames);
1614 * the maximum number of frames to be consumed and produced by process() */
1617 out_buf.frameCount = frames - frames_wr;
1631 /* process() has updated the number of frames consumed and produced in
1633 * move remaining frames to the beginning of in->proc_buf_in */
1642 /* if not enough frames were passed to process(), read more and retry. */
1644 ALOGW("No frames produced by preproc");
1648 if ((frames_wr + (ssize_t)out_buf.frameCount) <= frames) {
1652 ALOGE("preprocessing produced too many frames: %d + %zd > %d !",
1653 (unsigned int)frames_wr, out_buf.frameCount, (unsigned int)frames);
1654 frames_wr = frames;
1664 if (in->proc_buf_size < (size_t)frames) {
1665 size_t size_in_bytes = pcm_frames_to_bytes(pcm_device->pcm, frames);
1666 in->proc_buf_size = (size_t)frames;
1673 frames_wr = read_frames(in, proc_buf_out, frames);
1820 /* read_frames() reads frames from kernel driver, down samples to capture rate
1821 * if necessary and output the number of frames requested to the buffer specified */
1822 static ssize_t read_frames(struct stream_in *in, void *buffer, ssize_t frames)
1836 while (frames_wr < frames) {
1837 size_t frames_rd = frames - frames_wr;
2541 * multiple of 16 frames, as audioflinger expects audio buffers to
2542 * be a multiple of 16 frames
3000 ALOGVV("%s: resampler request frames = %d frame_size = %d",
3098 ALOGVV("%s rendered frames %d sample_rate %d",
3130 uint64_t *frames, struct timespec *timestamp)
3142 ALOGVV("%s rendered frames %ld sample_rate %d",
3144 *frames = dsp_frames;
3166 *frames = signed_frames;
3502 ssize_t frames = -1;
3541 frames = read_and_process_frames(in, buffer, frames_rq);
3542 if (frames >= 0)