[alsa-devel] how this will happen about hw_ptr_buffer_jiffies?

l9jj l9jj at 163.com
Tue Dec 11 12:58:46 CET 2012


recently,i am tracing the process into the snd_pcm_update_hw_ptr0() and find the statement. i do not understand when the 

if (hdelta > runtime->hw_ptr_buffer_jiffies/2) 
(1)will happen?
(2)and the reason?
(3)the other question is if the dma interrupt will can enter the snd_pcm_update_hw_ptr0() every time when it ocurrs?


thanks for any suggestion.
Best Regards
L9jj


=====================code start==============================>
if (in_interrupt) {
                   /* we know that one period was processed */


                   /* delta = "expected next hw_ptr" for in_interrupt != 0 */


                   delta = runtime->hw_ptr_interrupt + runtime->period_size;


                   if (delta > new_hw_ptr) {


                            /* check for double acknowledged interrupts */


                            hdelta = jiffies - runtime->hw_ptr_jiffies;


                            if (hdelta > runtime->hw_ptr_buffer_jiffies/2) {


                                     hw_base += runtime->buffer_size;


                                     if (hw_base >= runtime->boundary)


                                               hw_base = 0;


                                     new_hw_ptr = hw_base + pos;


                                     goto __delta;


                            }


                   }


<=====================code end============================





--
------------------------------------
 l9jj
Regards


More information about the Alsa-devel mailing list