Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Lee Revell <rlrevell@joe-job.com>
To: alsa-devel <alsa-devel@lists.sourceforge.net>
Cc: Takashi Iwai <tiwai@suse.de>
Subject: Driver design question
Date: Tue, 12 Sep 2006 16:27:18 -0400	[thread overview]
Message-ID: <1158092839.16327.34.camel@mindpipe> (raw)

I have a device here that can play PCM, but it's a weird implementation.
Only 2 periods of 0x2000 words per buffer are supported, and there is no
DMA - the driver must poll a status register, and when the chip is
ready, deliver all 0x2000 words using outw() then send an end xfer
command.

I think I need to use an intermediate buffer, and implement copy/silence
callbacks that write to this.  Then I plan to use a tasklet or workqueue
to do the actual xfer of PCM data to the hardware.  A timer callback
will periodically check whether at least 0x2000 words are in the buffer
and if so, schedule the tasklet to drain it.

I presume this implementation cannot support mmap() as there's no random
access to the hardware buffer.  Is this correct?

Do I call snd_pcm_period_elapsed() from the timer, immediately before
scheduling the tasklet, or from the tasklet, after the data has been
transferred to the hw?

In general, does this seem like a reasonable implementation?

Lee


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

             reply	other threads:[~2006-09-12 20:27 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-12 20:27 Lee Revell [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-09-14 11:29 Driver design question Takashi Iwai
2006-09-15 14:47 ` Lee Revell
2006-09-19 15:15   ` Takashi Iwai
2006-09-25 19:54     ` Lee Revell
2006-09-27 17:18       ` Takashi Iwai
2006-09-27 17:38         ` Lee Revell
2006-09-30  2:03         ` Lee Revell
2006-10-03 15:35           ` Lee Revell
2006-10-04  9:17             ` Takashi Iwai
2006-10-19 22:12               ` Lee Revell
2006-10-20 12:55                 ` Takashi Iwai
2006-10-20 20:12                   ` Lee Revell
2006-10-23 13:09                     ` Takashi Iwai
2006-10-23 17:46                       ` Lee Revell
2006-10-24 15:01                         ` Takashi Iwai
2006-10-24 15:30                           ` Lee Revell
2006-10-24 23:54                           ` Lee Revell
2006-10-04  9:07           ` Takashi Iwai
2006-09-27 13:58     ` Lee Revell
2006-09-27 16:52       ` 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=1158092839.16327.34.camel@mindpipe \
    --to=rlrevell@joe-job.com \
    --cc=alsa-devel@lists.sourceforge.net \
    --cc=tiwai@suse.de \
    /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