[alsa-devel] Timer instability
Clive Messer
clive at vacuumtube.org.uk
Wed Feb 25 19:34:31 CET 2009
On Wednesday 25 Feb 2009 18:13:47 Takashi Iwai wrote:
> > > diff --git a/src/pcm/pcm_hw.c b/src/pcm/pcm_hw.c
> > > index e9ce092..5211d1c 100644
> > > --- a/src/pcm/pcm_hw.c
> > > +++ b/src/pcm/pcm_hw.c
> > > @@ -131,6 +131,10 @@ struct timespec snd_pcm_hw_fast_tstamp(snd_pcm_t
> > > *pcm) static int sync_ptr1(snd_pcm_hw_t *hw, unsigned int flags)
> > > {
> > > int err;
> > > + long old_hwptr, new_hwptr;
> > > + long old_applptr, new_applptr;
> > > + old_hwptr = hw->sync_ptr->s.status.hw_ptr;
> > > + old_applptr = hw->sync_ptr->c.control.appl_ptr;
> > > hw->sync_ptr->flags = flags;
> > > err = ioctl((hw)->fd, SNDRV_PCM_IOCTL_SYNC_PTR,
> > > (hw)->sync_ptr); if (err < 0) {
> > > @@ -138,6 +142,11 @@ static int sync_ptr1(snd_pcm_hw_t *hw, unsigned
> > > int flags) SYSMSG("SNDRV_PCM_IOCTL_SYNC_PTR failed");
> > > return err;
> > > }
> > > + new_hwptr = hw->sync_ptr->s.status.hw_ptr;
> > > + new_applptr = hw->sync_ptr->c.control.appl_ptr;
> > > + printf("sync_ptr1: %ld(%ld), %ld(%ld)\n",
> > > + new_hwptr, new_hwptr - old_hwptr,
> > > + new_applptr, new_applptr - old_applptr);
> > > return 0;
> > > }
> > >
With sync_ptr I cannot reproduce the very large numbers. Here's a typical log.
(Attached).
Regards
Clive
--
Clive Messer <clive at vacuumtube.org.uk>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sync.log
Type: text/x-log
Size: 5088 bytes
Desc: not available
Url : http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20090225/8a7103ed/attachment-0001.log
More information about the Alsa-devel
mailing list