All of lore.kernel.org
 help / color / mirror / Atom feed
From: Timur Tabi <timur@freescale.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org
Subject: Re: hw_params function and OSS emulation
Date: Thu, 23 Aug 2007 14:13:08 -0500	[thread overview]
Message-ID: <46CDDC44.40709@freescale.com> (raw)
In-Reply-To: <s5hzm0inkgt.wl%tiwai@suse.de>

Takashi Iwai wrote:
> At Thu, 23 Aug 2007 13:43:40 -0500,
> Timur Tabi wrote:
>> Takashi Iwai wrote:
>>
>>> Err, usually, application = user-space application.  Do you mean
>>> really this?
>> Yes.  The application allocates a buffer, locks it down, and passes it to the 
>> kernel.  Since the buffer was allocated in user space, it is virtual 
>> contiguous but not physically contiguous, hence the need for a list of 
>> physical addresses.  To the hardware, the buffer appears as a collection of 
>> scattered buffers.  Hence, scatter/gather.
> 
> Hm, then it must be a really special application.  I've never seen
> linux audio apps doing such things...

That could be.  I'm using a generic definition of S/G.  Perhaps I should read 
the ALSA API before posting further. :-)

> The problem in your scenario is that the buffers allocated from
> user-space are not always DMA-able for devices, thus not always usable
> for the hardware.

It's possible for an application to allocate DMA-able memory.  I think you 
need to allocate it normally than use mlock() on it, but it's been a while so 
I'm not sure.

> The ALSA SG-buffer helper is simply to allocate individual pages and
> gather as a virtually linear buffer.  From the user-space, it's
> nothing but a normal linear buffer.

So what is the value of having the driver allocate a physically discontiguous 
buffer when it can easily allocate a contiguous one?  Are there systems where 
allocating a 32KB physically-contiguous buffer is too hard?

-- 
Timur Tabi
Linux Kernel Developer @ Freescale

  reply	other threads:[~2007-08-23 19:13 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-21 18:15 hw_params function and OSS emulation Timur Tabi
2007-08-21 23:42 ` Trent Piepho
2007-08-22  9:17 ` Takashi Iwai
2007-08-22 14:28   ` Timur Tabi
2007-08-22 14:59     ` Takashi Iwai
2007-08-22 15:02       ` Timur Tabi
2007-08-22 15:39         ` Takashi Iwai
2007-08-22 15:48           ` Timur Tabi
2007-08-22 15:57             ` Takashi Iwai
2007-08-23 17:36               ` Timur Tabi
2007-08-23 17:40                 ` Takashi Iwai
2007-08-23 18:43                   ` Timur Tabi
2007-08-23 19:01                     ` Takashi Iwai
2007-08-23 19:13                       ` Timur Tabi [this message]
2007-08-23 19:35                         ` Takashi Iwai
2007-08-23 22:17                       ` Trent Piepho
2007-08-22 20:25       ` Trent Piepho
2007-08-22 21:05         ` Takashi Iwai
2007-08-22 21:08           ` Timur Tabi
2007-08-22 21:57             ` Takashi Iwai
2007-08-22 22:08               ` Timur Tabi

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=46CDDC44.40709@freescale.com \
    --to=timur@freescale.com \
    --cc=alsa-devel@alsa-project.org \
    --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 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.