Sandisk Sansa View on Ubuntu Linux
May 21st, 2008My 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.
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.
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.
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:
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 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.
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
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.
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.
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.
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
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...
I'm working on a GUI media organizer as a front end to libmtp... which you can see below:

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
Popular Posts
RSS Feeds
Archives
May 22nd, 2008 at 7:04 pm
I was thinking of getting that player myself. I'll rethink my choice now :/
May 26th, 2008 at 6:31 pm
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
June 8th, 2008 at 12:48 pm
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.
June 14th, 2008 at 5:37 am
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.