Previous: GTK+ and Glade3 GUI Programming Tutorial - Part 3
Next: Libglade to GtkBuilder F.A.Q.

Sandisk Sansa View on Ubuntu Linux

May 21st, 2008

My girlfriend bought an 8GB Sansa View recently and I've been doing a lot of tinkering with it in Ubuntu 8.04 (both AMD64 and x86). Here is some of the knowledge I've gained in regards to the Sansa View and Ubuntu Linux. Please reply if you know any of this to be incorrect.

First of all, there are 2 modes you can use this device in, and they are mutually exclusive as far as working with them in Linux (that is, you don't have access to files added in MTP mode if you mount it in MSC mode).

MSC (Mass Storage Controller) Mode

By default, the device is in MTP (Microsoft Transfer Protocol) mode. More on this later. Most of us linux users are used to using MP3 players in MSC mode which is essentially just a USB flash drive.

Mounting the Sansa View in MSC Mode:

To mount the device in MSC mode, you put the device in hold (slide the power switch down) and then hold down the left button on the direction pad for about 5 seconds and then connect it to your USB port. The device should then auto mount into '/media/Sansa View' as a flash drive and an icon should show up on your desktop.

Getting Rhythmbox To Identify the Sansa View in MSC Mode:

Rhythmbox will not initially identify the device. To get rhythmbox to see the device, you simply place a text file into the root directory of the player named '.is_audio_player' (/media/Sansa View/.is_audio_player). Then it will show up in Rhythmbox and you can drag and drop your music onto it. However, rhythmbox seems to copy the music into the root instead of the 'MUSIC' folder. To change that behaviour, you can edit that '.is_audio_player' file to tell it where to copy the music. The following should work good for a '.is_audio_player' file for the Sansa View:

audio_folders=MUSIC/
folder_depth=2

This method should also work for other audio players like Amarok, Banshee, etc.

Using The Correct ID3 Tags in MSC Mode:

The Sansa View seems to prefer id3v2.3 tags, however, newver versions of id3 tagging libraries often use id3v2.4 tags. I use a program called easytag to organize my tags. You can install easy tag with:

sudo aptitude install easytag

You can setup easy tag to use the correct id3 tags by going into 'Settings' > 'Preferences' and clicking the 'ID3 Tag Settings' tab. You want to change the version setting for the id3v2 tags to 'id3v2.3' and leave it in UTF-16 encoding. Here is a screenshot of my preferences:

Using Easytag for Sansa View id3 tags

Once you change this setting, any files which have tags that are NOT in this version will show up red (unsaved). So you can simply load the folder you store your media in, select all, and save. They should now pass through correctly to the Sansa View in MSC mode (including album art discussed below).

Album Art in MSC Mode:

Album art in MSC mode can be achieved at least 2 different ways (that I've found). First, you can drop a 300x300 jpg version of the album art named 'folder.jpg' into the folder containing the songs for that album (ie: /media/Sansa View/MUSIC/some_artist/some_album/folder.jpg). Secondly, you can embed the 300x300 jpg file into the id3v2 tag. If you have setup easy tag as discussed in the previous section, this will work.

Playlists in MSC Mode:

As far as I can tell, the Sansa View does not support playlists in MSC mode! Correct me if I'm wrong. This was a deal breaker for me which is why I've been working in MTP mode.

MTP (Microsoft Transfer Protocol) Mode

If you're not familiar with MTP, it's a protocol used by many new portable media devices which "synch" up with Windows Media Player (WMP). It's not a file system in the traditional sense that MSC mode is, and thus it doesn't exactly "mount" in Linux (though you can using mtpfs).

It's important to understand that MTP mode is a different animal and the normal rules regarding playlists, album art, and ID3 tags do not apply.

The Sansa View's default mode is MTP, so that's why you aren't seeing an icon popup on your Ubuntu desktop as soon as you plug it in. To use it in MTP mode, you should install libmtp, the library for accessing MTP devices. It's also handy to install mtp-tools and mtpfs which I'll discuss later. You can install all 3 packages using:

sudo aptitude install libmtp mtp-tools mtpfs
Getting Rhythmbox To Identify the Sansa View in MTP Mode:

Open Rythmbox. Select 'Edit' > 'Plugins' and enable 'MTP Portable Devices' plugin. You can now drop your music onto your device in Rhythmbox, however, playlist support isn't quite working and album art is not supported (as of time of writing). I wasn't successful getting playlists and album art working in Amorok or Banshee either, however, since I use Rhythmbox, I didn't try very hard.

Using mtp-tools:

These utilities are some example programs from the libmtp source. Granted you can do just about anything you need to with these tools (create/delete tracks, folders, albums, album art, files, etc.), they are command line tools and doing so can be a bit tedious because of the nature of MTP. But it's a good way to experiment and ensure your MTP device is detected by libmtp. You could also use these tools with your own script if you needs are minimal. Start by typing 'mtp-detect' to find your device. Then type 'man mtp-connect' to see all the commands at your disposal.

About ID3 Tags in MTP Mode:

In MTP mode, the device isn't using the ID3 tags, but instead is given this information when added to the device (typically the program feeding the information *does* pull this from the ID3 tags). So when using the mtp-tools, you'll have to pass the meta data for tracks or albums along with the file.

Mounting The Sansa View As a Filesystem in MTP Mode:

This was a bit buggy for me, but you can try. Using mtpfs (uses FUSE) you can mount your device in MTP mode and browse like any other file system

Mount:

sudo mtpfs -o allow_other /media/SansaView

Unmount:

sudo fusermount -u /media/SansaView
Playlist Support in MTP Mode:

Although Amarok, Banshee, and Rhythmbox all supported the Sansa View in MTP mode, Amarok was the only one I could get to manage a playlist properly. Since I prefer Rhythmbox and am not going to switch just for playlist support, I haven't tested it any further, however, Amarok seems to provide the best support for the Sansa View in Ubuntu. Install it using:

sudo aptitude install amarok

It would be pretty easy to write a script to convert your .m3u or .pla playlists using mtp-tools (mtp-playlists mtp-newplaylist and mtp-delfile). I started writing my own application for MTP devices--specifically my Sansa View. Read below...

MOrganize - A GTK+ Based MTP Media Organzier for Linux:

I'm working on a GUI media organizer as a front end to libmtp... which you can see below:

MOrganize MTP Media Organzier

This project was only started a few days ago at the time of writing, and so it is still in very early development. However, I expect to have some files posted on sourceforge within a couple weeks. Email me if you would like to be emailed when some beta source is available and you can help me test it.

If you want to keep up, the project page is here: MOrganize



Categories
Linux

Related Posts


Technorati Tags

24 Responses to “Sandisk Sansa View on Ubuntu Linux”

RSS Subscription Comments RSS Feed

  1. Vadim P. Says:

    I was thinking of getting that player myself. I'll rethink my choice now :/

  2. Dan O. Says:

    The best app I've found for managing MTP devices in linux is Gnomad2, which written by one of the libmtp developers. http://gnomad2.sf.net

  3. sam fraser Says:

    I've also just bought this mp3 as it was the best mp3 player that met our requirements, i only use linux so this has been very helpful indeed!

    Thanks.

  4. Vincent Says:

    Thank you for all the supplied information - this page was a real help to get me up and running with my new Sansa View.

    One thing you might want to add: (When in MSC-mode) *ALWAYS* "umount -l" && "eject" the sansa before disconnecting. I used to be very careful and click on 'unmount filesystem' in pcmanfm, but apparantly this wasn't enough: my database refresh rarely succeeded and I thought my player was broken. Now it seems that I'm able to rebuild my database like it should.

  5. Snow Blind » Re: I Wanna Rock Says:

    [...] solution didn’t actually turn out to be that bad. As I found out on this blog, the solution wasn’t that bad at all under ubuntu. All it really took was… well [...]

  6. tom Says:

    Thank you very much for your excellent to-the-point information!

    Did you look at the video options as well?

  7. sfreud Says:

    When is MOrganize being published?

  8. TheMarkster Says:

    Nicely done. I don't have a View, but I do have an e200 series player. Most, if not all, of what you have here will relate to the e200 series, too. One comment I would make is the use of ID3v2.3 ISO-8859-1 ID3 tags is preferable to ID3v2.3 UTF-16 tags with the e200 series. This is because the ISO tags do a better job when it comes to playing tracks in proper sequence, as in audio books. The same might or might not apply to the View.

  9. virtuoso015 Says:

    isnt MTP = Media Transfer Protocol ?

  10. Micah Says:

    Yes, MTP is Media Transfer Protocol. See http://en.wikipedia.org/wiki/Media_Transfer_Protocol

  11. Dan Says:

    Hi Micah,

    Just wanted to say thanks on the great how to, saved me lots of time and effort.

    I'd love to get my claws on MOrganize and volunteer to help out with testing. I'm a newbie to Ubuntu but have many years of sw development experience and want to start learning how things are done in gnome/linux.

    Thanks,

    Dan

  12. Micah Says:

    Dan,

    I was just looking at MOrganize today wishing I had time to finish it. I'm really striving to get that done (as I need it badly too!)

    If you can send me an email, I'll get you involved in testing when I'm ready to start posting code. Alternatively, you can track the progress at morganize.sourceforge.net

  13. SVilla Says:

    Thanks for this how-to Micah. Do you know how to make the Sansa View 32GB work on Ubuntu? I tried some of what you said (beginning part) but to no avail.

  14. Alexandre Bastien Says:

    Thanks Vincent for your comment. I also tought that my files or player was broken until I realised that the library doesn't refresh properly. Actually you can't see if your library has updated succesfully or not. When you remove your sansa, if the player update for a second or two and then suddenly shutdow, you will know that the update is bad. If it stays open, the update is good. But I didn't figure out how to do both umount -l and eject. For exemple, my player is mounted in "/media/Sansa\ view" If I do umount -l "/media/Sansa\ view", I cannot do eject "/media/Sansa\ view" after that. Anyways, umount -l alone seems to do the trick.

    Another thing, is there somebody who know how to get special character display properly, like "é" or "è". Actually, they display as squares. I think that using easytag to change the tags encoding or id3 version may do the job but i'm not sure on how to do it?

  15. Emmanuel Rodriguez Says:

    I also have a SanDisk Sansa MP3 player and the lack of IDv2 2.3 tags in Gstreamer was annoying me. So I wrote a GStreamer plugin that provides IDv2 2.3. If you want you can compile it and install it. You can find the source code of the plugin in here:
    http://bugzilla.gnome.org/show_bug.cgi?id=459226

    The advantage of this plugin is that we can use the built-in MP3 encoder (sound-juicer) and encode the MP3s directly without having to retag them.

    Feel free to contact me by email for instructions on how to build and use the plugin. If you like the plugin please add a comment to the bugzilla, this way the plugin could end up in the next Ubuntu. It's truly a pity that IDv2 2.3 is not supported in Gstreamer.

  16. Mike S Says:

    Help...My Sansa View 32GB Does not recognize playlists. I have 2 other ones - 8GB that recognize them fine but the Sansa View 32GB mangles playlists, puts the wrong songs in them, and even erases them for no apparent reason.

    It is a total disaster as an MP3 player and I strongly urge everyone not to buy one ever - under any circumstances.

  17. Elin Says:

    Thank you, this was most useful! :-)

  18. Jonathan Says:

    Thanks for this info. I have a sansa e280. I was not able to get it to mount. How on earth did you figure out it was necessary to first put the device into HOLD and to push the left button for a while in order to get it to mount? Perhaps a more pertinent question is WHY on earth did Sandisk make such a round-about procedure necessary in the first place? Strange.
    Anyway... very happy to have my device connected to Ubuntu 8.10

    Cheers,
    Jonathan

  19. Abelardo Says:

    Hi, I hope you are very well. Thanks for your post. I followed your steps and all they work.

    However, you have already in repositories Gnomad2, this tools allow you to connect to your Sansa View without having to press hold when u turn player on.

    It works automatically, and I also got it working automatically in Amarok, I just added sansa as MTP device.

    So having MTP installed is the only requirement, the other ones are tricks, and kind of dangerous since if you delete system files in sansa view, i guess it will make device not operating.

    Cheers,
    Abelardo

  20. C. Chu Says:

    Thanks for the article!

    There is actually a way to use MSC mode and get playlists:

    http://www.mazleg.com/sansa/

    Haven't tried it yet but it looks promising. Hope this helps someone!

  21. Adrian Says:

    I've got a sansa view 8Gb and i could not recommend it. The problems i have with it are many. It's just usable, but my level of frustration with it is high.

  22. Hazel Pethig Says:

    Do you have any comments on loading audiobooks onto a 16g view? I can load them but they end up in the music file, and yes I'm using Ubuntu

  23. Andrew Says:

    Thank you!

    Been butting on my head on this for awhile now.

  24. Armando Says:

    Hi,

    I followed the steps to make the player work as MSC mode. It did OK at the first time.
    But after that, It won't mount anymore.

    I would appreciate some help!

Leave a Reply