aboutsummaryrefslogtreecommitdiffstats
path: root/sound/firewire/amdtp.h
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.h
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.h')
-rw-r--r--sound/firewire/amdtp.h13
1 files changed, 1 insertions, 12 deletions
diff --git a/sound/firewire/amdtp.h b/sound/firewire/amdtp.h
index 4987f826f9f3..3f13ff63c5d2 100644
--- a/sound/firewire/amdtp.h
+++ b/sound/firewire/amdtp.h
@@ -84,6 +84,7 @@ void amdtp_out_stream_stop(struct amdtp_out_stream *s);
84void amdtp_out_stream_set_pcm_format(struct amdtp_out_stream *s, 84void amdtp_out_stream_set_pcm_format(struct amdtp_out_stream *s,
85 snd_pcm_format_t format); 85 snd_pcm_format_t format);
86void amdtp_out_stream_pcm_prepare(struct amdtp_out_stream *s); 86void amdtp_out_stream_pcm_prepare(struct amdtp_out_stream *s);
87unsigned long amdtp_out_stream_pcm_pointer(struct amdtp_out_stream *s);
87void amdtp_out_stream_pcm_abort(struct amdtp_out_stream *s); 88void amdtp_out_stream_pcm_abort(struct amdtp_out_stream *s);
88 89
89/** 90/**
@@ -140,18 +141,6 @@ static inline void amdtp_out_stream_pcm_trigger(struct amdtp_out_stream *s,
140 ACCESS_ONCE(s->pcm) = pcm; 141 ACCESS_ONCE(s->pcm) = pcm;
141} 142}
142 143
143/**
144 * amdtp_out_stream_pcm_pointer - get the PCM buffer position
145 * @s: the AMDTP output stream that transports the PCM data
146 *
147 * Returns the current buffer position, in frames.
148 */
149static inline unsigned long
150amdtp_out_stream_pcm_pointer(struct amdtp_out_stream *s)
151{
152 return ACCESS_ONCE(s->pcm_buffer_pointer);
153}
154
155static inline bool cip_sfc_is_base_44100(enum cip_sfc sfc) 144static inline bool cip_sfc_is_base_44100(enum cip_sfc sfc)
156{ 145{
157 return sfc & 1; 146 return sfc & 1;