0

In ubuntu 18.04, with usbmon, I can see ISO USB traffic on bus1 with:

cat /sys/kernel/debug/usb/usbmon/1u

This line shows an ISO packet:

ffff8ac78a58d300 1916648463 C Zi:1:013:1 0:1:450:0 1 0:0:32 34 = 00000000 ....

I can see the 32bytes sent from device to host. Great! The ISO packets were generated from my USB microphone.

However, it only dumps the ISO packets for the first ~3000 packets after I plugin the USB device. Is there a way to keep usbmon dumping the ISO packets?

Edit: It seems that what I asked maybe impractical since usbmon runs in kernel space. usbmon might be modified to take a user space event to restart dumping ISO data but that would require some changes from usbmon developers. For now, I am satisfied to get ISO packet dumps after I replugin the device.

Reading usbmon driver files, mon_bin.c has MON_IOCH_MFLUSH. I am not familiar with usbmon, maybe it's possible to use user space usbmon API/ioctl() to flush isochronous packets stored in the buffer. It seems to me as long as usbmon is loaded in kernel, it has an impact to the USB performance.

  • have you considered using a more specialized tool than cat (which honestly is cool!), such as wireshark, which comes not only with a nice adapter for usbmon, but also packet dissectors? – Marcus Müller Dec 02 '22 at 20:11
  • Thanks for your reply, Marcus. I did try wireshark, but I saw the same thing. Maybe I didn't use wireshark properly. – Dan West Dec 02 '22 at 20:16
  • I can see usbmon keeps sending out data only when I moved the mouse. I suspect that maybe due to the non-stopping nature of ISO packets, usbmon turns it off on the log? I saw a package on github: https://github.com/radosroka/usbmon. It seems to me it uses usbmon API. Maybe I could change Radosroka's code and keep it dumping ISO packets. – Dan West Dec 02 '22 at 20:57
  • I think it makes sense it stops ISO dumping since stdio is so slow and ISO packets is real time. There is no way stdio/screen print can keep up with ISO data. But we can record the events we are interested in and dump it later. – Dan West Dec 02 '22 at 21:12
  • That was the reason I pointed at wireshark - that should be plenty fast enough. – Marcus Müller Dec 02 '22 at 21:22

0 Answers0