From: "Eliot Blennerhassett" <bigblen@icqmail.com>
To: alsa-devel@lists.sourceforge.net
Cc: linux@blennerhassett.gen.nz
Subject: Upgrade driver to 1.0.6, memory allocation?
Date: Wed, 18 Aug 2004 19:57:40 -0700 [thread overview]
Message-ID: <505401c48598$4a891ec0$72cb010a@mail2world.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 2056 bytes --]
Hello all,
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.
My cards have up to 16 substreams.
Chapter 10 of "Writing an alsa driver" says
"snd_pcm_lib_malloc_pages(substream, size);
Note that you have to pre-allocate to use this function. "
Does this only mean that you have to preallocate at least one buffer to
use the function?
If I read it correctly, snd_pcm_lib_malloc_pages will still try to
allocate some memory for substreams> 4, this just becomes less likely as
the system mem becomes fragmented.
Is there a rationale for making the substreams limit 4 as opposed to any
other number?
I guess I can change the max_substreams by providing a module parameter
to snd-pcm module.
============================
snd_pcm_lib_preallocate_pages1()
...
if (size> 0 && preallocate_dma && substream->number <maximum_substreams)
preallocate_pcm_pages(substream, size);
...
Maybe I'm missing something, but it seems the possible error return
value from preallocate_pcm_pages is ignored - is this intentional?
===========================
TIA for any enligtenment about the above.
-- Eliot
<P><font face="Arial, Helvetica, sans-serif" size="2" style="font-size:13.5px">_______________________________________________________________<BR><font face="Arial, Helvetica, sans-serif" size="2" style="font-size:13.5px">ICQ - You get the message, anywhere!<br>Get it @ <a href="http://www.icq.com" target=new>http://www.icq.com</a></font><br><br> </font></font>
[-- Attachment #2: Type: text/html, Size: 2249 bytes --]
next reply other threads:[~2004-08-19 2:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-19 2:57 Eliot Blennerhassett [this message]
2004-08-19 7:49 ` Upgrade driver to 1.0.6, memory allocation? Giuliano Pochini
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='505401c48598$4a891ec0$72cb010a@mail2world.com' \
--to=bigblen@icqmail.com \
--cc=alsa-devel@lists.sourceforge.net \
--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.