All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Sakamoto <o-takashi@sakamocchi.jp>
To: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
	Mark Brown <broonie@kernel.org>
Cc: Linux-ALSA <alsa-devel@alsa-project.org>,
	shiiba <naoya.shiiba.nx@renesas.com>,
	Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	komatsu <toshiaki.komatsu.ud@renesas.com>
Subject: Re: Question about device recovery when under/over run error case
Date: Mon, 18 Jan 2016 14:03:17 +0900	[thread overview]
Message-ID: <569C7215.2000801@sakamocchi.jp> (raw)
In-Reply-To: <87twmbfqio.wl%kuninori.morimoto.gx@renesas.com>

Hi,

I'm not Mark but might answer it.

On 2016年01月18日 13:45, Kuninori Morimoto wrote:
> Our sound device needs recovery if under/over run error happen.
> Basically, this "recovery" means "restart hardware".
> But, in such case, who should recovers sound device, Kernel or Userland ?
>
> Current our sound driver recovers it by kernel automatically.
> (But I need do work more for it)

I think you should not recover it in kernel space, because 'hw_ptr' in 
mapped page includes values unexpected by userspace application. (The 
value may suddenly jump up to unexpected value after recovered.)

What driver in kernel land is to notify XRUN to the applications in your 
case. If recovering processing includes event waiting, it should not be 
executed in interrupt context.

> We considered that userland should know it, or, run it by himself (?)
> If userland should do it, which function should be called to announce
> error to userland from kernel ?

Userspace can get to know the XRUN state by calling some APIs. Then, it 
can recover PCM substream by executing SNDRV_PCM_IOCTL_PREPARE ioctl.


Regards

Takashi Sakamoto
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

  reply	other threads:[~2016-01-18  5:03 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-18  4:45 Question about device recovery when under/over run error case Kuninori Morimoto
2016-01-18  5:03 ` Takashi Sakamoto [this message]
2016-01-18  6:04   ` Kuninori Morimoto
2016-01-18  8:29     ` Takashi Iwai
2016-01-19  0:04       ` Kuninori Morimoto
2016-01-19  1:15         ` Takashi Sakamoto
2016-01-19  3:08           ` Kuninori Morimoto
2016-01-19  3:21             ` Takashi Sakamoto
2016-01-19  4:42               ` Kuninori Morimoto
2016-01-19 12:33                 ` Takashi Sakamoto
2016-01-20  1:17                   ` Kuninori Morimoto
2016-01-20  3:19                     ` Takashi Sakamoto

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=569C7215.2000801@sakamocchi.jp \
    --to=o-takashi@sakamocchi.jp \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=hiroyuki.yokoyama.vx@renesas.com \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=lgirdwood@gmail.com \
    --cc=naoya.shiiba.nx@renesas.com \
    --cc=toshiaki.komatsu.ud@renesas.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.