New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SanDisk Sansa Clip+ in MSC mode is not detected as a media device #1523

Closed
lazka opened this Issue Mar 15, 2015 · 8 comments

Comments

Projects
None yet
1 participant
@lazka
Member

lazka commented Mar 15, 2015

Original issue 1523 created by marcelpaulo on 2015-01-15T03:09:50.000Z:

I would like to use Quodlibet to load music onto my recently bought
SanDisk Sansa Clip+ 8GB, but it doesn't detect it as a media device.

I plugged the Sansa Clip+ (syslog output showing its detection in "syslog_sansa_clip+_detection.txt"), ran «quodlibet --debug» (output in "quodlibet_debug.txt"), opened a Media Devices browser, but it doesn't show up (screenshot in "quodlibet_media_devices_browser.jpg"). As the Sansa Clip+ was named /dev/sdd, I could see that quodlibet found it but didn't recognize it as a media player:

D: 416.28: UDisks2Manager._try_build_device: Found device: '/dev/sdd'
D: 416.30: UDisks2Manager._try_build_device: '/dev/sdd' not a media player

I vaguely sense that I might need to add some udev rule to tag some property on the Sansa Clip+ when udev recognizes it, so that it's properly treated as a media player, but I don't know if that's the way to go.

I wonder if you could point me to the right direction to pursue this further.

Here are the versions of the relevant software:

OS Xubuntu 14.10
python 2.7.8-1
python3 3.4.2-1
quodlibet 3.3.1-0ppa0utopic
python-mutagen 1.27-0ppa1utopic
libgtk-3-0 3.12.2-0ubuntu15.2
libgtk2.0-0 2.24.25-0ubuntu1
python-gtk2 2.24.0-3ubuntu3
libgstreamer0.10-0 0.10.36-1.2ubuntu3
libgstreamer1.0-0 1.4.3-1

Thanks for this superb software which is quodlibet !

Paulo

@lazka

This comment has been minimized.

Member

lazka commented Mar 15, 2015

Comment #1 originally posted by reiter.christoph on 2015-01-15T10:39:31.000Z:

Do you have "media-player-info" installed?

@lazka

This comment has been minimized.

Member

lazka commented Mar 15, 2015

Comment #2 originally posted by marcelpaulo on 2015-01-15T11:57:43.000Z:

Good morning, Christoph

Allow me to call you a Zen master: with one swift question you solved my problem !

media-player-info is installed, at version 22-2. I looked at these files:

/lib/udev/rules.d/40-usb-media-players.rules
/usr/share/media-player-info/sandisk_sansa-clip-plus.mpi

and realized I had to set ID_MEDIA_PLAYER to "sandisk_sansa-clip-plus" when udev detected my Sansa Clip+, so that UDisks2 can properly report it as a media player. So I created /etc/udev/rules.d/sansa.rules, to define it when my Sansa Clip+ is plugged:

# when my SanDisk Sansa Clip+ is detected, do:
# 1. create symlink /dev/disk/by-label/sansa (to make it visible to pm)
# 2. set env var ID_MEDIA_PLAYER so that UDisks recognize it as a media player
ATTRS{product}=="SanDisk Sansa Clip+",SYMLINK+="disk/by-label/sansa",ENV{ID_MEDIA_PLAYER}="sandisk_sansa-clip-plus"

Plugged and mounted the Sansa Clip+, run quodlibet, and voilà, now quodlibet sees it (Media Devices - Quod Libet_003.jpg) !

D: 341.23: UDisks2Manager._try_build_device: Found device: '/dev/sdd'
D: 341.25: UDisks2Manager.create_device: Creating device u'SanDisk-Sansa-Clip+-8GB-591FE5134392C5A80000000000000000' supporting protocols: ['storage']

That was a real and generous lesson you gave me: there was no problem whatsoever with quodlibet, but you took time to analyze my scenario and point me to the right direction. I'm hugely indebted to you !

Paulo
@lazka

This comment has been minimized.

Member

lazka commented Mar 15, 2015

Comment #3 originally posted by reiter.christoph on 2015-01-15T12:23:21.000Z:

You obviously know more about this than I do :)

After looking at media-player-info it seems it is using those *.mpi files to create a udev hardware database at "/lib/udev/hwdb.d/20-usb-media-players.hwdb" which will set the right env vars for looking up the mpi files.

Further looking at media-player-info git there aren't many recent changes, so the clip+ should really be in there. Do you have a Sansa Clip Sport by chance?

Can you post/attach the output of "udevadm info /dev/sdd"?

@lazka

This comment has been minimized.

Member

lazka commented Mar 15, 2015

Comment #4 originally posted by marcelpaulo on 2015-01-15T13:17:30.000Z:

You dug deeper, as befits a Master !, I hadn't thought why my Clip+ wasn't correctly detected in the first place.

From the output of "udevadm info /dev/sdd" (udevadm_info_sdd.txt), I can see that the product and model IDs:

E: ID_VENDOR_ID=0781
E: ID_MODEL_ID=74d1

are in /lib/udev/hwdb.d/20-usb-media-players.hwdb:

# Sansa Clip+
usb:v0781p74D1*
 ID_MEDIA_PLAYER=sandisk_sansa-clip-plus

# Sansa Clip+
usb:v0781p74D1*
 ID_MEDIA_PLAYER=sandisk_sansa-clip-plus

usb:v0781p74D0*
 ID_MEDIA_PLAYER=sandisk_sansa-clip-plus

which means that udev should have set ID_MEDIA_PLAYER correctly, right ? Would it be the case of filing a udev bug ?

Once again, thanks a lot for your patience and attention !

PS: I don't have a Sansa Clip Sport.
@lazka

This comment has been minimized.

Member

lazka commented Mar 15, 2015

Comment #5 originally posted by reiter.christoph on 2015-01-15T13:39:56.000Z:

Looks like it should just work.. no idea where the problem is.

I'll can try with a sansa clip+ next week.

@lazka

This comment has been minimized.

Member

lazka commented Mar 15, 2015

Comment #6 originally posted by reiter.christoph on 2015-01-24T14:28:21.000Z:

I can reproduce with and old and a new Clip+, so I've filed a bug upstream: https://bugs.freedesktop.org/show_bug.cgi?id=88776

@lazka

This comment has been minimized.

Member

lazka commented Mar 15, 2015

Comment #7 originally posted by marcelpaulo on 2015-01-24T14:39:37.000Z:

Hey Christoph, thanks for hunting this further. I added myself to the Cc list for that bug.

While the bug is not fixed, the workaround is documented here: create /etc/udev/rules.d/sansa.rules with this line:

ATTRS{product}=="SanDisk Sansa Clip+",ENV{ID_MEDIA_PLAYER}="sandisk_sansa-clip-plus"

@lazka

This comment has been minimized.

Member

lazka commented Mar 15, 2015

Comment #8 originally posted by reiter.christoph on 2015-01-24T15:35:02.000Z:

Thanks. I've fixed it for QL in revision 144fda8

@lazka lazka closed this Mar 15, 2015

lazka added a commit that referenced this issue Apr 8, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment