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 */
448 * Do not handle stereo output in Multi-channel cases
449 * Stereo case is handled in normal playback path
560 usecase->devices = usecase->stream.in->device;
586 * Limitation: While in call, to do a device switch we need to disable
609 * the devices to reduce in-call device switch time.
653 static int stop_input_stream(struct stream_in *in)
657 struct audio_device *adev = in->dev;
662 in->usecase, use_case_table[in->usecase]);
663 uc_info = get_usecase_from_list(adev, in->usecase);
665 ALOGE("%s: Could not find the usecase (%d) in the list",
666 __func__, in->usecase);
683 int start_input_stream(struct stream_in *in)
688 struct audio_device *adev = in->dev;
690 ALOGV("%s: enter: usecase(%d)", __func__, in->usecase);
691 in->pcm_device_id = platform_get_pcm_device_id(in->usecase, PCM_CAPTURE);
692 if (in->pcm_device_id < 0) {
694 __func__, in->usecase);
699 adev->active_input = in;
701 uc_info->id = in->usecase;
703 uc_info->stream.in = in;
704 uc_info->devices = in->device;
709 select_devices(adev, in->usecase);
712 __func__, adev->snd_card, in->pcm_device_id, in->config.channels);
717 if (in->usecase == USECASE_AUDIO_RECORD_AFE_PROXY) {
723 in->pcm = pcm_open(adev->snd_card, in->pcm_device_id,
724 flags, &in->config);
725 if (in->pcm == NULL || !pcm_is_ready(in->pcm)) {
726 ALOGE("%s: %s", __func__, pcm_get_error(in->pcm));
727 if (in->pcm != NULL) {
728 pcm_close(in->pcm);
729 in->pcm = NULL;
745 stop_input_stream(in);
912 ALOGD("%s: voice call is active, no change in HDMI channels",
918 "no change in HDMI channels", __func__);
933 /* Check if change in HDMI channel config is allowed */
983 ALOGE("%s: Could not find the usecase (%d) in the list",
1311 * backend to the new device. Refer to check_usecases_codec_backend() in
1585 // It would be unusual for this value to be negative, but check just in case ...
1677 struct stream_in *in = (struct stream_in *)stream;
1679 return in->config.rate;
1689 struct stream_in *in = (struct stream_in *)stream;
1691 return in->config.period_size *
1697 struct stream_in *in = (struct stream_in *)stream;
1699 return in->channel_mask;
1714 struct stream_in *in = (struct stream_in *)stream;
1715 struct audio_device *adev = in->dev;
1718 pthread_mutex_lock(&in->lock);
1719 if (!in->standby) {
1721 in->standby = true;
1722 if (in->pcm) {
1723 pcm_close(in->pcm);
1724 in->pcm = NULL;
1728 status = stop_input_stream(in);
1731 pthread_mutex_unlock(&in->lock);
1743 struct stream_in *in = (struct stream_in *)stream;
1744 struct audio_device *adev = in->dev;
1756 pthread_mutex_lock(&in->lock);
1761 if ((in->source != val) && (val != 0)) {
1762 in->source = val;
1770 if (((int)in->device != val) && (val != 0)) {
1771 in->device = val;
1772 /* If recording is in progress, change the tx device to new device */
1773 if (!in->standby)
1774 status = select_devices(adev, in->usecase);
1779 pthread_mutex_unlock(&in->lock);
1800 struct stream_in *in = (struct stream_in *)stream;
1801 struct audio_device *adev = in->dev;
1804 pthread_mutex_lock(&in->lock);
1805 if (in->standby) {
1807 ret = start_input_stream(in);
1812 in->standby = 0;
1815 if (in->pcm) {
1816 if (in->usecase == USECASE_AUDIO_RECORD_AFE_PROXY) {
1817 ret = pcm_mmap_read(in->pcm, buffer, bytes);
1819 ret = pcm_read(in->pcm, buffer, bytes);
1827 if (ret == 0 && adev->mic_muted && in->usecase != USECASE_AUDIO_RECORD_AFE_PROXY)
1831 pthread_mutex_unlock(&in->lock);
1834 in_standby(&in->stream.common);
1837 in_get_sample_rate(&in->stream.common));
1851 struct stream_in *in = (struct stream_in *)stream;
1852 struct audio_device *adev = in->dev;
1860 pthread_mutex_lock(&in->lock);
1861 pthread_mutex_lock(&in->dev->lock);
1862 if ((in->source == AUDIO_SOURCE_VOICE_COMMUNICATION) &&
1863 in->enable_aec != enable &&
1865 in->enable_aec = enable;
1867 platform_set_echo_reference(in->dev, enable, AUDIO_DEVICE_NONE);
1878 if (!in->standby)
1879 select_devices(in->dev, in->usecase);
1881 if (in->enable_ns != enable &&
1883 in->enable_ns = enable;
1884 if (!in->standby)
1885 select_devices(in->dev, in->usecase);
1887 pthread_mutex_unlock(&in->dev->lock);
1888 pthread_mutex_unlock(&in->lock);
2045 * and use the one specified in audio_hw layer configuration.
2047 * and is used to set config->format in the code several lines below.
2185 // FIXME: note that the code below assumes that the speakers are in the correct placement
2349 struct stream_in *in;
2359 in = (struct stream_in *)calloc(1, sizeof(struct stream_in));
2361 pthread_mutex_init(&in->lock, (const pthread_mutexattr_t *) NULL);
2363 in->stream.common.get_sample_rate = in_get_sample_rate;
2364 in->stream.common.set_sample_rate = in_set_sample_rate;
2365 in->stream.common.get_buffer_size = in_get_buffer_size;
2366 in->stream.common.get_channels = in_get_channels;
2367 in->stream.common.get_format = in_get_format;
2368 in->stream.common.set_format = in_set_format;
2369 in->stream.common.standby = in_standby;
2370 in->stream.common.dump = in_dump;
2371 in->stream.common.set_parameters = in_set_parameters;
2372 in
2373 in->stream.common.add_audio_effect = in_add_audio_effect;
2374 in->stream.common.remove_audio_effect = in_remove_audio_effect;
2375 in->stream.set_gain = in_set_gain;
2376 in->stream.read = in_read;
2377 in->stream.get_input_frames_lost = in_get_input_frames_lost;
2379 in->device = devices;
2380 in->source = source;
2381 in->dev = adev;
2382 in->standby = 1;
2383 in->channel_mask = config->channel_mask;
2386 if (in->device == AUDIO_DEVICE_IN_TELEPHONY_RX) {
2403 in->usecase = USECASE_AUDIO_RECORD_AFE_PROXY;
2404 in->config = pcm_config_afe_proxy_record;
2406 in->usecase = USECASE_AUDIO_RECORD;
2411 in->usecase = USECASE_AUDIO_RECORD_LOW_LATENCY;
2414 in->config = pcm_config_audio_capture;
2416 frame_size = audio_stream_in_frame_size(&in->stream);
2421 in->config.period_size = buffer_size / frame_size;
2423 in->config.channels = channel_count;
2424 in->config.rate = config->sample_rate;
2427 *stream_in = &in->stream;
2432 free(in);
2462 * in order to power up the devices and read the device parameters.
2470 * In this case there are the following use cases and device ids.
2484 /* should be the usecases enabled in adev_open_input_stream() */
2489 /* should be the usecases enabled in adev_open_output_stream()*/
2524 struct stream_in in;
2542 adev->active_input = &in;
2543 memset(&in, 0, sizeof(in));
2544 in.device = audio_device;
2545 in.source = AUDIO_SOURCE_VOICE_COMMUNICATION;
2546 uc_info.stream.in = &in;
2551 out.devices = audio_device; /* only field needed in select_devices */
2558 /* select device - similar to start_(in/out)put_stream() */
2574 /* deselect device - similar to stop_(in/out)put_stream() */