Bug 264487 - Constant spinning of DVD drive when selecting dolphin
Summary: Constant spinning of DVD drive when selecting dolphin
Status: RESOLVED DUPLICATE of bug 261552
Alias: None
Product: solid
Classification: Frameworks and Libraries
Component: libsolid-udisks (show other bugs)
Version: unspecified
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Lukáš Tinkl
URL:
Keywords:
: 264973 264974 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-01-27 15:10 UTC by Matthias Fuchs
Modified: 2012-09-19 08:14 UTC (History)
10 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Fix spinning (2.44 KB, patch)
2011-01-28 19:16 UTC, Lukáš Tinkl
Details
Patch to the spec file to test Solid patch in Fedora (490 bytes, patch)
2011-01-29 07:21 UTC, Stan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Fuchs 2011-01-27 15:10:33 UTC
Version:           unspecified (using KDE 4.6.0) 
OS:                Linux

The CD in my dvd drive is currently umounted.
Whenever I switch the window to dolphin -- without doing anything else -- the CD starts spinning and I can clearly here my DVD drive.

Reproducible: Always

Steps to Reproduce:
Switch to Dolphin

Actual Results:  
Spinning of medium in the DVD drive

Expected Results:  
No spinning as it was before -- I supose with HAL.
Comment 1 Stan 2011-01-27 22:10:10 UTC
Also happens when opening a file dialog box (open, save as, etc...).  Confirmed on multiple distributions: Kubuntu Natty, Chakra Cyrus, and Fedora 15.
Comment 2 Lukáš Tinkl 2011-01-28 19:16:06 UTC
Created attachment 56583 [details]
Fix spinning

Patch to fix extra spinning by providing a cache of available content
Comment 3 Lukáš Tinkl 2011-01-28 19:16:42 UTC
Please try the above patch to see if it fixes your problem.
Comment 4 Stan 2011-01-29 07:19:59 UTC
I recompiled and installed the kdelibs RPM with the "Fix spinning" patch on Fedora 15.  Unfortunately, Dolphin and the file dialog boxes exhibit the same behavior after the patch as before.  So the proposed fix does not work.

In case anybody else wants to try this or any later patches on Fedora, I have attached the required change to the spec file (make sure to name the patch kdelibs-4.6.0-fix_spinning.patch, or change the spec diff before applying).
Comment 5 Stan 2011-01-29 07:21:37 UTC
Created attachment 56603 [details]
Patch to the spec file to test Solid patch in Fedora
Comment 6 Lukáš Tinkl 2011-02-02 13:46:31 UTC
*** Bug 264905 has been marked as a duplicate of this bug. ***
Comment 7 Lukáš Tinkl 2011-02-02 13:47:59 UTC
*** Bug 264974 has been marked as a duplicate of this bug. ***
Comment 8 Lukáš Tinkl 2011-02-02 16:32:46 UTC
Well, it looks like the patch itself isn't sufficient, Dolphin on the other side needs fixing too :)
Comment 9 Lukáš Tinkl 2011-02-09 17:25:08 UTC
*** Bug 264973 has been marked as a duplicate of this bug. ***
Comment 10 Jimmy Kloss 2011-02-16 17:06:56 UTC
As all my disks spinning bugs seem to be duplicates of this one I'll put this here directly. ;-)

It seems that all KDE apps, at least those with a 'Recent Files' menu, try to access all files from their 'Recent Files' list, thus triggering automount and spinning up disks of all kinds. It's really annoying if you click on local stored text file and kwrite triggers your NFS share on a sleeping remote disk and also blocks while waiting for the disk to spin up. Why? :'-(
Comment 11 Reartes Guillermo 2011-03-22 15:30:54 UTC
For me it is horrible. The cd/dvd is a noisy beast (very noisy).
And there is the 'blocking' time 3 or 5 second in my case (spinup time)

I got to hear the horrible sound when:
 * i opened any document from any kde application (kate, dolphin, etc):
   > yes, i must hear the noise and wait the blocking for opening ~/foo.txt
   > yes, i must heat & wait also for saving as...  ~/foo2.txt

It is mind-destroing (or dvd destroing maybe...) when you hear it more
than 10 times... (i counted it 15 once, now i took care of removing any media
as soon as posible).

I run F15 Alpha, which switched to udisks, so i opened a bugreport there, suspecting udisks.

udisks.x86_64    1.0.1-8.fc15
kernel           2.6.38-1.fc15.x86_64
kdebase          4.6.1-2.fc15.x86_64 

The problem is that the dvd/cd must only spin-up when clicked (selected) not allways, but for me smels more like an udisks problem, but i don't know.
Comment 12 Martin Klapetek 2011-03-23 12:57:39 UTC
Same as all above, whenever I switch to Dolphin or open/save dialog pops-up,
all my removeable media spins up, which introduces a 3-5secs delay (the spin-up
time) and also effectively breaks device powersaving by constantly waking them
up.

Fedora 14 x86_64, KDE 4.6.1-2
Comment 13 Rex Dieter 2011-03-23 21:03:16 UTC
Fwiw, the provided patch seems to help me, but I was only able to test with data media (not audio cd or dvd movie), I'll post some test-builds in the downstream fedora bug, https://bugzilla.redhat.com/show_bug.cgi?id=690123
Comment 14 Lukáš Tinkl 2011-03-24 16:15:05 UTC
Git commit fdd95ee87dcb60bc91729414d3555ddcad124352 by Lukas Tinkl.
Committed on 24/03/2011 at 16:16.
Pushed by lukas into branch 'KDE/4.6'.

fix excessive spinning of optical drives just to get the content type
(introduce a special cache for that)

BUG: 264487

M  +21   -10   solid/solid/backends/udisks/udisksopticaldisc.cpp     
M  +8    -1    solid/solid/backends/udisks/udisksopticaldisc.h     

http://commits.kde.org/kdelibs/fdd95ee87dcb60bc91729414d3555ddcad124352
Comment 15 Juliano F. Ravasi 2011-03-24 19:52:29 UTC
I'm not familiar with solid code, and I can't test it now, but at first sight I don't agree with the fix, and I would like to request for to bug to be reopened.

The patch seems to address the problem only for optical disks, but the same problem is seem on all devices. The following bugs are marked as duplicate of this bug:

bug 264905 - KDE touches unmounted filesystems, applications block for several seconds (reported by me)
bug 264973 - Unnecessarily HDD spin up on login
bug 264974 - Unnecessarily HDD/NFS share spin up in systemsettings -> Digital Camera

All three duplicates are not specific for optical disks. In my case, my problem is an external HDD that is very slow to spin up, and all applications block for up to 12 seconds on many occasions (specially on Open/Save dialogs).
Comment 16 Reartes Guillermo 2011-03-24 20:17:12 UTC
@Juliano F. Ravasi 

i only experiened it for cd/dvd drives, i did not test or investiage how it affects other disks (i have many) nor remote mounts (and it's disks) but if it is like you said, then i do agree with you.

---

i still havent updated & tested the fix (i even don't know if it is in fedora right now). I will first try the fix and see if it is enough or not.
Comment 17 Stan 2011-03-24 21:03:18 UTC
With the updated kdelibs in Fedora 15, I can again confirm that it does not fix the problems, just as Juliano found.

With my many hard drives, it takes around 6 seconds to open with kdelibs-4.6.1-5.fc15 (the updated version), and around 8 seconds with kdelibs-4.6.1-4.fc15 (the old version), compared to almost instantly in KDE 4.5 (with HAL).

As the new version does seem to at least help in the case of optical drives, perhaps implementing similar caches in all udisks*.{cpp,h} will do the trick?
Comment 18 Martin Klapetek 2011-03-24 21:07:19 UTC
I confirm that this is happenning for all removeable media, be it external hdds, cd/dvdrom, flash drives, pretty much everything :)

I'm on F14 x86_64, latest KDE updates
Comment 19 Stan 2011-03-24 21:13:21 UTC
@Martin, not just external media; if you are running SATA drives in AHCI mode, all hard drives are theoretically detachable, and hence it affects all running SATA hard drives, internal or external.
Comment 20 Matthias Fuchs 2011-04-08 00:58:01 UTC
I still have this issue with master just a few days old.
The cd drive is unmounted and whenever activating dolphin it spins up.
Comment 21 Risto H. Kurppa 2011-10-30 09:39:21 UTC
Confirmed on Kubuntu 11.10 64-bit. DVD drive spins up always when I focuse on Dolphin window. Kate File open dialog does the same. Not extremely nice having to wait for disks to spin up.

Anyone have any clue of what could be causing this and/or how to fix it..?
Comment 22 lazx888 2011-11-09 21:48:17 UTC
Confirmed.  My slow archive sata drive (which is rarely accessed by me) is being spun up when opening dolphin, opening files, etc.

A work around:
1) Hide the device in dolphin places.
2) Disable folder previews(?)
Comment 23 Juliano F. Ravasi 2012-01-07 00:45:00 UTC
Strange: I just upgraded to Kubuntu 11.10 64-bit (plus kubuntu-ppa and kubuntu-backports), and the problem suddenly disappeared. Now the disks only spin up when I actually try to mount them. Dolphin and Open/Save dialogs are no longer waking up external disks.

Since I use kubuntu-backports, the KDE version is the same as before the upgrade (4.7.4), so something else should have changed. Udev or udisks, maybe?
Comment 24 Franz Trischberger 2012-02-07 12:18:25 UTC
This is related to https://bugs.kde.org/show_bug.cgi?id=261552
I posted a fix in comment #22. It works here on 2 different PCs. Probably you could try it.
Comment 25 Lukáš Tinkl 2012-09-19 08:12:05 UTC
Git commit c62993b22ac7983db0c7b37f83e50999b699dfa0 by Lukas Tinkl.
Committed on 19/09/2012 at 10:10.
Pushed by lukas into branch 'KDE/4.9'.

use SOLID_GLOBAL_STATIC for the mutex

M  +10   -10   solid/solid/backends/udisks/udisksopticaldisc.cpp

http://commits.kde.org/kdelibs/c62993b22ac7983db0c7b37f83e50999b699dfa0
Comment 26 Lukáš Tinkl 2012-09-19 08:12:44 UTC
Git commit aab44d6b05214f485feb4bc9f2eb9e61c89f387a by Lukas Tinkl.
Committed on 19/09/2012 at 10:10.
Pushed by lukas into branch 'KDE/4.10'.

use SOLID_GLOBAL_STATIC for the mutex

M  +10   -10   solid/solid/backends/udisks/udisksopticaldisc.cpp

http://commits.kde.org/kdelibs/aab44d6b05214f485feb4bc9f2eb9e61c89f387a
Comment 27 Lukáš Tinkl 2012-09-19 08:14:15 UTC

*** This bug has been marked as a duplicate of bug 261552 ***