[alsa-devel] No stream timing info with alsa pulse plugin?

Raymond Yau superquad.vortex2 at gmail.com
Tue Feb 3 02:40:23 CET 2015


2015-1-27 上午3:33 於 "sqweek" <sqweek at gmail.com> 寫道:
>
> Hi guys,
>
> I discovered on my machine that alsa_snd_pcm_status_get_tstamp (and
> also get_htstamp) stop working when my asoundrc invokes the pulse
> plugin.
>
> That is, normally they work fine but once the sound is going via pulse
> the returned time stamp is always zero. I'm trying to understand why
> that is.
>
> I couldn't really find any discussion of the pulse plugin on the
> archives so I'm not entirely sure I've found the right list; I was
> directed here via the pulseaudio bugzilla[1].
>
> [1] https://bugs.freedesktop.org/show_bug.cgi?id=88503
>

http://git.alsa-project.org/?p=alsa-lib.git;a=commitdiff;h=65ff6fdafb705b5e2e6d4b9a94a80e5de89f5de1;hp=9b716075de4f2f7f15e428ee7efaa8960ef45b9c#patch14
448,7 +448,7 @@ static int snd_pcm_ioplug_start(snd_pcm_t *pcm)
        if (err < 0)
                return err;

-       gettimestamp(&io->trigger_tstamp, pcm->monotonic);
+       gettimestamp(&io->trigger_tstamp, pcm->tstamp_type);
        io->data->state = SND_PCM_STATE_RUNNING;

        return 0;
@@ -463,7 +463,7 @@ static int snd_pcm_ioplug_drop(snd_pcm_t *pcm)

        io->data->callback->stop(io->data);

-       gettimestamp(&io->trigger_tstamp, pcm->monotonic);
+       gettimestamp(&io->trigger_tstamp, pcm->tstamp_type);
        io->data->state = SND_PCM_STATE_SETUP;

        return 0;
@@ -1069,7 +1069,10 @@ int snd_pcm_ioplug_reinit_status(snd_pcm_ioplug_t
*ioplug)
{
        ioplug->pcm->poll_fd = ioplug->poll_fd;
        ioplug->pcm->poll_events = ioplug->poll_events;
-       ioplug->pcm->monotonic = (ioplug->flags &
SND_PCM_IOPLUG_FLAG_MONOTONIC) != 0;
+       if (ioplug->flags & SND_PCM_IOPLUG_FLAG_MONOTONIC)
+               ioplug->pcm->tstamp_type = SND_PCM_TSTAMP_TYPE_MONOTONIC;
+       else
+               ioplug->pcm->tstamp_type = SND_PCM_TSTAMP_TYPE_GETTIMEOFDAY;
        ioplug->pcm->mmap_rw = ioplug->mmap_rw;
        return 0;
}

Although time stamp was enabled in pcm_ioplug.c , it does not implies all
those io plugin really support time stamp

Is this a bug ?


More information about the Alsa-devel mailing list