On Thu, 13 Sep 2012, Clemens Ladisch wrote:

> Alan Stern wrote:
> > If instead I do "echo 2 3000 >test" then the next URB is submitted 3
> > frames too late.  Since the URB contains only 3 packets, all of its
> > slots have already expired.  The submission fails and the audio stops
> > playing, although the ogg123 program continues running and the synch
> > URBs continue to be submitted.
> 
> You might try this untested patch (ogg123 should then restart):
> 
> --- a/sound/usb/endpoint.c
> +++ b/sound/usb/endpoint.c
> @@ -386,7 +386,7 @@ static void snd_complete_urb(struct urb *urb)
>               return;
> 
>       snd_printk(KERN_ERR "cannot submit urb (err = %d)\n", err);
> -     //snd_pcm_stop(substream, SNDRV_PCM_STATE_XRUN);
> +     snd_pcm_stop(substream, SNDRV_PCM_STATE_XRUN);

This doesn't compile because substream is undefined.  I tried the 
following instead:

--- usb-3.6.orig/sound/usb/endpoint.c
+++ usb-3.6/sound/usb/endpoint.c
@@ -376,7 +376,7 @@ static void snd_complete_urb(struct urb
                return;
 
        snd_printk(KERN_ERR "cannot submit urb (err = %d)\n", err);
-       //snd_pcm_stop(substream, SNDRV_PCM_STATE_XRUN);
+       snd_pcm_stop(ctx->subs->pcm_substream, SNDRV_PCM_STATE_XRUN);
 
 exit_clear:
        clear_bit(ctx->index, &ep->active_mask);

But it caused an immediate oops during testing.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to