Sunday, December 27, 2009

Cheap MP3 Player and UDEV

This little tidbit might help someone some day.

Recently, I purchased a cheap mp3 player from dealextreme.com. When I plugged it into my Debian box running Squeeze/Sid, it was not properly recognized. According to dmesg, it was thought to be a USB touchscreen, rather than a USB storage device. The vendor ID is 1234 and the Product ID is 5678. Hmm, my guess is the manufacturer didn't bother to register the product with the official USB guys. One of the hazards of buying cheap stuff. Anyway, to get the udev to properly recognize the device, I added the following line (one long line) to /etc/udev/rules.d/z10_local.rules:


SUBSYSTEM=="usb", DRIVER=="usbtouchscreen", ATTRS{idVendor}=="1234", ATTRS{idProduct}=="5678", ACTION=="add",
RUN+="/usr/local/sbin/rebind_usbdriver usb-storage 1234 5678 :1.0"


This howto is an excellent description on how to write UDEV rules.