Bug 277685 - UMS devices detected only when amarok is restarted
Summary: UMS devices detected only when amarok is restarted
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: Collections/USB mass storage and MSC (show other bugs)
Version: 2.4-GIT
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: 2.4.2
Assignee: Amarok Developers
URL:
Keywords: release_blocker
Depends on:
Blocks:
 
Reported: 2011-07-13 10:49 UTC by Bobby
Modified: 2011-12-20 11:39 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
This is the output which is generated when I plug in my UMS device. (386 bytes, text/plain)
2011-07-13 10:49 UTC, Bobby
Details
Amarok debug log when GalaxyS is plugged (5.57 KB, text/plain)
2011-07-21 17:22 UTC, Frédéric COIFFIER
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bobby 2011-07-13 10:49:45 UTC
Created attachment 61841 [details]
This is the output which is generated when I plug in my UMS device. 

Version:           2.4-GIT (using KDE 4.6.4) 
OS:                Linux

When ever I add a UMS device like my Samsung Galaxy S (In mass storage mode) to amarok. It is not detected until I restart amarok while the device is still plugged in. Interestingly, I don't have this issue when I plugin a USB storage device or memory card reader to my system. Amarok detects them immediately. The problem only comes up when the connected device is a phone capable of UMS mode. 

Reproducible: Always

Steps to Reproduce:
Start Amarok 
Plug in a device which supports UMS mode (In my case the samsung galaxy S, and the Nokia N900)
Switch the device to UMS mode while it is plug to the PC running amarok

Actual Results:  
The device is detected by Kde Device notifier and dolphin file manager
The device is not detected by amarok, and does not show up among media devices in amarok.
Quit Amarok, and start it while the UMS device is still plugged in in UMS mode. 
Amarok now see the UMS device on restart and it shows up in the Media devices.

Expected Results:  
UMS devices should be detected immediately their plugged in to the PC and detected by the kde device notifier (or Desktop Environment)

The beta release of amarok 2.4.2 did fix the bug where UMS devices were not detected by amarok at all, I guess the issue is still yet to be perfect.
Comment 1 Bart Cerneels 2011-07-14 07:12:56 UTC
Is this phone showing up as an unpartitioned USB drive? You can check by running mount on the command line. Please paste the results.
# mount

If the phone entry of the output contains something like "/dev/sdb on /media/phone" instead of "/dev/sdb1" then this might be the cause. There was a recent fix in detecting these partitionless disks, but something might still be wrong.
Comment 2 Bart Cerneels 2011-07-14 07:13:07 UTC
Is this phone showing up as an unpartitioned USB drive? You can check by running mount on the command line. Please paste the results.
# mount

If the phone entry of the output contains something like "/dev/sdb on /media/phone" instead of "/dev/sdb1" then this might be the cause. There was a recent fix in detecting these partitionless disks, but something might still be wrong.
Comment 3 Bobby 2011-07-14 07:34:35 UTC
(In reply to comment #2)
> Is this phone showing up as an unpartitioned USB drive? You can check by
> running mount on the command line. Please paste the results.
> # mount
> 
> If the phone entry of the output contains something like "/dev/sdb on
> /media/phone" instead of "/dev/sdb1" then this might be the cause. There was a
> recent fix in detecting these partitionless disks, but something might still be
> wrong.

I think the phone is showing up as in unpartitioned USB drive. below is the output of mount

/dev/sdc on /media/408A-07D3 type vfat (rw,nosuid,nodev,uhelper=udisks,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,showexec)

Let me know how I can be of further assistance
Comment 4 Ralf Engels 2011-07-14 18:15:21 UTC
Could somebody explain it please to me:

If this is an unpartitioned drive, then it does not have any partitions on it, right?
So without partition we cannot access any file system?
And that would mean that we could not find any audio tracks on it?

So why should we show it?

(Is there a mistake in my reasoning?)
Comment 5 Bart Cerneels 2011-07-14 20:15:56 UTC
(In reply to comment #4)
> Could somebody explain it please to me:
> 
> If this is an unpartitioned drive, then it does not have any partitions on it,
> right?
> So without partition we cannot access any file system?
> (Is there a mistake in my reasoning?)

It's possible to create a filesystem on a partitionless drive.

example: mkfs.vfat -L part_less /dev/sdb
Comment 6 Frédéric COIFFIER 2011-07-21 08:30:31 UTC
I have the same problem with my Galaxy S : I can mount it and browse it with
Dolphin without any problems but it doesn't appear in Amarok 2.4.2 Beta 1 (with
KDE 4.7 rc2).

It worked fine some times ago with KDE 4.6 and previous Amarok version (but I
can't confirm it worked with 2.4.1).

It's usual for an USB stick to have no partition table.
In the case of the Galaxy S, Android simulates a Mass Storage Disk gadget and I
don't think we can create partition on it without breaking something.
Comment 7 Bobby 2011-07-21 08:38:21 UTC
Not just android it seems most mobile devices. Because I had the same issue
on my n900, galaxy s1 and galaxy s2.

Also I did not know Amarillo beta had fixed the ums detection bug in beta2
until I cleaned out my amarok configuration files and started amarok. Even
then the feature only works when amarok is started while my device is
plugged in.
On Jul 21, 2011 9:30 AM, "Frédéric COIFFIER" <frederic.coiffier@free.fr>
wrote:
> https://bugs.kde.org/show_bug.cgi?id=277685
>
>
>
>
>
> --- Comment #6 from Frédéric COIFFIER <frederic coiffier free fr>
2011-07-21 08:30:31 ---
> I have the same problem with my Galaxy S : I can mount it and browse it
with
> Dolphin without any problems but it doesn't appear in Amarok 2.4.2 Beta 1
(with
> KDE 4.7 rc2).
>
> It worked fine some times ago with KDE 4.6 and previous Amarok version
(but I
> can't confirm it worked with 2.4.1).
>
> It's usual for an USB stick to have no partition table.
> In the case of the Galaxy S, Android simulates a Mass Storage Disk gadget
and I
> don't think we can create partition on it without breaking something.
>
> --
> Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
> ------- You are receiving this mail because: -------
> You are a voter for the bug.
> You reported the bug.
Comment 8 Myriam Schweingruber 2011-07-21 10:41:53 UTC
Android phones do have partitions, and I can see my HTC Desire quite fine. I'd rather think it is a different issue then, unless Samsung made some specific changes to the underlying Android structure.
Comment 9 Bobby 2011-07-21 11:01:59 UTC
(In reply to comment #8)
> Android phones do have partitions, and I can see my HTC Desire quite fine. I'd
> rather think it is a different issue then, unless Samsung made some specific
> changes to the underlying Android structure.

Like I said this issue also affect Nokia N900, There seem to be lots of devices out there whose storage mode don't have partitions yet they work well with other music players (clementine, rhythmbox ) and are detected by kde and their files accessed via dolphin. The bug about amarok not detecting partition-less UMS devices as been fixed. However the fix does have some issues which is what the bug report is about.
Comment 10 Ralf Engels 2011-07-21 15:24:06 UTC
Hi,
I would need a debug output when this happens (amarok --debug)

If you want to look at the code, I guess the offending lines are here: src/core-impl/collections/umscollection/support/UmsConnectionAssistant.cpp
Comment 11 Bobby 2011-07-21 15:27:40 UTC
I did attached a debug symbol to the bug report which shows what happens
when I connect my device. Have you taken a look at that?
On Jul 21, 2011 4:24 PM, "Ralf Engels" <ralf.engels@nokia.com> wrote:
> https://bugs.kde.org/show_bug.cgi?id=277685
>
>
> Ralf Engels <ralf.engels@nokia.com> changed:
>
> What |Removed |Added
>
----------------------------------------------------------------------------
> Status|UNCONFIRMED |NEEDSINFO
> Resolution| |WAITINGFORINFO
>
>
>
>
> --- Comment #10 from Ralf Engels <ralf engels nokia com> 2011-07-21
15:24:06 ---
> Hi,
> I would need a debug output when this happens (amarok --debug)
>
> If you want to look at the code, I guess the offending lines are here:
> src/core-impl/collections/umscollection/support/UmsConnectionAssistant.cpp
>
> --
> Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
> ------- You are receiving this mail because: -------
> You are a voter for the bug.
> You reported the bug.
Comment 12 Ralf Engels 2011-07-21 15:53:57 UTC
Ok,
more debug output please. 

Somehow Amarok seems to think that the same device was already added.
I am wondering where that happens.
Comment 13 Frédéric COIFFIER 2011-07-21 17:22:12 UTC
Created attachment 62055 [details]
Amarok debug log when GalaxyS is plugged

An important remark : for Android phones, they can be mounted only after confirming the mass storage function on the phone.
Comment 14 Lydia Pintscher 2011-07-21 18:22:41 UTC
setting to new again
Comment 15 Bart Cerneels 2011-07-21 18:30:15 UTC
I've just tried with an unpartitioned vfat formatted drive. That is working perfectly. One thing to notice though is that the device needs to be mounted before it will show up in amarok. Something to fix later.

I also tried 2 HTC android devices.
A HTC Hero with VillainROM-v13: This worked perfectly, but the drive was indeed mounted on /dev/sdb1, but starting to suspect that does not matter.

A HTC tattoo using the original android 1.6 firmware with the SD card removed, so it didn't have to option to run in USB-storage mode. I've got exactly the same problem. I guess it's just incorrectly being reported as a Solid::StorageDrive in this case.

Same tattoo but with SD card, same error as reporter.
Comment 16 Bart Cerneels 2011-07-22 10:24:26 UTC
Git commit 0d69e6b4a02fb61ebfcce4e8966d7efe99be34af by Bart Cerneels.
Committed on 22/07/2011 at 12:21.
Pushed by shanachie into branch 'master'.

Fix USB device detection at runtime.

For devices that have delayed StorageVolume avialability (most smartphones it seems)
Solid reports this device again when the volume becomes available. Don't ignore the
second signal in that case.

BUG:277685

M  +2    -9    src/MediaDeviceCache.cpp
M  +1    -0    ChangeLog

http://commits.kde.org/amarok/0d69e6b4a02fb61ebfcce4e8966d7efe99be34af
Comment 17 Bobby 2011-07-22 10:37:12 UTC
Just did a git pull and I can confirm that this bug has been fix. Amarok now
detects my mobile now without having to restart.  Thanks guys. :)
On Jul 22, 2011 11:24 AM, "Bart Cerneels" <bart.cerneels@kde.org> wrote: