From: Adrian McMenamin <adrian@mcmen.demon.co.uk>
To: Carlos Munoz <carlos@kenati.com>
Cc: alsa-devel@lists.sourceforge.net
Subject: Re: Buffer management questions
Date: Mon, 13 Mar 2006 19:25:52 +0000 [thread overview]
Message-ID: <1142277952.9235.14.camel@localhost.localdomain> (raw)
In-Reply-To: <4415C6FE.2080202@kenati.com>
On Mon, 2006-03-13 at 11:24 -0800, Carlos Munoz wrote:
> Hi all,
>
> I'm writing my first alsa driver and I have the following questions
> regarding buffer management (I've read all the documents in the alsa
> site but none answered my questions):
>
> How is the sound data replenished in the dma buffer for playback ? I
> call snd_pcm_lib_malloc_pages() to allocate the buffer. I assume when
> the trigger function is called, there is valid data in the buffer.
> However, once the driver sends all the data in the buffer, how does it
> get more data ? Should I assume the data is there and just wrap around
> the buffer ?
>
Just been through all this myself :)
The alsa middle layer will handle this for if your driver is coded
correctly. In my case that means having a timer check that a period has
been played out, transferring new bytes across and then calling
snd_pcm_period_elapsed which manages the refill - give us some more
details of your hardware and I am sure others can help
> I'm used to the write()/read() function calls to pass data in/out of
> drivers, but don't yet understand how data is passed in the alsa model.
> Any help is appreciated.
>
The middle layer does most of the work for you though the implementation
details depend on how your hardware works. you don't need a write()
> Thanks,
>
>
> Carlos
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by xPML, a groundbreaking scripting language
> that extends applications into web and mobile media. Attend the live webcast
> and join the prime developer group breaking into this new coding territory!
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/alsa-devel
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
next prev parent reply other threads:[~2006-03-13 19:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-13 19:24 Buffer management questions Carlos Munoz
2006-03-13 19:25 ` Adrian McMenamin [this message]
2006-03-13 20:03 ` Carlos Munoz
2006-03-13 20:07 ` Adrian McMenamin
2006-03-13 20:09 ` Adrian McMenamin
2006-03-13 20:10 ` 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=1142277952.9235.14.camel@localhost.localdomain \
--to=adrian@mcmen.demon.co.uk \
--cc=alsa-devel@lists.sourceforge.net \
--cc=carlos@kenati.com \
/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.