All of lore.kernel.org
 help / color / mirror / Atom feed
From: Giuliano Pochini <pochini@shiny.it>
To: Eliot Blennerhassett <bigblen@icqmail.com>
Cc: linux@blennerhassett.gen.nz, alsa-devel@lists.sourceforge.net
Subject: RE: Upgrade driver to 1.0.6, memory allocation?
Date: Thu, 19 Aug 2004 09:49:52 +0200 (CEST)	[thread overview]
Message-ID: <XFMail.20040819094952.pochini@shiny.it> (raw)
In-Reply-To: <505401c48598$4a891ec0$72cb010a@mail2world.com>


On 19-Aug-2004 Eliot Blennerhassett wrote:

> with the upgrade to 1.0.6, my alsa driver broke. (asihpi)
> Now I'm trying to put it together again, and could do with some tips...
> Mostly it still contained lots of easy to fix snd_magic_cast() but
> Can anybody confirm that the following update is the 'correct' thing to
> do?
> 
> (My) old code:
> call snd_malloc_pages_fallback in the open callback.
> 
> New code:
> call snd_pcm_lib_malloc_pages() in the hw_params callback
> 
> and call snd_pcm_lib_preallocate_pages_for_all() in the sound card pcm
> init function (in my case snd_card_asihpi_pcm()
> ================================
> By default according to pcm_memory.c, only a maximum of 4 substreams are
> allowed.

By default it preallocates memory for the first 4
substreams only. _malloc_pages() will allocate memory on
demand for the other substreams. You can do your own
preallocation routine if you think this default is not good.
If you want to "prepare" the substrem for use with
snd_pcm_lib_malloc_pages() without actually allocating
memory call _preallocate_pages() with size==0.
You can change the size of preallocated memory from
userspace via /proc interface.

Btw I would move the check for (substream->number < 4)
from snd_pcm_lib_preallocate_pages1() to
snd_pcm_lib_preallocate_pages_for_all() in order to allow
the driver to preallocate memory for any ss it wishes.


--
Giuliano.


-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285

  reply	other threads:[~2004-08-19  7:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-19  2:57 Upgrade driver to 1.0.6, memory allocation? Eliot Blennerhassett
2004-08-19  7:49 ` Giuliano Pochini [this message]
2004-08-19 13:01 ` Fred Gleason
  -- strict thread matches above, loose matches on Subject: below --
2004-08-19  2:57 Eliot Blennerhassett
2004-08-19  9:53 ` Takashi Iwai
2004-08-19  2:57 Eliot Blennerhassett

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=XFMail.20040819094952.pochini@shiny.it \
    --to=pochini@shiny.it \
    --cc=alsa-devel@lists.sourceforge.net \
    --cc=bigblen@icqmail.com \
    --cc=linux@blennerhassett.gen.nz \
    /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.