Friday, February 12, 2010

Ubuntu 10.04 and 3G modems – usb-modeswitch or not?

I'm writing a blog entry instead of just replying to myself on a mailing list, since this subject might be interesting to a largish portion of the community. Most people assume things just magically work out by themselves and then after a release wonder why it wasn't so.

So, I raised a question on ubuntu-devel-discuss mailing list about whether usb-modeswitch should be included in the default Ubuntu 10.04 LTS installation instead of it only being in the universe repository. Reason was simply that firstly, I've read some general wonderings from the community about why it isn't already so. Secondly, without it my 3G modem (Huawei E1552) was first not functional, but right after installing usb-modeswitch package Network Manager worked smoothly with it.

Since I didn't get much discussion going on besides some statements that it doesn't work for everybody and even has caused extra problems for some others (in 9.10), I asked for a small round of comments on the subject on IRC. The channels are logged so I believe I can quote those a bit.

Colin Watson said among else:
"surely we just want the kernel to DTRT [do the right thing] by default ... this is the upstream trend ... it already DTRT for quite a few devices"
"I'd be very concerned about advertising that it's the Way to get things to work, and thus undermining getting things fixed in the kernel"
"I agree that usb-modeswitch is often a way to get otherwise non-working hardware to work ... I'm just not very convinced it's a real properly supportable option"
"but I'm just another user from this point of view, albeit one who ended up in quite a few discussions with various appropriate upstreams last time round :)"
Later on Paul Sladen continued a bit, among else:
"usb-modeswitch is a very long-winded way of sending a single usb-mass-storage command to the device's first profile"
"grep -hr MessageContent usb_modeswitch.d/ | sort -n | uniq -c | sort -rn shows the level of duplication in the configuration files"
"...I do like that it is done in userspace though, as so easy to disable if you wanted something else".
Meanwhile I also IM:d a bit with Antti Kaijanmäki from whom I probably originally coined the idea of following whether usb-modeswitch is integrated into Ubuntu or not. He mainly said that he doubts the feasibility of updating kernel's USB storage quirks in a stable release, compared to having stable release upgrades about the usb-modeswitch-data udev rules. He also proposed discussing maintainability and usability by distros with the Debian maintainer and upstream, although it sounds like Colin might have had some talks already.

So there we are now. Apparently at this point it is hoped that as many quirks as possible are inserted in the kernel, see for example drivers/usb/storage/unusual_devs.h in the kernel. But if you have concerns about if 10.04 LTS will be kept up-to-date regarding 3G modems and want to somehow participate in bringing usb-modeswitch into Ubuntu default installation or simply discuss how to handle the kernel SRUs properly, it's time to stand up and do something.

Should there perhaps be a process with which the usb-modeswitch developers would get the information they are gathering more easily to the upstream kernel _and_ (older) distribution kernels? Is this simply a case of being easier to address an issue with a "hackish" approach, or is the usb-modeswitch actually the right way to go?

Note that I'm no expert in this area, I simply become interested in various subject from time to time :)

-Timo, going to figure out a kernel quirk for his 3G modem

6 comments:

Unknown said...

Some two years ago, I purchased a laptop, because the USB dongle for Wi Fi could not be used in my old Linux Mint desktop and I needed Wi Fi. Thanks to the above post, I got to know usb-modeswitch, which I installed on the Mint desktop and behold! it works!!

Anonymous said...

Maybe userspace should be able to tell the kernel which devices are to have such quirks applied. The kernel can still keep its list of defaults, but it's then much easier for someone (or some package) to add/remove quirks from userspace. Or does it already support this?

Unknown said...

Take a Look at /lib/udev on your Ubuntu Machine you should find an app called modem-modeswitch.

If i understood it right, this small tool does exatcly the same as usb-modeswitch command.

Antti Kaijanmäki said...

Let's hope usb-modeswitch community and developers participate in this discussion, too:

http://www.draisberghof.de/usb_modeswitch/bb/viewtopic.php?t=322

Anonymous said...

I added my 2-3 cent to the discussion. See the USB_ModeSwitch forum (Antti's link), it has grown into something lengthy ...


Josua Dietze

USB_ModeSwitch author

Anonymous said...

Linkified Antti's link for convenience.