From: Takashi Sakamoto <o-takashi@sakamocchi.jp>
To: Jaroslav Kysela <perex@perex.cz>
Cc: "M. Armsby" <m.armsby@gmx.de>,
alsa-devel@alsa-project.org,
Takashi Sakamoto <takaswie@kernel.org>
Subject: Re: ALSAfirewire broken / Pipewire 90ms delay
Date: Thu, 4 Sep 2025 22:18:07 +0900 [thread overview]
Message-ID: <20250904131807.GA209723@workstation.local> (raw)
In-Reply-To: <3e07de0a-affa-4776-9172-83b2b071fbe8@perex.cz>
Hi,
On Wed, Sep 03, 2025 at 02:19:59PM +0200, Jaroslav Kysela wrote:
> On 03. 09. 25 13:15, Takashi Sakamoto wrote:
> > Hi Jaroslav,
> >
> > On Wed, Sep 03, 2025 at 10:47:32AM +0200, Jaroslav Kysela wrote:
> > > For Takashi Sakamoto:
> > >
> > > The hw_params constraints in the firewire driver should be improved based on
> > > [1]. The drivers may also require the SNDRV_PCM_INFO_BATCH info flag.
> >
> > How it works in this case?
>
> I guess that the question is for the BATCH flag. It's just an information
> that the stream queuing is not granular enough like for PCI cards and the
> samples are queued in chunks to the hardware. Applications can handle the
> queuing differently in this case.
Hm. A packet can multiplex several Multi Bit Linear Audio (MBLA) data
frames defined in IEC 61883-1/6 (e.g. 0, 6-8 frames per packet at 48.0
kHz sampling transmission rate) When considering the frame count reported
by typical serial sound interface in embedded SoCs, this granularity is
not particularly unusual, even if DMA transmission occurs between system
buffer and the interface buffer. Since the ALSA PCM interface does not
expose this granularity, it remains invisible to userspace applications,
and application therefore cannot distinguish its origin. This is why
these drivers does not report the BATCH flag[1].
Nevertheless, one likely reason might be that i programmed the
IEC 61883-1/6 packet stream engine to recycle retired packet buffers as
quickly as possible, using a "sequence replay" approach. This behaviour
may appear as though it follow the concept of the BATCH flag.
I plan to redesign both the engine and PCM operation implementations of
each driver to address this point, as well as to add support for
SNDRV_PCM_INFO_SYNC_APPLPTR to packetize in application processes.
However, it is not yet the right time (I still have some items in Linux
firewire stack itself).
> See also proposed (and applied) change in [2]. Please, read [1] thread
> referred in my previous e-mail to see the problematic buffer size
> configurations for firewire drivers.
In Linux FireWire subsystem, there is a size restriction on the context
header within the.structure specific to isochronous context[2]. This
software-side restriction determines the upper limit of the PCM
buffer. The content of IEC 61883-1/6 CIP header is stored into this
buffer, The frame count in each PCM period/buffer, as well as the total
count itself, are governed by the computation of the number of headers
fitting into the context header buffer[3]. The count differs by the
design of target device. The design of protocol mentioned in the above
appends more constraints[4].
[1] https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git/commit/?id=d360870a5bcf
[2] https://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394.git/tree/drivers/firewire/ohci.c?h=v6.16#n3137
[3] https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git/tree/sound/firewire/amdtp-stream.c?h=v6.16#n227
[4] https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git/tree/sound/firewire/amdtp-stream.c?h=v6.16#n160
Regards
Takashi Sakamoto
next prev parent reply other threads:[~2025-09-04 13:19 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-24 10:37 ALSAfirewire broken M. Armsby
2025-07-24 14:38 ` Takashi Sakamoto
2025-07-30 19:36 ` ALSAfirewire broken / Pipewire 90ms delay M. Armsby
2025-08-10 13:35 ` M. Armsby
2025-09-02 7:59 ` M. Armsby
2025-09-03 1:11 ` M. Armsby
2025-09-03 8:47 ` Jaroslav Kysela
2025-09-03 11:15 ` Takashi Sakamoto
2025-09-03 12:19 ` Jaroslav Kysela
2025-09-04 13:18 ` Takashi Sakamoto [this message]
2025-09-04 13:32 ` Jaroslav Kysela
2025-09-04 20:44 ` Takashi Sakamoto
-- strict thread matches above, loose matches on Subject: below --
2025-08-06 10:57 Goran Kovac
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=20250904131807.GA209723@workstation.local \
--to=o-takashi@sakamocchi.jp \
--cc=alsa-devel@alsa-project.org \
--cc=m.armsby@gmx.de \
--cc=perex@perex.cz \
--cc=takaswie@kernel.org \
/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.