From: David Henningsson <david.henningsson@canonical.com>
To: Irfan Shaikh <irfan.shaikh@sasken.com>
Cc: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>
Subject: Re: Direct write (using mmap_bigin and commit)
Date: Tue, 16 Nov 2010 08:10:53 +0100 [thread overview]
Message-ID: <4CE22E7D.7010808@canonical.com> (raw)
In-Reply-To: <16F32A3F9AF4E441B752BCD79C151ACA5D9A2EE339@EXGMBX01.sasken.com>
On 2010-11-15 13:24, Irfan Shaikh wrote:
> err = snd_pcm_mmap_begin(handle,&my_areas,&offset,&frames);
> mybuffer=(char *)malloc(frames*2);
> result = fread (mybuffer,1,(frames*2),pFile);
> my_areas.addr=mybuffer; // IS THIS CORRECT ? WILL THIS WORK ? How can i write my audio file data here in areas?
> commitres = snd_pcm_mmap_commit(handle, offset, frames);
No, fread should write directly into the buffer given by
snd_pcm_mmap_begin, you don't need "mybuffer" at all.
--
David Henningsson, Canonical Ltd.
http://launchpad.net/~diwic
prev parent reply other threads:[~2010-11-16 7:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-15 12:24 Direct write (using mmap_bigin and commit) Irfan Shaikh
2010-11-15 13:22 ` Jaroslav Kysela
2010-11-16 5:51 ` Irfan Shaikh
2010-11-16 7:10 ` David Henningsson [this message]
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=4CE22E7D.7010808@canonical.com \
--to=david.henningsson@canonical.com \
--cc=alsa-devel@alsa-project.org \
--cc=irfan.shaikh@sasken.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).