Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Getting 'usbview' working in Raspbian

Sat Sep 28, 2013 7:52 pm

I really like the USBVIEW program (Google it!) and like to run it under Raspbian.

However, it doesn't work out-of-the-box, for a bunch of semi-related reasons. I will detail them here, but the underlying question is: Whose job is it to fix these? Who is responsible for the repositories and who is responsible for the inter-operability between the versions of software in the repositories and the specific configuration of the Raspbian OS? Those are the questions (and my primary reason for posting)...

Anyway, here's the story:

1) There are two versions of USBVIEW floating around - version 1.1 and version 2.0. 2.0 is fancier, but is in a way less aesthetically pleasing to look at. So, an argument can be made that you might prefer the 1.1 version.

2) The version in the repository is 1.1 - and there doesn't seem to be any plans to upgrade that. However, that version doesn't work. It doesn't work because it can't find the "devices" pseudo-file that drives the program. This is because it (this version) is compiled to use "usbdevfs", which is not in the standard Raspbian kernel. However, it can be made (I.e., hacked) to work - see below.

3) You can self-compile version 2.0 - as I have done - and it works out-of-the-box, almost. See next point...

4) The standard Raspbian kernel does include 'debugfs', but it is not mounted by default. Once you've configured your system to mount 'debugfs', then you can use your self-compiled version of USBVIEW 2.0.

5) The version in the repository (1.1) can be hacked to work, once you have 'debugfs' mounted, by making it use the 'devices' file from 'debugfs' (rather than the compiled-in default which assumes 'usbdevfs'). This requires some symlink trickery and hacking the 'usbview' binary. I've done this, but the details are beyond the scope of this posting. If you are comfortable hacking binaries, it is easy enough to figure out what to do.

Anyway, it would be nice if the repository version (what you get from 'apt-get install usbview') would work out-of-the-box on Raspbian. It would also be nice if it were the current version.
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

User avatar
mpthompson
Posts: 620
Joined: Fri Feb 03, 2012 7:18 pm
Location: San Carlos, CA
Contact: Website

Re: Getting 'usbview' working in Raspbian

Sun Sep 29, 2013 7:09 am

Whose job is it to fix these?
Well, the short answer is that it is all of us (those who use Raspbian on the Raspberry Pi). I think you've done a pretty good job of diagnosing the problem and provided enough information that someone who does want to get usbview running should be able to get it working.

I agree that it is unfortunate that usbview doesn't work "out of the box", but the kernel is maintained by the folks at the Raspberry Pi Foundation. Desired changes to the kernel would need to be brought to their attention and perhaps they would be willing to add the needed kernel drivers/options in a future build.

We could update the usbview package in the Raspbian repository to better reflect how the kernel is built for the Raspberry Pi, but it would almost certainly require someone else to generate the needed changes to the package and then working with us to get the package updated in the repository. Creating such changes can be a bit time consuming and tedious, but that is unfortunately the nature of maintaining Debian packages. If you or someone else wanted to take this task on, I or Plugwash could work with you to get the package into the Raspbian repository.

BTW, the newer 2.0 version of usbview looks to be in Raspbian Jessie. However, you might likely need to upgrade your version of Raspbian to Jessie (see other threads in this forum) before it would work. You could try directly downloading and installing the .deb using the 'dpkg' utility in Raspbian Wheezy as it might work if it doesn't have dependencies on other Jessie packages.

The .deb packages can be found here: http://archive.raspbian.org/raspbian/po ... u/usbview/

If you want to take a stab at generating changes tuned for the Raspbian usbview package, let me know and I can steer you towards some resources that describe how it can be done.

Mike

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: Getting 'usbview' working in Raspbian

Sun Sep 29, 2013 11:13 am

Thanks, Mike, for your reply. Quite interesting.

I may take you up on your offer of help at some future time.

BTW, I think the real fix to this problem is to update usbview itself (I.e., in the C source code) to take a "-f" command line option. This would eliminate the problem totally, by allowing the user to specify where the "devices" file is on his particular system. Doing this properly would, of course, require working with the usbview author, which would add to the complexity of the task...
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

User avatar
mpthompson
Posts: 620
Joined: Fri Feb 03, 2012 7:18 pm
Location: San Carlos, CA
Contact: Website

Re: Getting 'usbview' working in Raspbian

Sun Sep 29, 2013 9:38 pm

Every Debian package has a maintainer associated with it -- basically a person or group of persons responsible for taking the original source code and converting it into a Debian source package that is suitable for compilation into a binary package on the Debian build servers. For Raspbian, we take these same Debian source packages and simply rebuild them with the correct settings for the Armv6 CPU with hard float on the Raspberry Pi. A small percentage of these packages do need to be hand tweaked to build, but it's manageable.

If you have suggestions for a Debian package such as usbview it may be worthwhile to send an email off to the Debian package maintainer. They may or may not be thrilled about a request for a custom tweak to the package for Raspbian (which is an unofficial rebuild of Debian), but you may get a sympathetic ear and possibly some help with a future update to the package being more suitable for the Raspberry Pi.

Return to “Raspbian”