aboutsummaryrefslogtreecommitdiffstats
path: root/sound/firewire/amdtp.c
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2012-05-13 12:49:14 -0400
committerTakashi Iwai <tiwai@suse.de>2012-05-14 04:43:36 -0400
commite9148dddc3c7b6121300319c3e31f9380d459be8 (patch)
tree42ce7e28e71caaa277fee3b1d21a378f0e8b835e /sound/firewire/amdtp.c
parent76fb87894828756e069a43ce55f775a6c893a53d (diff)
ALSA: firewire-lib: flush completed packets when reading PCM position
By flushing all completed but not yet reported packets before reading the PCM hardware position, the granularity of the pointer is improved from the interrupt interval to the packet size. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire/amdtp.c')
-rw-r--r--sound/firewire/amdtp.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/sound/firewire/amdtp.c b/sound/firewire/amdtp.c
index 3284ee9c1ec..c2685fbd736 100644
--- a/sound/firewire/amdtp.c
+++ b/sound/firewire/amdtp.c
@@ -532,6 +532,20 @@ err_unlock:
532EXPORT_SYMBOL(amdtp_out_stream_start); 532EXPORT_SYMBOL(amdtp_out_stream_start);
533 533
534/** 534/**
535 * amdtp_out_stream_pcm_pointer - get the PCM buffer position
536 * @s: the AMDTP output stream that transports the PCM data
537 *
538 * Returns the current buffer position, in frames.
539 */
540unsigned long amdtp_out_stream_pcm_pointer(struct amdtp_out_stream *s)
541{
542 fw_iso_context_flush_completions(s->context);
543
544 return ACCESS_ONCE(s->pcm_buffer_pointer);
545}
546EXPORT_SYMBOL(amdtp_out_stream_pcm_pointer);
547
548/**
535 * amdtp_out_stream_update - update the stream after a bus reset 549 * amdtp_out_stream_update - update the stream after a bus reset
536 * @s: the AMDTP output stream 550 * @s: the AMDTP output stream
537 */ 551 */