All of lore.kernel.org
 help / color / mirror / Atom feed
* Q2: Driver notified of MMAP commit.
@ 2007-02-01  3:37 Eliot Blennerhassett
  2007-02-01 14:15 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Eliot Blennerhassett @ 2007-02-01  3:37 UTC (permalink / raw)
  To: alsa-devel

Greetings,

I am trying to add mmap support to our driver (asihpi).

I'm looking for a way for the driver to be notified when the application
commits more data into the mmapped buffer, so I can pass that on to our
DMA engine.  Is there a driver operation that does this?

Aside: Is it true that ALSA assumes that once DMA is started, it will
run round and round the circular buffer forever (until stopped) no
matter whether there is valid data there or not?

Our DMA operates differently in that it only takes valid data, and then
stops until more data is written to the buffer.   In this case the
detection of xrun condition is difficult...

thanks

Eliot

-------------------------------------------------------------------------
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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Q2: Driver notified of MMAP commit.
  2007-02-01  3:37 Q2: Driver notified of MMAP commit Eliot Blennerhassett
@ 2007-02-01 14:15 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2007-02-01 14:15 UTC (permalink / raw)
  To: Eliot Blennerhassett; +Cc: alsa-devel

At Thu, 01 Feb 2007 16:37:33 +1300,
Eliot Blennerhassett wrote:
> 
> Greetings,
> 
> I am trying to add mmap support to our driver (asihpi).

Oh that fabulous and notorious mmap :)

> I'm looking for a way for the driver to be notified when the application
> commits more data into the mmapped buffer, so I can pass that on to our
> DMA engine.  Is there a driver operation that does this?

Not really.  The mmap data transfer is asynchrnous, and multiple
processes may write on the same mmaped area at any time (e.g. dmix).
Thus, ack mechanism doesn't work for mmap mode.  Instead, the driver
needs to "fetch" a chunk of data to transfer from mmap to the hardware
at each time (e.g. at irq).

> Aside: Is it true that ALSA assumes that once DMA is started, it will
> run round and round the circular buffer forever (until stopped) no
> matter whether there is valid data there or not?

Usually the PCM core stops if buffer underrun is detected.
You can set sw_params->stop_thresholld to ignore that, too.

> Our DMA operates differently in that it only takes valid data, and then
> stops until more data is written to the buffer.   In this case the
> detection of xrun condition is difficult...

It's possible to stop the stream explicitly from the driver via
snd_pcm_stop(XRUN), too.


Takashi

-------------------------------------------------------------------------
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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-02-01 14:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-01  3:37 Q2: Driver notified of MMAP commit Eliot Blennerhassett
2007-02-01 14:15 ` Takashi Iwai

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.