提交 e9148ddd 编写于 作者: C Clemens Ladisch 提交者: Takashi Iwai

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: NClemens Ladisch <clemens@ladisch.de>
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
上级 76fb8789
......@@ -531,6 +531,20 @@ int amdtp_out_stream_start(struct amdtp_out_stream *s, int channel, int speed)
}
EXPORT_SYMBOL(amdtp_out_stream_start);
/**
* amdtp_out_stream_pcm_pointer - get the PCM buffer position
* @s: the AMDTP output stream that transports the PCM data
*
* Returns the current buffer position, in frames.
*/
unsigned long amdtp_out_stream_pcm_pointer(struct amdtp_out_stream *s)
{
fw_iso_context_flush_completions(s->context);
return ACCESS_ONCE(s->pcm_buffer_pointer);
}
EXPORT_SYMBOL(amdtp_out_stream_pcm_pointer);
/**
* amdtp_out_stream_update - update the stream after a bus reset
* @s: the AMDTP output stream
......
......@@ -84,6 +84,7 @@ void amdtp_out_stream_stop(struct amdtp_out_stream *s);
void amdtp_out_stream_set_pcm_format(struct amdtp_out_stream *s,
snd_pcm_format_t format);
void amdtp_out_stream_pcm_prepare(struct amdtp_out_stream *s);
unsigned long amdtp_out_stream_pcm_pointer(struct amdtp_out_stream *s);
void amdtp_out_stream_pcm_abort(struct amdtp_out_stream *s);
/**
......@@ -140,18 +141,6 @@ static inline void amdtp_out_stream_pcm_trigger(struct amdtp_out_stream *s,
ACCESS_ONCE(s->pcm) = pcm;
}
/**
* amdtp_out_stream_pcm_pointer - get the PCM buffer position
* @s: the AMDTP output stream that transports the PCM data
*
* Returns the current buffer position, in frames.
*/
static inline unsigned long
amdtp_out_stream_pcm_pointer(struct amdtp_out_stream *s)
{
return ACCESS_ONCE(s->pcm_buffer_pointer);
}
static inline bool cip_sfc_is_base_44100(enum cip_sfc sfc)
{
return sfc & 1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册