16 Dec
2012
16 Dec
'12
3:13 p.m.
Yes,when buffer_size wraped the 'pos' is smallar than last one.If we want to confirm the hw_base need to adjust there must be consider another confidition:
hdelta = jiffies - runtime->hw_ptr_jiffies;
if (hdelta > runtime->hw_ptr_buffer_jiffies/2)
how to connect this code with checking unnormal interrupt(lost or delayed)?
This condition is for the double interrupt acknowledge problems (see comment). It makes sure, that the DMA buffer position was wrapped using another external timing source. Indeed, it's mostly a lowlevel driver fault to call this pointer update routine with the in_interrupt flag when the period was not really elapsed.
But,why alsa use the specific value 'runtime->hw_ptr_buffer_jiffies/2' to compare with hdelta than other?