All of lore.kernel.org
 help / color / mirror / Atom feed
* ALSA calling pcm_pointer excessively?
@ 2012-05-10 16:06 Russell King - ARM Linux
  2012-05-10 16:29 ` Russell King - ARM Linux
                   ` (2 more replies)
  0 siblings, 3 replies; 21+ messages in thread
From: Russell King - ARM Linux @ 2012-05-10 16:06 UTC (permalink / raw)
  To: alsa-devel, Mark Brown

I'm wondering what is causing ALSA to behave as follows - I have a 64KiB
buffer, which is divided up into 4 16KiB periods.  The log below is from
my soc-dmaengine.c code which supports audio on the Assabet (as we don't
have cyclic DMA support there yet.)

I'm just trying to sort out the DMA engine tx_status residue code, and
am using this as proof that its working.

However, it seems that ALSA for whatever reason likes to hammer away at
the pcm_pointer callback from time to time:

soc_dmaengine_pointer: index 3 stat 1 residue 0018 cookie 3cfe pos 10000 bytes ffe8
soc_dmaengine_pointer: index 3 stat 1 residue 0008 cookie 3cfe pos 10000 bytes fff8
soc_dmaengine_callback: complete
soc_dmaengine_pointer: index 0 stat 1 residue 3ff0 cookie 3cff pos 4000 bytes 0010
soc_dmaengine_submit: submitting index 3 size 4000 cookie 3d02
soc_dmaengine_pointer: index 0 stat 1 residue 3fd0 cookie 3cff pos 4000 bytes 0030
soc_dmaengine_pointer: index 0 stat 1 residue 17b8 cookie 3cff pos 4000 bytes 2848
soc_dmaengine_pointer: index 0 stat 1 residue 1770 cookie 3cff pos 4000 bytes 2890
soc_dmaengine_pointer: index 0 stat 1 residue 1768 cookie 3cff pos 4000 bytes 2898
soc_dmaengine_pointer: index 0 stat 1 residue 1758 cookie 3cff pos 4000 bytes 28a8
soc_dmaengine_pointer: index 0 stat 1 residue 1748 cookie 3cff pos 4000 bytes 28b8
soc_dmaengine_pointer: index 0 stat 1 residue 1740 cookie 3cff pos 4000 bytes 28c0
soc_dmaengine_pointer: index 0 stat 1 residue 1730 cookie 3cff pos 4000 bytes 28d0
soc_dmaengine_pointer: index 0 stat 1 residue 1720 cookie 3cff pos 4000 bytes 28e0
soc_dmaengine_pointer: index 0 stat 1 residue 1718 cookie 3cff pos 4000 bytes 28e8
...
soc_dmaengine_pointer: index 0 stat 1 residue 0018 cookie 3cff pos 4000 bytes 3fe8
soc_dmaengine_pointer: index 0 stat 1 residue 0008 cookie 3cff pos 4000 bytes 3ff8
soc_dmaengine_callback: complete
soc_dmaengine_pointer: index 1 stat 1 residue 3ff0 cookie 3d00 pos 8000 bytes 4010
soc_dmaengine_submit: submitting index 0 size 4000 cookie 3d03
soc_dmaengine_pointer: index 1 stat 1 residue 3fd0 cookie 3d00 pos 8000 bytes 4030
soc_dmaengine_pointer: index 1 stat 1 residue 3b28 cookie 3d00 pos 8000 bytes 44d8
soc_dmaengine_pointer: index 1 stat 1 residue 3b10 cookie 3d00 pos 8000 bytes 44f0
soc_dmaengine_pointer: index 1 stat 1 residue 3b00 cookie 3d00 pos 8000 bytes 4500

'pos' is the end of the current DMA buffer ((index + 1) * period_byte_size)
'residue' is the value returned from tx_status
'bytes' is the value passed into bytes_to_frames() to return from my
pcm_pointer function.

The question is - what would cause ALSA to hammer away at the buffer
like that - checking it every 16 or 8 DMA bytes transferred?  I'm also
seeing around 75% system CPU time, which really isn't good.

The above was captured while aplay was running, with no apparant audio
corruption.

Any ideas?

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

end of thread, other threads:[~2012-05-11 17:07 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-10 16:06 ALSA calling pcm_pointer excessively? Russell King - ARM Linux
2012-05-10 16:29 ` Russell King - ARM Linux
2012-05-10 17:05   ` Clemens Ladisch
2012-05-10 17:13     ` Clemens Ladisch
2012-05-10 18:18       ` Russell King - ARM Linux
2012-05-10 18:43         ` Clemens Ladisch
2012-05-10 23:09           ` Russell King - ARM Linux
2012-05-10 17:47     ` Jassi Brar
2012-05-11 13:31     ` Takashi Iwai
2012-05-11 14:02       ` Russell King - ARM Linux
2012-05-11 14:17         ` Takashi Iwai
2012-05-11 15:04           ` Russell King - ARM Linux
2012-05-11 16:31             ` Takashi Iwai
2012-05-11 16:38               ` Russell King - ARM Linux
2012-05-11 17:07                 ` Takashi Iwai
2012-05-10 16:34 ` Trent Piepho
2012-05-10 16:42   ` Russell King - ARM Linux
2012-05-10 17:00 ` Jassi Brar
2012-05-10 17:04   ` Trent Piepho
2012-05-10 17:04   ` Russell King - ARM Linux
2012-05-10 17:18     ` Jassi Brar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.