At Thu, 13 May 2004 20:06:45 +0200, I wrote: > > [1 <text/plain; US-ASCII (7bit)>] > 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
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; + } } /**