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
708 /* Delay in Us */
898 static ssize_t read_frames(struct stream_in *in, void *buffer, ssize_t frames);
899 static int do_in_standby_l(struct stream_in *in);
902 static void get_capture_reference_delay(struct stream_in *in,
908 /* read frames available in kernel driver buffer */
917 ref_device = node_to_item(list_tail(&in->pcm_dev_list),
942 in,
947 /* read frames available in kernel driver buffer */
956 pcm_device = node_to_item(list_head(&in->pcm_dev_list),
967 /* read frames available in audio HAL input buffer
969 * in current buffer */
970 /* frames in in->read_buf are at driver sampling rate while frames in in->proc_buf are
972 buf_delay = (long)(((int64_t)(in->read_buf_frames) * 1000000000) / in->config.rate +
973 ((int64_t)(in->proc_buf_frames) * 1000000000) / in->requested_rate );
977 if (in->resampler) {
978 rsmp_delay = in->resampler->delay_ns(in->resampler);
981 kernel_delay = (long)(((int64_t)kernel_frames * 1000000000) / in->config.rate);
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)
997 ALOGVV("%s: enter:), in->config.channels(%d)", __func__,in->config.channels);
1002 pcm_device = node_to_item(list_head(&in->pcm_dev_list),
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));
1012 ALOG_ASSERT((in->ref_buf != NULL),
1015 in->ref_buf, pcm_frames_to_bytes(pcm_device->pcm, frames));
1017 b.frame_count = frames - in->ref_buf_frames;
1018 b.raw = (void *)(in->ref_buf + in->ref_buf_frames * in->config.channels);
1020 get_capture_delay(in, frames, &b);
1022 if (in->echo_reference->read(in->echo_reference, &b) == 0)
1024 in->ref_buf_frames += b.frame_count;
1025 ALOGVV("update_echo_reference(): in->ref_buf_frames:[%zd], "
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);
1071 static void push_echo_reference(struct stream_in *in, size_t frames)
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;
1086 buf.raw = in->ref_buf;
1088 for (i = 0; i < in->num_preprocessors; i++) {
1089 if ((*in->preprocessors[i].effect_itfe)->process_reverse == NULL)
1092 (*in->preprocessors[i].effect_itfe)->process_reverse(in->preprocessors[i].effect_itfe,
1096 set_preprocessor_echo_delay(in->preprocessors[i].effect_itfe, delay_us);
1099 in->ref_buf_frames -= buf.frameCount;
1100 ALOGVV("%s: in->ref_buf_frames(%zd), in->config.channels(%d) ",
1101 __func__, in->ref_buf_frames, in->config.channels);
1102 if (in->ref_buf_frames) {
1103 memcpy(in->ref_buf,
1104 in->ref_buf + buf.frameCount * in->config.channels,
1105 in->ref_buf_frames * in->config.channels * sizeof(int16_t));
1123 // if the primary output is in standby or did not pick the echo reference yet
1125 // otherwise, out_write() or out_standby() will detect the change in echo reference
1166 static int get_hw_echo_reference(struct stream_in *in)
1170 struct audio_device *adev = in->dev;
1172 in->hw_echo_reference = false;
1187 if (in->input_flags & AUDIO_INPUT_FLAG_FAST) {
1205 list_add_tail(&in->pcm_dev_list, &ref_device->stream_list_node);
1207 in->hw_echo_reference = true;
1259 static int in_configure_reverse(struct stream_in *in)
1267 ALOGV("%s: enter: in->num_preprocessors(%d)", __func__, in->num_preprocessors);
1268 if (in->num_preprocessors > 0) {
1269 config.inputCfg.channels = in->main_channels;
1270 config.outputCfg.channels = in->main_channels;
1273 config.inputCfg.samplingRate = in->requested_rate;
1274 config.outputCfg.samplingRate = in->requested_rate;
1280 for (i = 0; i < in->num_preprocessors; i++)
1282 if ((*in->preprocessors[i].effect_itfe)->process_reverse == NULL)
1284 fct_status = (*(in->preprocessors[i].effect_itfe))->command(
1285 in->preprocessors[i].effect_itfe,
1300 static void in_read_audio_effect_channel_configs(struct stream_in *in __unused,
1303 /* size and format of the cmd are defined in hardware/audio_effect.h */
1356 static uint32_t in_get_aux_channels(struct stream_in *in)
1361 if (in->num_preprocessors == 0)
1366 if (!(in->devices & (AUDIO_DEVICE_IN_BUILTIN_MIC | AUDIO_DEVICE_IN_BACK_MIC)))
1373 if (cur_chcfg->main_channels == in->main_channels) {
1378 idx_preproc < (size_t)in->num_preprocessors && match_cnt == idx_preproc;
1380 struct effect_info_s *effect_info = &in->preprocessors[idx_preproc];
1393 if (match_cnt == (size_t)in->num_preprocessors) {
1470 static int in_reconfigure_channels(struct stream_in *in,
1484 for (i = 0; i < in->num_preprocessors; i++)
1486 int cur_status = in_configure_effect_channels(in->preprocessors[i].effect_itfe,
1508 static void in_update_aux_channels(struct stream_in *in,
1515 aux_channels = in_get_aux_channels(in);
1517 channel_config.main_channels = in->main_channels;
1519 status = in_reconfigure_channels(in,
1522 (aux_channels != in->aux_channels));
1529 in_reconfigure_channels(in, effect, &channel_config, true);
1531 ALOGV("%s: aux_channels=%d, in->aux_channels_changed=%d", __func__, aux_channels, in->aux_channels_changed);
1532 if (in->aux_channels != aux_channels) {
1533 in->aux_channels_changed = true;
1534 in->aux_channels = aux_channels;
1535 do_in_standby_l(in);
1545 static ssize_t read_and_process_frames(struct stream_in *in, void* buffer, ssize_t frames)
1550 size_t src_channels = in->config.channels;
1551 size_t dst_channels = audio_channel_count_from_in_mask(in->main_channels);
1557 bool has_processing = (in->num_preprocessors != 0) ? true : false;
1563 * In case of additional channels, we cannot work inplace
1566 proc_buf_out = in->proc_buf_out;
1570 if (list_empty(&in->pcm_dev_list)) {
1575 pcm_device = node_to_item(list_head(&in->pcm_dev_list),
1580 /* since all the processing below is done in frames and using the config.channels
1581 * as the number of channels, no changes is required in case aux_channels are present */
1584 if (in->proc_buf_frames < (size_t)frames) {
1586 if (in->proc_buf_size < (size_t)frames) {
1588 in->proc_buf_size = (size_t)frames;
1589 in->proc_buf_in = (int16_t *)realloc(in->proc_buf_in, size_in_bytes);
1590 ALOG_ASSERT((in->proc_buf_in != NULL),
1593 in->proc_buf_out = (int16_t *)realloc(in->proc_buf_out, size_in_bytes);
1594 ALOG_ASSERT((in->proc_buf_out != NULL),
1596 proc_buf_out = in->proc_buf_out;
1599 frames_rd = read_frames(in,
1600 in->proc_buf_in +
1601 in->proc_buf_frames * in->config.channels,
1602 frames - in->proc_buf_frames);
1608 in->proc_buf_frames += frames_rd;
1611 if (in->echo_reference != NULL) {
1612 push_echo_reference(in, in->proc_buf_frames);
1617 in_buf.frameCount = in->proc_buf_frames;
1618 in_buf.s16 = in->proc_buf_in;
1620 out_buf.s16 = (int16_t *)proc_buf_out + frames_wr * in->config.channels;
1627 for (i = 0; i < in->num_preprocessors; i++) {
1628 (*in->preprocessors[i].effect_itfe)->process(in->preprocessors[i].effect_itfe,
1633 /* process() has updated the number of frames consumed and produced in
1635 * move remaining frames to the beginning of in->proc_buf_in */
1636 in->proc_buf_frames -= in_buf.frameCount;
1638 if (in->proc_buf_frames) {
1639 memcpy(in->proc_buf_in,
1640 in->proc_buf_in + in_buf.frameCount * in->config.channels,
1641 in->proc_buf_frames * in->config.channels * sizeof(int16_t));
1653 /* The effect does not comply to the API. In theory, we should never end up here! */
1666 if (in->proc_buf_size < (size_t)frames) {
1668 in->proc_buf_size = (size_t)frames;
1669 in->proc_buf_out = (int16_t *)realloc(in->proc_buf_out, size_in_bytes);
1670 ALOG_ASSERT((in->proc_buf_out != NULL),
1672 proc_buf_out = in->proc_buf_out;
1675 frames_wr = read_frames(in, proc_buf_out, frames);
1711 struct stream_in *in;
1717 in = (struct stream_in *)((char *)buffer_provider -
1720 if (list_empty(&in->pcm_dev_list)) {
1723 in->read_status = -ENODEV;
1727 pcm_device = node_to_item(list_head(&in->pcm_dev_list),
1730 if (in->read_buf_frames == 0) {
1731 size_t size_in_bytes = pcm_frames_to_bytes(pcm_device->pcm, in->config.period_size);
1732 if (in->read_buf_size < in->config.period_size) {
1733 in->read_buf_size = in->config.period_size;
1734 in->read_buf = (int16_t *) realloc(in->read_buf, size_in_bytes);
1735 ALOG_ASSERT((in->read_buf != NULL),
1739 in->read_status = pcm_read(pcm_device->pcm, (void*)in->read_buf, size_in_bytes);
1741 if (in->read_status != 0) {
1742 ALOGE("get_next_buffer() pcm_read error %d", in->read_status);
1745 return in->read_status;
1747 in->read_buf_frames = in->config.period_size;
1751 if (in->hw_echo_reference) {
1760 ref_device = node_to_item(list_tail(&in->pcm_dev_list),
1762 list_for_each(node, &in->pcm_dev_list) {
1772 if (in->hw_ref_buf_size < size_hw_ref_frames) {
1773 in->hw_ref_buf_size = size_hw_ref_frames;
1774 in->hw_ref_buf = (int16_t *) realloc(in->hw_ref_buf, size_hw_ref_bytes);
1775 ALOG_ASSERT((in->hw_ref_buf != NULL),
1778 in->hw_ref_buf, size_hw_ref_bytes);
1781 read_status = pcm_read(ref_device->pcm, (void*)in->hw_ref_buf, size_hw_ref_bytes);
1788 get_capture_reference_delay(in, size_hw_ref_frames, &b);
1789 b.raw = (void *)in->hw_ref_buf;
1793 in->echo_reference->write(in->echo_reference, &b);
1801 buffer->frame_count = (buffer->frame_count > in->read_buf_frames) ?
1802 in->read_buf_frames : buffer->frame_count;
1803 buffer->i16 = in->read_buf + (in->config.period_size - in->read_buf_frames) *
1804 in->config.channels;
1805 return in->read_status;
1811 struct stream_in *in;
1816 in = (struct stream_in *)((char *)buffer_provider -
1819 in->read_buf_frames -= buffer->frame_count;
1824 static ssize_t read_frames(struct stream_in *in, void *buffer, ssize_t frames)
1830 if (list_empty(&in->pcm_dev_list)) {
1835 pcm_device = node_to_item(list_head(&in->pcm_dev_list),
1840 ALOGVV("%s: frames_rd: %zd, frames_wr: %zd, in->config.channels: %d",
1841 __func__,frames_rd,frames_wr,in->config.channels);
1842 if (in->resampler != NULL) {
1843 in->resampler->resample_from_provider(in->resampler,
1852 get_next_buffer(&in->buf_provider, &buf);
1860 release_buffer(&in->buf_provider, &buf);
1862 /* in->read_status is updated by getNextBuffer() also called by
1863 * in->resampler->resample_from_provider() */
1864 if (in->read_status != 0)
1865 return in->read_status;
1872 static int in_release_pcm_devices(struct stream_in *in)
1878 list_for_each_safe(node, next, &in->pcm_dev_list) {
1887 static int stop_input_stream(struct stream_in *in)
1890 struct audio_device *adev = in->dev;
1894 in->usecase, use_case_table[in->usecase]);
1895 uc_info = get_usecase_from_id(adev, in->usecase);
1897 ALOGE("%s: Could not find the usecase (%d) in the list",
1898 __func__, in->usecase);
1908 if (list_empty(&in->pcm_dev_list)) {
1913 in_release_pcm_devices(in);
1914 list_init(&in->pcm_dev_list);
1917 if (in->hw_echo_reference)
1919 in->hw_echo_reference = false;
1927 int start_input_stream(struct stream_in *in)
1933 struct audio_device *adev = in->dev;
1937 ALOGV("%s: enter: usecase(%d)", __func__, in->usecase);
1938 adev->active_input = in;
1939 pcm_profile = get_pcm_device(in->usecase == USECASE_AUDIO_CAPTURE_HOTWORD
1940 ? PCM_HOTWORD_STREAMING : PCM_CAPTURE, in->devices);
1943 __func__, in->usecase);
1948 if (in->input_flags & AUDIO_INPUT_FLAG_FAST) {
1955 uc_info->id = in->usecase;
1957 uc_info->stream = (struct audio_stream *)in;
1958 uc_info->devices = in->devices;
1964 list_init(&in->pcm_dev_list);
1965 list_add_tail(&in->pcm_dev_list, &pcm_device->stream_list_node);
1974 select_devices(adev, in->usecase);
1980 if (in->config.rate != pcm_profile->config.rate) {
1983 in->config = pcm_profile->config;
1986 if (in->aux_channels_changed) {
1987 in->config.channels = audio_channel_count_from_in_mask(in->main_channels | in->aux_channels);
1992 if (in->requested_rate != in->config.rate) {
1997 if (in->resampler) {
1998 release_resampler(in->resampler);
1999 in->resampler = NULL;
2001 in->buf_provider.get_next_buffer = get_next_buffer;
2002 in->buf_provider.release_buffer = release_buffer;
2003 ret = create_resampler(in->config.rate,
2004 in->requested_rate,
2005 in->config.channels,
2007 &in->buf_provider,
2008 &in->resampler);
2012 if (in->enable_aec && in->echo_reference == NULL) {
2013 in->echo_reference = get_echo_reference(adev,
2015 audio_channel_count_from_in_mask(in->main_channels),
2016 in->requested_rate
2021 if (in->enable_aec) {
2022 ret = get_hw_echo_reference(in);
2027 in->hw_ref_buf_size = 0;
2034 * As such a change in aux_channels will not have an effect.
2069 /* force read and proc buffer reallocation in case of frame size or
2071 in->proc_buf_frames = 0;
2072 in->proc_buf_size = 0;
2073 in->read_buf_size = 0;
2074 in->read_buf_frames = 0;
2077 if (in->resampler) {
2078 in->resampler->reset(in->resampler);
2085 if (in->resampler) {
2086 release_resampler(in->resampler);
2087 in->resampler = NULL;
2089 stop_input_stream(in);
2356 ALOGE("%s: Could not find the usecase (%d) in the list",
2468 ALOGE("%s: Could not find the usecase (%d) in the list",
2723 struct stream_in *in = NULL; /* if non-NULL, then force input to standby */
2740 * - because a change in output device may change mic settings */
2743 in = adev->active_input;
2753 ALOGE("%s: Could not find the usecase (%d) in the list",
2787 if (in) {
2789 pthread_mutex_lock(&in->lock);
2791 LOG_ALWAYS_FATAL_IF(in != adev->active_input);
2792 do_in_standby_l(in);
2794 pthread_mutex_unlock(&in->lock);
2933 struct stream_in *in = NULL;
2961 /* A change in output device may change the microphone selection */
2965 in = adev->active_input;
2971 if (!in) {
2972 /* Leave mutex locked iff in != NULL */
3006 if (in) {
3007 /* This mutex was left locked iff in != NULL */
3164 if (in) {
3166 pthread_mutex_lock(&in->lock);
3168 LOG_ALWAYS_FATAL_IF(in != adev->active_input);
3169 do_in_standby_l(in);
3171 pthread_mutex_unlock(&in->lock);
3172 /* This mutex was left locked iff in != NULL */
3256 /* It would be unusual for this value to be negative, but check just in case ... */
3345 ALOGE("out_flush() called in wrong state %d", out->offload_state);
3362 struct stream_in *in = (struct stream_in *)stream;
3364 return in->requested_rate;
3376 struct stream_in *in = (struct stream_in *)stream;
3378 return in->main_channels;
3397 struct stream_in *in = (struct stream_in *)stream;
3399 return get_input_buffer_size(in->requested_rate,
3401 audio_channel_count_from_in_mask(in->main_channels),
3402 in->devices);
3405 static int in_close_pcm_devices(struct stream_in *in)
3409 struct audio_device *adev = in->dev;
3411 list_for_each(node, &in->pcm_dev_list) {
3427 static int do_in_standby_l(struct stream_in *in)
3432 struct audio_device *adev = in->dev;
3434 if (!in->standby) {
3436 in_close_pcm_devices(in);
3439 if (in->echo_reference != NULL) {
3441 in->echo_reference->read(in->echo_reference, NULL);
3442 put_echo_reference(adev, in->echo_reference);
3443 in->echo_reference = NULL;
3446 if (in->hw_echo_reference)
3448 if (in->hw_ref_buf) {
3449 free(in->hw_ref_buf);
3450 in->hw_ref_buf = NULL;
3456 status = stop_input_stream(in);
3458 if (in->read_buf) {
3459 free(in->read_buf);
3460 in->read_buf = NULL;
3463 in->standby = 1;
3469 static int in_standby_l(struct stream_in *in)
3471 struct audio_device *adev = in->dev;
3473 pthread_mutex_lock(&in->lock);
3474 if (!in->standby) {
3476 status = do_in_standby_l(in);
3479 pthread_mutex_unlock(&in->lock);
3485 struct stream_in *in = (struct stream_in *)stream;
3486 struct audio_device *adev = in->dev;
3490 status = in_standby_l(in);
3506 struct stream_in *in = (struct stream_in *)stream;
3507 struct audio_device *adev = in->dev;
3524 pthread_mutex_lock(&in->lock);
3529 if (((int)in->source != val) && (val != 0)) {
3530 in->source = val;
3537 if (((int)in->devices != val) && (val != 0)) {
3538 in->devices = val;
3539 /* If recording is in progress, change the tx device to new device */
3540 if (!in->standby) {
3541 uc_info = get_usecase_from_id(adev, in->usecase);
3543 ALOGE("%s: Could not find the usecase (%d) in the list",
3544 __func__, in->usecase);
3546 if (list_empty(&in->pcm_dev_list))
3549 pcm_device = node_to_item(list_head(&in->pcm_dev_list),
3557 ret = do_in_standby_l(in);
3559 ret = select_devices(adev, in->usecase);
3564 pthread_mutex_unlock(&in->lock);
3588 static ssize_t read_bytes_from_dsp(struct stream_in *in, void* buffer,
3592 struct audio_device *adev = in->dev;
3594 pcm_device = node_to_item(list_head(&in->pcm_dev_list),
3606 struct stream_in *in = (struct stream_in *)stream;
3607 struct audio_device *adev = in->dev;
3615 pthread_mutex_lock(&in->lock);
3616 if (in->standby) {
3617 in->lock);
3619 pthread_mutex_lock(&in->lock);
3620 if (!in->standby) {
3625 ret = start_input_stream(in);
3631 in->standby = 0;
3635 if (!list_empty(&in->pcm_dev_list)) {
3636 if (in->usecase == USECASE_AUDIO_CAPTURE_HOTWORD) {
3637 bytes = read_bytes_from_dsp(in, buffer, bytes);
3647 frames = read_and_process_frames(in, buffer, frames_rq);
3661 pthread_mutex_unlock(&in->lock);
3664 in_standby(&in->stream.common);
3667 in->requested_rate);
3683 struct stream_in *in = (struct stream_in *)stream;
3684 struct audio_device *adev = in->dev;
3697 pthread_mutex_lock(&in->lock);
3698 pthread_mutex_lock(&in->dev->lock);
3700 if ((in->source == AUDIO_SOURCE_VOICE_COMMUNICATION) &&
3701 in->enable_aec != enable &&
3703 in->enable_aec = enable;
3704 if (!in->standby)
3705 select_devices(in->dev, in->usecase);
3708 if ( (in->num_preprocessors > MAX_PREPROCESSORS) && (enable == true) ) {
3713 in->preprocessors[in->num_preprocessors].effect_itfe = effect;
3714 /* add the supported channel of the effect in the channel_configs */
3715 in_read_audio_effect_channel_configs(in, &in->preprocessors[in->num_preprocessors]);
3716 in->num_preprocessors ++;
3718 in_update_aux_channels(in, effect);//wesley crash
3719 in->aux_channels_changed = true;
3722 if (in->num_preprocessors <= 0) {
3727 for (i=0; i < in->num_preprocessors; i++) {
3729 in->preprocessors[i - 1].effect_itfe = in->preprocessors[i].effect_itfe;
3730 in->preprocessors[i - 1].channel_configs = in->preprocessors[i].channel_configs;
3731 in->preprocessors[i - 1].num_channel_configs =
3732 in->preprocessors[i].num_channel_configs;
3736 if ( in->preprocessors[i].effect_itfe == effect ) {
3738 free(in->preprocessors[i].channel_configs);
3744 in->num_preprocessors--;
3746 in->preprocessors[in->num_preprocessors].num_channel_configs = 0;
3747 in->preprocessors[in->num_preprocessors].effect_itfe = NULL;
3748 in->preprocessors[in->num_preprocessors].channel_configs = NULL;
3749 in->aux_channels_changed = false;
3750 ALOGV("%s: enable(%d), in->aux_channels_changed(%d)", __func__, enable, in->aux_channels_changed);
3752 ALOGI("%s: num_preprocessors = %d", __func__, in->num_preprocessors);
3755 in->enable_aec = enable;
3757 if (!in->standby) {
3758 select_devices(in->dev, in->usecase);
3759 do_in_standby_l(in);
3761 if (in->enable_aec == true) {
3762 in_configure_reverse(in);
3768 pthread_mutex_unlock(&in->dev->lock);
3769 pthread_mutex_unlock(&in->lock);
4028 /* FIXME: note that the code below assumes that the speakers are in the correct placement
4172 /* NOTE: we default to built in mic which may cause a mismatch between what we
4191 struct stream_in *in;
4209 in = (struct stream_in *)calloc(1, sizeof(struct stream_in));
4211 in->stream.common.get_sample_rate = in_get_sample_rate;
4212 in->stream.common.set_sample_rate = in_set_sample_rate;
4213 in->stream.common.get_buffer_size = in_get_buffer_size;
4214 in->stream.common.get_channels = in_get_channels;
4215 in->stream.common.get_format = in_get_format;
4216 in->stream.common.set_format = in_set_format;
4217 in->stream.common.standby = in_standby;
4218 in->stream.common.dump = in_dump;
4219 in->stream.common.set_parameters = in_set_parameters;
4220 in->stream.common.get_parameters = in_get_parameters;
4221 in->stream.common.add_audio_effect = in_add_audio_effect;
4222 in->stream.common.remove_audio_effect = in_remove_audio_effect;
4223 in->stream.set_gain = in_set_gain;
4224 in->stream.read = in_read;
4225 in->stream.get_input_frames_lost = in_get_input_frames_lost;
4227 in->devices = devices;
4228 in->source = source;
4229 in->dev = adev;
4230 in->standby = 1;
4231 in->main_channels = config->channel_mask;
4232 in->requested_rate = config->sample_rate;
4235 in->input_flags = flags;
4238 in->config = pcm_profile->config;
4242 in->usecase = USECASE_AUDIO_CAPTURE_HOTWORD;
4244 in->usecase = USECASE_AUDIO_CAPTURE;
4247 *stream_in = &in->stream;
4256 struct stream_in *in = (struct stream_in*)stream;
4265 for (i=0; i<in->num_preprocessors; i++) {
4266 free(in->preprocessors[i].channel_configs);
4269 if (in->read_buf) {
4270 free(in->read_buf);
4271 in->read_buf = NULL;
4274 if (in->proc_buf_in) {
4275 free(in->proc_buf_in);
4276 in->proc_buf_in = NULL;
4279 if (in->proc_buf_out) {
4280 free(in->proc_buf_out);
4281 in->proc_buf_out = NULL;
4284 if (in->ref_buf) {
4285 free(in->ref_buf);
4286 in->ref_buf = NULL;
4289 if (in->resampler) {
4290 release_resampler(in->resampler);
4291 in->resampler = NULL;
4295 in_standby_l(in);
4430 adev->dummybuf_thread_timeout = 6000; /* in 18 sec */
4581 ALOGE("%s: Error grabbing functions in %s", __func__, SOUND_TRIGGER_HAL_LIBRARY_PATH);