All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Cc: alsa-devel@alsa-project.org, Mark Brown <broonie@kernel.org>
Subject: Re: [PATCH] ALSA: core: Allow drivers to set R/W wait time.
Date: Fri, 16 Mar 2018 14:11:42 +0100	[thread overview]
Message-ID: <s5h1sgk5fn5.wl-tiwai@suse.de> (raw)
In-Reply-To: <1521203706.7762.390.camel@linux.intel.com>

On Fri, 16 Mar 2018 13:35:06 +0100,
Liam Girdwood wrote:
> 
> On Thu, 2018-03-15 at 17:25 +0100, Jaroslav Kysela wrote:
> > Dne 15.3.2018 v 17:07 Liam Girdwood napsal(a):
> > > On Thu, 2018-03-15 at 15:30 +0100, Takashi Iwai wrote:
> > > > > It's not atm, as it was being set by the driver. Would probably mean an
> > > > > ABI
> > > > > change to PCM ops or a new ioctl ? The latter wont break the ABI and the
> > > > > default
> > > > > value would remain if the ioctl was not called.
> > > > 
> > > > Basically this timeout is merely for a safety, wasn't considered as a
> > > > part of the real functionality.
> > > > 
> > > > So, with your plan, this is exposed as a real PCM feature, as a part
> > > > of API?  For what kind of scenario / purpose?
> > > 
> > > Use case is XRUN handling, DMA failure or FW crash detection. The shortened
> > > timeout means we can recover far faster leaving a smaller gap in any audio.
> > 
> > We have the non-blocking access mode for this purpose where the
> > application can choose the state check time independently.
> 
> Yes, but unfortunately I'm coming across a lot of userspace who are using ALSA
> blocking IO as an audio synchronisation mechanism.
> 
> > 
> > It seems to me, that you like to resolve something else with this. The
> > 'error' checking should be handled at the driver level in my opinion.
> > 
> 
> It mostly is handled by the driver in this case, but userspace may care and is
> immediately notified by the IO failing. Fwiw, this is important in safety
> critical situations where any failure of audio could be deemed a safety risk
> (automotive use cases).
> 
> > I see only the possibility to reduce the timeout to a more appropriate
> > value (we know all stream and buffering parameters to calculate the
> > 'late' time limit). I agree that the current timeout is too big, but
> > it's something outside the API as Takashi mentioned.
> 
> ok, any objections if I change it directly (in the structure) from the SOF
> driver and have some core PCM hw_params() check that makes sure we are good for
> period/buffer time ?

I'm fine with that.


thanks,

Takashi

      reply	other threads:[~2018-03-16 13:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-14 20:44 [PATCH] ALSA: core: Allow drivers to set R/W wait time Liam Girdwood
2018-03-14 22:04 ` Takashi Iwai
2018-03-15 13:35   ` Liam Girdwood
2018-03-15 14:30     ` Takashi Iwai
2018-03-15 16:07       ` Liam Girdwood
2018-03-15 16:25         ` Jaroslav Kysela
2018-03-16 12:35           ` Liam Girdwood
2018-03-16 13:11             ` Takashi Iwai [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=s5h1sgk5fn5.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=liam.r.girdwood@linux.intel.com \
    /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.