Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
To: Manuel Lauss <manuel.lauss@gmail.com>
Cc: alsa-devel@alsa-project.org, Mark Brown <broonie@kernel.org>,
	tiwai@suse.de, perex@perex.cz
Subject: Re: [PATCH v2] ASoC: au1x: declare that FIFO is reported in frames
Date: Fri, 5 Apr 2024 15:16:49 +0200	[thread overview]
Message-ID: <Zg/5wXkjJC6HSYuD@ugly> (raw)
In-Reply-To: <CAOLZvyGnfGjNA=N30LC+UVt92obOoHQt+bekADey=amKkTr8EQ@mail.gmail.com>

On Fri, Apr 05, 2024 at 01:22:41PM +0200, Manuel Lauss wrote:
>On Mon, Apr 1, 2024 at 10:11 PM Oswald Buddenhagen
><oswald.buddenhagen@gmx.de> wrote:
>> Is this right? The comment on the field says "fifo entries of
>> AC97/I2S
>> PSC", which doesn't suggest bytes. The data sheet speaks of "words" and
>> "byte masks", but without digging into it I can't tell how it would
>> behave with different sample widths and channel counts (which the driver
>> does not seem to limit _at all_? what am I missing?).
>
>Each fifo entry contains a sample; wordsize is configured in register
>0x08[24:21].
>The fifo is 16 samples deep, so you can have 8 stereo frames or 16
>mono frames queued up.
>
ok, so i'm apparently onto something, though the patch is wrong.

>But the fifo isn't managed by hand, dma transfers are used instead and
>the amount
>of transmitted bytes is extracted from DMA information, so I think this change
>is pointless.
>
not *quite* pointless - that field is used for calculating latencies
which are reported to user space. this doesn't really matter except for
pro audio equipment. it also isn't very precise if converter latencies
(which can be rather substantial for delta-sigma convs) are not also
taken into account. it's even more "interesting" when a single pcm
stream is connected to multiple ports with different latencies (e.g.,
s/pdif and analog).

HDA has the proper framework for tracking the entire path's latency and
the driver seems to support that, but from the drivers i surveyed that
was the only one which takes the matter seriously. most (legacy?)
drivers just set it explicitly to zero or leave it at the zero default,
which is a somewhat clear expression of "no clue / don't care".

so if you don't want to bother with getting it right or it is hopeless
due to inaccessible variables, just deleting the code is an option. or
simply ignoring the problem ...

i'm sure the alsa maints will correct me if i got anything wrong. ^^


      reply	other threads:[~2024-04-05 13:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-01 20:11 [PATCH v2] ASoC: au1x: declare that FIFO is reported in frames Oswald Buddenhagen
2024-04-05 11:22 ` Manuel Lauss
2024-04-05 13:16   ` Oswald Buddenhagen [this message]

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=Zg/5wXkjJC6HSYuD@ugly \
    --to=oswald.buddenhagen@gmx.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=manuel.lauss@gmail.com \
    --cc=perex@perex.cz \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox