alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* hw_ptr_interrupt removal broke interrupt pointer updates
@ 2010-01-26 13:39 Clemens Ladisch
  2010-01-26 16:16 ` Jaroslav Kysela
  0 siblings, 1 reply; 9+ messages in thread
From: Clemens Ladisch @ 2010-01-26 13:39 UTC (permalink / raw)
  To: Jaroslav Kysela; +Cc: alsa-devel

Commit "cleanup & merge hw_ptr update functions" says:
> The main change is hw_ptr_interrupt variable removal to simplify code
> logic. This variable can be computed directly from hw_ptr.

The hw_ptr_interrupt variable was needed to differentiate between the
position at the last normal pointer update and the position of the last
signaled period boundary.

	if (in_interrupt) {
		/* we know that one period was processed */
		/* delta = "expected next hw_ptr" for in_interrupt != 0 */
		delta = old_hw_ptr - (old_hw_ptr % runtime->period_size)
			+ runtime->period_size;
		if (delta > new_hw_ptr) {
			hw_base += runtime->buffer_size;

It is possible for the status/delay ioctls to be called when the sound
card's pointer register alreay shows a position at the beginning of the
new period, but immediately before the interrupt is actually executed.
(This happens regularly on a SMP machine with mplayer.)  When that
happens, the code thinks that the position must be at least one period
ahead of the current position and drops an entire buffer of data.


Best regards,
Clemens

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2010-02-01 15:33 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-26 13:39 hw_ptr_interrupt removal broke interrupt pointer updates Clemens Ladisch
2010-01-26 16:16 ` Jaroslav Kysela
2010-01-27  3:09   ` Raymond Yau
2010-01-27  7:06     ` Jaroslav Kysela
2010-01-27  9:49   ` Clemens Ladisch
2010-01-27 10:11     ` Jaroslav Kysela
2010-01-27 14:12       ` Clemens Ladisch
2010-01-27 17:21         ` Jaroslav Kysela
2010-02-01 15:33           ` Colin Guthrie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).