Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: ritsch@iem.at
Cc: alsa-devel@lists.sourceforge.net
Subject: Re: Scatter-Gather buffer allocation before running on HDSP-MADI ?
Date: Fri, 10 Oct 2003 13:39:51 +0200	[thread overview]
Message-ID: <s5hn0c97248.wl@alsa2.suse.de> (raw)
In-Reply-To: <1065776616.3f8675e8b202e@iem.at>

At Fri, 10 Oct 2003 11:03:36 +0200 (CEST),
ritsch@iem.at wrote:
> 
> Hello,
> 
> 
> the hdsp-madi card with the hdspm driver seems to work now.
> so I want do a clean out of the code:
> 
> I asking how should I do this:
> 
> > > at least I have to allocate one page more = 4194304+4096, to get no
> > > Segmentation fault, but that could be the hardware too, since hdsp
> > > also needs one page more ?
> > 
> > the SG-buffer allocation size is aligned (round up) to PAGE_SIZE.
> > (note that PAGE_SIZE is not always 4K byte on other architectures.)
> > 
> 
> Ok on my i386 architecture I have 4k pages and
> the rme card needs  4k buffers.
> 
> So how to code this that it works on all architectures getting
> a SG Buf with 4k buffers.
> 
> Do I have to do something by doing preallocation ?

on linux, the least page size is 4K byte (so far, all architectures
are so).  thus, simply do a loop like

	offset = 0; /* bytes */
	while (offset < total_size) {
		dma_addr_t addr = snd_sgbuf_get_addr(sgbuf, offset);
		map_this_addr_to_my_hw_table(addr);
		offset += 4096; /* 4k */
	}


Takashi


-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php

  parent reply	other threads:[~2003-10-10 11:39 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-04 16:15 Scatter-Gather buffer allocation before running on HDSP-MADI ? Winfried Ritsch
2003-10-05 19:01 ` Jaroslav Kysela
2003-10-06 13:50   ` Takashi Iwai
2003-10-06 17:19     ` ritsch
2003-10-06 17:38       ` Takashi Iwai
2003-10-07 16:25         ` Winfried Ritsch
2003-10-07 16:43           ` Takashi Iwai
     [not found]             ` <1065776616.3f8675e8b202e@iem.at>
2003-10-10 11:39               ` Takashi Iwai [this message]
2003-10-10 11:57                 ` Jaroslav Kysela
2003-10-10 12:06                   ` Takashi Iwai
2003-10-10 12:15                     ` Jaroslav Kysela
2003-10-10 15:23                     ` Winfried Ritsch

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=s5hn0c97248.wl@alsa2.suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@lists.sourceforge.net \
    --cc=ritsch@iem.at \
    /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