Hi,
 
I'm having a PCMCIA card with USB and serial functionality.  The USB
controller is OHCI based.  And I've developed an OHCI driver for the
same.  When I connect a "Philips Audio Speaker", and then play a ".wav"
file using the "play utility, I get the following message:

timeout: still 1 active urbs...

This message is printed by the audio driver module snd-usb-audio.ko.
And I receive this message only after the entire file is played.

Has anyone encountered this issue before?

I studied the audio driver code (usbaudio.c) and found the following:

1. In the completion handler, snd_complete_urb(), the following
condition is executed:

        if ((subs->running && subs->ops.retire(subs, substream->runtime,
urb)) ||
            ! subs->running || /* can be stopped during retire callback
*/
            (err = subs->ops.prepare(subs, substream->runtime, urb)) < 0
||
            (err = usb_submit_urb(urb, GFP_ATOMIC)) < 0) {
                clear_bit(ctx->index, &subs->active_mask);
                if (err < 0) {
                        snd_printd(KERN_ERR "cannot submit urb (err =
%d)\n", err);
                        snd_pcm_stop(substream, SNDRV_PCM_STATE_XRUN);
                }
        }

2. On urb completion, this routine calls prepare_playback_urb
(ops.prepare in the above-mentioned condition) and then
   submits the urb (usb_submit_urb). On a condition check,
prepare_playback_urb calls snd_usb_playback_trigger, which in
   turn calls deactivate_urbs.

3. The function deactivate_urbs deactivates all the urbs (in my case,
no. of urbs is 8) using usb_unlink_urb.  This function resets the
"subs->running" flag.  So as per check, in the completion handler, no
completed urbs are resubmitted.  However, in my case, one of the urbs,
which is completed has already checked this flag subs->running, and
hence this is resubmitted after ops.prepare returns.

4. This resubmitted urb after deactivate_urbs completes, results into 1
active urb remaining, therefore
audio driver prints the message from wait_clear_urbs function.
 "timeout: still %d active urbs..\n"

Has anyone encountered this issue on OHCI before?

-Srivas


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to