Using the Fuze and Linux

@byteenable wrote:
Linux can operate in MTP mode.

I got this reply in the “Common problems with Fuze” thread. I would rather keep that thread clean so I started a new thread on this issue.

I believe ByteEnable is wrong. I tried it and can’t get it to work. What I did was:

  1. Changed the Fuze USB mode to MTP
  2. Connected the Fuze
  3. The command_ lsusb_ revealed that the Fuze has an ID of 0x74c2 when it is MTP mode (it’s ID is 0x74c3 when in MSC mode)
  4. Edited the file /usr/share/hal/fdi/information/10freedesktop/10-usb-music-players.fdi
  5. Added the ID to the Fuze section
  6. Disconnected the Fuze
  7. Re-connected the Fuze
  8. Opened Rhythmbox

If you have a method of getting Linux to recognise the Fuze when it is in MTP mode please share it.

What version of libmtp have you got installed?

You need >= 3.0.0.

Depending on your distro, you might need to install mtp-tools (or whatever package has mtp-detect in it).

Open a console, and run the mtp-detect command.

If that doesn’t return an error, and does return lots of details about your Fuze, linux works with your Fuze.

Whether RhythmBox understands MTP players is a different issue. I’ve not tried it in MTP mode recently.

Edit:

AFAIK, 10-usb-music-players.fdi is only relevant to UMS (or MSC) devices.

And the output of mtp-detect starts like this:

graham@upstairs-linux:~/mtp_stuff/libmtp/examples$ mtp-detect                                                                                                                           
libmtp version: 0.3.0                                                                                                                                                                   

Listing raw device(s)
   Found 1 device(s):
   SanDisk: Sansa Fuze (0781:74c0) @ bus 0, dev 4
Attempting to connect device(s)                 
PTP: Opening session                            
USB low-level info:                             
   Using kernel interface “usbfs”               
   bcdUSB: 512                                  
   bDeviceClass: 0                              
   bDeviceSubClass: 0                           
   bDeviceProtocol: 0                           
   idVendor: 0781                               
   idProduct: 74c0                              
   IN endpoint maxpacket: 512 bytes             
   OUT endpoint maxpacket: 512 bytes            

Message Edited by daytona955 on 01-14-2009 06:43 AM

Message Edited by daytona955 on 01-14-2009 09:33 AM

Message Edited by daytona955 on 01-14-2009 09:34 AM

@daytona955 wrote:

What version of libmtp have you got installed?

 

You need >= 3.0.0.

 

Depending on your distro, you might need to install mtp-tools (or whatever package has mtp-detect in it).

 

Open a console, and run the mtp-detect command.

 

If that doesn’t return an error, and does return lots of details about your Fuze, linux works with your Fuze.

 

Whether RhythmBox understands MTP players is a different issue. I’ve not tried it in MTP mode recently.

 

Edit:

AFAIK, 10-usb-music-players.fdi is only relevant to UMS (or MSC) devices.

I don’t even know if I have libmtp or mtp-tools installed… Linux just kicks *rse doesn’t it? No matter what MS try and do to lock people in there are smarter FOSS developers that blow them out of the water.

I don’t believe in “renting” music, I hate using playlists and music with DRM. I have my music collection well enough organised that I don’t need the computer to think for me.

So I doubt I will need anything that requires MTP mode but I will figure out how to get it working in MTP and what programs can use the Fuze in MTP mode.

I just did a search of the Ubuntu packages and found mtpfs (FUSE filesystem for Media Transfer Protocol devices)… no they did not have a typo, it is not just for our Fuze, it’s a package that has a desciption:

MTPfs is a FUSE filesystem that supports reading and writing from MTP (Media Transfer Protocol) devices, such as MP3 players, video players or digital cameras.

In addition to revealing media files on the connected device, MTPfs exposes a virtual directory called “/Playlists” which contains the device’s playlists as m3u files.

I am going to have a play with this and report back.

Message Edited by hazza on 01-15-2009 08:02 AM

@hazza wrote:


MTPfs is a FUSE filesystem that supports reading and writing from MTP (Media Transfer Protocol) devices, such as MP3 players, video players or digital cameras.

In addition to revealing media files on the connected device, MTPfs exposes a virtual directory called “/Playlists” which contains the device’s playlists as m3u files.


I am going to have a play with this and report back.

Good luck with mtpfs! I think it’s a bit of a ‘work in progress’. It does work, but only supports the players internal storage. I think you may have to mount the MTP filesystem manually - I don’t think Ubuntu will auto detect a player on plugin and stoke up MTPfs.

@hazza wrote:

 

I am going to have a play with this and report back.

Ok here is what I did and found out about connecting the Fuze to Ubuntu 8.10 Linux:

  1. Installed the indicated packages
  2. Changed the Fuze to MTP mode and connected it
  3. Started Rhythmbox
  4. Nothing
  5. Ran mtp-detect “no raw devices found”
  6. Ran mtp-connect, screen on information about all sorts of MTP players.
  7. Searched that and found the Fuze with an ID of 0x74c0
  8. Ran lsusb and found the my Fuze has a ID of 0x74c2
  9. Eventually found the file  /etc/udev/rules.d/45-libmtp8.rules
  10. In that file at lines 147/148 and 472/473 was references to the Fuze with an ID of 0x74c0
  11. Changed those to 0x74c2
  12. Reconnected the Fuze
  13. Restarted Rhythmbox
  14. No device :frowning:
  15. Ran mtp-detect, screens and screens of info went by, but it locked.
  16. Ran mtp-connect, still has the 0x74c0 reference :frowning:

The mtp-tools must use another location to reference the 0x74c0 ID but I can’t find it. I suspect that is the ID of the version 1 Fuze and I have a version 2.

Can someone that has a version 1 Fuze run lsusb and tell me if it has an ID of 0x74c0 in MTP mode and 0x74c1 when it is in MSC mode?

Message Edited by hazza on 01-16-2009 07:16 PM

@hazza wrote:

The mtp-tools must use another location to reference the 0x74c0 ID but I can’t find it. I suspect that is the ID of the version 1 Fuze and I have a version 2.

I’m sure you are correct.

Unfortunately Sansa devices, like many others, have their own peculiarities (i.e. they don’t properly conform to the MTP spec, they do MTP just well enough to work with the Windoze implementation).

If you really want to make your Fuze work, you will need to build libmtp from source, after hacking music-players.h to tell libmtp about the peculiarities of your player. Assuming that v2 Fuzes (don’t) work in the same way as v1 Fuzes (don’t) work, you could find the lines for the v1 Fuze and clone them. You’ll find the relevant bit is a set of flags to say in what way the Fuze doesn’t do MTP properly.

You can get the source from the libmtp project page. There is also an active forum which was very helpful when I was trying to hack libmtp to get my e260v2 working.

The fixes for the e260v2 also mean other AMS based Sansa players (Fuze, Clip) mostly work. So hopefully the Fuze v2 should just be a case of adding the new USB ID.

Message Edited by daytona955 on 01-16-2009 03:33 AM

Message Edited by daytona955 on 01-16-2009 03:34 AM

Hazza I ran mtp-detect and I got this:

 http://docs.google.com/Doc?id=df7snrjc_0dvkndsfd

I ran lsusb in mtp and I got this ID: 0781:74c0. When I go to msc I get the ID 0781:74c1.

 When I was in mtp mode, I opened Rhythmbox, and I also couldn’t get Rhythmbox to recognize my Fuze until I enabled the plug "Portable Players - MTP. Do you have that plug-in enabled in Rhythmbox?

@daytona955 wrote:

You can get the source from the libmtp project page. There is also an active forum which was very helpful when I was trying to hack libmtp to get my e260v2 working.

To get something going I draw the line just before compiling source code.

I will search/post something on the Ubuntu forum to let better people than I know that the v2 Fuze is different and does not currently work.

@silverwolf wrote:

Hazza I ran mtp-detect and I got this:

 

 http://docs.google.com/Doc?id=df7snrjc_0dvkndsfd

I ran lsusb in mtp and I got this ID: 0781:74c0. When I go to msc I get the ID 0781:74c1.

 

 

 When I was in mtp mode, I opened Rhythmbox, and I also couldn’t get Rhythmbox to recognize my Fuze until I enabled the plug "Portable Players - MTP. Do you have that plug-in enabled in Rhythmbox?

 

No I was not aware of that option, I will try it.

I had a look at your output and I get similar up to the 3rd last line, my screen locks before that… well I think it locks, does it take long to display that WMPInfo.xml line? The rest of the info takes 1 second and then I waited like 60 seconds but it stopped after showing me the </DEVCERT> line.

It doesn’t take long to show the WMPInfo.xml. I didn’t have any lockups.

@silverwolf wrote:

I ran lsusb in mtp and I got this ID: 0781:74c0. When I go to msc I get the ID 0781:74c1.


It doesn’t take long to show the WMPInfo.xml. I didn’t have any lockups.

Yours is a V1, so it will work because libmtp knows the ID and understands how to talk to it.

 Hazza’s has a different ID, so libmtp will not apply the Sansa/AMS fixes needed to make it work, even it you hack udev to recognise the new ID.

Basically, it needs someone with a Fuze v2 to build libmtp with the new ID, check that it works, and post the new ID to the libmtp forum. Or if it doesn’t work, post the details of the failure to the forum.

Until that’s done, Fuze v2 will not work with libmtp, and therefore won’t work under Linux in MTP mode.

I think it is likely to work, since, AFAIK, it uses the same AMS chipset.

The real killer for AMS Sansas is that they expect an exchange on USB before kicking into MTP mode. It’s probably part of the Auto mode function, but they still expect it in MTP only mode. It’s not part of MTP, but Windoze does it anyway, and Sansa’s expect it. Applying that (and other ‘bodges’) is why libmtp needs to know the ID.

I have submitted a new device request on the libmtp sourceforge page here.

SilverWolf wrote, inter alia:

I ran lsusb in mtp and I got this ID: 0781:74c0. When I go to msc I get the ID 0781:74c1.

0781 (hex) is the vendor ID. 74c0 and 74c1 are product ID’s of the version 1 Fuze, but there’s no consistency regarding the differences between msc and mtp modes. 74c2 and 74c3 are the ID’s for the version 2 Fuze, but again there’s no consistency regarding the two modes.

BTW, I extracted this information (from a number of Fuzes) using System Profiler in OS X Leopard.  Although OS X doesn’t have anyway of interacting usefully in MTP mode, it can detect connected devices and give basic information about them. 

@aarons510 wrote:
Although OS X doesn’t have anyway of interacting usefully in MTP mode, it can detect connected devices and give basic information about them. 

I know little about Macs… but XNJB claims to do libmtp on Mac.

@daytona955 wrote:


@aarons510 wrote:
Although OS X doesn’t have anyway of interacting usefully in MTP mode, it can detect connected devices and give basic information about them. 


 I know little about Macs… but XNJB claims to do libmtp on Mac.

Thanks! I just tried XNJB and it works, at least with the Fuze v2 and E280 v1 and v2. I couldn’t get it to work with, or even recognize, the View, which could be a consequence of the View’s extremely buggy firmware.