Bug 128334 - first click on "connect to media device" fails after calling pre-connect action
Summary: first click on "connect to media device" fails after calling pre-connect action
Status: RESOLVED UNMAINTAINED
Alias: None
Product: amarok
Classification: Applications
Component: Collections/Media Devices (show other bugs)
Version: 1.4.0
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Amarok Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-31 00:50 UTC by Christoph Vogtländer
Modified: 2009-03-19 20:38 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christoph Vogtländer 2006-05-31 00:50:02 UTC
Version:           1.4.0a (using KDE KDE 3.5.2)
Installed from:    Gentoo Packages
Compiler:          gcc-3.4.5 ppc
OS:                Linux

using the pre-connect action "pmount-hal %d" seems to be to slow for amarok... clicking "connect" in the media device tab results in an error message that amarok could not find the mountpoint. A second click on "connect" finally connects (as the media was already mounted correctly after the first click). I have a fairly slow system (700MHz), so it might be that the mount-process takes too long, and amarok proceeds before the action has finished.
Comment 1 Martin Aumueller 2006-06-13 10:45:27 UTC
Actually, Amarok waits for the pre-connect command to finish before it proceeds. Could it be that the pmount-hal command returns before the device is actually mounted and added to /etc/mtab?
Comment 2 Christoph Vogtländer 2006-06-14 00:14:42 UTC
no, it does not seem to return before device is mounted... at least "pmount-hal /dev/sda1 && mount" always shows /dev/sda1 mounted correctly. I modified the pre-connect command to "pmount-hal %d && sleep 5", giving me time to call mount from a console while pre-connect command was still running. Strangely amarok still insists after the 5s that the media is not mounted, although mount shows that it is. So the problem seems to be not to be a problem with the pre-connect command itself?
Comment 3 Malte S. Stretz 2006-06-22 18:10:28 UTC
I can confirm this with pmount.  The issue with pmount-hal might be that it tries to mount it on a mount point based on the label (at least here it puts my player under /media/NO NAME), but pmount theoretically works correct.

I also put the following small shell script /usr/local/bin/pmount:
#!/bin/bash
date +%s >/tmp/pmount.log
echo "$@">>/tmp/pmount.log
/usr/bin/pmount "$@"
date +%s >>/tmp/pmount.log
x=$?
echo $x>>/tmp/pmount.log
mount|grep "$1">>/tmp/pmount.log
exit $x

The output looks fine... just once my player loaded within one second and indeed that try amarok didn't complain.

Failed:
1150992363
/dev/sdc1
1150992369
0
/dev/sdc1 on /media/sdc1 type vfat (rw,noexec,nosuid,nodev,quiet,shortname=mixed,uid=1000,gid=100,umask=077)

Worked:
1150992313
/dev/sdc1
1150992313
0
/dev/sdc1 on /media/sdc1 type vfat (rw,noexec,nosuid,nodev,quiet,shortname=mixed,uid=1000,gid=100,umask=077)
Comment 4 Malte S. Stretz 2006-06-22 18:12:55 UTC
Actually, now that I think about it I guess I forgot to umount the device in the second example.
Comment 5 Fede 2006-06-24 20:02:58 UTC
I'm experiencing this as well, using Amarok 1.4.0 on a Kubuntu Dapper 6.06 (64 bits) installation, with a Creative Zen Nano Plus. I just added this line:
/dev/sda1                       /media/zen         vfat         rw,user,noauto                         0       0
to /etc/fstab, and then put "mount %d" and "eject %d" in the preconnect and postdisconnect commands, as is shown as example in the config dialog. As the original reporter, it fails on first attempt, but succeeds on the second. As my computer should be fast enough (AMD Sempron 2800+ -1600MHZ-), i don't think it's caused by a slow computer.

I posted about this problem in amarok's forum to see if it was a known problem, and a user confirmed he experienced the same behaviour on a SVN snapshot from the 21st of June, you can check it at
http://amarok.kde.org/forum/index.php/topic,12489.0.html
Comment 6 solsTiCe 2006-08-19 18:30:27 UTC
i confirm that problem

i have put pmount %d and pumount %d as command.

the first click fails on my athlon xp 1800+
the second suceed.
i use svn 572562
Comment 7 Martin Aumueller 2006-10-21 14:18:16 UTC
What happens if you use current svn and don't specify a pre-connect action? Does it then work for you?
Comment 8 solsTiCe 2006-10-28 10:35:38 UTC
it seems to work but there is still a yellow popup claiming that i first need to mount the device and then re-click on connect button.
Comment 9 Myriam Schweingruber 2009-03-19 20:38:55 UTC
We are sorry, but Amarok 1.x is not maintained anymore.