Friday, November 18, 2011

Creating Playlists for a Sansa Clip Using Linux.

Creating Sansa clip playlists in Linux is super easy IF you do it exactly right and make NO mistakes.

The playlist is just a text file with a .m3u file extension; that's all there is to it, but (and this is a BIG BUT) the playlist won't work if it doesn't have a commented out identifier at the top of the list. Here's one I've copy pasted from my Sansa Clip:

---

#EXTM3U

Away_In_A_Manger.mp3
Be_Home_for_Christmas.mp3
Carol_Of_The_Bells.mp3
Charlie_Brown_Medley.mp3
Christmas_At_Hogwarts.mp3
Holy_Night.mp3
I_Saw_Three_Ships.mp3
Let_it_Snow.mp3
Merry_Little_Christmas.mp3
Silent_Night.mp3
The_Christmas_Song.mp3
The_First_Noel.mp3
The_Holly_And_The_Ivy.mp3
What_Child_Is_This.mp3
Winter_Wonderland.mp3

---

If you've been a Linux user for a while you know as well as I do that the hashmark (pound sign) preceding the characters at the top of the file indicates that what follows is a comment which should be ignored by the player's software but if you leave that commented line out of the playlist it WON'T WORK. Why? I've no idea but that's how it is. The carriage return which followed the commented line seems to be optional but this particular playlist didn't work without it so I've gotten in the habit of using it with all of them.

---

As it powers up, the Sansa clip doesn't recognise folders in its file system and will list your music files as though you had dumped them all into one large folder even if you've carefully sorted them into labelled folders. If, on the other hand, you do carefully sort your music into folders, each folder must contain its own playlist because folders ARE recognised by the software that reads the playlists and will be unable to find an mp3 file which isn't in the
SAME folder as the playlist.

Note: In case you're wondering if you can specify the path to the mp3 file in the playlist, I have no idea, I've never had occasion to try that.

If you wish to use the same tunes on more than one playlist you must, then, avoid using sub-folders and put all your mp3 files and playlists into the MUSIC folder.



---

You CANNOT delete any music files or playlists using your file manager in normal user mode because Linux will then create a hidden, system trash folder inside the Sansa clip and move the files you've deleted into it. You will know that this has happened because when the Sansa clip re-initializes, after you've safely removed it from your computer's USB port, it will find, recognise and display the deleted playlist (or music files). You'll know this has happened because you'll have an extra playlist that comes up empty when you select it (or songs that you're certain you've delete will still appear to be there).

---

** If you find that you do, in fact, have an empty playlist (or songs that you know darn well you've deleted), you'll need dolphin, Konqueror or some other file manager that permits you to split the screen into two windows and you'll need to open an instance of that file manager with root privileges.

With *buntu systems (or systems based on Ubuntu) you can use...

sudo dolphin

or

sudo konqueror

On just about any other system you should probably use

gksu dolphin

or gksu konqueror

Note 1: If you get an error message, open up your package manager, search for and install gksu. Then try it again.

Note 2: In either instance, you may have to go to your package manager and install dolphin or konqueror.

Note 3: Yes, you may be able to type "su" followed by your root password and then type dolphin or konqueror but, in my experience, this sometimes returns an error and simply won't work whereas gksu, which is designed for the purpose, usually works fine.

Note 4: Insofar as I'm aware, there are no other Linux file managers with split screen capabilities but don't let my ignorance stop you if you have, or know of, another file manager which has the capability.

---

Once you've opened an instance of your file manager which has root privileges, split the screen, direct one window to the trash folder on your main hard drive and the other window to the Sansa clip.

With focus on the window showing the Sansa clip, set the file manager to Show hidden files. Drag and drop the hidden, system trash folder from the Sansa clip into the trash on your main hard drive. While you're at it, check the file folders, and every folder you've created on the Sansa clip for backup files created by your text editor and delete them. Why? because the Sansa clip doesn't recognise backup files and will find and display them as yet another playlist after it's initialised.

Speaking of which; before creating, editing or manipulating playlists, make sure you've set the preferences in your chosen text editor so that it will NOT create backup files.

If you forget to do this and notice that your editor has, for example, created a back up copy of your playlist on the Sansa clip remember that you cannot just delete it. Why? Because when you do Linux will create a hidden, system trash folder and move that backup playlist into it and because the Sansa clip operating system has no idea what a trash folder is it will find and display that deleted playlist (unless you also deleted the songs that were listed in that playlist, thereby putting them in the same folder, in which case it will remain a playable list). What should you do if that happens? back up the two asterisks on this page (** above) and start over.

---

So, if you started your playlist with the right information...

#EXTM3U

...listed the songs you want played, separated by carriage returns (the enter key for those of you too young to remember typewriters) with no typos in the file names or the file extensions, didn't list any songs that aren't in the same folder as the playlist, didn't delete any files or use an editor that creates automatic backups and remembered to save your playlists with .m3u file extensions, your playlists will be recognised when the Sansa clip initializes and will work beautifully. If you've forgotten even ONE of these carefully composed instructions you get to start all over again.

Do NOT ask my how I know so much about making playlists for Sansa clips on Linux systems. You may, however, assume that I've had a great deal of experience with creating playlists for the single Sansa clip I happen to own. My Sansa clip contains 200 songs sorted into 5 perfectly functional playlists. That's the truth and is as much as I'll admit to without coercion.

If you get stumped feel free to contact me. :)