Translate

Saturday 19 November 2011

Creating m3u playlists on the Sansa clip+ player in Linux

The Sansa clip+ player is an excellent audio player which works very well under Linux. m3u playlists can easily be created and this blog post describes some simple  ways of doing this. All that's required is to create a list of audio files which is saved to the Clip's MUSIC directory in a file with an .m3u extension.  

The first technique uses a custom action in the Thunar file manager. The player needs to be in MSC mode which is set on the player itself:  Settings => System settings => USB mode => MSC). Now you need to configure a custom action in Thunar. From the Edit menu in Thunar select Configure custom actions... Click on the + icon to add a new action and in the Name field enter Create a Sansa clip playlist. Don't worry about the Description field but in the command field enter:

ls %N > playlist.m3u

Now select the Appearance conditions tab, make sure there is an asterisk (*) in the File pattern field and that Audio files is checked. 

To create a playlist, the player needs to be mounted in Linux. Under Gnome this happens automatically on my system (currently OpenSuse 11.4) but I prefer the Fluxbox window manager and use the wmvolman dockapp to mount the player manually. In Thunar, navigate to the MUSIC directory (on my system for the Sansa clip's internal memory this is /media/0123-4567/MUSIC) and CTRL+Click to select the files which will make up the playlist. Next, right click and you should see an option to use your custom action: Create a Sansa clip playlist. Select this menu, and a file called playlist.m3u will appear in the same directory. This is an m3u playlist which should be usable on your Sansa Clip+. It's useful to rename the file, since it will be overwritten next time you run the script.

I ran into problems when I tried to delete playlists in Thunar, because it places the files in a Trash folder which I couldn't delete permanently. I therefore delete the playlists from the command line but Nautilus works as well.   

Another (and more flexible) way to create playlists on the Sansa Clip+ is to use the kid3 KDE ID3 tag editor. Under Suse, install the package using: sudo zypper install kid3-qt. With the Sansa clip mounted, open the MUSIC directory on the player in kid3 (File => open directory) and CNTRL+click to select multiple files. Now click on the Create playlist item. In the Format field you can use any name for the playlist as well as ID3 tags.  Make sure you use the following options:    
  • Create in: current directory
  • Format: m3u
  • Include only the selected files
  • Use relative path for files in playlist
  • Write only list of files
One advantage of kid3 is that you can create playlists based on strings in the filename or in the ID3 tags. First, in kid3 open the MUSIC directory on the Sansa Clip.  Now Select the menu option Tools then Filter... Now set up a custom filter. All the variables you can use (filename, duration etc.) are displayed if you hover over the dialog box for the filter itself. As an example, the following filter selects filenames which contain the string "Elgar":

%{file} contains "Elgar"

You can now create a playlist which contains only those files.