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