Lines Matching refs:sync_ptr
395 struct snd_pcm_sync_ptr *sync_ptr = pcm->sync_ptr;
398 sync_ptr->s.status.hw_ptr,
400 sync_ptr->c.control.appl_ptr);
403 long avail = sync_ptr->s.status.hw_ptr - sync_ptr->c.control.appl_ptr;
408 long avail = sync_ptr->s.status.hw_ptr - sync_ptr->c.control.appl_ptr + ((pcm->flags & PCM_MONO) ? pcm->buffer_size/2 : pcm->buffer_size/4);
417 int sync_ptr(struct pcm *pcm)
420 err = ioctl(pcm->fd, SNDRV_PCM_IOCTL_SYNC_PTR, pcm->sync_ptr);
458 struct snd_pcm_sync_ptr *sync_ptr = pcm->sync_ptr;
461 appl_ptr = (pcm->flags & PCM_MONO) ? sync_ptr->c.control.appl_ptr*2 : sync_ptr->c.control.appl_ptr*4;
470 struct snd_pcm_sync_ptr *sync_ptr = pcm->sync_ptr;
491 struct snd_pcm_sync_ptr *sync_ptr = pcm->sync_ptr;
497 unsigned int tmp = (pcm->flags & PCM_MONO) ? sync_ptr->c.control.appl_ptr*2 : sync_ptr->c.control.appl_ptr*4;
530 pcm->sync_ptr->flags = SNDRV_PCM_SYNC_PTR_APPL | SNDRV_PCM_SYNC_PTR_AVAIL_MIN;
531 err = sync_ptr(pcm);
533 ALOGE("Failed in sync_ptr\n");
539 pcm->sync_ptr->c.control.appl_ptr += frames;
540 pcm->sync_ptr->flags = 0;
542 err = sync_ptr(pcm);
544 ALOGE("Failed in sync_ptr 2 \n");
550 bytes_written = pcm->sync_ptr->c.control.appl_ptr - pcm->sync_ptr->s.status.hw_ptr;
746 if (pcm->sync_ptr)
747 free(pcm->sync_ptr);
811 pcm->sync_ptr = calloc(1, sizeof(struct snd_pcm_sync_ptr));
812 if (!pcm->sync_ptr) {
820 free(pcm->sync_ptr);
829 free(pcm->sync_ptr);