From: Nicolas Boullis <nboullis@debian.org>
To: alsa-devel@lists.sourceforge.net
Subject: Re: writing an alsa driver for an MPEG decoder chip
Date: Mon, 29 Aug 2005 19:45:34 +0200 [thread overview]
Message-ID: <20050829174533.GA3822@home> (raw)
In-Reply-To: <43125102.5020101@superbug.co.uk>
On Mon, Aug 29, 2005 at 01:04:18AM +0100, James Courtier-Dutton wrote:
> >Anyway, explanations and suggestions for improvement are still very
> >welcome... ;-)
>
> Well, get it working first, then improve it.
And as it now seems to be working, it's now time for improvements... ;-)
> For example, all the "magic" stuff is unneeded now.
I kept this stuff because I thought it was useful for compatibility with
older alsa, but it seems I was mistaken. Thanks for pointing this, I
will replace the magic stuff with the non-magic one... ;-)
> The Linux kernel has it's own scatter gather framework, but I can't
> remember off hand how best to use it.
OK. But do you think it is worth spending some time. Isn't it fine the
way I do it?
> Is the number of entries in the scatter-gather list a fixed size? If so,
> how big is it? If the number of entries in the scatter-gather list can
> be varied each time you open the device, then set the "periods_min/max
> to the range of values it can take. Most sound cards generally do
> between 2 and 8 periods.
The number of entries in the scatter-gather list is computed by dividing
the size of the list (MA_PCISize) by the size of an entry. I used to
think that MA_PCISize was read-only, which leads to a fixed-size list.
But it certainly is worth trying to write it and see if it works fine...
;-)
(With the firware I am using, there are 32 elements in the list.)
> You would generally pre allocate all the DMA memory use for sound in the
> snd_em8300_create() function.
I do call snd_pcm_lib_preallocate_pages_for_all in snd_em8300_pcm().
Should I move the call to snd_em8300_create()?
> One would then fill the scatter-gather list with pointers to the DMA
> memory in the snd_em8300_pcm_prepare() function.
That's already what I do... ;-)
> One would also try to do the fewest number of read/write to IO memory in
> the em8300_alsa_audio_interrupt() function. I.e. remove the
> read_ucregister(MA_PCISize) calls etc, and cache their values in the
> em8300_alsa_t structure.
> You might want to write to the MA_PCISize register if you want the
> application to be able to select a different number of periods. It would
> be set in the prepare() function.
Or I guess I might use the number of periods instead of re-computing
it... ;-)
Thanks for your help,
Nicolas
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
prev parent reply other threads:[~2005-08-29 17:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-08-28 14:46 writing an alsa driver for an MPEG decoder chip Nicolas Boullis
2005-08-28 21:59 ` James Courtier-Dutton
2005-08-28 22:35 ` Nicolas Boullis
2005-08-28 22:51 ` James Courtier-Dutton
2005-08-28 23:36 ` Nicolas Boullis
2005-08-29 0:04 ` James Courtier-Dutton
2005-08-29 17:45 ` Nicolas Boullis [this message]
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=20050829174533.GA3822@home \
--to=nboullis@debian.org \
--cc=alsa-devel@lists.sourceforge.net \
/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.