Re: USB logic analyzer problem

From: Milan Obuch <freebsd-usb_at_dino.sk>
Date: Wed, 21 Dec 2022 10:28:58 UTC
On Wed, 21 Dec 2022 09:52:47 +0100
Hans Petter Selasky <hps@selasky.org> wrote:

> On 12/21/22 08:44, Milan Obuch wrote:
> > Hi,
> > 
> > recently I've got two simple USB logic analyzers (one with analog
> > channel as well), and I am trying to get them working under FreeBSD.
> > They are
> > 
> > ugen0.x: <vendor 0x08a9 product 0x0014> at usbus0
> > ugen0.y: <vendor 0x0925 product 0x3881> at usbus0
> > 
> > as seen on plugging in USB port (x, y varies on attempts). These
> > should be handled by sigrok and pulseview (science/sigrok* and
> > science/pulseview ports). While building and installing ports was
> > relatively easy, I did not managed them to work correctly.
> > 
> > Looking at sigrok wiki, both should work with fx2lafw driver, info
> > at
> > 
> > https://sigrok.org/wiki/AZDelivery_Logic_Analyzer/Info
> > https://sigrok.org/wiki/Noname_LHT00SU1/Info
> > 
> > At first, I thought problem is access rights, as all devices are
> > created with mode crw-------, uid root. I did not succeed to change
> > this, trying devd and/or devfs, even manually chmod. As a simple
> > test, I started pulseview as root, still, no success - I can see my
> > devices listed and selectable for data acquisition, but trying to
> > get data yields
> > 
> > sr: fx2lafw: resubmit_transfer: LIBUSB_ERROR_NO_DEVICE
> > sr: fx2lafw: resubmit_transfer: LIBUSB_ERROR_NO_DEVICE
> > sr: fx2lafw: resubmit_transfer: LIBUSB_ERROR_NO_DEVICE
> > sr: fx2lafw: resubmit_transfer: LIBUSB_ERROR_NO_DEVICE
> > sr: fx2lafw: resubmit_transfer: LIBUSB_ERROR_NO_DEVICE
> > sr: fx2lafw: resubmit_transfer: LIBUSB_ERROR_NO_DEVICE
> > sr: fx2lafw: resubmit_transfer: LIBUSB_ERROR_NO_DEVICE
> > sr: fx2lafw: resubmit_transfer: LIBUSB_ERROR_NO_DEVICE
> > sr: fx2lafw: resubmit_transfer: LIBUSB_ERROR_NO_DEVICE
> > sr: fx2lafw: resubmit_transfer: LIBUSB_ERROR_NO_DEVICE
> > sr: fx2lafw: resubmit_transfer: LIBUSB_ERROR_NO_DEVICE
> > sr: fx2lafw: resubmit_transfer: LIBUSB_ERROR_NO_DEVICE
> > sr: fx2lafw: resubmit_transfer: LIBUSB_ERROR_NO_DEVICE
> > sr: fx2lafw: resubmit_transfer: LIBUSB_ERROR_NO_DEVICE
> > sr: fx2lafw: resubmit_transfer: LIBUSB_ERROR_NO_DEVICE
> > sr: fx2lafw: resubmit_transfer: LIBUSB_ERROR_NO_DEVICE
> > sr: fx2lafw: resubmit_transfer: LIBUSB_ERROR_NO_DEVICE
> > sr: fx2lafw: resubmit_transfer: LIBUSB_ERROR_NO_DEVICE
> > sr: fx2lafw: resubmit_transfer: LIBUSB_ERROR_NO_DEVICE
> > Acquisition took 0.07 s
> > 
> > at best. So, data set is empty, nothing is captured.
> > 
> > I am out of ideas. Has anybody any experience with this kind of
> > devices? Any idea how to debug this issue?
> > 
> > Regards,
> > Milan
> >   
> 
> Hi Milan,
> 
> If you get a no device error on re-submit, the device has been 
> disconnected, but the software side has not yet done the same I
> believe. Can you check that?
>

Thanks for reply. How could I check this? Note, science/pulseview is a
port, I just build it as usual, so I don't know anything about
internals. I just found using '-l 5' switch in command line makes a lot
of noise, but nothing understandable for me at the moment. See
attachment (long lines, trying to avoid mangling via mailer). Also,
doing 'ls -l /dev/usb/0.[56]*' before and after starting pulseview
seems to be stable:

crw-rw-rw-  1 root  operator  0x19e Dec 21 11:19 /dev/usb/0.5.0
crw-------  1 root  operator  0x1a0 Dec 21 11:19 /dev/usb/0.5.2
crw-rw-rw-  1 root  operator  0x1a1 Dec 21 11:19 /dev/usb/0.6.0
crw-------  1 root  operator  0x1a3 Dec 21 11:19 /dev/usb/0.6.2

(no change here at all, timestamp looks the same as well).

Could some usbdump output help? No idea how to try it, either, I just
know it exists :)

Regards,
Milan