Update of /cvsroot/alsa/alsa-kernel/usb
In directory sc8-pr-cvs1:/tmp/cvs-serv6169/usb

Modified Files:
        usbaudio.c 
Log Message:
- prepare callback can sleep if a flag is given in pcm->info_flags.
- usbaudio driver uses non-atomic prepare callback for synchronization
  of pending unlinked urbs.
- async_unlink option of usbaudio driver is enabled as default now.
- fixed the initialization of pseudo-dma pointers in usbaudio.


Index: usbaudio.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/usb/usbaudio.c,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -r1.71 -r1.72
--- usbaudio.c  24 Nov 2003 11:52:24 -0000      1.71
+++ usbaudio.c  25 Nov 2003 12:01:22 -0000      1.72
@@ -28,9 +28,8 @@
  *  NOTES:
  *
  *   - async unlink should be used for avoiding the sleep inside lock.
- *     however, it causes oops by unknown reason on usb-uhci, and
- *     disabled as default.  the feature is enabled by async_unlink=1
- *     option (especially when preempt is used).
+ *     2.4.22 usb-uhci seems buggy for async unlinking and results in
+ *     oops.  in such a cse, pass async_unlink=0 option.
  *   - the linked URBs would be preferred but not used so far because of
  *     the instability of unlinking.
  *   - type II is not supported properly.  there is no device which supports
@@ -69,7 +68,7 @@
 static int vid[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = -1 }; /* Vendor ID for this 
card */
 static int pid[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = -1 }; /* Product ID for 
this card */
 static int nrpacks = 4;                /* max. number of packets per urb */
-static int async_unlink = 0;
+static int async_unlink = 1;
 
 MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
 MODULE_PARM_DESC(index, "Index value for the USB audio adapter.");
@@ -804,8 +803,7 @@
        int i;
 
        /* stop urbs (to be sure) */
-       deactivate_urbs(subs, force, 1);
-       if (async_unlink)
+       if (deactivate_urbs(subs, force, 1) > 0)
                wait_clear_urbs(subs);
 
        for (i = 0; i < MAX_URBS; i++)
@@ -834,12 +832,6 @@
        subs->freqmax = subs->freqn + (subs->freqn >> 2); /* max. allowed frequency */
        subs->phase = 0;
 
-       /* reset the pointer */
-       subs->hwptr = 0;
-       subs->hwptr_done = 0;
-       subs->transfer_sched = 0;
-       subs->transfer_done = 0;
-
        /* calculate the max. size of packet */
        maxsize = ((subs->freqmax + 0x3fff) * (frame_bits >> 3)) >> 14;
        if (subs->maxpacksize && maxsize > subs->maxpacksize) {
@@ -1277,6 +1269,17 @@
        subs->maxframesize = bytes_to_frames(runtime, subs->maxpacksize);
        subs->curframesize = bytes_to_frames(runtime, subs->curpacksize);
 
+       /* reset the pointer */
+       subs->hwptr = 0;
+       subs->hwptr_done = 0;
+       subs->transfer_sched = 0;
+       subs->transfer_done = 0;
+       subs->phase = 0;
+
+       /* clear urbs (to be sure) */
+       if (deactivate_urbs(subs, 0, 0) > 0)
+               wait_clear_urbs(subs);
+
        return 0;
 }
 
@@ -2002,7 +2005,7 @@
        as->pcm = pcm;
        pcm->private_data = as;
        pcm->private_free = snd_usb_audio_pcm_free;
-       pcm->info_flags = 0;
+       pcm->info_flags = SNDRV_PCM_INFO_NONATOMIC_OPS;
        if (chip->pcm_devs > 0)
                sprintf(pcm->name, "USB Audio #%d", chip->pcm_devs);
        else



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog

Reply via email to