Bug 147758 - While ipod is connected, quitting or ejecting it takes a long time
Summary: While ipod is connected, quitting or ejecting it takes a long time
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: general (show other bugs)
Version: 1.4.6
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Amarok Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-10 19:14 UTC by Piotr Mitas
Modified: 2008-08-05 23:07 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Piotr Mitas 2007-07-10 19:14:39 UTC
Version:           1.4.6 (using KDE 3.5.7, Gentoo)
Compiler:          GCC 4.1.2 
OS:                Linux (i686) release 2.6.21-ck2-r1

When my 80GB ipod video is connected and I try to eject it, or quit Amarok, suddenly CPU usage jumps to 100% for about 20 seconds and for that period it's very unresponsive. Then it quits or disconnects. It's even more annoying when I'm compiling/encoding something in the background. Not sure if it helps, but here's a part of what 'strace amarokapp' prints:

---
fcntl64(14, F_SETLK64, {type=F_UNLCK, whence=SEEK_SET, start=0, len=0}, 0xbfa37204) = 0
fcntl64(14, F_SETLK64, {type=F_RDLCK, whence=SEEK_SET, start=1073741824, len=1}, 0xbfa37234) = 0
fcntl64(14, F_SETLK64, {type=F_RDLCK, whence=SEEK_SET, start=1073741826, len=510}, 0xbfa37234) = 0
fcntl64(14, F_SETLK64, {type=F_UNLCK, whence=SEEK_SET, start=1073741824, len=1}, 0xbfa37234) = 0
access("/home/piotrek/.kde3.5/share/apps/amarok/collection.db-journal", F_OK) = -1 ENOENT (No such file or directory)
fstat64(14, {st_mode=S_IFREG|0644, st_size=6172672, ...}) = 0
_llseek(14, 24, [24], SEEK_SET)         = 0
read(14, "\0\0\3I\0\0\0\0\0\0\v\7\0\0\0\4", 16) = 16
stat64("/var/tmp", {st_mode=S_IFDIR|S_ISVTX|0777, st_size=4096, ...}) = 0
access("/var/tmp", R_OK|W_OK|X_OK)      = 0
access("/var/tmp/etilqs_0CrO7MSsaU8NTJ0", F_OK) = -1 ENOENT (No such file or directory)
open("/var/tmp/etilqs_0CrO7MSsaU8NTJ0", O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE, 0600) = 24
fstat64(24, {st_mode=S_IFREG|0600, st_size=0, ...}) = 0
unlink("/var/tmp/etilqs_0CrO7MSsaU8NTJ0") = 0
stat64("/var/tmp", {st_mode=S_IFDIR|S_ISVTX|0777, st_size=4096, ...}) = 0
access("/var/tmp", R_OK|W_OK|X_OK)      = 0
access("/var/tmp/etilqs_PkQWhEqHC3rPkI9", F_OK) = -1 ENOENT (No such file or directory)
_llseek(24, 0, [0], SEEK_SET)           = 0
read(24, "", 100)                       = 0
fcntl64(24, F_SETLK64, {type=F_RDLCK, whence=SEEK_SET, start=1073741824, len=1}, 0xbfa37234) = 0
fcntl64(24, F_SETLK64, {type=F_RDLCK, whence=SEEK_SET, start=1073741826, len=510}, 0xbfa37234) = 0
fcntl64(24, F_SETLK64, {type=F_UNLCK, whence=SEEK_SET, start=1073741824, len=1}, 0xbfa37234) = 0
fstat64(24, {st_mode=S_IFREG|0600, st_size=0, ...}) = 0
fcntl64(24, F_SETLK64, {type=F_WRLCK, whence=SEEK_SET, start=1073741825, len=1}, 0xbfa372c4) = 0
fcntl64(24, F_SETLK64, {type=F_RDLCK, whence=SEEK_SET, start=1073741826, len=510}, 0xbfa37224) = 0
fcntl64(24, F_SETLK64, {type=F_UNLCK, whence=SEEK_SET, start=1073741824, len=2}, 0xbfa37224) = 0
fcntl64(24, F_SETLK64, {type=F_UNLCK, whence=SEEK_SET, start=0, len=0}, 0xbfa37234) = 0
close(24)                               = 0
fcntl64(14, F_SETLK64, {type=F_UNLCK, whence=SEEK_SET, start=0, len=0}, 0xbfa37254) = 0
fcntl64(14, F_SETLK64, {type=F_RDLCK, whence=SEEK_SET, start=1073741824, len=1}, 0xbfa371d4) = 0
fcntl64(14, F_SETLK64, {type=F_RDLCK, whence=SEEK_SET, start=1073741826, len=510}, 0xbfa371d4) = 0
fcntl64(14, F_SETLK64, {type=F_UNLCK, whence=SEEK_SET, start=1073741824, len=1}, 0xbfa371d4) = 0
access("/home/piotrek/.kde3.5/share/apps/amarok/collection.db-journal", F_OK) = -1 ENOENT (No such file or directory)
fstat64(14, {st_mode=S_IFREG|0644, st_size=6172672, ...}) = 0
_llseek(14, 24, [24], SEEK_SET)         = 0
read(14, "\0\0\3I\0\0\0\0\0\0\v\7\0\0\0\4", 16) = 16
fcntl64(14, F_SETLK64, {type=F_UNLCK, whence=SEEK_SET, start=0, len=0}, 0xbfa371f4) = 0
fcntl64(14, F_SETLK64, {type=F_RDLCK, whence=SEEK_SET, start=1073741824, len=1}, 0xbfa371e4) = 0
fcntl64(14, F_SETLK64, {type=F_RDLCK, whence=SEEK_SET, start=1073741826, len=510}, 0xbfa371e4) = 0
fcntl64(14, F_SETLK64, {type=F_UNLCK, whence=SEEK_SET, start=1073741824, len=1}, 0xbfa371e4) = 0
access("/home/piotrek/.kde3.5/share/apps/amarok/collection.db-journal", F_OK) = -1 ENOENT (No such file or directory)
fstat64(14, {st_mode=S_IFREG|0644, st_size=6172672, ...}) = 0
_llseek(14, 24, [24], SEEK_SET)         = 0
read(14, "\0\0\3I\0\0\0\0\0\0\v\7\0\0\0\4", 16) = 16
fcntl64(14, F_SETLK64, {type=F_UNLCK, whence=SEEK_SET, start=0, len=0}, 0xbfa37204) = 0
fcntl64(14, F_SETLK64, {type=F_RDLCK, whence=SEEK_SET, start=1073741824, len=1}, 0xbfa371e4) = 0
fcntl64(14, F_SETLK64, {type=F_RDLCK, whence=SEEK_SET, start=1073741826, len=510}, 0xbfa371e4) = 0
fcntl64(14, F_SETLK64, {type=F_UNLCK, whence=SEEK_SET, start=1073741824, len=1}, 0xbfa371e4) = 0
access("/home/piotrek/.kde3.5/share/apps/amarok/collection.db-journal", F_OK) = -1 ENOENT (No such file or directory)
fstat64(14, {st_mode=S_IFREG|0644, st_size=6172672, ...}) = 0
_llseek(14, 24, [24], SEEK_SET)         = 0
read(14, "\0\0\3I\0\0\0\0\0\0\v\7\0\0\0\4", 16) = 16
fcntl64(14, F_SETLK64, {type=F_UNLCK, whence=SEEK_SET, start=0, len=0}, 0xbfa37204) = 0
fcntl64(14, F_SETLK64, {type=F_RDLCK, whence=SEEK_SET, start=1073741824, len=1}, 0xbfa37234) = 0
fcntl64(14, F_SETLK64, {type=F_RDLCK, whence=SEEK_SET, start=1073741826, len=510}, 0xbfa37234) = 0
fcntl64(14, F_SETLK64, {type=F_UNLCK, whence=SEEK_SET, start=1073741824, len=1}, 0xbfa37234) = 0
access("/home/piotrek/.kde3.5/share/apps/amarok/collection.db-journal", F_OK) = -1 ENOENT (No such file or directory)
fstat64(14, {st_mode=S_IFREG|0644, st_size=6172672, ...}) = 0
_llseek(14, 24, [24], SEEK_SET)         = 0
read(14, "\0\0\3I\0\0\0\0\0\0\v\7\0\0\0\4", 16) = 16
stat64("/var/tmp", {st_mode=S_IFDIR|S_ISVTX|0777, st_size=4096, ...}) = 0
access("/var/tmp", R_OK|W_OK|X_OK)      = 0
access("/var/tmp/etilqs_Dqazt9CD4dbgYBH", F_OK) = -1 ENOENT (No such file or directory)
open("/var/tmp/etilqs_Dqazt9CD4dbgYBH", O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE, 0600) = 24
fstat64(24, {st_mode=S_IFREG|0600, st_size=0, ...}) = 0
unlink("/var/tmp/etilqs_Dqazt9CD4dbgYBH") = 0
stat64("/var/tmp", {st_mode=S_IFDIR|S_ISVTX|0777, st_size=4096, ...}) = 0
access("/var/tmp", R_OK|W_OK|X_OK)      = 0
access("/var/tmp/etilqs_QTK2p3AhVINCpBS", F_OK) = -1 ENOENT (No such file or directory)
_llseek(24, 0, [0], SEEK_SET)           = 0
read(24, "", 100)                       = 0
fcntl64(24, F_SETLK64, {type=F_RDLCK, whence=SEEK_SET, start=1073741824, len=1}, 0xbfa37234) = 0
fcntl64(24, F_SETLK64, {type=F_RDLCK, whence=SEEK_SET, start=1073741826, len=510}, 0xbfa37234) = 0
fcntl64(24, F_SETLK64, {type=F_UNLCK, whence=SEEK_SET, start=1073741824, len=1}, 0xbfa37234) = 0
fstat64(24, {st_mode=S_IFREG|0600, st_size=0, ...}) = 0
fcntl64(24, F_SETLK64, {type=F_WRLCK, whence=SEEK_SET, start=1073741825, len=1}, 0xbfa372c4) = 0
fcntl64(24, F_SETLK64, {type=F_RDLCK, whence=SEEK_SET, start=1073741826, len=510}, 0xbfa37224) = 0
fcntl64(24, F_SETLK64, {type=F_UNLCK, whence=SEEK_SET, start=1073741824, len=2}, 0xbfa37224) = 0
fcntl64(24, F_SETLK64, {type=F_UNLCK, whence=SEEK_SET, start=0, len=0}, 0xbfa37234) = 0
close(24)                               = 0
fcntl64(14, F_SETLK64, {type=F_UNLCK, whence=SEEK_SET, start=0, len=0}, 0xbfa37254) = 0
fcntl64(14, F_SETLK64, {type=F_RDLCK, whence=SEEK_SET, start=1073741824, len=1}, 0xbfa371d4) = 0
fcntl64(14, F_SETLK64, {type=F_RDLCK, whence=SEEK_SET, start=1073741826, len=510}, 0xbfa371d4) = 0
fcntl64(14, F_SETLK64, {type=F_UNLCK, whence=SEEK_SET, start=1073741824, len=1}, 0xbfa371d4) = 0
access("/home/piotrek/.kde3.5/share/apps/amarok/collection.db-journal", F_OK) = -1 ENOENT (No such file or directory)
fstat64(14, {st_mode=S_IFREG|0644, st_size=6172672, ...}) = 0
_llseek(14, 24, [24], SEEK_SET)         = 0
read(14, "\0\0\3I\0\0\0\0\0\0\v\7\0\0\0\4", 16) = 16
fcntl64(14, F_SETLK64, {type=F_UNLCK, whence=SEEK_SET, start=0, len=0}, 0xbfa371f4) = 0
fcntl64(14, F_SETLK64, {type=F_RDLCK, whence=SEEK_SET, start=1073741824, len=1}, 0xbfa371e4) = 0
fcntl64(14, F_SETLK64, {type=F_RDLCK, whence=SEEK_SET, start=1073741826, len=510}, 0xbfa371e4) = 0
fcntl64(14, F_SETLK64, {type=F_UNLCK, whence=SEEK_SET, start=1073741824, len=1}, 0xbfa371e4) = 0
access("/home/piotrek/.kde3.5/share/apps/amarok/collection.db-journal", F_OK) = -1 ENOENT (No such file or directory)
fstat64(14, {st_mode=S_IFREG|0644, st_size=6172672, ...}) = 0
_llseek(14, 24, [24], SEEK_SET)         = 0
read(14, "\0\0\3I\0\0\0\0\0\0\v\7\0\0\0\4", 16) = 16
fcntl64(14, F_SETLK64, {type=F_UNLCK, whence=SEEK_SET, start=0, len=0}, 0xbfa37204) = 0
fcntl64(14, F_SETLK64, {type=F_RDLCK, whence=SEEK_SET, start=1073741824, len=1}, 0xbfa371e4) = 0
fcntl64(14, F_SETLK64, {type=F_RDLCK, whence=SEEK_SET, start=1073741826, len=510}, 0xbfa371e4) = 0
fcntl64(14, F_SETLK64, {type=F_UNLCK, whence=SEEK_SET, start=1073741824, len=1}, 0xbfa371e4) = 0
access("/home/piotrek/.kde3.5/share/apps/amarok/collection.db-journal", F_OK) = -1 ENOENT (No such file or directory)
fstat64(14, {st_mode=S_IFREG|0644, st_size=6172672, ...}) = 0

I can provide more information if nessesary.
Comment 1 shattered 2007-07-22 17:16:18 UTC
Assuming that "eject" == "disconnect" in amarok's "media device" tab:

amarok synchronizes scores and play counts to the ipod (MediaDevice::syncStatsToDevice).  This happens unconditionally, even if a playlist transfer finished immediately before that.
Comment 2 Sebastien 2007-11-11 23:57:08 UTC
I confirm.

I have 4360 songs, and it takes 1.5 minutes to disconnect.
There is no iPod disk activity during those 1.5 minutes, only ~10 seconds of iPod disk acticity at the end of the disconnecting.

I was told rythmbox also sync ratings and statistics, and it takes 10 seconds to disconnect the iPod.
And iTunes also do such syncing, and disconnecting also takes just a few seconds.

Amarok can clearly optimize on that path.
Or at least do that in a separate thread, right when the iPod is connected, and not take 100% CPU.
Comment 3 David Leutwyler 2008-06-15 20:17:09 UTC
I cannot test this since I dont have an 80 gig IPod. Works with my 40gig. But anyway Amarok 1.4.x is in bugfix-only mode as development is focused on Amarok 2. Unfortunately your feature request can not be implemented in Amarok 1, as Amarok developers do not have the resources for it and risk of regression would be too high. I am therefore moving your request to Amarok 2. I cannot make any guarantee as to whether is will get implemented there or not though. Thank you for your report.
Comment 4 Lydia Pintscher 2008-08-05 23:07:09 UTC
I assume this is fixed.
If not: This changed a lot in Amarok 2 and it is unlikely that this is still valid there.

Thank you for your report.