Home | History | Annotate | Download | only in hal

Lines Matching refs:frames

898 static ssize_t read_frames(struct stream_in *in, void *buffer, ssize_t frames);
903 size_t frames,
908 /* read frames available in kernel driver buffer */
938 " delay_ns: [%d] , frames:[%zd]",
939 buffer->time_stamp.tv_sec , buffer->time_stamp.tv_nsec, kernel_frames, buffer->delay_ns, frames);
943 size_t frames,
947 /* read frames available in kernel driver buffer */
967 /* read frames available in audio HAL input buffer
968 * add number of frames being read as we want the capture time of first sample
970 /* frames in in->read_buf are at driver sampling rate while frames in in->proc_buf are
989 "in->read_buf_frames:[%zd], in->proc_buf_frames:[%zd], frames:[%zd]",
992 in->read_buf_frames, in->proc_buf_frames, frames);
995 static int32_t update_echo_reference(struct stream_in *in, size_t frames)
1005 ALOGVV("update_echo_reference, in->config.channels(%d), frames = [%zd], in->ref_buf_frames = [%zd], "
1007 in->config.channels, frames, in->ref_buf_frames, frames - in->ref_buf_frames);
1008 if (in->ref_buf_frames < frames) {
1009 if (in->ref_buf_size < frames) {
1010 in->ref_buf_size = frames;
1011 in->ref_buf = (int16_t *)realloc(in->ref_buf, pcm_frames_to_bytes(pcm_device->pcm, frames));
1015 in->ref_buf, pcm_frames_to_bytes(pcm_device->pcm, frames));
1017 b.frame_count = frames - in->ref_buf_frames;
1020 get_capture_delay(in, frames, &b);
1026 "in->ref_buf_size:[%zd], frames:[%zd], b.frame_count:[%zd]",
1027 in->ref_buf_frames, in->ref_buf_size, frames, b.frame_count);
1030 ALOGW("update_echo_reference(): NOT enough frames to read ref buffer");
1071 static void push_echo_reference(struct stream_in *in, size_t frames)
1074 /* read frames from echo reference buffer and update echo delay
1075 * in->ref_buf_frames is updated with frames available in in->ref_buf */
1077 int32_t delay_us = update_echo_reference(in, frames)/1000;
1082 if (in->ref_buf_frames < frames)
1083 frames = in->ref_buf_frames;
1085 buf.frameCount = frames;
1217 size_t frames,
1243 buffer->delay_ns = (long)(((int64_t)(kernel_frames + frames)* 1000000000)/
1545 static ssize_t read_and_process_frames(struct stream_in *in, void* buffer, ssize_t frames)
1580 /* since all the processing below is done in frames and using the config.channels
1582 while (frames_wr < frames) {
1583 /* first reload enough frames at the end of process input buffer */
1584 if (in->proc_buf_frames < (size_t)frames) {
1586 if (in->proc_buf_size < (size_t)frames) {
1587 size_t size_in_bytes = pcm_frames_to_bytes(pcm_device->pcm, frames);
1588 in->proc_buf_size = (size_t)frames;
1602 frames - in->proc_buf_frames);
1616 * the maximum number of frames to be consumed and produced by process() */
1619 out_buf.frameCount = frames - frames_wr;
1633 /* process() has updated the number of frames consumed and produced in
1635 * move remaining frames to the beginning of in->proc_buf_in */
1644 /* if not enough frames were passed to process(), read more and retry. */
1646 ALOGW("No frames produced by preproc");
1650 if ((frames_wr + (ssize_t)out_buf.frameCount) <= frames) {
1654 ALOGE("preprocessing produced too many frames: %d + %zd > %d !",
1655 (unsigned int)frames_wr, out_buf.frameCount, (unsigned int)frames);
1656 frames_wr = frames;
1666 if (in->proc_buf_size < (size_t)frames) {
1667 size_t size_in_bytes = pcm_frames_to_bytes(pcm_device->pcm, frames);
1668 in->proc_buf_size = (size_t)frames;
1675 frames_wr = read_frames(in, proc_buf_out, frames);
1822 /* read_frames() reads frames from kernel driver, down samples to capture rate
1823 * if necessary and output the number of frames requested to the buffer specified */
1824 static ssize_t read_frames(struct stream_in *in, void *buffer, ssize_t frames)
1838 while (frames_wr < frames) {
1839 size_t frames_rd = frames - frames_wr;
2559 * multiple of 16 frames, as audioflinger expects audio buffers to
2560 * be a multiple of 16 frames
3048 ALOGVV("%s: resampler request frames = %d frame_size = %d",
3190 ALOGVV("%s rendered frames %d sample_rate %d",
3222 uint64_t *frames, struct timespec *timestamp)
3234 ALOGVV("%s rendered frames %ld sample_rate %d",
3236 *frames = dsp_frames;
3258 *frames = signed_frames;
3608 ssize_t frames = -1;
3647 frames = read_and_process_frames(in, buffer, frames_rq);
3648 if (frames >= 0)