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>
Subject: Re: Can I stop sound from driver as system error ?
Date: Tue, 15 Dec 2015 10:48:45 +0900 [thread overview]
Message-ID: <566F717D.3050701@sakamocchi.jp> (raw)
In-Reply-To: <87zixcpktb.wl%kuninori.morimoto.gx@renesas.com>
Hi,
On Dec 15 2015 10:25, Kuninori Morimoto wrote:
> I wonder can I stop sound from driver side (not from user-land)
> as system error during playback or capture ?
> How to do it if we can ?
Stop PCM substreams with SNDRV_PCM_STATE_XRUN. In detail, see
implementation of snd_pcm_stop_xrun() available in 3.19 or later. Then,
userspace applications cannot continue to read/write PCM frames via ALSA
uapi.
When using alsa-lib, then, userspace applications receive -EPIPE as
return value of calling PCM APIs. The applications can stop their
operation for PCM character devices, or can also recover the XRUN state
of PCM substream by calling snd_pcm_prepare(). In this case, struct
snd_pcm_ops.prepare() is called again in driver side.
I think tinyalsa works almost the same.
Regards
Takashi Sakamoto
next prev parent reply other threads:[~2015-12-15 1:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-15 1:25 Can I stop sound from driver as system error ? Kuninori Morimoto
2015-12-15 1:48 ` Takashi Sakamoto [this message]
2015-12-15 2:47 ` Kuninori Morimoto
2015-12-15 3:55 ` 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=566F717D.3050701@sakamocchi.jp \
--to=o-takashi@sakamocchi.jp \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=kuninori.morimoto.gx@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox