All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: alsa-devel@lists.sourceforge.net
Subject: Re: DMA: do all drivers need it?
Date: Mon, 06 May 2002 17:47:02 +0200	[thread overview]
Message-ID: <s5h1ycpmg7d.wl@alsa2.suse.de> (raw)
In-Reply-To: <200205041140.g44BeoD09284@post2.fast.net>

At Sat, 04 May 2002 07:41:28 -0400,
Paul Davis wrote:
> 
> >I am starting to write an sound driver for a card with no previous support and
> >would like to know if DMA is necessary as per the ALSA framework itself. My
> >card doesn't support DMA, yet. So if your answer is no, I would need to
> >fallback on OSS for the time being.
> 
> its not. ALSA doesn't require anything but a fairly small set of
> function pointers to be initialized so that the "mid-level" code can
> manage the device. as long as there is some way to move data to and
> from the audio interface (which seems like a pretty basic assumption),
> you just have to wrap it up and present it to the mid-level code.

in fact, you don't need even wrappers, if update of periods can be
done asynchronously, that is, either by hardware interrupts or timer
interrupts.

for example, recently i wrote a code to play pcm using emu8000
wavetable engine on sbawe (yes, just for fun :)
it has no DMA and no hardware interrupts.

the DMA'ish copy is done in copy/silence callbacks.  they are called
from the read/write syscalls only if defined.  interestingly, in the
emu8000 pcm routine, there is even no buffer because it transfers the
data from user space to its hardware directly by loop.

the update of period is established by checking the current pointer in
the system timer interrupts.  this is odd, of course.  the least
period size is limited by the timer interrupt frequency.
but it works.

the problem arises when the transfer rate is really slow or equal with
the playback rate.  in such a case, it's fairly difficult to get the
accurate schedule timing.  i don't think this is his case, though.


Takashi

_______________________________________________________________

Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: bandwidth@sourceforge.net

  reply	other threads:[~2002-05-06 15:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-23 19:10 DMA: do all drivers need it? Guilhem Tardy
2002-05-04 11:41 ` Paul Davis
2002-05-06 15:47   ` Takashi Iwai [this message]
2002-06-19 18:49     ` prepare(substream) Guilhem Tardy
2002-06-20  2:35       ` prepare(substream) Paul Davis
2002-06-21 13:43       ` prepare(substream) Takashi Iwai

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=s5h1ycpmg7d.wl@alsa2.suse.de \
    --to=tiwai@suse.de \
    --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.