USB analyzer, how well does it work?

I have a logic 16 device and am using logic 2.4.6

For the first time I am trying to monitor/analyze USB data.

The device I am trying to monitor is an MSD, I have restricted it to Full Speed to try and be able to monitor it using logic.

Selecting a decode level of packets seems to result in nothing being decoded.
Selecting a decode level of Control transfers, results in a bit more, but the decoder ‘stops’ decoding very early in the stream with no message or anything
“an unknown error occurred while saving the session” happens when trying to save a large session
“Device Change in progress” occurs when trying to start a new session without restarting logic and logic needs to be terminated.

Am I expecting too much from this analyzer?
What else can I try? Hardware analyzers seem to be very pricy and all the software analyzers I’ve tried are either very high level or BSOD ‘regularly’, none can analyze the ‘arrival’ of the device

(Typical of where the decoder ‘stops’)

I have had some success with using the USB LS/FS analyzer. I have mainly used it to help in trying to understand some different USB devices and how to maybe support them, with our Teensy(PJRC) USB Host code.

I have had the best luck using packets mode. Occasionally getting some data using control.
But in many of these cases, I ended up with gigantic forest where it made it very difficult to find the trees I was looking for. Literally something like 10s or 100s of thousands of output lines. And the main data I was looking for was maybe < 100 lines. So, with their current released stuff, I used to do a capture, save the report out to file, and then use a combination of greps (usually using the linux version) and some regular expression search/replace within sublime text to knock the data down to size…

Several threads up here where I mentioned it. With the version 2 software with Low level and high level analyzers, I was (and am) hoping that Saleae will have an updated version of the USB analyzer that supports the new protocols, which allows it to work with High Level analyzers(HLA).

AFAIK - they have not yet done this yet. So awhile ago, I did a first cut at it. It is not 100% completed. I started off with packet mode as that is what I mostly use. And had it working well enough for the stuff I was doing at the time. I also then developed an HLA that extracted the data that I was interested in. In particular anything that had data associated with it.

I started to add some of the Control stuff as it is very convenient for it to decode some of the packets, so I don’t have to. I have/had some of this working.

I typically only work on this stuff, when I need to. That is, I am actively trying to figure out what some new device is doing. And for the last many months, I have been off playing with other stuff.

More information up on the thread:
USB LS and FS Analyzer been enhanced? - Logic 2 Software - Saleae - Logic 2

@mark1 Thanks for letting us know about this. First, can you review the images in the support article below and let me know which specific Saleae Logic model number you own? Just want to make sure we know which exact model you are using.

Next, the issues below look pretty critical. This is not normal. I’d like to get started with figuring out what could be going on here as a starting point.

  • How large of a session are you attempting to save (i.e. how long is the capture, what are your capture settings, etc)? Is it possible your PC is running out of hard disk space when attempting to save the capture?
  • Is the “Device Change in progress” error 100% reproducible by following a specific set of steps? If so, can you confirm how exactly you can reproduce the issue?
  • Can you share what OS you are running?
  • Can you share your machine ID with us?

It’s an ‘Original Logic 16’
The session isn’t that big, say 50 seconds, seems to save a few MB, but read on.
Win10 MachineID: 11409efc-2f22-4ed4-a07c-d25ba0ad33f8
Everything works ‘well’ and normal until the decoder ‘stops’ and I try to change the ‘USB Decode Level’. Actually, even that seems to work a few times, but eventually the ‘Save’ button in the ‘USB LS and FS’ menu goes grey after clicking on it (i.e. the menu does not close) and that’s when the problems start.
When I then click ‘save Capture’ that’s when the unknown error occurs. When clicking ‘save capture’ the ‘type=render’ thread goes to a significant part of one CPU and stays there, even after the error.
You can ‘cancel’ out of that menu, but the app seems to be not fully operational anymore, hovering over the start button displays ‘start’, but clicking on it results in the ‘Device change in progress’. The app can be closed, but the looping task stays there until manually terminated.
If the decoder has a stream that it can decode doing the above all works and there is no issue.
Hope that helps

Thanks @mark1! We’ll review any uploaded error reports your PC may have sent to us and we’ll let you know our findings.

Hi @mark1,

Thanks for sending in the details, and I’m sorry for the trouble with this!

Using the machine ID you sent in, I was able to find errors that suggest the software back-end became hungup after attempting to start saving a capture. Unfortunately, I don’t have quite enough detail to figure out why.

What would help a lot is if you could could reproduce the case where the “save” button is disabled, then delete all analyzers you have added to the capture, then try saving it and send us a copy. Hopefully we’ll be able to reproduce it by adding the USB analyzer again here and changing the decode layer several times.

What’s particularly unusual about the hangup is that it’s reporting that the save start operation has locked up. However, the same start operation should be basically instant - it just kicks off another thread and then returns. It could be some sort of contention that is blocking the save start operation that’s causing the problem.

LoopingCapture2.sal (5.8 MB)
You don’t even need to go as far as getting the save button disabled with this capture.
Just open the capture, click to add the analyzer, as soon as the dialog is open ‘the loop’ starts, you can then cancel the add of the analyzer and the loop continues.
Any attempt to save the capture results in the ‘original’ error.

@mark1 Thanks for providing that capture file. I was immediately able to reproduce the decoding process getting locked up at the exact point shown in the image below.

We’ll look into this.

For what it’s worth, my hacked up version with protocol 2 and HLA appears to go farther…

and if I go into Terminal mode with only HLA output to it and cut and paste to fil and load
into excel it starts off with:

37.21099234 SETUP 0x0 0x0 [GET_DESCRIPTOR - DEVICE #:0 I:0x0 L:0x40] 0x80 0x6 0x0 0x1 0x0 0x0 0x40 0x0
37.21121925 IN 0x0 0x0 0xD8(0x0x8) 0x12 0x1 0x0 0x2 0x0 0x0 0x0 0x40 0xd8 0x4 0x9 0x0 0x0 0x1 0x1 0x2 0x3 0x1
37.25891289 SETUP 0x0 0x0 SET_ADDRESS I:0x0 L:0x0] 0x0 0x5 0x18 0x0 0x0 0x0 0x0 0x0
37.26988335 SETUP 0x0 0x18 [GET_DESCRIPTOR - DEVICE #:0 I:0x0 L:0x12] 0x80 0x6 0x0 0x1 0x0 0x0 0x12 0x0
37.27009806 IN 0x0 0x18 0xD8(0x0x8) 0x12 0x1 0x0 0x2 0x0 0x0 0x0 0x40 0xd8 0x4 0x9 0x0 0x0 0x1 0x1 0x2 0x3 0x1
37.2702235 SETUP 0x0 0x18 [SET_CONFIGURATION I:0x0 L:0x0] 0x0 0x9 0x1 0x0 0x0 0x0 0x0 0x0
37.27142277 OUT 0x2 0x18 0x55 0x53 0x42 0x43 0x50 0x79 0x6d 0xdf 0x0 0x2 0x0 0x0 0x80 0x0 0xa 0x28 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x1 0x0 0x0 0x0 0x0 0x0 0x0 0x0
37.27171274 IN 0x1 0x18 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0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0x0 0x12 0x0
37.49805863 IN 0x0 0x18 0xD8(0x0x8) 0x12 0x1 0x0 0x2 0x0 0x0 0x0 0x40 0xd8 0x4 0x9 0x0 0x0 0x1 0x1 0x2 0x3 0x1
37.49820357 SETUP 0x0 0x18 [SET_CONFIGURATION I:0x0 L:0x0] 0x0 0x9 0x1 0x0 0x0 0x0 0x0 0x0

Again not saying it is perfect state, simply that it did not totally hang. It did chug for a long time when it hit about 65% done.

1 Like

Thanks @mark1,

I was able to attach a debugger and found that our USB analyzer is getting into an infinite loop while it’s trying to parse a control request. I’m still digging through the session, and I haven’t been able to identify the problem yet.

I believe it is in the middle of parsing the response to a string descriptor read. Descriptor index 3.

The value the analyzer has decoded for the string descriptor at this point is “123-32”.

The problem is that the analyzer believes that there is still more data to be parsed from this, however it has nothing left to parse. As if there are 5 more bytes that need to be processed before it will exit this processing loop.

This is the while loop at the top of void USBControlTransferParser::ParseDataPacket( USBPacket& packet ) in USBControlTransfers.cpp, specifically while( mPacketDataBytes > mPacketOffset ).

@KurtE, thanks for running this with your version. Could you send me a link? Also, is yours running in at the control transfer layer? I suspect that lower levels of decoding might skip this issue, but I need to check.

The analyzer does work properly when set to the “Packets” decode level. However it may be tricky to change to this mode, because the analyzer will start running with the last used settings the moment you add it. If this is a problem, simply take a new capture with no data, add the USB analyzer, change the settings, and close it. This will change the default settings for the next time you add the USB analyzer to your saved capture. I’ve attached a new copy of the save file with the analyzer already reset as needed.

I believe this is the point in the data where the descriptor is being read, and I can see the descriptor contents in hex “123-321”. Note that the analyzer had failed to parse the last character “1”.

What’s particularly odd is that if I trim the capture to be a little longer than this point, I can see that the analysis always ends there, but the software no longer locks up completely. I’ll need to debug this more closely. I suspect that whatever goes wrong here puts the USB analyzer into a bad state, but that bad state does not ultimately cause the infinite loop until later through the capture.

LoopingCapture2_packets.sal (5.8 MB)

Hmm, could it be that the length value for the 123-321 is wrong?

Just speculating atm as I am not in a position to test.

I saw lengths being 1 low for some other strings in this ‘sample’ code and I wonder if this is still wrong here.

Regardless, it shouldn’t cause the problem observed, but it might explain it.

@mark1, you’re right, that’s the problem. The bLength should be the complete size of the descriptor, including the bLength and bDescriptorType bytes.

There is a bug in the USB analyzer that prevents it from recovering from this error.

I’ve implemented a fix, and have verified it fixes the problem you’re seeing.

I still need to verify that it doesn’t break anything, by comparing the output against the original analyzer with more sample data, but I’m pretty sure that my change will only affect this specific issue.

The fix is here:

We’re swamped at the moment, but I do hope to get this into an upcoming release. In the meantime though, you can download the analyzer with the fix from github here:

Note, I believe you will need to have a github account to actually download the files, despite this being a public repository. Those downloads will also automatically expire after a while, but long after the update has been published with the Logic 2 software.

Now when the descriptor is parsed, our analyzer will skip the remaining bytes when bLength is reached. You can see the missing bytes:

Edit: this isn’t quite fixed yet actually. This can cause issue with other descriptor parsing, should be fixed soon.

Edit 2: It’s fixed now. And it’s passed all testing.