Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] ALSA: firewire-lib: report extra delay of PCM runtime
@ 2023-01-10 13:49 Takashi Sakamoto
  2023-01-10 13:49 ` [PATCH 1/3] ALSA: firewire-lib: move parameter for pcm frame multiplier from context payload processing layer Takashi Sakamoto
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Takashi Sakamoto @ 2023-01-10 13:49 UTC (permalink / raw)
  To: tiwai; +Cc: alsa-devel, clemens

For reasons, all drivers in ALSA firewire stack have never reported extra
delay for the runtime of PCM substream. The main reason is that the
meaning of extra delay differs depending on driver design. Another
technical reason is that no kernel API was provided to know the current
hardware time.

I realized that the extra delay is helpful to user space PCM applications
in the case of packet-oriented drivers since the drivers have a gap
between the current transmission cycle and the latest transmission cycle
to which the packet is processed (for PCM capture) or scheduled (for PCM
playback). The amount of PCM frames delivered during the gap is usually
invisible from the application as is in reported delay.

A commit baa914cd81f5 ("firewire: add kernel API to access CYCLE_TIME
register") was already merged into Linux kernel v5.19 or later, and the
unit drivers can read hardware time and calculate the current isochronous
cycle. Moreover, a commit f0117128879b ("ALSA: firewire-lib: keep history
to process isochronous packet") enables to keep the recent history of
packets, including cycle count and data block count.

It is ready at last. This patchset adds computation of the extra delay.

Takashi Sakamoto (3):
  ALSA: firewire-lib: move parameter for pcm frame multiplier from
    context payload processing layer
  ALSA: firewire-lib: obsolete return value from context payload
    processing layer
  ALSA: firewire-lib: compute extra delay for runtime of PCM substream

 sound/firewire/amdtp-am824.c         |  50 +++++--------
 sound/firewire/amdtp-stream.c        | 108 +++++++++++++++++++++++++--
 sound/firewire/amdtp-stream.h        |  12 +--
 sound/firewire/digi00x/amdtp-dot.c   |  18 ++---
 sound/firewire/fireface/amdtp-ff.c   |  18 ++---
 sound/firewire/motu/amdtp-motu.c     |  18 ++---
 sound/firewire/tascam/amdtp-tascam.c |  18 ++---
 7 files changed, 146 insertions(+), 96 deletions(-)

-- 
2.37.2


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

end of thread, other threads:[~2023-01-12 11:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-10 13:49 [PATCH 0/3] ALSA: firewire-lib: report extra delay of PCM runtime Takashi Sakamoto
2023-01-10 13:49 ` [PATCH 1/3] ALSA: firewire-lib: move parameter for pcm frame multiplier from context payload processing layer Takashi Sakamoto
2023-01-10 13:49 ` [PATCH 2/3] ALSA: firewire-lib: obsolete return value " Takashi Sakamoto
2023-01-10 13:49 ` [PATCH 3/3] ALSA: firewire-lib: compute extra delay for runtime of PCM substream Takashi Sakamoto
2023-01-12 11:15 ` [PATCH 0/3] ALSA: firewire-lib: report extra delay of PCM runtime Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox