On Wed, 12 Mar 2025 11:30:03 +0100, Marcus Glocker <mar...@nazgul.ch> wrote: > > On Wed, Mar 12, 2025 at 10:24:04AM GMT, Landry Breuil wrote: > > > Le Wed, Mar 12, 2025 at 10:05:30AM +0100, Landry Breuil a ?crit : > > > hi, > > > > > > updated my t470s from '#564: Tue Feb 25 21:20:18 MST 2025' to '#591: Tue > > > Mar 11 20:48:18 MDT 2025' and my webcam now shows weird 'stripes' on top > > > of the image (that works). > > > > the 'weird stripes' only show up from some webrtc clients (ive noticed > > it with jitsi in firefox 137.0b4), using video(1) i havent been able to > > replicate (yet).. > > > > no issue in https://mozilla.github.io/webrtc-landing/gum_test.html so > > might be the way jitsi queries the video device. > > > > Landry > > I have the same cam in my X1 Carbon. I can't reproduce the issue on > video(1) either, because it's using YUYV422 as the default input format. > When using ffplay with MJPEG as input format, I can reproduce the issue. > > I'll try to figure out which of the recent commits has introduced the > regression. >
Landry, may I ask you to try this two patch which reverts USB3 speed for isoc devices? Also, may I ask you to share output of ffplay -list_formats all -i /dev/videoX with and without this diffs? Notable to say that I see broken mjpeg stream from Jabra PanaCast 20 when I connect it via CalDigit's Element Hub on 3840x2160 stream, and no issue at all when I connect it via Hub in used external monitor LG UltraFine 5K. But I haven't dig inti it yet. -- wbr, Kirill
Index: sys/dev/usb/usb_subr.c =================================================================== RCS file: /home/cvs/src/sys/dev/usb/usb_subr.c,v diff -u -p -r1.164 usb_subr.c --- sys/dev/usb/usb_subr.c 1 Mar 2025 14:43:03 -0000 1.164 +++ sys/dev/usb/usb_subr.c 12 Mar 2025 13:04:26 -0000 @@ -514,8 +514,7 @@ int usbd_parse_idesc(struct usbd_device *dev, struct usbd_interface *ifc) { #define ed ((usb_endpoint_descriptor_t *)p) -#define essd ((usb_endpoint_ss_comp_descriptor_t *)pp) - char *p, *pp, *end; + char *p, *end; int i; p = (char *)ifc->idesc + ifc->idesc->bLength; @@ -535,11 +534,6 @@ usbd_parse_idesc(struct usbd_device *dev if (p >= end) return (-1); - pp = p + ed->bLength; - if (pp >= end || essd->bLength == 0 || - essd->bDescriptorType != UDESC_ENDPOINT_SS_COMP) - pp = NULL; - if (dev->speed == USB_SPEED_HIGH) { unsigned int mps; @@ -563,7 +557,6 @@ usbd_parse_idesc(struct usbd_device *dev } ifc->endpoints[i].edesc = ed; - ifc->endpoints[i].esscd = essd; ifc->endpoints[i].refcnt = 0; ifc->endpoints[i].savedtoggle = 0; p += ed->bLength; @@ -571,7 +564,6 @@ usbd_parse_idesc(struct usbd_device *dev return (0); #undef ed -#undef essd } void Index: sys/dev/usb/usbdivar.h =================================================================== RCS file: /home/cvs/src/sys/dev/usb/usbdivar.h,v diff -u -p -r1.85 usbdivar.h --- sys/dev/usb/usbdivar.h 1 Mar 2025 14:43:03 -0000 1.85 +++ sys/dev/usb/usbdivar.h 12 Mar 2025 13:04:26 -0000 @@ -55,7 +55,6 @@ struct usbd_pipe; struct usbd_endpoint { usb_endpoint_descriptor_t *edesc; - usb_endpoint_ss_comp_descriptor_t *esscd; int refcnt; int savedtoggle; }; Index: sys/dev/usb/xhci.c =================================================================== RCS file: /home/cvs/src/sys/dev/usb/xhci.c,v diff -u -p -r1.136 xhci.c --- sys/dev/usb/xhci.c 1 Mar 2025 14:43:03 -0000 1.136 +++ sys/dev/usb/xhci.c 12 Mar 2025 13:04:26 -0000 @@ -1355,7 +1355,6 @@ static inline uint32_t xhci_get_txinfo(struct xhci_softc *sc, struct usbd_pipe *pipe) { usb_endpoint_descriptor_t *ed = pipe->endpoint->edesc; - usb_endpoint_ss_comp_descriptor_t *esscd = pipe->endpoint->esscd; uint32_t mep, atl, mps = UGETW(ed->wMaxPacketSize); switch (UE_GET_XFERTYPE(ed->bmAttributes)) { @@ -1365,10 +1364,8 @@ xhci_get_txinfo(struct xhci_softc *sc, s break; case UE_INTERRUPT: case UE_ISOCHRONOUS: - if (esscd && pipe->device->speed >= USB_SPEED_SUPER) { - mep = UGETW(esscd->wBytesPerInterval); - atl = mep; - break; + if (pipe->device->speed == USB_SPEED_SUPER) { + /* XXX Read the companion descriptor */ } mep = (UE_GET_TRANS(mps) + 1) * UE_GET_SIZE(mps); @@ -1444,7 +1441,6 @@ uint32_t xhci_pipe_maxburst(struct usbd_pipe *pipe) { usb_endpoint_descriptor_t *ed = pipe->endpoint->edesc; - usb_endpoint_ss_comp_descriptor_t *esscd = pipe->endpoint->esscd; uint32_t mps = UGETW(ed->wMaxPacketSize); uint8_t xfertype = UE_GET_XFERTYPE(ed->bmAttributes); uint32_t maxb = 0; @@ -1455,9 +1451,7 @@ xhci_pipe_maxburst(struct usbd_pipe *pip maxb = UE_GET_TRANS(mps); break; case USB_SPEED_SUPER: - if (esscd && - (xfertype == UE_ISOCHRONOUS || xfertype == UE_INTERRUPT)) - maxb = esscd->bMaxBurst; + /* XXX Read the companion descriptor */ default: break; }
Index: sys/dev/usb/uvideo.c =================================================================== RCS file: /home/cvs/src/sys/dev/usb/uvideo.c,v diff -u -p -r1.251 uvideo.c --- sys/dev/usb/uvideo.c 10 Mar 2025 07:38:12 -0000 1.251 +++ sys/dev/usb/uvideo.c 12 Mar 2025 13:19:54 -0000 @@ -141,8 +141,7 @@ usbd_status uvideo_vs_parse_desc_format_ usbd_status uvideo_vs_parse_desc_frame(struct uvideo_softc *); usbd_status uvideo_vs_parse_desc_frame_sub(struct uvideo_softc *, const usb_descriptor_t *); -uint32_t uvideo_vc_parse_max_packet_size(struct uvideo_softc *, - usb_endpoint_descriptor_t *); +uint32_t uvideo_vc_parse_max_packet_size(usb_endpoint_descriptor_t *); usbd_status uvideo_vs_parse_desc_alt(struct uvideo_softc *, int, int, int); usbd_status uvideo_vs_set_alt(struct uvideo_softc *, struct usbd_interface *, int); @@ -196,8 +195,6 @@ void uvideo_dump_desc_output(struct uvi const usb_descriptor_t *); void uvideo_dump_desc_endpoint(struct uvideo_softc *, const usb_descriptor_t *); -void uvideo_dump_desc_endpoint_ss_comp(struct uvideo_softc *, - const usb_descriptor_t *); void uvideo_dump_desc_iface_assoc(struct uvideo_softc *, const usb_descriptor_t *); void uvideo_dump_desc_interface(struct uvideo_softc *, @@ -1315,39 +1312,12 @@ uvideo_vs_parse_desc_frame_sub(struct uv } uint32_t -uvideo_vc_parse_max_packet_size(struct uvideo_softc *sc, - usb_endpoint_descriptor_t *ed) +uvideo_vc_parse_max_packet_size(usb_endpoint_descriptor_t *ed) { uint32_t psize; - struct usbd_desc_iter iter; - const usb_descriptor_t *desc; - usb_endpoint_ss_comp_descriptor_t *esscd; - - /* - * USB 3.0 Section 9.6.7 states that wBytesPerInterval is only - * valid for periodic endpoints (isochronous and interrupt). - */ - if (UE_GET_XFERTYPE(ed->bmAttributes) == UE_BULK) - goto skip_ss_comp; - - usbd_desc_iter_init(sc->sc_udev, &iter); - while ((desc = usbd_desc_iter_next(&iter))) { - if (desc == (const usb_descriptor_t *)ed) { - desc = usbd_desc_iter_next(&iter); - break; - } - } - if (desc && sc->sc_udev->speed >= USB_SPEED_SUPER && - desc->bDescriptorType == UDESC_ENDPOINT_SS_COMP) { - esscd = (usb_endpoint_ss_comp_descriptor_t *)desc; - psize = UGETW(esscd->wBytesPerInterval); - DPRINTF(1, "%s: wBytesPerInterval=%d\n", - DEVNAME(sc), psize); - return psize; - } + /* XXX: get USB 3.0 speed from wBytesPerInterval */ -skip_ss_comp: psize = UGETW(ed->wMaxPacketSize); psize = UE_GET_SIZE(psize) * (1 + UE_GET_TRANS(psize)); @@ -1426,7 +1396,7 @@ uvideo_vs_parse_desc_alt(struct uvideo_s if (bulk_endpoint && !vs->bulk_endpoint) goto next; - psize = uvideo_vc_parse_max_packet_size(sc, ed); + psize = uvideo_vc_parse_max_packet_size(ed); /* save endpoint with largest bandwidth */ if (psize > vs->psize) { vs->ifaceh = &sc->sc_udev->ifaces[iface]; @@ -1504,7 +1474,7 @@ uvideo_vs_set_alt(struct uvideo_softc *s goto next; /* save endpoint with requested bandwidth */ - psize = uvideo_vc_parse_max_packet_size(sc, ed); + psize = uvideo_vc_parse_max_packet_size(ed); if (psize >= max_packet_size) diff = psize - max_packet_size; else @@ -2733,11 +2703,6 @@ uvideo_dump_desc_all(struct uvideo_softc printf("|\n"); uvideo_dump_desc_endpoint(sc, desc); break; - case UDESC_ENDPOINT_SS_COMP: - printf(" (UDESC_ENDPOINT_SS_COMP)\n"); - printf("|\n"); - uvideo_dump_desc_endpoint_ss_comp(sc, desc); - break; case UDESC_INTERFACE: printf(" (UDESC_INTERFACE)\n"); printf("|\n"); @@ -2873,21 +2838,6 @@ uvideo_dump_desc_endpoint(struct uvideo_ printf(" (UE_INTERRUPT)\n"); printf("wMaxPacketSize=%d\n", UGETW(d->wMaxPacketSize)); printf("bInterval=0x%02x\n", d->bInterval); -} - -void -uvideo_dump_desc_endpoint_ss_comp(struct uvideo_softc *sc, - const usb_descriptor_t *desc) -{ - usb_endpoint_ss_comp_descriptor_t *d; - - d = (usb_endpoint_ss_comp_descriptor_t *)(uint8_t *)desc; - - printf("bLength=%d\n", d->bLength); - printf("bDescriptorType=0x%02x\n", d->bDescriptorType); - printf("bMaxBurst=0x%02x\n", d->bMaxBurst); - printf("bmAttributes=0x%02x\n", d->bmAttributes); - printf("wBytesPerInterval=%d\n", UGETW(d->wBytesPerInterval)); } void