Lines Matching refs:pcm
374 out->pcm, &out->config); in register_out_stream()
394 in->pcm, in register_in_stream()
1588 if (in->pcm == NULL || !pcm_is_ready(in->pcm)) { in start_input_stream()
1592 ret = pcm_start(in->pcm); in start_input_stream()
1612 in->pcm = pcm_open(adev->snd_card, in->pcm_device_id, in start_input_stream()
1614 if (in->pcm == NULL || !pcm_is_ready(in->pcm)) { in start_input_stream()
1615 ALOGE("%s: %s", __func__, pcm_get_error(in->pcm)); in start_input_stream()
1616 if (in->pcm != NULL) { in start_input_stream()
1617 pcm_close(in->pcm); in start_input_stream()
1618 in->pcm = NULL; in start_input_stream()
1631 ret = pcm_prepare(in->pcm); in start_input_stream()
1634 pcm_close(in->pcm); in start_input_stream()
1635 in->pcm = NULL; in start_input_stream()
1639 ret = pcm_start(in->pcm); in start_input_stream()
1642 pcm_close(in->pcm); in start_input_stream()
1643 in->pcm = NULL; in start_input_stream()
2095 out->pcm = NULL; in start_output_stream()
2113 if (out->pcm == NULL || !pcm_is_ready(out->pcm)) { in start_output_stream()
2117 ret = pcm_start(out->pcm); in start_output_stream()
2134 out->pcm = pcm_open(adev->snd_card, out->pcm_device_id, in start_output_stream()
2136 if (out->pcm == NULL || !pcm_is_ready(out->pcm)) { in start_output_stream()
2137 ALOGE("%s: %s", __func__, pcm_get_error(out->pcm)); in start_output_stream()
2138 if (out->pcm != NULL) { in start_output_stream()
2139 pcm_close(out->pcm); in start_output_stream()
2140 out->pcm = NULL; in start_output_stream()
2152 if (pcm_is_ready(out->pcm)) { in start_output_stream()
2153 ret = pcm_prepare(out->pcm); in start_output_stream()
2156 pcm_close(out->pcm); in start_output_stream()
2157 out->pcm = NULL; in start_output_stream()
2162 ret = pcm_start(out->pcm); in start_output_stream()
2165 pcm_close(out->pcm); in start_output_stream()
2166 out->pcm = NULL; in start_output_stream()
2361 if (out->pcm) { in out_standby_l()
2362 pcm_close(out->pcm); in out_standby_l()
2363 out->pcm = NULL; in out_standby_l()
3035 if (out->pcm) { in out_write()
3062 ret = pcm_mmap_write(out->pcm, (void *)buffer, bytes_to_write); in out_write()
3064 ret = pcm_write(out->pcm, (void *)buffer, bytes_to_write); in out_write()
3082 ALOGE_IF(out->pcm != NULL, in out_write()
3083 "%s: error %zd - %s", __func__, ret, pcm_get_error(out->pcm)); in out_write()
3167 if (out->pcm) { in out_get_presentation_position()
3169 if (pcm_get_htimestamp(out->pcm, &avail, timestamp) == 0) { in out_get_presentation_position()
3282 out->playback_started && out->pcm != NULL) { in out_stop()
3283 pcm_stop(out->pcm); in out_stop()
3300 !out->playback_started && out->pcm != NULL) { in out_start()
3369 out->pcm = pcm_open(adev->snd_card, out->pcm_device_id, in out_create_mmap_buffer()
3371 if (out->pcm == NULL || !pcm_is_ready(out->pcm)) { in out_create_mmap_buffer()
3376 ret = pcm_mmap_begin(out->pcm, &info->shared_memory_address, &offset1, &frames1); in out_create_mmap_buffer()
3381 info->buffer_size_frames = pcm_get_buffer_size(out->pcm); in out_create_mmap_buffer()
3382 buffer_size = pcm_frames_to_bytes(out->pcm, info->buffer_size_frames); in out_create_mmap_buffer()
3390 info->shared_memory_fd = pcm_get_poll_fd(out->pcm); in out_create_mmap_buffer()
3401 ret = pcm_mmap_commit(out->pcm, 0, MMAP_PERIOD_SIZE); in out_create_mmap_buffer()
3415 if (out->pcm == NULL) { in out_create_mmap_buffer()
3418 ALOGE("%s: %s %s", __func__, step, pcm_get_error(out->pcm)); in out_create_mmap_buffer()
3419 pcm_close(out->pcm); in out_create_mmap_buffer()
3420 out->pcm = NULL; in out_create_mmap_buffer()
3439 out->pcm == NULL) { in out_get_mmap_position()
3445 ret = pcm_mmap_get_hw_ptr(out->pcm, (unsigned int *)&position->position_frames, &ts); in out_get_mmap_position()
3447 ALOGE("%s: %s", __func__, pcm_get_error(out->pcm)); in out_get_mmap_position()
3522 if (in->pcm) { in in_standby()
3523 pcm_close(in->pcm); in in_standby()
3524 in->pcm = NULL; in in_standby()
3764 long ns = pcm_bytes_to_frames(in->pcm, bytes)*1000000000LL/ in in_read()
3769 if (in->pcm) { in in_read()
3771 ret = pcm_mmap_read(in->pcm, buffer, bytes); in in_read()
3773 ret = pcm_read(in->pcm, buffer, bytes); in in_read()
3844 ALOGE_IF(in->pcm != NULL && !in->is_st_session, in in_get_capture_position()
3848 if (in->pcm) { in in_get_capture_position()
3851 if (pcm_get_htimestamp(in->pcm, &avail, ×tamp) == 0) { in in_get_capture_position()
3934 in->capture_started && in->pcm != NULL) { in in_stop()
3935 pcm_stop(in->pcm); in in_stop()
3952 !in->capture_started && in->pcm != NULL) { in in_start()
4004 in->pcm = pcm_open(adev->snd_card, in->pcm_device_id, in in_create_mmap_buffer()
4006 if (in->pcm == NULL || !pcm_is_ready(in->pcm)) { in in_create_mmap_buffer()
4012 ret = pcm_mmap_begin(in->pcm, &info->shared_memory_address, &offset1, &frames1); in in_create_mmap_buffer()
4017 info->buffer_size_frames = pcm_get_buffer_size(in->pcm); in in_create_mmap_buffer()
4018 buffer_size = pcm_frames_to_bytes(in->pcm, info->buffer_size_frames); in in_create_mmap_buffer()
4026 info->shared_memory_fd = pcm_get_poll_fd(in->pcm); in in_create_mmap_buffer()
4038 ret = pcm_mmap_commit(in->pcm, 0, MMAP_PERIOD_SIZE); in in_create_mmap_buffer()
4052 if (in->pcm == NULL) { in in_create_mmap_buffer()
4055 ALOGE("%s: %s %s", __func__, step, pcm_get_error(in->pcm)); in in_create_mmap_buffer()
4056 pcm_close(in->pcm); in in_create_mmap_buffer()
4057 in->pcm = NULL; in in_create_mmap_buffer()
4076 in->pcm == NULL) { in in_get_mmap_position()
4081 ret = pcm_mmap_get_hw_ptr(in->pcm, (unsigned int *)&position->position_frames, &ts); in in_get_mmap_position()
4083 ALOGE("%s: %s", __func__, pcm_get_error(in->pcm)); in in_get_mmap_position()