Go Back   abi>>forums > Software & Media > Software > MTP on Linux

Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 11-02-2009, 11:36 AM
meetooman's Avatar
meetooman meetooman is offline
Join Date: Oct 2009
Posts: 488
Default How to set the Linux Kernel to use a MTP/MSC device as MTP only

Many portable players, from Sony for example, work in a dual MTP/MSC mode. This behavior makes them recognized by default as MTP devices on Windows PCs, but as MSC device on other OSes.
On Linux when the device is plugged the kernel usb-storage module takes control of it and then often prevents successful MTP operations. Even if the module is unloaded afterward, the device may not be in a correct USB state anymore and will not respond correctly to MTP queries.
A first way to solve the issue is to ban the module by adding it to the blacklist file. But then you will not be able to use any MSC device on the system.

Since the Linux 2.6.29 kernel released on 23 March, 2009 there is a better solution. The usb-storage module has a new "quirks" parameter we can use to tell the module not to bind to a specific device.

This is how to do it:

Create a file named for example usb-storage-devices-blacklist in the /etc/modprobe.d/ directory. You can then type our usb-storage options text line. For each device you want to free from the usb-storage module add a three fields entry. A quirks entry syntax is Vendor_ID:Product_ID:i. The "i" is the flag to say "IGNORE_DEVICE (don't bind to this device)".
options usb-storage quirks=Vendor_ID:Product_ID:i
The following line sets your kernel usb-storage module to ignore a Sony NWZ-A82x player.
options usb-storage quirks=054c:035b:i
More devices can be described, entries are separated by a comma. Here is the line for both a Sony MWZ-A82x and a Meizu M6 MiniPlayer (in MTP mode).
options usb-storage quirks=054c:035b:i,04e8:5a0f:i
Type rmmod usb-storage && modprobe usb-storage as root or reboot the PC to set the new configuration.

You will find the complete instructions and discover several other flags in the Documentation/kernel-parameters.txt file of your recent kernel source tree.

It is now recommended to name your files in /etc/modprobe.d/ using a ".conf" extension. In openSUSE 11.2, there is also now a priority number prefix and a you will find a 99-local.conf file to give your personal parameters to modules.

Last edited by meetooman; 11-14-2009 at 06:27 AM. Reason: Update informations
Reply With Quote

Advertisement [Remove Advertisement]


linux, msc, mtp, quirks, usb-storage

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -5. The time now is 10:12 PM.