From: Lauri Kasanen <cand@gmx.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: linux-mips@vger.kernel.org, tsbogend@alpha.franken.de, perex@perex.cz
Subject: Re: [PATCH 5/6 v2] sound: Add n64 driver
Date: Sun, 10 Jan 2021 09:15:36 +0200 [thread overview]
Message-ID: <20210110091536.b3bc5dce2ef9d6c94d3eb873@gmx.com> (raw)
In-Reply-To: <s5h5z45x24r.wl-tiwai@suse.de>
On Sat, 09 Jan 2021 21:54:12 +0100
Takashi Iwai <tiwai@suse.de> wrote:
> When the start starts, it copies the full period size data, and moves
> nextpos to period size while keeping pos 0. And, at this moment, it's
> even possible that no enough data has been filled for the period
> size; this is practically a buffer underrun.
> Usually PCM core can catch the buffer underrun by comparing the
> current position reported by the pointer callback against the filled
> size, but in this case, PCM core can't know of it because the driver
> just tells the position 0. This is one problem.
>
> Then, at the first period IRQ, the next period is copied, then nextpos
> becomes 2*period_size. At this moment, pos = nextpos, hence it jumps
> from 0 to 2*periodsize out of sudden. It's quite confusing behavior
> for applications. That's the second problem.
>
> I guess that both problems could be avoided if n64audio_pointer()
> reports always nextpos instead of pos.
At first there was no nextpos, and _pointer() always reported pos. This
didn't work, the core played through the audio at chipmunk speed. So
there must be more that I don't understand here.
Let me describe the hw, perhaps a different approach would be better.
- the DMA unit requires 8-byte alignment and 8-divisible size (two
frames at the only supported format, s16be stereo)
- the DMA unit has errata if (start + len) & 0x3fff == 0x2000, this
must never happen
- the audio IRQ is not a timer, it fires when the card's internal
buffers are empty and need immediate refill
- Lauri
next prev parent reply other threads:[~2021-01-10 7:16 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-08 8:35 [PATCH 5/6 v2] sound: Add n64 driver Lauri Kasanen
2021-01-08 9:06 ` Takashi Iwai
2021-01-08 10:13 ` Lauri Kasanen
2021-01-09 7:23 ` Lauri Kasanen
2021-01-09 8:16 ` Takashi Iwai
2021-01-09 17:46 ` Lauri Kasanen
2021-01-09 18:17 ` Takashi Iwai
2021-01-09 20:54 ` Takashi Iwai
2021-01-10 7:15 ` Lauri Kasanen [this message]
2021-01-10 10:24 ` Takashi Iwai
2021-01-10 17:03 ` Lauri Kasanen
2021-01-10 17:22 ` Takashi Iwai
2021-01-10 17:41 ` Lauri Kasanen
2021-01-11 8:05 ` Takashi Iwai
2021-01-11 9:43 ` Lauri Kasanen
2021-01-11 10:11 ` Takashi Iwai
2021-01-11 12:02 ` Lauri Kasanen
2021-01-11 15:25 ` Takashi Iwai
2021-01-11 15:51 ` Lauri Kasanen
2021-01-13 11:57 ` Lauri Kasanen
2021-01-13 12:04 ` Takashi Iwai
2021-01-13 12:14 ` Lauri Kasanen
2021-01-13 12:38 ` Takashi Iwai
2021-01-13 12:49 ` Lauri Kasanen
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=20210110091536.b3bc5dce2ef9d6c94d3eb873@gmx.com \
--to=cand@gmx.com \
--cc=linux-mips@vger.kernel.org \
--cc=perex@perex.cz \
--cc=tiwai@suse.de \
--cc=tsbogend@alpha.franken.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