All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Sakamoto <o-takashi@sakamocchi.jp>
To: clemens@ladisch.de, tiwai@suse.de
Cc: alsa-devel@alsa-project.org
Subject: [alsa-devel] [PATCH 12/12] ALSA: firewire-lib: tune the minimum available size of PCM period
Date: Fri, 18 Oct 2019 00:54:24 +0900	[thread overview]
Message-ID: <20191017155424.885-13-o-takashi@sakamocchi.jp> (raw)
In-Reply-To: <20191017155424.885-1-o-takashi@sakamocchi.jp>

In IEC 61883-1/6, one isoc packet can transfer events up to the value of
syt interval. This comes from the interval of isoc cycle. As 1394 OHCI
controller can generate hardware IRQ per isoc packet, the interval is
calculated as 125 usec.

In IEC 61883-1/6, two ways of transmission is described; blocking and
non-blocking methods. In blocking method, the sequence of packet includes
'empty' or 'NODATA' packets which include no events. In non-blocking
method, the number of events per packet is variable up to the syt
interval.

This commit uses double of the value of syt interval as minimum available
size of PCM period due to the above protocol design.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
---
 sound/firewire/amdtp-stream.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/sound/firewire/amdtp-stream.c b/sound/firewire/amdtp-stream.c
index 8a7818130382..7486eec4d958 100644
--- a/sound/firewire/amdtp-stream.c
+++ b/sound/firewire/amdtp-stream.c
@@ -213,9 +213,21 @@ int amdtp_stream_add_pcm_hw_constraints(struct amdtp_stream *s,
 	maximum_usec_per_period = USEC_PER_SEC * PAGE_SIZE /
 				  CYCLES_PER_SECOND / ctx_header_size;
 
+	// In IEC 61883-6, one isoc packet can transfer events up to the value
+	// of syt interval. This comes from the interval of isoc cycle. As 1394
+	// OHCI controller can generate hardware IRQ per isoc packet, the
+	// interval is 125 usec.
+	// However, there are two ways of transmission in IEC 61883-6; blocking
+	// and non-blocking modes. In blocking mode, the sequence of isoc packet
+	// includes 'empty' or 'NODATA' packets which include no event. In
+	// non-blocking mode, the number of events per packet is variable up to
+	// the syt interval.
+	// Due to the above protocol design, the minimum PCM frames per
+	// interrupt should be double of the value of syt interval, thus it is
+	// 250 usec.
 	err = snd_pcm_hw_constraint_minmax(runtime,
 					   SNDRV_PCM_HW_PARAM_PERIOD_TIME,
-					   5000, maximum_usec_per_period);
+					   250, maximum_usec_per_period);
 	if (err < 0)
 		goto end;
 
-- 
2.20.1

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

  parent reply	other threads:[~2019-10-17 16:04 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-17 15:54 [alsa-devel] [PATCH 00/12] ALSA: firewire: configure interval of hw IRQ via ALSA PCM interface Takashi Sakamoto
2019-10-17 15:54 ` [alsa-devel] [PATCH 01/12] ALSA: firewire-lib: use variable size of queue for isoc packets instead of fixed size Takashi Sakamoto
2019-10-17 15:54 ` [alsa-devel] [PATCH 02/12] ALSA: bebob: share PCM buffer size for both direction Takashi Sakamoto
2019-10-17 15:54 ` [alsa-devel] [PATCH 03/12] ALSA: fireworks: " Takashi Sakamoto
2019-10-17 15:54 ` [alsa-devel] [PATCH 04/12] ALSA: oxfw: " Takashi Sakamoto
2019-10-17 15:54 ` [alsa-devel] [PATCH 05/12] ALSA: dice: " Takashi Sakamoto
2019-10-17 15:54 ` [alsa-devel] [PATCH 06/12] ALSA: firewire-digi00x: " Takashi Sakamoto
2019-10-17 15:54 ` [alsa-devel] [PATCH 07/12] ALSA: firewire-tascam: " Takashi Sakamoto
2019-10-17 15:54 ` [alsa-devel] [PATCH 08/12] ALSA: firewire-motu: " Takashi Sakamoto
2019-10-17 15:54 ` [alsa-devel] [PATCH 09/12] ALSA: fireface: " Takashi Sakamoto
2019-10-17 15:54 ` [alsa-devel] [PATCH 10/12] ALSA: firewire-lib: schedule hardware IRQ according to the size of PCM period Takashi Sakamoto
2019-10-17 15:54 ` [alsa-devel] [PATCH 11/12] ALSA: firewire-lib: tune the maximum available " Takashi Sakamoto
2019-10-17 15:54 ` Takashi Sakamoto [this message]
2019-10-18  2:37 ` [alsa-devel] [PATCH 00/12] ALSA: firewire: configure interval of hw IRQ via ALSA PCM interface Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191017155424.885-13-o-takashi@sakamocchi.jp \
    --to=o-takashi@sakamocchi.jp \
    --cc=alsa-devel@alsa-project.org \
    --cc=clemens@ladisch.de \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.