[alsa-devel] how to update hw_ptr and appl_ptr

Zhen Fu fuzh at marvell.com
Wed Jun 27 05:13:31 CEST 2012


Because when I use aplay playback wav file, appear underrun phenomenon. So I want to ALSA driver how to handle xrun.

--
Best Regards,
Zhen Fu

-----Original Message-----
From: Clemens Ladisch [mailto:clemens at ladisch.de] 
Sent: Tuesday, June 26, 2012 8:27 PM
To: Zhen Fu
Cc: alsa-devel at alsa-project.org
Subject: Re: [alsa-devel] how to update hw_ptr and appl_ptr

Zhen Fu wrote:
> when DMA handler called snd_pcm_period_elapsed, so I want to know how
> about update hw_ptr in ALSA.

snd_pcm_period_elapsed() calls snd_pcm_update_hw_ptr0(), which calls
your driver's .pointer callback.  The value returned by that callback
essentially is the hw_ptr (although it doesn't wrap around at the end
of the buffer).

Why do you care about hw_ptr?


Regards,
Clemens


More information about the Alsa-devel mailing list