public inbox for linux-mips@vger.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Lauri Kasanen <cand@gmx.com>
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 18:22:50 +0100	[thread overview]
Message-ID: <s5ho8hwvh91.wl-tiwai@suse.de> (raw)
In-Reply-To: <20210110190332.8a818e931975f02b8f3d3881@gmx.com>

On Sun, 10 Jan 2021 18:03:32 +0100,
Lauri Kasanen wrote:
> 
> On Sun, 10 Jan 2021 11:24:22 +0100
> Takashi Iwai <tiwai@suse.de> wrote:
> 
> > > 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.
> >
> > Try to set the periods_min=2 and the integer periods hw constraint at
> > first, and change the pointer callback to return nextpos.  Also, at
> > the push function, set runtime->delay = period_size as well.
> 
> When I do all this, it still causes the chipmunk speed. Several seconds
> of audio gets played in 0.3s or so. Sorry if this is taking too much of
> your time, I'm a bit lost here at what the alsa core is expecting.
> 
> Printks show the following repeats:
> start, period size 1024
> push, bool irq=0
> irq fired
> push, bool irq=1
> pointer at 8192
> stop

Hm, is the above about the result with the pointer callback returning
pos, not nextpos?  If so,

> start, period size 1024
> push, bool irq=0

At this moment, nextpos is 1024, and it should take some time until

> irq fired

... this IRQ is triggered; it must be the period time.
Was the reported timing as expected?

> push, bool irq=1
> pointer at 8192

If it's the first IRQ, isn't the nextpos 2048?

> stop

It's stopped likely because the position reported the driver is beyond
the data size the application filled (XRUN).

> It stops and starts again for some reason. This does not happen in the
> current pos/nextpos implementation.
> 
> > > - the DMA unit has errata if (start + len) & 0x3fff == 0x2000, this
> > > must never happen
> >
> > Ditto.
> 
> Can it really handle a constraint this complex? That'd be impressive.
> It'd remove the memcpy need if so.

The hw constraint can be just a function that filters the min/max
value the driver may accept, so such a rule is possible.

> > > - the audio IRQ is not a timer, it fires when the card's internal
> > > buffers are empty and need immediate refill
> >
> > It's the current implementation, right?
> 
> Yes, but I was wondering if a different setup would work better. The
> alsa setup is a bit confusing to me still.

The implementation became a bit complex due to the hardware
restriction, yeah.


thanks,

Takashi

  reply	other threads:[~2021-01-10 17:23 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
2021-01-10 10:24               ` Takashi Iwai
2021-01-10 17:03                 ` Lauri Kasanen
2021-01-10 17:22                   ` Takashi Iwai [this message]
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=s5ho8hwvh91.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=cand@gmx.com \
    --cc=linux-mips@vger.kernel.org \
    --cc=perex@perex.cz \
    --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