• Home
  • Raw
  • Download

Lines Matching refs:out

239 static int start_output_stream(struct stream_out *out)  in start_output_stream()  argument
241 struct audio_device *adev = out->dev; in start_output_stream()
255 out->pcm_config.channels, in start_output_stream()
256 out->pcm_config.rate, in start_output_stream()
257 out->pcm_config.period_size, in start_output_stream()
258 out->pcm_config.period_count, in start_output_stream()
259 out->pcm_config.format); in start_output_stream()
261 out->pcm_config.start_threshold = 0; in start_output_stream()
262 out->pcm_config.stop_threshold = 0; in start_output_stream()
263 out->pcm_config.silence_threshold = 0; in start_output_stream()
276 out->pcm = pcm_open(adev->card, adev->device, PCM_OUT, &out->pcm_config); in start_output_stream()
278 if (out->pcm && !pcm_is_ready(out->pcm)) { in start_output_stream()
279 ALOGE("pcm_open() failed: %s", pcm_get_error(out->pcm)); in start_output_stream()
280 pcm_close(out->pcm); in start_output_stream()
285 activePcm = out->pcm; in start_output_stream()
286 activeChannel = out->pcm_config.channels; in start_output_stream()
288 …ALOGV("Initialized PCM device for channels %d handle = %d",out->pcm_config.channels, (int)activePc… in start_output_stream()
297 struct stream_out *out = (struct stream_out *)stream; in out_get_sample_rate() local
298 return out->pcm_config.rate; in out_get_sample_rate()
311 struct stream_out *out = (struct stream_out *)stream; in out_get_buffer_size() local
314 if(out->channel_mask > 2){ in out_get_buffer_size()
315 buf_size = out->pcm_config.period_size * in out_get_buffer_size()
319 buf_size = out->pcm_config.period_size * in out_get_buffer_size()
320 out->pcm_config.period_count * in out_get_buffer_size()
332 out->pcm_config.period_size, in out_get_buffer_size()
341 struct stream_out *out = (struct stream_out *)stream; in out_get_channels() local
342 ALOGV("%s channel mask : %x",__func__,out->channel_mask); in out_get_channels()
343 return out->channel_mask; in out_get_channels()
363 struct stream_out *out = (struct stream_out *)stream; in out_standby() local
365 ALOGV("%s enter standby = %d",__func__,out->standby); in out_standby()
367 pthread_mutex_lock(&out->dev->lock); in out_standby()
368 pthread_mutex_lock(&out->lock); in out_standby()
370 if (!out->standby && activePcm) { in out_standby()
372 out->pcm = NULL; in out_standby()
373 out->standby = true; in out_standby()
378 pthread_mutex_unlock(&out->lock); in out_standby()
379 pthread_mutex_unlock(&out->dev->lock); in out_standby()
394 struct stream_out *out = (struct stream_out *)stream; in out_set_parameters() local
395 struct audio_device *adev = out->dev; in out_set_parameters()
489 struct stream_out *out = (struct stream_out *)stream; in out_read_edid() local
490 struct audio_device *adev = out->dev; in out_read_edid()
512 struct stream_out *out = (struct stream_out *)stream; in out_get_parameters() local
513 struct audio_device *adev = out->dev; in out_get_parameters()
529 out_read_edid(out); in out_get_parameters()
566 struct stream_out *out = (struct stream_out *)stream; in out_get_latency() local
567 return (out->pcm_config.period_size * out->pcm_config.period_count * 1000) / in out_get_latency()
585 struct stream_out *out = (struct stream_out *)stream; in out_write() local
589 ALOGV("%s enter for bytes = %d channels = %d",__func__,bytes, out->pcm_config.channels); in out_write()
591 pthread_mutex_lock(&out->dev->lock); in out_write()
592 pthread_mutex_lock(&out->lock); in out_write()
596 out->standby = true; in out_write()
599 if (out->standby) { in out_write()
600 ret = start_output_stream(out); in out_write()
604 out->standby = false; in out_write()
607 if((!out->pcm) || (activeChannel != out->pcm_config.channels)){ in out_write()
612 if(Get_SinkSupported_format() == out->pcm_config.format){ in out_write()
618 pthread_mutex_unlock(&out->lock); in out_write()
619 pthread_mutex_unlock(&out->dev->lock); in out_write()
630 ret = pcm_write(out->pcm, (void *)dstbuff, outbytes); in out_write()
633 ret = pcm_write(out->pcm, (void *)buffer, bytes); in out_write()
635 …ALOGV("pcm_write: %s done for %d input bytes, output bytes = %d ", pcm_get_error(out->pcm),bytes,o… in out_write()
640 pthread_mutex_unlock(&out->lock); in out_write()
641 pthread_mutex_unlock(&out->dev->lock); in out_write()
702 struct stream_out *out; in adev_open_output_stream() local
706 out = (struct stream_out *)calloc(1, sizeof(struct stream_out)); in adev_open_output_stream()
707 if (!out) in adev_open_output_stream()
711 out->dev = adev; in adev_open_output_stream()
712 out->channel_mask = AUDIO_CHANNEL_OUT_STEREO; in adev_open_output_stream()
721 out_read_edid(out); in adev_open_output_stream()
733 out->channel_mask = config->channel_mask; in adev_open_output_stream()
735 out->pcm_config.channels = popcount(config->channel_mask); in adev_open_output_stream()
736 out->pcm_config.rate = config->sample_rate; in adev_open_output_stream()
737 out->pcm_config.period_size = pcm_config_default.period_size; in adev_open_output_stream()
738 out->pcm_config.period_count = pcm_config_default.period_count; in adev_open_output_stream()
739 out->pcm_config.format = pcm_config_default.format; in adev_open_output_stream()
741 out->stream.common.get_sample_rate = out_get_sample_rate; in adev_open_output_stream()
742 out->stream.common.set_sample_rate = out_set_sample_rate; in adev_open_output_stream()
743 out->stream.common.get_buffer_size = out_get_buffer_size; in adev_open_output_stream()
744 out->stream.common.get_channels = out_get_channels; in adev_open_output_stream()
745 out->stream.common.get_format = out_get_format; in adev_open_output_stream()
746 out->stream.common.set_format = out_set_format; in adev_open_output_stream()
747 out->stream.common.standby = out_standby; in adev_open_output_stream()
748 out->stream.common.dump = out_dump; in adev_open_output_stream()
749 out->stream.common.set_parameters = out_set_parameters; in adev_open_output_stream()
750 out->stream.common.get_parameters = out_get_parameters; in adev_open_output_stream()
751 out->stream.common.add_audio_effect = out_add_audio_effect; in adev_open_output_stream()
752 out->stream.common.remove_audio_effect = out_remove_audio_effect; in adev_open_output_stream()
753 out->stream.get_latency = out_get_latency; in adev_open_output_stream()
754 out->stream.set_volume = out_set_volume; in adev_open_output_stream()
755 out->stream.write = out_write; in adev_open_output_stream()
756 out->stream.get_render_position = out_get_render_position; in adev_open_output_stream()
757 out->stream.get_next_write_timestamp = out_get_next_write_timestamp; in adev_open_output_stream()
759 config->format = out_get_format(&out->stream.common); in adev_open_output_stream()
760 config->channel_mask = out_get_channels(&out->stream.common); in adev_open_output_stream()
761 config->sample_rate = out_get_sample_rate(&out->stream.common); in adev_open_output_stream()
763 out->standby = true; in adev_open_output_stream()
768 pthread_mutex_lock(&out->dev->lock); in adev_open_output_stream()
769 pthread_mutex_lock(&out->lock); in adev_open_output_stream()
772 ALOGV("Closing already open tiny alsa stream %d",(int)out->pcm); in adev_open_output_stream()
776 ret = start_output_stream(out); in adev_open_output_stream()
782 out->standby = false; in adev_open_output_stream()
784 *stream_out = &out->stream; in adev_open_output_stream()
786 pthread_mutex_unlock(&out->lock); in adev_open_output_stream()
787 pthread_mutex_unlock(&out->dev->lock); in adev_open_output_stream()
794 pthread_mutex_unlock(&out->lock); in adev_open_output_stream()
795 pthread_mutex_unlock(&out->dev->lock); in adev_open_output_stream()
796 free(out); in adev_open_output_stream()
806 struct stream_out *out = (struct stream_out *)stream; in adev_close_output_stream() local
809 out->standby = false; in adev_close_output_stream()