mirror of
https://github.com/openharmony/third_party_tinyalsa.git
synced 2026-07-19 15:24:22 -04:00
Tinyalsa: add pcm_delay()
ALSA supports reporting of pcm_delay, make that availble to the users of tinyalsa too Change-Id: Ic460f5c55137d263fdf7b142503d3bd52c4b7ebd Signed-off-by: Hardik T Shah <hardik.t.shah@intel.com> Signed-off-by: Apelete Seketeli <apeletex.seketeli@intel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
This commit is contained in:
committed by
Vinod Koul
parent
84889d0fa6
commit
9ecb93fb6b
@@ -205,6 +205,9 @@ int pcm_stop(struct pcm *pcm);
|
||||
int pcm_wait(struct pcm *pcm, int timeout);
|
||||
|
||||
|
||||
/* Get the pcm delay */
|
||||
long pcm_get_delay(struct pcm *pcm);
|
||||
|
||||
/*
|
||||
* MIXER API
|
||||
*/
|
||||
|
||||
@@ -170,6 +170,7 @@ struct pcm {
|
||||
struct snd_pcm_sync_ptr *sync_ptr;
|
||||
void *mmap_buffer;
|
||||
unsigned int noirq_frames_per_msec;
|
||||
long pcm_delay;
|
||||
};
|
||||
|
||||
unsigned int pcm_get_buffer_size(struct pcm *pcm)
|
||||
@@ -1046,3 +1047,11 @@ int pcm_mmap_read(struct pcm *pcm, void *data, unsigned int count)
|
||||
|
||||
return pcm_mmap_transfer(pcm, data, count);
|
||||
}
|
||||
|
||||
long pcm_get_delay(struct pcm *pcm)
|
||||
{
|
||||
if (ioctl(pcm->fd, SNDRV_PCM_IOCTL_DELAY, &pcm->pcm_delay) < 0)
|
||||
return -1;
|
||||
|
||||
return pcm->pcm_delay;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user