[alsa-devel] how to update hw_ptr and appl_ptr
Hi developer,
I recently look the function snd_pcm_update_hw_ptr0 want to find how to update status->hw_ptr and control->appl_ptr. If you have to know this, can you tell me? Thank you very much.
-- Best Regards, Zhen Fu
Zhen Fu wrote:
I recently look the function snd_pcm_update_hw_ptr0 want to find how to update status->hw_ptr and control->appl_ptr.
status->hw_ptr is updated by snd_pcm_update_hw_ptr0. control->appl_ptr is updated by snd_pcm_lib_write1.
Why are you asking?
Regards, Clemens
Yes, I know this. I want to know how about updated by snd_pcm_update_hw_ptr0.
-- Best Regards, Zhen Fu
-----Original Message----- From: Clemens Ladisch [mailto:clemens@ladisch.de] Sent: Tuesday, June 26, 2012 5:35 PM To: Zhen Fu Cc: alsa-devel@alsa-project.org Subject: Re: [alsa-devel] how to update hw_ptr and appl_ptr
Zhen Fu wrote:
I recently look the function snd_pcm_update_hw_ptr0 want to find how to update status->hw_ptr and control->appl_ptr.
status->hw_ptr is updated by snd_pcm_update_hw_ptr0. control->appl_ptr is updated by snd_pcm_lib_write1.
Why are you asking?
Regards, Clemens
I recently write squ driver and when DMA handler called snd_pcm_period_elapsed, so I want to know how about update hw_ptr in ALSA.
-- Best Regards, Zhen Fu
-----Original Message----- From: Clemens Ladisch [mailto:clemens@ladisch.de] Sent: Tuesday, June 26, 2012 5:35 PM To: Zhen Fu Cc: alsa-devel@alsa-project.org Subject: Re: [alsa-devel] how to update hw_ptr and appl_ptr
Zhen Fu wrote:
I recently look the function snd_pcm_update_hw_ptr0 want to find how to update status->hw_ptr and control->appl_ptr.
status->hw_ptr is updated by snd_pcm_update_hw_ptr0. control->appl_ptr is updated by snd_pcm_lib_write1.
Why are you asking?
Regards, Clemens
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
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@ladisch.de] Sent: Tuesday, June 26, 2012 8:27 PM To: Zhen Fu Cc: alsa-devel@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
A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in e-mail?
Zhen Fu wrote:
Because when I use aplay playback wav file, appear underrun phenomenon. So I want to ALSA driver how to handle xrun.
The most likely reason is that the .pointer callback returns wrong values.
Regards, Clemens
participants (2)
-
Clemens Ladisch
-
Zhen Fu