From: "Reiner P" <reiner1210@googlemail.com>
To: alsa-devel@alsa-project.org
Subject: Re: mm functions vs. normal IO
Date: Tue, 4 Mar 2008 14:55:58 +0100 [thread overview]
Message-ID: <af8e60de0803040555k3bde920die41a13d1bd76a93c@mail.gmail.com> (raw)
In-Reply-To: <47CD0137.9000608@ladisch.de>
Hello,
ok, at the moment I use a simple read(...) to get the data from file
so mm should be ok.
Playing position:
I can count the frames I have written to the buffer but where is the
actual play position ???
What's the porpose of the triigerTimestamp in the status filed?
Thanks
Reiner
On Tue, Mar 4, 2008 at 8:58 AM, Clemens Ladisch <clemens@ladisch.de> wrote:
>
> Reiner wrote:
> > I was astonished that a simple wav playback example does not exist.
>
> The alsa-lib package has test/pcm_min.c.
>
>
> > What should be used:
> >
> > snd_pcm_mmap_commit
> > (I think snd_pcm_mmap_writei is the same with an additional copy behind ?)
>
> snd_pcm_mmap_writei is the same as calling snd_pcm_mmap_begin, copying
> into the buffer, and calling snd_pcm_mmap_commit.
>
> > or snd_pcm_writei
>
> If you have to ask, use snd_pcm_writei.
>
>
> > I think mmap will have better performance,
>
> Only if the program generates samples on the fly and can write them
> directly to the buffer in a format supported by the hardware.
>
> If you already have the data in some buffer, copying it into the
> device's buffer with snd_pcm_writei or snd_pcm_mmap_writei is just as
> fast as when you copy it into the device's buffer by yourself.
>
>
> > but will it work with all soundcards?
>
> Not directly. ALSA has mmap emulation for cards that don't support it.
> And there are devices where only support mmap access is
> SND_PCM_ACCESS_MMAP_COMPLEX.
>
>
> > I'am also looking for a function to get the number of played frames.
>
> ALSA doesn't count them. This is nothing that a program couldn't do
> trivially by itself.
>
>
> HTH
> Clemens
>
next prev parent reply other threads:[~2008-03-04 13:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-03 22:40 mm functions vs. normal IO Reiner
2008-03-04 7:58 ` Clemens Ladisch
2008-03-04 13:55 ` Reiner P [this message]
2008-03-04 14:04 ` James Courtier-Dutton
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=af8e60de0803040555k3bde920die41a13d1bd76a93c@mail.gmail.com \
--to=reiner1210@googlemail.com \
--cc=alsa-devel@alsa-project.org \
/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