diff options
author | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2019-10-17 18:54:24 +0300 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2019-10-18 05:35:55 +0300 |
commit | f706df4f42b1b9f5acb6641eb6818d85b6856476 (patch) | |
tree | 71d3f0036f0b0cb19df100f80f5cc238eac345d6 /sound/firewire | |
parent | 99921ec67dcdaeb5a5cc503f23ea2b5b6ff380ae (diff) | |
download | linux-f706df4f42b1b9f5acb6641eb6818d85b6856476.tar.xz |
ALSA: firewire-lib: tune the minimum available size of PCM period
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>
Link: https://lore.kernel.org/r/20191017155424.885-13-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire')
-rw-r--r-- | sound/firewire/amdtp-stream.c | 14 |
1 files changed, 13 insertions, 1 deletions
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; |