[alsa-devel] Help required with debugging

Jaroslav Kysela perex at perex.cz
Thu Jul 2 10:08:35 CEST 2009

On Thu, 2 Jul 2009, Harsha, Priya wrote:

> Why is runtime->hw_ptr_jiffies updated in hw_ptr()? This should be only 
> updated in the interrupt context right?

The idea of hw_ptr_jiffies is to have a check if real-time clock in sync 
with the DMA buffer position. If your hardware does block transfers and is 
not able to return fine position in period set SNDRV_PCM_INFO_BATCH flag. 
But it's rather a workaround than a proper fix, because timestamps are 
updated but the ring buffer position is not moved (which brokes the idea 
to have a relation between the ring buffer position and the real-time 

I think that this sort of drivers might require to implement the 
SNDRV_PCM_POS_KEEP return value in case when position does not change from 
last read to notify midlevel PCM code that they're not able to handle fine 
pointer resolution.

Also, hardware with large FIFOs should update properly runtime->delay 
value now.


Jaroslav Kysela <perex at perex.cz>
Linux Kernel Sound Maintainer
ALSA Project, Red Hat, Inc.

More information about the Alsa-devel mailing list