Re: How should we handle isochronous underruns?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jul 3, 2013 at 10:15 PM, Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote:
> On Wed, 3 Jul 2013, Ming Lei wrote:
>
>> >> Yes, that is the change tasklet is bringing, so looks we need to find a way
>> >> to distinguish streaming-on from underrun when stream->td_list becomes
>> >> empty in iso_stream_schedule().
>> >
>> > The difference will be the URB_ISO_ASAP flag.  The flag should be set
>> > in the first URB of a new stream.  It should not be set in any other
>> > URBs, unless the client driver doesn't care about losing
>> > synchronization when an underrun occurs.
>>
>> So sounds a better name for the flag should be URB_ISO_STREAM_ON, :-)
>
> I agree, but the existing name is already exposed to userspace in
> include/uapi/linux/usbdevice_fs.h.  We could change the internal name

If so, your coming change may break ABI because as you described
that "the flag should be set in the first URB of a new stream", but
some user-space drivers may not set it before. Even USB audio driver
doesn't set it in current -next tree.

> while leaving the external name the same, but that would be confusing.
>
> (URB_ISO_ASAP used to mean that the HCD was responsible for scheduling
> the URB, and if the flag wasn't set then the value of urb->start_frame
> would be used directly.  This doesn't make sense, because drivers
> should not be in charge of URB scheduling -- HCDs should take care of
> it.  So I have felt free to alter the flag's meaning.)

Anyway the name will become a bit confusing, so if we don't plan to
change it, we should add detailed comment about its usage.

>
>> Also looks drivers need fix for the API change.
>
> I don't know if any drivers will need to be fixed.  I suspect many of

Since the flag was exported to userspace, it is really hard to know now, :-)

> them simply set URB_ISO_ASAP on all their URBs.  Clemens has already
> added a fix for the snd-usb-audio driver.

I am wondering the fix has been added because it may depend on the
coming change of URB_ISO_ASAP, :-)

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




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux