From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: ALSA Memory Allocation Bug Date: Thu, 13 May 2004 20:18:23 +0200 Sender: alsa-devel-admin@lists.sourceforge.net Message-ID: References: Mime-Version: 1.0 (generated by SEMI 1.14.5 - "Awara-Onsen") Content-Type: multipart/mixed; boundary="Multipart_Thu_May_13_20:18:23_2004-1" Return-path: In-Reply-To: Errors-To: alsa-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: Loc Ho Cc: alsa-devel@lists.sourceforge.net List-Id: alsa-devel@alsa-project.org --Multipart_Thu_May_13_20:18:23_2004-1 Content-Type: text/plain; charset=US-ASCII At Thu, 13 May 2004 20:06:45 +0200, I wrote: > > [1 ] > At Thu, 13 May 2004 10:53:48 -0700, > Loc Ho wrote: > > > > Hi, > > > > Also, after looking at the snd memory allocation routines, the > > unique tag are type, id, and flag. The type is "continous". The id is > > formated by the device ID, stream number, and substream number. The > > flag is the kernel memory flag. I already discussed the ID in my > > previous email (see below). Therefore, it will NOT be unique across > > multiple card!!! > > hmm, you're right. > > obviously it's a bug of snd-usb-audio. > the attached patch should fix the problem. maybe this one is better. i'll commit this to cvs. Takashi --Multipart_Thu_May_13_20:18:23_2004-1 Content-Type: text/plain; charset=US-ASCII Index: alsa-kernel/core/pcm_memory.c =================================================================== RCS file: /suse/tiwai/cvs/alsa/alsa-kernel/core/pcm_memory.c,v retrieving revision 1.25 diff -u -r1.25 pcm_memory.c --- alsa-kernel/core/pcm_memory.c 7 Apr 2004 17:49:39 -0000 1.25 +++ alsa-kernel/core/pcm_memory.c 13 May 2004 18:16:27 -0000 @@ -224,9 +224,13 @@ */ static inline void setup_pcm_id(snd_pcm_substream_t *subs) { - if (! subs->dma_device.id) + if (! subs->dma_device.id) { subs->dma_device.id = subs->pcm->device << 16 | subs->stream << 8 | (subs->number + 1); + if (subs->dma_device.type == SNDRV_DMA_TYPE_CONTINUOUS || + subs->dma_device.dev == NULL) + subs->dma_device.id |= (subs->pcm->card->number + 1) << 24; + } } /** --Multipart_Thu_May_13_20:18:23_2004-1-- ------------------------------------------------------- This SF.Net email is sponsored by: SourceForge.net Broadband Sign-up now for SourceForge Broadband and get the fastest 6.0/768 connection for only $19.95/mo for the first 3 months! http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click