Hi jdb, thanks for the reply.No.Is there a way to have usb interrupt moderation on the cm4 in device mode?
What endpoints are you using, and how are you delivering buffers from your application to the gadget layer?
I am using a fork of uvc-gadget that added support for using a tmp file as src for streaming. The file is in /tmp in order to use ramfs.
I also recently added support for tripple buffering to deal with jitter in my gstreamer pipeline, so now we got up to 3 files in /tmp for storing frames. The jitter only happens with specific usb cameras that seems to be buggy. The cameras I have tried for this issue are not buggy and work properly.
Here is the repo: https://github.com/nicolasb565/uvc-gadget
The frames are transfered from the uvc-gadget gadget apps to the usb uvc gadget using specific ioctls (v4l2 qbuf and v4l2 dqbuf).
My gstreamer pipeline just take video from a usb camera and send it to a tee, with one branch going to hdmi output, and the other branch going to /tmp as jpeg encoded frames.
For the audio, I either get audio from a usb camera and send it to uac gadget, or if the camera I was testing had no microphone, I created a gstreamer pipeline that send a test tone to the uac gadget. I tried multiple cameras and it is not related to the inputs used, instead it only happens on specific PC. Most PC do not create a high interrupt load even when using the same setup.
My usb gadget is a composite gadget, uvc + uac1 + hid + ncm (ethernet over usb). I was not doing anything with hid and ncm for those tests.
I tried removing hid and ncm from the composite gadget and it did not change anything.
Uvc gadget has been modified to use bulk transfers. Having both uvc and uac1 use isochronous transfers was buggy, I was getting video corruption for some frames over time. I just applied patch from here: https://lore.kernel.org/lkml/2022051222 ... tel.com/T/
The endpoints that are getting used are the uvc streaming endpoint, uac1 audio streaming endpoint (the one where the audio goes from the rpi to the pc). I am getting issue when I start recording audio from the uac1gadget on a specific windows PC while also streaming video over uvc.
Overall, the system slowdown only happens with specific PC that generate a high interrupt load. This is why I am looking at way to reduce the interrupt load by handling them in batch if they come in too fast. Is there a way over usb to limit the amount of interrupts, does the hardware have any registers to set interrupt moderation?
Thanks!
Statistics: Posted by nicolasb565 — Tue Jan 16, 2024 6:43 pm