Repeated clicking at 1 second intervals from floppy drive

Bug #741632 reported by Chris Cowley
196
This bug affects 26 people
Affects Status Importance Assigned to Milestone
calibre
Won't Fix
Undecided
Unassigned

Bug Description

Calibre 0.7.50 on Windows 7. Whenever I plug my mobile phone into the USB port to charge it with calibre running, the floppy disk drive in the machine (yes, some PCs do still have floppy drives!) begins a constant process of loud repeated clicking at approx. 1 second intervals. There is no disk in the floppy drive at the time. The clicking stops as soon as I unplug the phone.

Debug device detection info:-

Version: 0.7.50
USB devices on system:
[u'usb\\root_hub&vid8086&pid27cb&rev0001',
 u'usb\\root_hub&vid8086&pid27c8&rev0001',
 u'usb\\root_hub&vid8086&pid27ca&rev0001',
 u'usb\\root_hub&vid8086&pid27c9&rev0001',
 u'usb\\root_hub20&vid8086&pid27cc&rev0001',
 u'usb\\vid_0424&pid_2504&rev_0001',
 u'usb\\vid_0461&pid_4d0f&rev_0200',
 u'usb\\vid_0bb4&pid_0ff9&rev_0226',
 u'usb\\vid_0bc2&pid_3001&rev_0000',
 u'usb\\vid_0c45&pid_602c&rev_0101',
 u'usb\\vid_413c&pid_2003&rev_0301',
 u'usb\\vid_413c&pid_5117&rev_0001',
 u'usb\\vid_413c&pid_5117&rev_0001&mi_00',
 u'usb\\vid_413c&pid_5117&rev_0001&mi_01',
 u'usb\\vid_413c&pid_5117&rev_0001&mi_02',
 u'usb\\vid_413c&pid_5117&rev_0001&mi_03']
Drives detected:
Available plugins: ALEX ALURATEK_COLOR ANDROID ARCHOS7O AVANT AZBOOKA BAMBOOK BLACKBERRY
BOOQ BOOX COOL_ER CYBOOK DBOOK E52 E71X EB511 EB600 EBK52 ECLICTO EDGE
EEEREADER ELONEX ESLICK FOLDER_DEVICE_FOR_CONFIG GEMEI GER2 HANLINV3
HANLINV5 ILIAD INVESBOOK IPAPYRUS IREXDR1000 IREXDR800 IRIVER_STORY
ITALICA ITUNES JETBOOK JETBOOK_MINI KINDLE KINDLE2 KINDLE_DX KOBO
LUMIREAD MENTOR MIBUK N516 N770 N810 NEWSMY NEXTBOOK NOOK NOOK_COLOR
NUUT2 ORIZON PALMPRE PDNOVEL PDNOVEL_KOBO PICO POCKETBOOK301
POCKETBOOK360 POCKETBOOK602 POCKETBOOK701 PRS505 README S60 SHINEBOOK
SNE SOVOS SPECTRA STASH SUNSTECH_EB700 SWEEX TECLAST_K3 THEBOOK
TREKSTOR VELOCITYMICRO WEXLER

Looking for devices...
 u'usb\\vid_0bb4&pid_0ff9&rev_0226'

Devices possibly connected: None

Revision history for this message
Kovid Goyal (kovid) wrote : Re: calibre bug 741632

You have an HTC phone (or other device connected). Either disconnect it or go
to preferences->plugins in calibre and disable the android plugin, then
calibre will not try to connect to the phone, causing your flopy seeks.

 status fixreleased

Changed in calibre:
status: New → Fix Released
Revision history for this message
Chris Cowley (chris-cowley) wrote :

What if my ebook reader is an android device? I don't think Calibre should be polling floppy disk drives when looking for devices.

Revision history for this message
Kovid Goyal (kovid) wrote :

If your device is actually detected successfully then calibre will not poll
your drive. It's only a partial detection that causes the polling.

Revision history for this message
Chris Cowley (chris-cowley) wrote :

Yes, I fully appreciate this - but calibre should still not be doing anything with my floppy disk drive as part of the polling process. I appreciate that it may affect so few users that it's not worth your time to address (I guess not that many people have floppy disk drives any more), but I don't think it's correct to imply this isn't a bug in calibre. Under C/C++, one could use DeviceIoControl with the IOCTL_DISK_GET_MEDIA_TYPES to avoid erroneously polling floppy disks - unfortunately, I don't know python otherwise I'd gladly try to submit a patch to address this.

For info, there is a fairly high likelihood of android devices being 'partially detected' in this way because, when the device is connected via USB it asks the user whether they want to "charge only" or mount the SD card as a disk. I select "charge only" because that's what I want to do, and if I instead elect to mount the SD card as a disk in Windows, it's immediately *unmounted* on the phone which stops a whole bunch of apps working (any apps that are installed on the SD card, plus any apps that use the SD card to cache or store data such as the web browser, dropbox, etc).

Like I say, I do fully appreciate that I may be in a tiny minority of users who are affected by this (and as it happens my ebook reader is a kindle, so disabling the android plug-in works around the issue for me), but neverless it is a bug, I think.

Revision history for this message
Kovid Goyal (kovid) wrote :

Hey if you want to submit a patch, I'll be thrilled to accept one. This is an
issue that has always irritated me, but not being a windows developer and not
having any floppy drives, I've never been motivated enough to fix it. The
relevant code is in C, the file winutil.c in the calibre codebase. It should be
easy for you to compile winutil.c into an executable to test your patch, if
you need any help, let me know.

Submit a patch and I will be happy to review it.

 status inprogress

Changed in calibre:
status: Fix Released → In Progress
Revision history for this message
Chris Cowley (chris-cowley) wrote :

Nice :) Thanks very much for the info... I will take a look at at winutil.c and let you know how I get on.

Revision history for this message
Chris Cowley (chris-cowley) wrote :

Had a look at this today and, unfortunately, the interfaces to the functions in winutil.c seem to be pythonesque and I can't work out how to create "PyObject"s or how to create wrappers around them to pass parameters to the winutil functions from C. I'm guessing it'd need a test harness building in python, or I'd need to set up a full build environment for calibre to test my changes. I might have a look at doing this at some point in the future, but for now it far exceeds the limit of my knowledge of Python so perhaps I am not the right man for the job... Sorry I can't be of any more immediate help. :(

Revision history for this message
Kovid Goyal (kovid) wrote :

Just take the code from lines 170 to ~700 and paste them into a new C file.
That is the part of the code that has the drive scannig stuff and no python
object.. Rewrite winutil_get_usb_devices as a main function and you should be good to go.

 status inprogress

Kovid Goyal (kovid)
Changed in calibre:
status: In Progress → Incomplete
Kovid Goyal (kovid)
Changed in calibre:
status: Incomplete → Won't Fix
Revision history for this message
azteech (stevep.) wrote :

This is also happening with a home built system running Windows Vista Ultimate with SP2 installed, and also with an HTC Android phone installed. The solution I have found is when the HTC is plugged in to be charged, I set it first to Drive Mode. When Calibre finds the droid SD drive, and clicking stops, I then go back in and reset the drive mode back to charge mode.

While this isn't the proper way to correct for a flaw in the program, is it a workable solution that is easy to implement. Problem is, every time you start Calibre one has to follow the above procedure to stop the clicking.

Revision history for this message
Martin Schneider (protagonist-0815) wrote :

I also got this problem and reported it as a new bug. I was not aware that my mobile phone was also connected to my PC when this happened. It is a cheap china mobile which logs in as 2 different drives. Without the phone, calibre works fine as usual. As I connect my phone to my PC less than once a month, this bug does not bother me anymore...

Thanks kovid for this GREAT program!!

Revision history for this message
Carl Greener (geordey) wrote :

My floppy drive is polled with either my iPhone or Blackberry attached. Running Win 7. I do not use the drive but it is rather annoying.

Revision history for this message
Kovid Goyal (kovid) wrote :

If you dont use the drive go into windows drive manager and disable it.

Revision history for this message
Mark Sinden (mark-sinden) wrote :

Also happens with a Samsung Galaxy phone on a computer running Windows XP SP3. Is it related to the device having multiple storage areas? If so, most smart phones have SD cards which show up as an additional hard drive...

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.