Home | History | Annotate | Download | only in hal

Lines Matching defs:in

5  * you may not use this file except in compliance with the License.
10 * Unless required by applicable law or agreed to in writing, software
706 /* Delay in Us */
896 static ssize_t read_frames(struct stream_in *in, void *buffer, ssize_t frames);
897 static int do_in_standby_l(struct stream_in *in);
900 static void get_capture_reference_delay(struct stream_in *in,
906 /* read frames available in kernel driver buffer */
915 ref_device = node_to_item(list_tail(&in->pcm_dev_list),
940 static void get_capture_delay(struct stream_in *in,
945 /* read frames available in kernel driver buffer */
954 pcm_device = node_to_item(list_head(&in->pcm_dev_list),
965 /* read frames available in audio HAL input buffer
967 * in current buffer */
968 /* frames in in->read_buf are at driver sampling rate while frames in in->proc_buf are
970 buf_delay = (long)(((int64_t)(in->read_buf_frames) * 1000000000) / in->config.rate +
971 ((int64_t)(in->proc_buf_frames) * 1000000000) / in->requested_rate );
975 if (in->resampler) {
976 rsmp_delay = in->resampler->delay_ns(in->resampler);
979 kernel_delay = (long)(((int64_t)kernel_frames * 1000000000) / in->config.rate);
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)
995 ALOGVV("%s: enter:), in->config.channels(%d)", __func__,in->config.channels);
1000 pcm_device = node_to_item(list_head(&in->pcm_dev_list),
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));
1010 ALOG_ASSERT((in->ref_buf != NULL),
1013 in->ref_buf, pcm_frames_to_bytes(pcm_device->pcm, frames));
1015 b.frame_count = frames - in->ref_buf_frames;
1016 b.raw = (void *)(in->ref_buf + in->ref_buf_frames * in->config.channels);
1018 get_capture_delay(in, frames, &b);
1020 if (in->echo_reference->read(in->echo_reference, &b) == 0)
1022 in->ref_buf_frames += b.frame_count;
1023 ALOGVV("update_echo_reference(): in->ref_buf_frames:[%zd], "
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);
1069 static void push_echo_reference(struct stream_in *in, size_t frames)
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;
1084 buf.raw = in->ref_buf;
1086 for (i = 0; i < in->num_preprocessors; i++) {
1087 if ((*in->preprocessors[i].effect_itfe)->process_reverse == NULL)
1090 (*in->preprocessors[i].effect_itfe)->process_reverse(in->preprocessors[i].effect_itfe,
1094 set_preprocessor_echo_delay(in->preprocessors[i].effect_itfe, delay_us);
1097 in->ref_buf_frames -= buf.frameCount;
1098 ALOGVV("%s: in->ref_buf_frames(%zd), in->config.channels(%d) ",
1099 __func__, in->ref_buf_frames, in->config.channels);
1100 if (in->ref_buf_frames) {
1101 memcpy(in->ref_buf,
1102 in->ref_buf + buf.frameCount * in->config.channels,
1103 in->ref_buf_frames * in->config.channels * sizeof(int16_t));
1121 // if the primary output is in standby or did not pick the echo reference yet
1123 // otherwise, out_write() or out_standby() will detect the change in echo reference
1164 static int get_hw_echo_reference(struct stream_in *in)
1168 struct audio_device *adev = in->dev;
1170 in->hw_echo_reference = false;
1185 if (in->input_flags & AUDIO_INPUT_FLAG_FAST) {
1203 list_add_tail(&in->pcm_dev_list, &ref_device->stream_list_node);
1205 in->hw_echo_reference = true;
1257 static int in_configure_reverse(struct stream_in *in)
1265 ALOGV("%s: enter: in->num_preprocessors(%d)", __func__, in->num_preprocessors);
1266 if (in->num_preprocessors > 0) {
1267 config.inputCfg.channels = in->main_channels;
1268 config.outputCfg.channels = in->main_channels;
1271 config.inputCfg.samplingRate = in->requested_rate;
1272 config.outputCfg.samplingRate = in->requested_rate;
1278 for (i = 0; i < in->num_preprocessors; i++)
1280 if ((*in->preprocessors[i].effect_itfe)->process_reverse == NULL)
1282 fct_status = (*(in->preprocessors[i].effect_itfe))->command(
1283 in->preprocessors[i].effect_itfe,
1298 static void in_read_audio_effect_channel_configs(struct stream_in *in __unused,
1301 /* size and format of the cmd are defined in hardware/audio_effect.h */
1354 static uint32_t in_get_aux_channels(struct stream_in *in)
1359 if (in->num_preprocessors == 0)
1364 if (!(in->devices & (AUDIO_DEVICE_IN_BUILTIN_MIC | AUDIO_DEVICE_IN_BACK_MIC)))
1371 if (cur_chcfg->main_channels == in->main_channels) {
1376 idx_preproc < (size_t)in->num_preprocessors && match_cnt == idx_preproc;
1378 struct effect_info_s *effect_info = &in->preprocessors[idx_preproc];
1391 if (match_cnt == (size_t)in->num_preprocessors) {
1468 static int in_reconfigure_channels(struct stream_in *in,
1482 for (i = 0; i < in->num_preprocessors; i++)
1484 int cur_status = in_configure_effect_channels(in->preprocessors[i].effect_itfe,
1506 static void in_update_aux_channels(struct stream_in *in,
1513 aux_channels = in_get_aux_channels(in);
1515 channel_config.main_channels = in->main_channels;
1517 status = in_reconfigure_channels(in,
1520 (aux_channels != in->aux_channels));
1527 in_reconfigure_channels(in, effect, &channel_config, true);
1529 ALOGV("%s: aux_channels=%d, in->aux_channels_changed=%d", __func__, aux_channels, in->aux_channels_changed);
1530 if (in->aux_channels != aux_channels) {
1531 in->aux_channels_changed = true;
1532 in->aux_channels = aux_channels;
1533 do_in_standby_l(in);
1543 static ssize_t read_and_process_frames(struct stream_in *in, void* buffer, ssize_t frames)
1548 size_t src_channels = in->config.channels;
1549 size_t dst_channels = audio_channel_count_from_in_mask(in->main_channels);
1555 bool has_processing = (in->num_preprocessors != 0) ? true : false;
1561 * In case of additional channels, we cannot work inplace
1564 proc_buf_out = in->proc_buf_out;
1568 if (list_empty(&in->pcm_dev_list)) {
1573 pcm_device = node_to_item(list_head(&in->pcm_dev_list),
1578 /* since all the processing below is done in frames and using the config.channels
1579 * as the number of channels, no changes is required in case aux_channels are present */
1582 if (in->proc_buf_frames < (size_t)frames) {
1584 if (in->proc_buf_size < (size_t)frames) {
1586 in->proc_buf_size = (size_t)frames;
1587 in->proc_buf_in = (int16_t *)realloc(in->proc_buf_in, size_in_bytes);
1588 ALOG_ASSERT((in->proc_buf_in != NULL),
1591 in->proc_buf_out = (int16_t *)realloc(in->proc_buf_out, size_in_bytes);
1592 ALOG_ASSERT((in->proc_buf_out != NULL),
1594 proc_buf_out = in->proc_buf_out;
1597 frames_rd = read_frames(in,
1598 in->proc_buf_in +
1599 in->proc_buf_frames * in->config.channels,
1600 frames - in->proc_buf_frames);
1606 in->proc_buf_frames += frames_rd;
1609 if (in->echo_reference != NULL) {
1610 push_echo_reference(in, in->proc_buf_frames);
1615 in_buf.frameCount = in->proc_buf_frames;
1616 in_buf.s16 = in->proc_buf_in;
1618 out_buf.s16 = (int16_t *)proc_buf_out + frames_wr * in->config.channels;
1625 for (i = 0; i < in->num_preprocessors; i++) {
1626 (*in->preprocessors[i].effect_itfe)->process(in->preprocessors[i].effect_itfe,
1631 /* process() has updated the number of frames consumed and produced in
1633 * move remaining frames to the beginning of in->proc_buf_in */
1634 in->proc_buf_frames -= in_buf.frameCount;
1636 if (in->proc_buf_frames) {
1637 memcpy(in->proc_buf_in,
1638 in->proc_buf_in + in_buf.frameCount * in->config.channels,
1639 in->proc_buf_frames * in->config.channels * sizeof(int16_t));
1651 /* The effect does not comply to the API. In theory, we should never end up here! */
1664 if (in->proc_buf_size < (size_t)frames) {
1666 in->proc_buf_size = (size_t)frames;
1667 in->proc_buf_out = (int16_t *)realloc(in->proc_buf_out, size_in_bytes);
1668 ALOG_ASSERT((in->proc_buf_out != NULL),
1670 proc_buf_out = in->proc_buf_out;
1673 frames_wr = read_frames(in, proc_buf_out, frames);
1709 struct stream_in *in;
1715 in = (struct stream_in *)((char *)buffer_provider -
1718 if (list_empty(&in->pcm_dev_list)) {
1721 in->read_status = -ENODEV;
1725 pcm_device = node_to_item(list_head(&in->pcm_dev_list),
1728 if (in->read_buf_frames == 0) {
1729 size_t size_in_bytes = pcm_frames_to_bytes(pcm_device->pcm, in->config.period_size);
1730 if (in->read_buf_size < in->config.period_size) {
1731 in->read_buf_size = in->config.period_size;
1732 in->read_buf = (int16_t *) realloc(in->read_buf, size_in_bytes);
1733 ALOG_ASSERT((in->read_buf != NULL),
1737 in->read_status = pcm_read(pcm_device->pcm, (void*)in->read_buf, size_in_bytes);
1739 if (in->read_status != 0) {
1740 ALOGE("get_next_buffer() pcm_read error %d", in->read_status);
1743 return in->read_status;
1745 in->read_buf_frames = in->config.period_size;
1749 if (in->hw_echo_reference) {
1758 ref_device = node_to_item(list_tail(&in->pcm_dev_list),
1760 list_for_each(node, &in->pcm_dev_list) {
1770 if (in->hw_ref_buf_size < size_hw_ref_frames) {
1771 in->hw_ref_buf_size = size_hw_ref_frames;
1772 in->hw_ref_buf = (int16_t *) realloc(in->hw_ref_buf, size_hw_ref_bytes);
1773 ALOG_ASSERT((in->hw_ref_buf != NULL),
1776 in->hw_ref_buf, size_hw_ref_bytes);
1779 read_status = pcm_read(ref_device->pcm, (void*)in->hw_ref_buf, size_hw_ref_bytes);
1786 get_capture_reference_delay(in, size_hw_ref_frames, &b);
1787 b.raw = (void *)in->hw_ref_buf;
1791 in->echo_reference->write(in->echo_reference, &b);
1799 buffer->frame_count = (buffer->frame_count > in->read_buf_frames) ?
1800 in->read_buf_frames : buffer->frame_count;
1801 buffer->i16 = in->read_buf + (in->config.period_size - in->read_buf_frames) *
1802 in->config.channels;
1803 return in->read_status;
1809 struct stream_in *in;
1814 in = (struct stream_in *)((char *)buffer_provider -
1817 in->read_buf_frames -= buffer->frame_count;
1822 static ssize_t read_frames(struct stream_in *in, void *buffer, ssize_t frames)
1828 if (list_empty(&in->pcm_dev_list)) {
1833 pcm_device = node_to_item(list_head(&in->pcm_dev_list),
1838 ALOGVV("%s: frames_rd: %zd, frames_wr: %zd, in->config.channels: %d",
1839 __func__,frames_rd,frames_wr,in->config.channels);
1840 if (in->resampler != NULL) {
1841 in->resampler->resample_from_provider(in->resampler,
1850 get_next_buffer(&in->buf_provider, &buf);
1858 release_buffer(&in->buf_provider, &buf);
1860 /* in->read_status is updated by getNextBuffer() also called by
1861 * in->resampler->resample_from_provider() */
1862 if (in->read_status != 0)
1863 return in->read_status;
1870 static int in_release_pcm_devices(struct stream_in *in)
1876 list_for_each_safe(node, next, &in->pcm_dev_list) {
1885 static int stop_input_stream(struct stream_in *in)
1888 struct audio_device *adev = in->dev;
1892 in->usecase, use_case_table[in->usecase]);
1893 uc_info = get_usecase_from_id(adev, in->usecase);
1895 ALOGE("%s: Could not find the usecase (%d) in the list",
1896 __func__, in->usecase);
1906 if (list_empty(&in->pcm_dev_list)) {
1911 in_release_pcm_devices(in);
1912 list_init(&in->pcm_dev_list);
1915 if (in->hw_echo_reference)
1917 in->hw_echo_reference = false;
1925 int start_input_stream(struct stream_in *in)
1931 struct audio_device *adev = in->dev;
1935 ALOGV("%s: enter: usecase(%d)", __func__, in->usecase);
1936 adev->active_input = in;
1937 pcm_profile = get_pcm_device(in->usecase == USECASE_AUDIO_CAPTURE_HOTWORD
1938 ? PCM_HOTWORD_STREAMING : PCM_CAPTURE, in->devices);
1941 __func__, in->usecase);
1946 if (in->input_flags & AUDIO_INPUT_FLAG_FAST) {
1953 uc_info->id = in->usecase;
1955 uc_info->stream = (struct audio_stream *)in;
1956 uc_info->devices = in->devices;
1962 list_init(&in->pcm_dev_list);
1963 list_add_tail(&in->pcm_dev_list, &pcm_device->stream_list_node);
1972 select_devices(adev, in->usecase);
1978 if (in->config.rate != pcm_profile->config.rate) {
1981 in->config = pcm_profile->config;
1984 if (in->aux_channels_changed) {
1985 in->config.channels = audio_channel_count_from_in_mask(in->main_channels | in->aux_channels);
1990 if (in->requested_rate != in->config.rate) {
1995 if (in->resampler) {
1996 release_resampler(in->resampler);
1997 in->resampler = NULL;
1999 in->buf_provider.get_next_buffer = get_next_buffer;
2000 in->buf_provider.release_buffer = release_buffer;
2001 ret = create_resampler(in->config.rate,
2002 in->requested_rate,
2003 in->config.channels,
2005 &in->buf_provider,
2006 &in->resampler);
2010 if (in->enable_aec && in->echo_reference == NULL) {
2011 in->echo_reference = get_echo_reference(adev,
2013 audio_channel_count_from_in_mask(in->main_channels),
2014 in->requested_rate
2019 if (in->enable_aec) {
2020 ret = get_hw_echo_reference(in);
2025 in->hw_ref_buf_size = 0;
2032 * As such a change in aux_channels will not have an effect.
2067 /* force read and proc buffer reallocation in case of frame size or
2069 in->proc_buf_frames = 0;
2070 in->proc_buf_size = 0;
2071 in->read_buf_size = 0;
2072 in->read_buf_frames = 0;
2075 if (in->resampler) {
2076 in->resampler->reset(in->resampler);
2083 if (in->resampler) {
2084 release_resampler(in->resampler);
2085 in->resampler = NULL;
2087 stop_input_stream(in);
2363 ALOGE("%s: Could not find the usecase (%d) in the list",
2450 ALOGE("%s: Could not find the usecase (%d) in the list",
2705 struct stream_in *in = NULL; /* if non-NULL, then force input to standby */
2722 * - because a change in output device may change mic settings */
2725 in = adev->active_input;
2735 ALOGE("%s: Could not find the usecase (%d) in the list",
2769 if (in) {
2771 pthread_mutex_lock(&in->lock);
2773 LOG_ALWAYS_FATAL_IF(in != adev->active_input);
2774 do_in_standby_l(in);
2776 pthread_mutex_unlock(&in->lock);
2892 struct stream_in *in = NULL;
2920 /* A change in output device may change the microphone selection */
2924 in = adev->active_input;
2930 if (!in) {
2931 /* Leave mutex locked iff in != NULL */
2958 if (in) {
2959 /* This mutex was left locked iff in != NULL */
3072 if (in) {
3074 pthread_mutex_lock(&in->lock);
3076 LOG_ALWAYS_FATAL_IF(in != adev->active_input);
3077 do_in_standby_l(in);
3079 pthread_mutex_unlock(&in->lock);
3080 /* This mutex was left locked iff in != NULL */
3164 /* It would be unusual for this value to be negative, but check just in case ... */
3256 struct stream_in *in = (struct stream_in *)stream;
3258 return in->requested_rate;
3270 struct stream_in *in = (struct stream_in *)stream;
3272 return in->main_channels;
3291 struct stream_in *in = (struct stream_in *)stream;
3293 return get_input_buffer_size(in->requested_rate,
3295 audio_channel_count_from_in_mask(in->main_channels),
3296 in->devices);
3299 static int in_close_pcm_devices(struct stream_in *in)
3303 struct audio_device *adev = in->dev;
3305 list_for_each(node, &in->pcm_dev_list) {
3321 static int do_in_standby_l(struct stream_in *in)
3326 struct audio_device *adev = in->dev;
3328 if (!in->standby) {
3330 in_close_pcm_devices(in);
3333 if (in->echo_reference != NULL) {
3335 in->echo_reference->read(in->echo_reference, NULL);
3336 put_echo_reference(adev, in->echo_reference);
3337 in->echo_reference = NULL;
3340 if (in->hw_echo_reference)
3342 if (in->hw_ref_buf) {
3343 free(in->hw_ref_buf);
3344 in->hw_ref_buf = NULL;
3350 status = stop_input_stream(in);
3352 if (in->read_buf) {
3353 free(in->read_buf);
3354 in->read_buf = NULL;
3357 in->standby = 1;
3363 static int in_standby_l(struct stream_in *in)
3365 struct audio_device *adev = in->dev;
3367 pthread_mutex_lock(&in->lock);
3368 if (!in->standby) {
3370 status = do_in_standby_l(in);
3373 pthread_mutex_unlock(&in->lock);
3379 struct stream_in *in = (struct stream_in *)stream;
3380 struct audio_device *adev = in->dev;
3384 status = in_standby_l(in);
3400 struct stream_in *in = (struct stream_in *)stream;
3401 struct audio_device *adev = in->dev;
3418 pthread_mutex_lock(&in->lock);
3423 if (((int)in->source != val) && (val != 0)) {
3424 in->source = val;
3431 if (((int)in->devices != val) && (val != 0)) {
3432 in->devices = val;
3433 /* If recording is in progress, change the tx device to new device */
3434 if (!in->standby) {
3435 uc_info = get_usecase_from_id(adev, in->usecase);
3437 ALOGE("%s: Could not find the usecase (%d) in the list",
3438 __func__, in->usecase);
3440 if (list_empty(&in->pcm_dev_list))
3443 pcm_device = node_to_item(list_head(&in->pcm_dev_list),
3451 ret = do_in_standby_l(in);
3453 ret = select_devices(adev, in->usecase);
3458 pthread_mutex_unlock(&in->lock);
3482 static ssize_t read_bytes_from_dsp(struct stream_in *in, void* buffer,
3486 struct audio_device *adev = in->dev;
3488 pcm_device = node_to_item(list_head(&in->pcm_dev_list),
3500 struct stream_in *in = (struct stream_in *)stream;
3501 struct audio_device *adev = in->dev;
3509 pthread_mutex_lock(&in->lock);
3510 if (in->standby) {
3511 pthread_mutex_unlock(&in->lock);
3513 pthread_mutex_lock(&in->lock);
3514 if (!in->standby) {
3519 ret = start_input_stream(in);
3525 in->standby = 0;
3529 if (!list_empty(&in->pcm_dev_list)) {
3530 if (in->usecase == USECASE_AUDIO_CAPTURE_HOTWORD) {
3531 bytes = read_bytes_from_dsp(in, buffer, bytes);
3541 frames = read_and_process_frames(in, buffer, frames_rq);
3555 pthread_mutex_unlock(&in->lock);
3558 in_standby(&in->stream.common);
3561 in->requested_rate);
3577 struct stream_in *in = (struct stream_in *)stream;
3578 struct audio_device *adev = in->dev;
3591 pthread_mutex_lock(&in->lock);
3592 pthread_mutex_lock(&in->dev->lock);
3594 if ((in->source == AUDIO_SOURCE_VOICE_COMMUNICATION) &&
3595 in->enable_aec != enable &&
3597 in->enable_aec = enable;
3598 if (!in->standby)
3599 select_devices(in->dev, in->usecase);
3602 if ( (in->num_preprocessors > MAX_PREPROCESSORS) && (enable == true) ) {
3607 in->preprocessors[in->num_preprocessors].effect_itfe = effect;
3608 /* add the supported channel of the effect in the channel_configs */
3609 in_read_audio_effect_channel_configs(in, &in->preprocessors[in->num_preprocessors]);
3610 in->num_preprocessors ++;
3612 in_update_aux_channels(in, effect);//wesley crash
3613 in->aux_channels_changed = true;
3616 if (in->num_preprocessors <= 0) {
3621 for (i=0; i < in->num_preprocessors; i++) {
3623 in->preprocessors[i - 1].effect_itfe = in->preprocessors[i].effect_itfe;
3624 in->preprocessors[i - 1].channel_configs = in->preprocessors[i].channel_configs;
3625 in->preprocessors[i - 1].num_channel_configs =
3626 in->preprocessors[i].num_channel_configs;
3630 if ( in->preprocessors[i].effect_itfe == effect ) {
3632 free(in->preprocessors[i].channel_configs);
3638 in->num_preprocessors--;
3640 in->preprocessors[in->num_preprocessors].num_channel_configs = 0;
3641 in->preprocessors[in->num_preprocessors].effect_itfe = NULL;
3642 in->preprocessors[in->num_preprocessors].channel_configs = NULL;
3643 in->aux_channels_changed = false;
3644 ALOGV("%s: enable(%d), in->aux_channels_changed(%d)", __func__, enable, in->aux_channels_changed);
3646 ALOGI("%s: num_preprocessors = %d", __func__, in->num_preprocessors);
3649 in->enable_aec = enable;
3651 if (!in->standby) {
3652 select_devices(in->dev, in->usecase);
3653 do_in_standby_l(in);
3655 if (in->enable_aec == true) {
3656 in_configure_reverse(in);
3662 pthread_mutex_unlock(&in->dev->lock);
3663 pthread_mutex_unlock(&in->lock);
3921 /* FIXME: note that the code below assumes that the speakers are in the correct placement
4065 /* NOTE: we default to built in mic which may cause a mismatch between what we
4084 struct stream_in *in;
4102 in = (struct stream_in *)calloc(1, sizeof(struct stream_in));
4104 in->stream.common.get_sample_rate = in_get_sample_rate;
4105 in->stream.common.set_sample_rate = in_set_sample_rate;
4106 in->stream.common.get_buffer_size = in_get_buffer_size;
4107 in->stream.common.get_channels = in_get_channels;
4108 in->stream.common.get_format = in_get_format;
4109 in->stream.common.set_format = in_set_format;
4110 in->stream.common.standby = in_standby;
4111 in->stream.common.dump = in_dump;
4112 in
4113 in->stream.common.get_parameters = in_get_parameters;
4114 in->stream.common.add_audio_effect = in_add_audio_effect;
4115 in->stream.common.remove_audio_effect = in_remove_audio_effect;
4116 in->stream.set_gain = in_set_gain;
4117 in->stream.read = in_read;
4118 in->stream.get_input_frames_lost = in_get_input_frames_lost;
4120 in->devices = devices;
4121 in->source = source;
4122 in->dev = adev;
4123 in->standby = 1;
4124 in->main_channels = config->channel_mask;
4125 in->requested_rate = config->sample_rate;
4128 in->input_flags = flags;
4131 in->config = pcm_profile->config;
4135 in->usecase = USECASE_AUDIO_CAPTURE_HOTWORD;
4137 in->usecase = USECASE_AUDIO_CAPTURE;
4140 *stream_in = &in->stream;
4149 struct stream_in *in = (struct stream_in*)stream;
4158 for (i=0; i<in->num_preprocessors; i++) {
4159 free(in->preprocessors[i].channel_configs);
4162 if (in->read_buf) {
4163 free(in->read_buf);
4164 in->read_buf = NULL;
4167 if (in->proc_buf_in) {
4168 free(in->proc_buf_in);
4169 in->proc_buf_in = NULL;
4172 if (in->proc_buf_out) {
4173 free(in->proc_buf_out);
4174 in->proc_buf_out = NULL;
4177 if (in->ref_buf) {
4178 free(in->ref_buf);
4179 in->ref_buf = NULL;
4182 if (in->resampler) {
4183 release_resampler(in->resampler);
4184 in->resampler = NULL;
4188 in_standby_l(in);
4323 adev->dummybuf_thread_timeout = 6000; /* in 18 sec */
4474 ALOGE("%s: Error grabbing functions in %s", __func__, SOUND_TRIGGER_HAL_LIBRARY_PATH);