Hi,

Your fix of the ALSA memory allocation problem is incorrect. This only fixes the 
problem with the commerical USB Audio driver. It does not fix for all drivers. The 
proper fix is to replace the function setup_pcm_id with this one (note the added 
"card->number << 24"):

============================================================================================
/*
 * set up the unique pcm id
 */
static inline void setup_pcm_id(snd_pcm_substream_t *subs)
{
        if (! subs->dma_device.id)
                subs->dma_device.id = subs->pcm->card->number << 24 | 
subs->pcm->device << 16 |
                        subs->stream << 8 | (subs->number + 1);
}

============================================================================================

Thanks,
Loc Ho



Index: alsa-kernel/usb/usbaudio.c
===================================================================
RCS file: /suse/tiwai/cvs/alsa/alsa-kernel/usb/usbaudio.c,v
retrieving revision 1.100
diff -u -r1.100 usbaudio.c
--- alsa-kernel/usb/usbaudio.c  7 May 2004 10:08:49 -0000       1.100
+++ alsa-kernel/usb/usbaudio.c  13 May 2004 18:05:45 -0000
@@ -2036,6 +2036,7 @@
 static void init_substream(snd_usb_stream_t *as, int stream, struct audioformat *fp)
 {
        snd_usb_substream_t *subs = &as->substream[stream];
+       snd_pcm_substream_t *pcms;
 
        INIT_LIST_HEAD(&subs->fmt_list);
        spin_lock_init(&subs->lock);
@@ -2047,7 +2048,12 @@
                subs->ops = audio_urb_ops[stream];
        else
                subs->ops = audio_urb_ops_high_speed[stream];
-       snd_pcm_lib_preallocate_pages(as->pcm->streams[stream].substream,
+       /* set up the unique device id with the card index number */
+       pcms = as->pcm->streams[stream].substream;
+       pcms->dma_device.id = (as->pcm->device << 16) |
+               (pcms->stream << 8) | (pcms->number + 1) |
+               (as->chip->card->number + 1) << 24;
+       snd_pcm_lib_preallocate_pages(pcms,
                                      SNDRV_DMA_TYPE_CONTINUOUS,
                                      snd_dma_continuous_data(GFP_KERNEL),
                                      64 * 1024, 128 * 1024);

--Multipart_Thu_May_13_20:06:45_2004-1--



--__--__--

_______________________________________________
Alsa-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-devel


End of Alsa-devel Digest


-------------------------------------------------------
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%62&alloc_ida84&op=click
_______________________________________________
Alsa-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

Reply via email to