From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: Help needed. (long) Date: Tue, 20 May 2003 10:56:29 +0200 Sender: alsa-devel-admin@lists.sourceforge.net Message-ID: References: <20030519024010.3367.h002.c012.wm@mail.icqmail.com.criticalpath.net> Mime-Version: 1.0 (generated by SEMI 1.14.4 - "Hosorogi") Content-Type: text/plain; charset=US-ASCII Return-path: In-Reply-To: Errors-To: alsa-devel-admin@lists.sourceforge.net List-Help: List-Post: List-Subscribe: , List-Unsubscribe: , List-Archive: To: Eliot Blennerhassett Cc: alsa-devel@lists.sourceforge.net, eliot@blennerhassett.gen.nz List-Id: alsa-devel@alsa-project.org Hi, just checking the mail again, and i have a question now... At Mon, 19 May 2003 18:34:42 +0200, I wrote: > > > static int snd_card_asihpi_playback_copy( > > snd_pcm_substream_t *substream, int channel, > > snd_pcm_uframes_t pos, > > void *src, > > snd_pcm_uframes_t count) > > { > > snd_pcm_runtime_t *runtime = substream->runtime; > > snd_card_asihpi_pcm_t *dpcm = snd_magic_cast(snd_card_asihpi_pcm_t, > > runtime->private_data, return -ENXIO); > > HW16 err; > > unsigned int len; > > > > len = frames_to_bytes(runtime, count); > > > > if (copy_from_user(runtime->dma_area, src, len)) > > return -EFAULT; > > > > dpcm->Data.dwDataSize = len; > > dpcm->Data.dwpbData = (HW32)runtime->dma_area; > > > > err = HPI_OutStreamWrite(phSubSys,dpcm->hStream,&dpcm->Data); > > return 0; > > } what does HPI_OutStreamWrite() do? does it copy the data onto the hardware buffer only? if this function itself plays the role of sample playback (aka DMA), the function should be called not in the copy callback but in the other code path. as mentioned in my last mail, copy callback is provided as an alternative to copy_from_user(). it's supposed to do a job only as a transfer method between the user-space and the hardware device. that means, the samples must be audible after the trigger callback is called. Takashi ------------------------------------------------------- This SF.net email is sponsored by: ObjectStore. If flattening out C++ or Java code to make your application fit in a relational database is painful, don't do it! Check out ObjectStore. Now part of Progress Software. http://www.objectstore.net/sourceforge