alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: "Harrod, John" <john.harrod@philips.com>
Cc: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>
Subject: Re: Triggering a DAPM widget event
Date: Wed, 26 Jan 2011 18:27:54 +0000	[thread overview]
Message-ID: <20110126182754.GJ8501@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <39D4D143FC30524CAB784A72ADFECEEE34A0E8F3DF@NLCLUEXM02.connect1.local>

On Wed, Jan 26, 2011 at 07:08:31PM +0100, Harrod, John wrote:

http://daringfireball.net/2007/07/on_top

> I ran a few experiments where I frequently opened and closed the PCM. Under
> a heavy load, I sometimes get a resource busy error when I use the
> snd_pcm_open() call. So it looks like alsa-lib is not designed for frequent

Two issues here:
- Opening and closing streams are not the same thing as stopping and
  starting them.  From a power point of view only the stoping and
  starting of data transfer should make any difference.

- That said should be no problem with opening and closing streams as often
  as you like.  It seems most likely that if there's an issue here it's
  due to a race condition somewhere or other, quite possibly in the
  driver code.

> pcm opening and closing. I also noticed a few points in the alsa-lib code
> where dynamic memory is being allocated and freed and am wondering how this
> would affect heap fragmentation in the long term.

Obviously any dynamic memory allocator will be designed to deal with
frequent allocations and frees.  I would be astonished if this caused a
serious issue.

> So the pre-powerdown event should occur when no sound is being played? When you
> say stop the data flowing, you mean within the sound kernel module? There is
> no call that I need to make to alsa-lib (for example making a call to
> snd_pcm_pause())? It sounds like something is not working correctly in the kernel
> module...

Just stop playing data from your application.  For PCM streams from the
CPU that's all your application should need to do.

What is your actual problem here?

  reply	other threads:[~2011-01-26 18:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-25 16:53 Triggering a DAPM widget event Harrod, John
2011-01-26 16:53 ` Mark Brown
2011-01-26 18:08   ` Harrod, John
2011-01-26 18:27     ` Mark Brown [this message]
2011-01-26 20:38       ` Harrod, John
2011-01-26 20:43         ` Mark Brown
2011-01-27  7:09         ` Peter Ujfalusi
2011-01-27  9:56           ` Mark Brown

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=20110126182754.GJ8501@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=john.harrod@philips.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;
as well as URLs for NNTP newsgroup(s).