Monday, January 31, 2011

Sansa Clip Plus on Ubuntu 10.04

Problem:I had some trouble with my Sansa on Ubuntu.  I could see it as a drive, but I couldn't access it. 

Solution:  Update the firmware.  If you have a windows computer, you can get the most recent firmware update that way.  There may be a way to load in Linux as well.

After that, you can use it as a drive in Ubuntu.  To do this, go to settings -> system -> usb -> MSC on the device.  Alternatively, you can select MTP to use it through your media player's interface, but this seems kind of clunky to me.

Extra Credit:
I keep my files on a honking FreeNAS media server which has lots of wonderful redundancy which I access through NFS.  I didn't want to mess about with a media player to sort and load the files, but I did want something that could only get my more recent files (anything from the last year) and load them.  My solution was simple, create a shell script to do it.

Here is the code.  In the revised version, I added an optional command line argument for the number of days so it isn't locked to 365.

The code messes with $IFS to handle spaces in names, creates a directory to hold the files locally, finds files in a 2 directory deep structure which are 365 days old or newer, and then copies those files to the local directory.  After that, it copies those local files to the player (removing asterices in the file name in the process).  When done, it deletes the local directory before exiting.

Feel free to modify this code and distribute it as you will.  It would be a lot more flexible with arguments to provide the mp3 folder path, local path, and media player path.  Also, users may want to skip the step of intermediate copying if they store their files locally already.  If you do keep your files right on your PC, I can't warn enough about the necessity of backups.

No comments: