Lines Matching defs:out
45 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
147 * following order: hw device > out stream
224 static int start_output_stream(struct stream_out *out)
226 struct audio_device *adev = out->dev;
239 out->pcm_config.channels,
240 out->pcm_config.rate,
241 out->pcm_config.period_size,
242 out->pcm_config.period_count,
243 out->pcm_config.format);
245 out->pcm_config.start_threshold = 0;
246 out->pcm_config.stop_threshold = 0;
247 out->pcm_config.silence_threshold = 0;
260 out->pcm = pcm_open(adev->card, adev->device, PCM_OUT, &out->pcm_config);
262 if (out->pcm && !pcm_is_ready(out->pcm)) {
263 ALOGE("pcm_open() failed: %s", pcm_get_error(out->pcm));
264 pcm_close(out->pcm);
269 activePcm = out->pcm;
270 activeChannel = out->pcm_config.channels;
272 ALOGV("Initialized PCM device for channels %d handle = %d",out->pcm_config.channels, (int)activePcm);
281 struct stream_out *out = (struct stream_out *)stream;
282 return out->pcm_config.rate;
295 struct stream_out *out = (struct stream_out *)stream;
298 if(out->channel_mask > 2){
299 buf_size = out->pcm_config.period_size *
303 buf_size = out->pcm_config.period_size *
304 out->pcm_config.period_count *
316 out->pcm_config.period_size,
325 struct stream_out *out = (struct stream_out *)stream;
326 ALOGV("%s channel mask : %x",__func__,out->channel_mask);
327 return out->channel_mask;
347 struct stream_out *out = (struct stream_out *)stream;
349 ALOGV("%s enter standby = %d",__func__,out->standby);
351 pthread_mutex_lock(&out->dev->lock);
352 pthread_mutex_lock(&out->lock);
354 if (!out->standby && activePcm) {
356 out->pcm = NULL;
357 out->standby = true;
362 pthread_mutex_unlock(&out->lock);
363 pthread_mutex_unlock(&out->dev->lock);
378 struct stream_out *out = (struct stream_out *)stream;
379 struct audio_device *adev = out->dev;
472 struct stream_out *out = (struct stream_out *)stream;
473 struct audio_device *adev = out->dev;
495 struct stream_out *out = (struct stream_out *)stream;
496 struct audio_device *adev = out->dev;
512 out_read_edid(out);
549 struct stream_out *out = (struct stream_out *)stream;
550 return (out->pcm_config.period_size * out->pcm_config.period_count * 1000) /
568 struct stream_out *out = (struct stream_out *)stream;
572 ALOGV("%s enter for bytes = %d channels = %d",__func__,bytes, out->pcm_config.channels);
574 pthread_mutex_lock(&out->dev->lock);
575 pthread_mutex_lock(&out->lock);
579 out->standby = true;
582 if (out->standby) {
583 ret = start_output_stream(out);
587 out->standby = false;
590 if((!out->pcm) || (activeChannel != out->pcm_config.channels)){
595 if(Get_SinkSupported_format() == out->pcm_config.format){
601 pthread_mutex_unlock(&out->lock);
602 pthread_mutex_unlock(&out->dev->lock);
613 ret = pcm_write(out->pcm, (void *)dstbuff, outbytes);
616 ret = pcm_write(out->pcm, (void *)buffer, bytes);
618 ALOGV("pcm_write: %s done for %d input bytes, output bytes = %d ", pcm_get_error(out->pcm),bytes,outbytes);
623 pthread_mutex_unlock(&out->lock);
624 pthread_mutex_unlock(&out->dev->lock);
685 struct stream_out *out;
689 out = (struct stream_out *)calloc(1, sizeof(struct stream_out));
690 if (!out)
694 out->dev = adev;
695 out->channel_mask = AUDIO_CHANNEL_OUT_STEREO;
704 out_read_edid(out);
716 out->channel_mask = config->channel_mask;
718 out->pcm_config.channels = popcount(config->channel_mask);
719 out->pcm_config.rate = config->sample_rate;
720 out->pcm_config.period_size = pcm_config_default.period_size;
721 out->pcm_config.period_count = pcm_config_default.period_count;
722 out->pcm_config.format = pcm_config_default.format;
724 out->stream.common.get_sample_rate = out_get_sample_rate;
725 out->stream.common.set_sample_rate = out_set_sample_rate;
726 out->stream.common.get_buffer_size = out_get_buffer_size;
727 out->stream.common.get_channels = out_get_channels;
728 out->stream.common.get_format = out_get_format;
729 out->stream.common.set_format = out_set_format;
730 out->stream.common.standby = out_standby;
731 out->stream.common.dump = out_dump;
732 out->stream.common.set_parameters = out_set_parameters;
733 out->stream.common.get_parameters = out_get_parameters;
734 out->stream.common.add_audio_effect = out_add_audio_effect;
735 out->stream.common.remove_audio_effect = out_remove_audio_effect;
736 out->stream.get_latency = out_get_latency;
737 out->stream.set_volume = out_set_volume;
738 out->stream.write = out_write;
739 out->stream.get_render_position = out_get_render_position;
740 out->stream.get_next_write_timestamp = out_get_next_write_timestamp;
742 config->format = out_get_format(&out->stream.common);
743 config->channel_mask = out_get_channels(&out->stream.common);
744 config->sample_rate = out_get_sample_rate(&out->stream.common);
746 out->standby = true;
751 pthread_mutex_lock(&out->dev->lock);
752 pthread_mutex_lock(&out->lock);
755 ALOGV("Closing already open tiny alsa stream %d",(int)out->pcm);
759 ret = start_output_stream(out);
765 out->standby = false;
767 *stream_out = &out->stream;
769 pthread_mutex_unlock(&out->lock);
770 pthread_mutex_unlock(&out->dev->lock);
777 pthread_mutex_unlock(&out->lock);
778 pthread_mutex_unlock(&out->dev->lock);
779 free(out);
789 struct stream_out *out = (struct stream_out *)stream;
792 out->standby = false;