[alsa-devel] Timing Info

Paul Dugas paul at dugasenterprises.com
Tue Jun 15 00:54:16 CEST 2010


On Sun, Jun 13, 2010 at 3:47 PM, Paul Dugas <paul at dugasenterprises.com> wrote:
> On Sun, Jun 13, 2010 at 10:10 AM, Clemens Ladisch <clemens at ladisch.de>
> wrote:
>>
>> Paul Dugas wrote:
>> > What's the "timestamp mode".  Does it generate a timestamp each
>> > period?  How would I access that timestamp?
>>
>> Set SND_PCM_TSTAMP_ENABLE to generate a timestamp whenever the hardware
>> position is updated.  Call snd_pcm_status to read the position and the
>> corresponding timestamp.
>
> So, does setting SND_PCM_TSTAMP_ENABLE change the meaning of the tstamp
> field in the status?  I believe I read somewhere that with TSTAMP_NONE,
> tstamp was set to "now" when readi() was called.  Does it change to meaning
> " the timestamp od the first frame returned"?  If not, where do I look?

I spun up a test program but I'm not seeing what I expect.  I'm still
missing something.

I'm calling snd_pcm_status() and snd_pcm_status_dump() before each
snd_pcm_readi() call.  I see the "trigger_time" not changing (after
the first readi call).  The "tsamp" isn't increasing in consistent
steps.  I expect it to be consistently 10,666 usecs per the
"period_time" value below.

The PCM device is configured like so:
  >  Plug PCM: Linear Integer <-> Linear Float conversion PCM (S32_LE)
  >  Its setup is:
  >    stream       : CAPTURE
  >    access       : RW_INTERLEAVED
  >    format       : FLOAT64_LE
  >    subformat    : STD
  >    channels     : 8
  >    rate         : 96000
  >    exact rate   : 96000 (96000/1)
  >    msbits       : 64
  >    buffer_size  : 32768
  >    period_size  : 1024
  >    period_time  : 10666
  >    tstamp_mode  : ENABLE
  >    period_step  : 1
  >    avail_min    : 1024
  >    period_event : 0
  >    start_threshold  : 1
  >    stop_threshold   : 32768
  >    silence_threshold: 0
  >    silence_size : 0
  >    boundary     : 4611686018427387904
  >  Slave: Route conversion PCM (sformat=S32_LE)
  >    Transformation table:
  >      0 <- 0
  >      1 <- 1
  >      2 <- none
  >      3 <- none
  >      4 <- none
  >      5 <- none
  >      6 <- none
  >      7 <- none
  >  Its setup is:
  >    stream       : CAPTURE
  >    access       : MMAP_INTERLEAVED
  >    format       : S32_LE
  >    subformat    : STD
  >    channels     : 8
  >    rate         : 96000
  >    exact rate   : 96000 (96000/1)
  >    msbits       : 32
  >    buffer_size  : 32768
  >    period_size  : 1024
  >    period_time  : 10666
  >    tstamp_mode  : ENABLE
  >    period_step  : 1
  >    avail_min    : 1024
  >    period_event : 0
  >    start_threshold  : 1
  >    stop_threshold   : 32768
  >    silence_threshold: 0
  >    silence_size : 0
  >    boundary     : 4611686018427387904
  >  Slave: Hardware PCM card 0 'HDA Intel' device 0 subdevice 0
  >  Its setup is:
  >    stream       : CAPTURE
  >    access       : MMAP_INTERLEAVED
  >    format       : S32_LE
  >    subformat    : STD
  >    channels     : 2
  >    rate         : 96000
  >    exact rate   : 96000 (96000/1)
  >    msbits       : 32
  >    buffer_size  : 32768
  >    period_size  : 1024
  >    period_time  : 10666
  >    tstamp_mode  : ENABLE
  >    period_step  : 1
  >    avail_min    : 1024
  >    period_event : 0
  >    start_threshold  : 1
  >    stop_threshold   : 32768
  >    silence_threshold: 0
  >    silence_size : 0
  >    boundary     : 4611686018427387904
  >    appl_ptr     : 0
  >    hw_ptr       : 0

Hmmm....   Not sure what to try next.

Paul


More information about the Alsa-devel mailing list