Home | History | Annotate | Download | only in audio

Lines Matching refs:frames

136 /* Constraint imposed by ABE: for playback, all period sizes must be multiples of 24 frames
138 * limitation is actually a min number of bytes which translates to a different amount of frames
148 /* number of frames per short period (low latency) */
153 /* number of frames per short deep buffer period (screen on) */
161 /* number of frames per long deep buffer period (screen off) */
167 /* number of frames per period for HDMI multichannel output */
202 /* Number of frames per period for capture. This cannot be reduced below 96.
1540 multiple of 16 frames, as audioflinger expects audio buffers to
1541 be a multiple of 16 frames */
1613 size_t frames,
1639 buffer->delay_ns = (long)(((int64_t)(kernel_frames + frames)* 1000000000)/
1667 multiple of 16 frames, as audioflinger expects audio buffers to
1668 be a multiple of 16 frames. Note: we use the default rate here
1680 multiple of 16 frames, as audioflinger expects audio buffers to
1681 be a multiple of 16 frames. Note: we use the default rate here
2084 /* do not allow more than out->write_threshold frames in kernel pcm driver buffer */
2384 frames,
2388 /* read frames available in kernel driver buffer */
2404 /* read frames available in audio HAL input buffer
2405 * add number of frames being read as we want the capture time of first sample
2407 /* frames in in->buffer are at driver sampling rate while frames in in->proc_buf are
2427 "in->read_buf_frames:[%d], in->proc_buf_frames:[%d], frames:[%d]",
2430 in->read_buf_frames, in->proc_buf_frames, frames);
2434 static int32_t update_echo_reference(struct tuna_stream_in *in, size_t frames)
2439 ALOGV("update_echo_reference, frames = [%d], in->ref_buf_frames = [%d], "
2441 frames, in->ref_buf_frames, frames - in->ref_buf_frames);
2442 if (in->ref_buf_frames < frames) {
2443 if (in->ref_buf_size < frames) {
2444 in->ref_buf_size = frames;
2445 in->ref_buf = (int16_t *)realloc(in->ref_buf, pcm_frames_to_bytes(in->pcm, frames));
2449 in->ref_buf, pcm_frames_to_bytes(in->pcm, frames));
2451 b.frame_count = frames - in->ref_buf_frames;
2454 get_capture_delay(in, frames, &b);
2460 "in->ref_buf_size:[%d], frames:[%d], b.frame_count:[%d]",
2461 in->ref_buf_frames, in->ref_buf_size, frames, b.frame_count);
2464 ALOGW("update_echo_reference(): NOT enough frames to read ref buffer");
2501 static void push_echo_reference(struct tuna_stream_in *in, size_t frames)
2503 /* read frames from echo reference buffer and update echo delay
2504 * in->ref_buf_frames is updated with frames available in in->ref_buf */
2505 int32_t delay_us = update_echo_reference(in, frames)/1000;
2509 if (in->ref_buf_frames < frames)
2510 frames = in->ref_buf_frames;
2512 buf.frameCount = frames;
2596 /* read_frames() reads frames from kernel driver, down samples to capture rate
2597 * if necessary and output the number of frames requested to the buffer specified */
2598 static ssize_t read_frames(struct tuna_stream_in *in, void *buffer, ssize_t frames)
2602 while (frames_wr < frames) {
2603 size_t frames_rd = frames - frames_wr;
2635 /* process_frames() reads frames from kernel driver (via read_frames()),
2636 * calls the active audio pre processings and output the number of frames requested
2638 static ssize_t process_frames(struct tuna_stream_in *in, void* buffer, ssize_t frames)
2652 /* since all the processing below is done in frames and using the config.channels
2654 while (frames_wr < frames) {
2655 /* first reload enough frames at the end of process input buffer */
2656 if (in->proc_buf_frames < (size_t)frames) {
2659 if (in->proc_buf_size < (size_t)frames) {
2660 size_t size_in_bytes = pcm_frames_to_bytes(in->pcm, frames);
2662 in->proc_buf_size = (size_t)frames;
2678 frames - in->proc_buf_frames);
2690 * the maximum number of frames to be consumed and produced by process() */
2693 out_buf.frameCount = frames - frames_wr;
2707 /* process() has updated the number of frames consumed and produced in
2709 * move remaining frames to the beginning of in->proc_buf_in */
2718 /* if not enough frames were passed to process(), read more and retry. */
2720 ALOGW("No frames produced by preproc");
2724 if ((frames_wr + (ssize_t)out_buf.frameCount) <= frames) {
2728 ALOGE("preprocessing produced too many frames: %d + %d > %d !",
2729 (unsigned int)frames_wr, out_buf.frameCount, (unsigned int)frames);
2730 frames_wr = frames;