The USB analyser (https://github.com/saleae/usb-analyzer) is very useful when debugging USB communication. Unfortunately even the most coarse view shows a large amount of traffic that it can be difficult to figure out what communication is going on. I have attached a picture with an example. Depending on what you are debugging you might not be interested in all the Sync and PID IN data.
I looked at writing a HLA in Python to process the data more to remove the communication that isn’t PID_DATA0/PID_DATA1 (the interesting communication) but the HLA shows a warning that the USB input isn’t supported.
Can the USB analyser be updated to support a HLA? It would also be great if Saleae could write an example USB decoder in Python as a starting point. Then people can use this to filter out the background communication and just focus on requests and responses. This would then allow the LA to be very similar to the expensive USB sniffers which offer similar features.
I do and have done similar stuff. For example for a Teeny 3.6 and now T4.x that have the ability for USB Host setup, I often try to capture the USB data transfers and try to get the data into a format maybe more similar to what WireShark or Beagle USB 12 might output. (Wish we could do the 480, but that is probably wishing for too much).
It sounds like you are looking for the same sort of features. The posts you link to are what I’m looking for as well. I never had a lot of luck analysing the exported the data as it was difficult to get a good idea what is going on.
I just added an idea post below to begin officially tracking this feature request. I also linked it to this discuss post to add more context.
Feel free to add your votes and comments to it. It’s not on the roadmap yet, but we’d like to track user interest in it to help with prioritization. Right now, our HLAs support the following analyzers. Adding HLA support for a single analyzer is quite involved.
Depending on what you are debugging you might not be interested in all the Sync and PID IN data.
Would a simple Data Table filter (in this case for “VALUE”) help in your case? We’re in the process of evaluating how to improve our Data Table. if so, would you mind posting that idea below with that information? Feel free to link this discuss post to your idea post as well. https://ideas.saleae.com/
Yes having versions of the filtering might help. There was some discussion about some of it I think back in the thread:
As I mentioned back then, when I receive packets with data, I need the previous packet as well. That will give you context of if it is a Setup or an IN or an OUT packet, with the context.
But at a minimum it would help if one could filter out, all of the other stuff, like SOF, ACK, NAK, … type messages.
Thanks for adding that to the feature request @timreyes.
I can imagine that porting the USB analyser to the new HLA setup would be a lot of work. Hopefully others are interested in it and can up vote the feature request.
I included an example of what some interesting traffic looks like in USB. As you can see there are multiple transactions, so a simple value filter wouldn’t be enough. In this case it might be easier to do an inverse filter (as in ignore values that match a pattern).
Sorry for cross-posting from ideas.saleae.com… but I think I might reach more people here. This thread already has 4k views up to this day. I wrote a Python high level decoder for traces exported from Saleae Logic USB LS/FS.
It’s open source and you can find it on GitHub. It’s not a modified Saleae Logic analyzer but it’s a tool to process CSV files exported with Saleae Logic using Python.
UsbInsight - a high-level USB decoder to export USB transactions or packets from Saleae Logic traces - maehw/UsbInsight
Please note that this is an external tool and not a HLA extension. If people are interested, we could make this a binary to run on Windows or MacOS so that you don’t need a Python environment.
I haven’t checked your solution @KurtE - so I cannot tell the differences. But if I understand correctly, you’ve modified the existing USB analyzer Saleae originally provided.
Yes - I made a version of their LLA that outputs the new format, which allows you to then
use it as an input for an HLA. I also have an HLA that outputs the data that I am interested in.
Will have to try yours, next time I setup to do USB Host stuff. To see how well it works.
Short update on this little side-project in case you are still interested: today, I recorded and analyzed a USB full-speed capture with my Saleae Logic analyzer. This made me add support for start-of-frame (SOF) packets as I had placed some assertions in the code that would fail when somebody tried to process USB full-speed (FS) instead of low-speed (LS) captures – because I had not yet recorded (and hence tested) my own ones. This is fixed… or at least works for me™ (YMMV). As my capture was very long… or my machine was very slow in processing, I’ve also added a progress bar (using Python module tqdm). Happy hacking!
And another short update: you can now export binary data of control transfers (on endpoints 0) and also the binary data of all other endpoints (Windows seems to call this “R/W pipes”). The R/W pipe data can be split by EP0 control transfers or dumped as a whole. Feel free to test it out and make additional suggestions. Or ask when there’s a lack of documentation.