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
57 /* ToDo: Check and update a proper value in msec */
461 * Do not handle stereo output in Multi-channel cases
462 * Stereo case is handled in normal playback path
572 usecase->devices = usecase->stream.in->device;
597 * Limitation: While in call, to do a device switch we need to disable
620 * the devices to reduce in-call device switch time.
664 static int stop_input_stream(struct stream_in *in)
668 struct audio_device *adev = in->dev;
673 in->usecase, use_case_table[in->usecase]);
674 uc_info = get_usecase_from_list(adev, in->usecase);
676 ALOGE("%s: Could not find the usecase (%d) in the list",
677 __func__, in->usecase);
694 int start_input_stream(struct stream_in *in)
699 struct audio_device *adev = in->dev;
701 ALOGV("%s: enter: usecase(%d)", __func__, in->usecase);
702 in->pcm_device_id = platform_get_pcm_device_id(in->usecase, PCM_CAPTURE);
703 if (in->pcm_device_id < 0) {
705 __func__, in->usecase);
710 adev->active_input = in;
712 uc_info->id = in->usecase;
714 uc_info->stream.in = in;
715 uc_info->devices = in->device;
720 select_devices(adev, in->usecase);
723 __func__, adev->snd_card, in->pcm_device_id, in->config.channels);
728 if (in->usecase == USECASE_AUDIO_RECORD_AFE_PROXY) {
734 in->pcm = pcm_open(adev->snd_card, in->pcm_device_id,
735 flags, &in->config);
736 if (in->pcm == NULL || !pcm_is_ready(in->pcm)) {
737 ALOGE("%s: %s", __func__, pcm_get_error(in->pcm));
738 if (in->pcm != NULL) {
739 pcm_close(in->pcm);
740 in->pcm = NULL;
756 stop_input_stream(in);
920 ALOGD("%s: voice call is active, no change in HDMI channels",
926 "no change in HDMI channels", __func__);
941 /* Check if change in HDMI channel config is allowed */
991 ALOGE("%s: Could not find the usecase (%d) in the list",
1319 * backend to the new device. Refer to check_usecases_codec_backend() in
1593 // It would be unusual for this value to be negative, but check just in case ...
1685 struct stream_in *in = (struct stream_in *)stream;
1687 return in->config.rate;
1697 struct stream_in *in = (struct stream_in *)stream;
1699 return in->config.period_size *
1705 struct stream_in *in = (struct stream_in *)stream;
1707 return in->channel_mask;
1722 struct stream_in *in = (struct stream_in *)stream;
1723 struct audio_device *adev = in->dev;
1726 pthread_mutex_lock(&in->lock);
1727 if (!in->standby) {
1729 in->standby = true;
1730 if (in->pcm) {
1731 pcm_close(in->pcm);
1732 in->pcm = NULL;
1736 status = stop_input_stream(in);
1739 pthread_mutex_unlock(&in->lock);
1751 struct stream_in *in = (struct stream_in *)stream;
1752 struct audio_device *adev = in->dev;
1764 pthread_mutex_lock(&in->lock);
1769 if ((in->source != val) && (val != 0)) {
1770 in->source = val;
1778 if (((int)in->device != val) && (val != 0)) {
1779 in->device = val;
1780 /* If recording is in progress, change the tx device to new device */
1781 if (!in->standby)
1782 status = select_devices(adev, in->usecase);
1787 pthread_mutex_unlock(&in->lock);
1808 struct stream_in *in = (struct stream_in *)stream;
1809 struct audio_device *adev = in->dev;
1812 pthread_mutex_lock(&in->lock);
1813 if (in->standby) {
1815 ret = start_input_stream(in);
1820 in->standby = 0;
1823 if (in->pcm) {
1824 if (in->usecase == USECASE_AUDIO_RECORD_AFE_PROXY) {
1825 ret = pcm_mmap_read(in->pcm, buffer, bytes);
1827 ret = pcm_read(in->pcm, buffer, bytes);
1835 if (ret == 0 && adev->mic_muted && in->usecase != USECASE_AUDIO_RECORD_AFE_PROXY)
1839 pthread_mutex_unlock(&in->lock);
1842 in_standby(&in->stream.common);
1845 in_get_sample_rate(&in->stream.common));
1859 struct stream_in *in = (struct stream_in *)stream;
1860 struct audio_device *adev = in->dev;
1868 pthread_mutex_lock(&in->lock);
1869 pthread_mutex_lock(&in->dev->lock);
1870 if ((in->source == AUDIO_SOURCE_VOICE_COMMUNICATION) &&
1871 in->enable_aec != enable &&
1873 in->enable_aec = enable;
1875 platform_set_echo_reference(in->dev, enable, AUDIO_DEVICE_NONE);
1886 if (!in->standby)
1887 select_devices(in->dev, in->usecase);
1889 if (in->enable_ns != enable &&
1891 in->enable_ns = enable;
1892 if (!in->standby)
1893 select_devices(in->dev, in->usecase);
1895 pthread_mutex_unlock(&in->dev->lock);
1896 pthread_mutex_unlock(&in->lock);
2054 * and use the one specified in audio_hw layer configuration.
2056 * and is used to set config->format in the code several lines below.
2194 // FIXME: note that the code below assumes that the speakers are in the correct placement
2358 struct stream_in *in;
2368 in = (struct stream_in *)calloc(1, sizeof(struct stream_in));
2370 pthread_mutex_init(&in->lock, (const pthread_mutexattr_t *) NULL);
2372 in->stream.common.get_sample_rate = in_get_sample_rate;
2373 in->stream.common.set_sample_rate = in_set_sample_rate;
2374 in->stream.common.get_buffer_size = in_get_buffer_size;
2375 in->stream.common.get_channels = in_get_channels;
2376 in->stream.common.get_format = in_get_format;
2377 in->stream.common.set_format = in_set_format;
2378 in->stream.common.standby = in_standby;
2379 in->stream.common.dump = in_dump;
2380 in->stream.common.set_parameters = in_set_parameters;
2381 in->stream.common.get_parameters = in_get_parameters;
2382 in
2383 in->stream.common.remove_audio_effect = in_remove_audio_effect;
2384 in->stream.set_gain = in_set_gain;
2385 in->stream.read = in_read;
2386 in->stream.get_input_frames_lost = in_get_input_frames_lost;
2388 in->device = devices;
2389 in->source = source;
2390 in->dev = adev;
2391 in->standby = 1;
2392 in->channel_mask = config->channel_mask;
2395 if (in->device == AUDIO_DEVICE_IN_TELEPHONY_RX) {
2412 in->usecase = USECASE_AUDIO_RECORD_AFE_PROXY;
2413 in->config = pcm_config_afe_proxy_record;
2415 in->usecase = USECASE_AUDIO_RECORD;
2420 in->usecase = USECASE_AUDIO_RECORD_LOW_LATENCY;
2423 in->config = pcm_config_audio_capture;
2425 frame_size = audio_stream_in_frame_size(&in->stream);
2430 in->config.period_size = buffer_size / frame_size;
2432 in->config.channels = channel_count;
2433 in->config.rate = config->sample_rate;
2436 *stream_in = &in->stream;
2441 free(in);
2471 * in order to power up the devices and read the device parameters.
2479 * In this case there are the following use cases and device ids.
2493 /* should be the usecases enabled in adev_open_input_stream() */
2498 /* should be the usecases enabled in adev_open_output_stream()*/
2533 struct stream_in in;
2551 adev->active_input = &in;
2552 memset(&in, 0, sizeof(in));
2553 in.device = audio_device;
2554 in.source = AUDIO_SOURCE_VOICE_COMMUNICATION;
2555 uc_info.stream.in = &in;
2560 out.devices = audio_device; /* only field needed in select_devices */
2567 /* select device - similar to start_(in/out)put_stream() */
2583 /* deselect device - similar to stop_(in/out)put_stream() */