USB stack getting confused

O'Connor, Daniel darius at dons.net.au
Fri Mar 8 23:36:24 UTC 2019


Hi,
I'm developing a data acquisition system on FreeBSD using a USB3 interface (the OrangeTree ZestSC3) and I find that the USB stack appears to 'lose' the device after a while.

My program normally runs continually doing acquisitions of data for N seconds, doing some checks and restarting. After a while (~30 1 minute acquisitions or ~8 30 minute ones) my program can't 'see' the device (it uses libusb10) any more (it reconnects each acquisition for $REASONS). Also pretty weirdly usbconfig can't see it either(!).

If I stop my program the device reappears in usbconfig. If I restart my program it works.

I did some GDB'ing and it appears that ugen20_enumerate (the libusb10 interface is implemented by calling libusb20 functions) can't open /dev/ugenX.Y and errno is 12 (ENOMEM).

After digging with dtrace I have seen the open method be something different for this device. I have also seen it where opening the device doesn't call usb_fifo_open (not sure what it *does* call though - I see user land call openat but haven't traced through what gets called).

I'm still digging but am somewhat hopeful someone can suggest some things to look at :)

This is on 11.2 if it matters.

Thanks.

--
Daniel O'Connor
"The nice thing about standards is that there
are so many of them to choose from."
 -- Andrew Tanenbaum




More information about the freebsd-hackers mailing list