Home | History | Annotate | Download | only in hal

Lines Matching defs:pcm

52 /* TODO: the following PCM device profiles could be read from a config file */
920 if (pcm_get_htimestamp(ref_device->pcm, &kernel_frames, &tstamp) < 0) {
959 if (pcm_get_htimestamp(pcm_device->pcm, &kernel_frames, &tstamp) < 0) {
1011 in->ref_buf = (int16_t *)realloc(in->ref_buf, pcm_frames_to_bytes(pcm_device->pcm, frames));
1015 in->ref_buf, pcm_frames_to_bytes(pcm_device->pcm, frames));
1182 ALOGE("%s: Could not find PCM device id for the usecase(%d)",
1197 ref_device->pcm = pcm_open(ref_device->pcm_profile->card, ref_device->pcm_profile->id, PCM_IN | PCM_MONOTONIC, &ref_device->pcm_profile->config);
1199 if (ref_device->pcm && !pcm_is_ready(ref_device->pcm)) {
1200 ALOGE("%s: %s", __func__, pcm_get_error(ref_device->pcm));
1201 pcm_close(ref_device->pcm);
1202 ref_device->pcm = NULL;
1228 status = pcm_get_htimestamp(pcm_device->pcm, &kernel_frames, &buffer->time_stamp);
1238 kernel_frames = pcm_get_buffer_size(pcm_device->pcm) - kernel_frames;
1540 /* This function reads PCM data and:
1571 ALOGE("%s: pcm device list empty", __func__);
1587 size_t size_in_bytes = pcm_frames_to_bytes(pcm_device->pcm, frames);
1667 size_t size_in_bytes = pcm_frames_to_bytes(pcm_device->pcm, frames);
1731 size_t size_in_bytes = pcm_frames_to_bytes(pcm_device->pcm, in->config.period_size);
1739 in->read_status = pcm_read(pcm_device->pcm, (void*)in->read_buf, size_in_bytes);
1770 size_hw_ref_bytes = pcm_frames_to_bytes(ref_device->pcm, ref_device->pcm_profile->config.period_size);
1781 read_status = pcm_read(ref_device->pcm, (void*)in->hw_ref_buf, size_hw_ref_bytes);
1831 ALOGE("%s: pcm device list empty", __func__);
1845 pcm_frames_to_bytes(pcm_device->pcm, frames_wr)),
1855 pcm_frames_to_bytes(pcm_device->pcm, frames_wr),
1857 pcm_frames_to_bytes(pcm_device->pcm, buf.frame_count));
1909 ALOGE("%s: pcm device list empty", __func__);
1942 ALOGE("%s: Could not find PCM device id for the usecase(%d)",
2032 /* Open the PCM device.
2036 ALOGV("%s: Opening PCM device card_id(%d) device_id(%d), channels %d, smp rate %d format %d, \
2047 pcm_device->pcm = NULL;
2057 pcm_device->pcm = pcm_open(pcm_device->pcm_profile->card, pcm_device->pcm_profile->id,
2060 if (pcm_device->pcm && !pcm_is_ready(pcm_device->pcm)) {
2061 ALOGE("%s: %s", __func__, pcm_get_error(pcm_device->pcm));
2062 pcm_close(pcm_device->pcm);
2063 pcm_device->pcm = NULL;
2286 if (pcm_device->pcm) {
2287 pcm_close(pcm_device->pcm);
2288 pcm_device->pcm = NULL;
2311 ALOGV("%s: Opening PCM device card_id(%d) device_id(%d)",
2314 pcm_device->pcm = pcm_open(pcm_device->pcm_profile->card, pcm_device->pcm_profile->id,
2317 if (pcm_device->pcm && !pcm_is_ready(pcm_device->pcm)) {
2318 ALOGE("%s: %s", __func__, pcm_get_error(pcm_device->pcm));
2319 pcm_device->pcm = NULL;
2324 * If the stream rate differs from the PCM rate, we need to
3054 if (pcm_device->pcm) {
3069 calloc(pcm_frames_to_bytes(pcm_device->pcm, out->config.period_size),
3074 // reopen pcm with stop_threshold = INT_MAX/2
3079 if (pcm_device->pcm)
3080 pcm_close(pcm_device->pcm);
3083 pcm_device->pcm = pcm_open(pcm_device->pcm_profile->card,
3086 if (pcm_device->pcm != NULL && pcm_is_ready(pcm_device->pcm))
3092 ALOGE("%s: failed to reopen pcm device", __func__);
3094 if (pcm_device->pcm) {
3096 pcm_write(pcm_device->pcm, (void *)data,
3097 pcm_frames_to_bytes(pcm_device->pcm,
3111 // reopen pcm with normal stop_threshold
3112 if (pcm_device->pcm)
3113 pcm_close(pcm_device->pcm);
3116 pcm = pcm_open(pcm_device->pcm_profile->card,
3119 if (pcm_device->pcm != NULL && pcm_is_ready(pcm_device->pcm))
3125 ALOGE("%s: failed to reopen pcm device, error return", __func__);
3134 ALOGVV("%s: writing buffer (%d bytes) to pcm device", __func__, bytes);
3137 pcm_write(pcm_device->pcm, (void *)pcm_device->res_buffer,
3140 pcm_device->status = pcm_write(pcm_device->pcm, (void *)buffer, bytes);
3155 if (pcm_device->pcm && pcm_device->status != 0)
3156 ALOGE("%s: error %zd - %s", __func__, ret, pcm_get_error(pcm_device->pcm));
3248 if (pcm_get_htimestamp(pcm_device->pcm, &avail, timestamp) == 0) {
3414 if (pcm_device->pcm)
3415 pcm_close(pcm_device->pcm);
3416 pcm_device->pcm = NULL;
3547 ALOGE("%s: pcm device list empty", __func__);
3642 * Read PCM and:
4044 /* only update the selected device if there is active pcm playback */
4331 struct pcm *pcm = NULL;
4347 pcm = pcm_open(profile->card, profile->id,
4349 if (pcm != NULL && !pcm_is_ready(pcm)) {
4351 pcm_close(pcm);
4352 pcm = NULL;
4365 if (pcm) {
4366 pcm_close(pcm);
4367 pcm = NULL;
4377 if (pcm) {
4382 pcm_write(pcm, (void *)data, DEEP_BUFFER_OUTPUT_PERIOD_SIZE * 8);
4389 pcm = pcm_open(profile->card, profile->id,
4391 if (pcm != NULL && !pcm_is_ready(pcm)) {
4393 pcm_close(pcm);
4394 pcm = NULL;
4403 if (pcm) {
4405 pcm_close(pcm);
4411 pcm = NULL;
4500 /* Set the default route before the PCM stream is opened */