From: Winfried Ritsch Subject: Re: Scatter-Gather buffer allocation before running on HDSP-MADI ? Date: Tue, 7 Oct 2003 18:25:50 +0200 Sender: alsa-devel-admin@lists.sourceforge.net Message-ID: <16258.59662.729091.684464@seneca.iemnet> References: <16254.61960.840856.972245@seneca.iemnet> <1065460748.3f81a40c61063@iem.at> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Errors-To: alsa-devel-admin@lists.sourceforge.net List-Help: List-Post: List-Subscribe: , List-Unsubscribe: , List-Archive: To: alsa-devel@lists.sourceforge.net Cc: Takashi Iwai List-Id: alsa-devel@alsa-project.org Thanx that cleared a lot. So I managed now to put it in hw_params and it works in some way. needed an additional There is one point I found: - when I preallocate with for playback and capture 2*4194304 = 8388608 Bytes: snd_pcm_lib_preallocate_sg_pages_for_all(hdspm->pci, pcm,8388608,8388608)) and then in hw_params for one substream do a: snd_pcm_lib_malloc_pages(substream, 4194304); I got a sgbuf with size=8388608 not 4194304. So it takes all the memory at first. Then I tried to preallcate 4194304 and it nearly works (see below). ... since in it prealloctes the mem for 2 substreams (seen in pcm_memory.c). 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 ? What should be the right way ? a) Allocating the sum of both ? b) Acllocate with the value of one substream ? c) should I call snd_pcm_lib_preallocate_sg_pages_for_all twice ? (also free pages twice) mfg winfried ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf