From: Takashi Iwai Subject: Re: snd_pcm_lib_malloc_pages Date: Mon, 21 Nov 2005 11:07:02 +0100 Message-ID: References: <1132528326.9292.23.camel@localhost.localdomain> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Return-path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa.jcu.cz (ALSA's E-mail Delivery System) with ESMTP id A2050169 for ; Mon, 21 Nov 2005 11:07:02 +0100 (MET) In-Reply-To: <1132528326.9292.23.camel@localhost.localdomain> Sender: alsa-devel-admin@lists.sourceforge.net Errors-To: alsa-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: Adrian McMenamin Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Sun, 20 Nov 2005 23:12:05 +0000, Adrian McMenamin wrote: > > I am trying to write to a driver on the Dreamcast (SH4) - as far as I > can see there are no ALSA drivers extant for this processor. Does that > mean I should assume this function is implemented or unimplemented on > SH? On a scan through the code I can see no obvious reason why it > wouldn't be working (ie no processor specific code) but there must be > some degree of processor/bus specific code. You don't have to use snd_pcm_lib_malloc_pages(). This function is provided for the common case together with the buffer pre-allocation via snd_pcm_lib_preallocate_pages*() functions. snd_pcm_lib_malloc_pages() itself doesn't allocate buffers but calls the allocator in memalloc.c. Thus, without pre-allocation, this function doesn't work at all. What you have to do is just to set up the buffer in hw_params callback and release in hw_free callback. Note that these callbacks may called multiple times per session, so you have to check if the parameters are identical and reset the bufer if changed. Takashi ------------------------------------------------------- This SF.Net email is sponsored by the JBoss Inc. Get Certified Today Register for a JBoss Training Course. Free Certification Exam for All Training Attendees Through End of 2005. For more info visit: http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click