Can i set timestamp in ALSA?

811 views Asked by At

I am developing one application in which i need to play audio packets as per timestamp. For this i need to tell alsa driver at what timestamp my audio packet should get played. For this i need to set the timestamp of ALSA.

I could find the alsa api to get the timestamp (snd_pcm_status_get_tstamp()) at which the audio packet are getting played.

void gettimestamp(snd_pcm_t *handle, snd_timestamp_t *timestamp)
{
    int err;
    snd_pcm_status_t *status;
    snd_pcm_status_alloca(&status);
    if ((err = snd_pcm_status(handle, status)) < 0) {
        printf("Stream status error: %s\n", snd_strerror(err));
        exit(0);
    }
    snd_pcm_status_get_tstamp (status, timestamp);
}

I could not find any api to set the timestamp.

Please help!!

1

There are 1 answers

3
CL. On

You could not find any API to set the timestamp because there is none.