Home | History | Annotate | Download | only in usbaudio

Lines Matching defs:out

237  * following order: hw device > out stream
241 * OUT functions
257 const struct stream_out* out = (const struct stream_out*)stream;
259 proxy_get_period_size(&out->proxy) * audio_stream_out_frame_size(&(out->stream));
265 const struct stream_out *out = (const struct stream_out*)stream;
266 return audio_channel_out_mask_from_count(out->hal_channel_count);
287 struct stream_out *out = (struct stream_out *)stream;
289 pthread_mutex_lock(&out->dev->lock);
290 pthread_mutex_lock(&out->lock);
292 if (!out->standby) {
293 proxy_close(&out->proxy);
294 out->standby = true;
297 pthread_mutex_unlock(&out->lock);
298 pthread_mutex_unlock(&out->dev->lock);
310 ALOGV("usb:audio_hw::out out_set_parameters() keys:%s", kvpairs);
312 struct stream_out *out = (struct stream_out *)stream;
322 pthread_mutex_lock(&out->dev->lock);
323 pthread_mutex_lock(&out->lock);
333 if (card >= 0 && device >= 0 && !profile_is_cached_for(out->profile, card, device)) {
335 if (!out->standby)
338 int saved_card = out->profile->card;
339 int saved_device = out->profile->device;
340 out->profile->card = card;
341 out->profile->device = device;
342 ret_value = profile_read_device_info(out->profile) ? 0 : -EINVAL;
344 out->profile->card = saved_card;
345 out->profile->device = saved_device;
350 pthread_mutex_unlock(&out->lock);
351 pthread_mutex_unlock(&out->dev->lock);
359 struct stream_out *out = (struct stream_out *)stream;
360 pthread_mutex_lock(&out->dev->lock);
361 pthread_mutex_lock(&out->lock);
363 char * params_str = device_get_parameters(out->profile, keys);
365 pthread_mutex_unlock(&out->lock);
366 pthread_mutex_unlock(&out->dev->lock);
383 static int start_output_stream(struct stream_out *out)
385 ALOGV("usb:audio_hw::out start_output_stream(card:%d device:%d)",
386 out->profile->card, out->profile->device);
388 return proxy_open(&out->proxy);
394 struct stream_out *out = (struct stream_out *)stream;
396 pthread_mutex_lock(&out->dev->lock);
397 pthread_mutex_lock(&out->lock);
398 if (out->standby) {
399 ret = start_output_stream(out);
401 pthread_mutex_unlock(&out->dev->lock);
404 out->standby = false;
406 pthread_mutex_unlock(&out->dev->lock);
408 alsa_device_proxy* proxy = &out->proxy;
412 const int num_req_channels = out->hal_channel_count; /* what we told AudioFlinger */
417 if (required_conversion_buffer_size > out->conversion_buffer_size) {
418 out->conversion_buffer_size = required_conversion_buffer_size;
419 out->conversion_buffer = realloc(out->conversion_buffer,
420 out->conversion_buffer_size);
423 const audio_format_t audio_format = out_get_format(&(out->stream.common));
427 out->conversion_buffer, num_device_channels,
429 write_buff = out->conversion_buffer;
433 proxy_write(&out->proxy, write_buff, num_write_buff_bytes);
436 pthread_mutex_unlock(&out->lock);
441 pthread_mutex_unlock(&out->lock);
485 ALOGV("usb:audio_hw::out adev_open_output_stream() handle:0x%X, device:0x%X, flags:0x%X",
490 struct stream_out *out;
492 out
493 if (!out)
497 out->stream.common.get_sample_rate = out_get_sample_rate;
498 out->stream.common.set_sample_rate = out_set_sample_rate;
499 out->stream.common.get_buffer_size = out_get_buffer_size;
500 out->stream.common.get_channels = out_get_channels;
501 out->stream.common.get_format = out_get_format;
502 out->stream.common.set_format = out_set_format;
503 out->stream.common.standby = out_standby;
504 out->stream.common.dump = out_dump;
505 out->stream.common.set_parameters = out_set_parameters;
506 out->stream.common.get_parameters = out_get_parameters;
507 out->stream.common.add_audio_effect = out_add_audio_effect;
508 out->stream.common.remove_audio_effect = out_remove_audio_effect;
509 out->stream.get_latency = out_get_latency;
510 out->stream.set_volume = out_set_volume;
511 out->stream.write = out_write;
512 out->stream.get_render_position = out_get_render_position;
513 out->stream.get_presentation_position = out_get_presentation_position;
514 out->stream.get_next_write_timestamp = out_get_next_write_timestamp;
516 out->dev = adev;
518 out->profile = &adev->out_profile;
528 proxy_config.rate = config->sample_rate = profile_get_default_sample_rate(out->profile);
529 } else if (profile_is_sample_rate_valid(out->profile, config->sample_rate)) {
532 proxy_config.rate = config->sample_rate = profile_get_default_sample_rate(out->profile);
538 proxy_config.format = profile_get_default_format(out->profile);
542 if (profile_is_format_valid(out->profile, fmt)) {
545 proxy_config.format = profile_get_default_format(out->profile);
552 unsigned proposed_channel_count = profile_get_default_channel_count(out->profile);
560 out->hal_channel_count = proposed_channel_count;
565 proxy_prepare(&out->proxy, out->profile, &proxy_config);
570 out->conversion_buffer = NULL;
571 out->conversion_buffer_size = 0;
573 out->standby = true;
575 *stream_out = &out->stream;
580 free(out);
588 ALOGV("usb:audio_hw::out adev_close_output_stream()");
589 struct stream_out *out = (struct stream_out *)stream;
594 free(out->conversion_buffer);
596 out->conversion_buffer = NULL;
597 out->conversion_buffer_size = 0;
797 * OK, we need to figure out how much data to read to be able to output the requested