Created : Jan 2008
Last Update :

Sansa playlist creator on Linux

Keywords : sansa music player, linux, podcast, playlist

Intro

I have a Sansa 260 music player. The best feature I liked is, it plugged into Linux as a 'usb storage device'. You can treat it like a disk and copy music onto it. No more 'cryptic' filenames like Ipod. TO boot, it even had a pretty good radio ! Life was good. But I found that I was listening to podcasts most of the time, instead of music. I needed an easy way to download/manage podcasts and upload them into Sansa.

When I had a ipod for a while, I used a program called HappyFish to do the exact same thing.. HappyFish was podcast aggregator. I downloads podcasts and uploaded them into Ipods. It created a separate playlist for each podcast, ordered by date, you can configure a maximum number of episodes per podcast. It was great, worked beautifully. The problem was, it was a windows based program

I was looking for a linux equivalent, and here is my setup

Setup

  1. Use IcePodder to download podcasts.
  2. Use the script 'sansa.sh' to upload the content to Sansa and create playlists
    download SANSA.SH from here. This is a bash script
To download podcasts, I tried a bunch of Linux podcast clients.  I ended up going with IcePodder.  It has a nice, simple UI and pretty straightforward functionality.  More over it is being maintained actively.
Another close runner up is Amarok.  Though I love it as a superb music collection organizer and player, its podcasting functionality was weak.   No import-export of OPML and  frequent crashes when left running for days ..etc.  (Granted I was using 1.4.5 version, may be I will try Amarok v2.0 when it is released)

Ipodder by default collects podcasts into

$HOME/iPodderData/downloads

have a directory called sansa.


$HOME/sansa

       |
       +--- podcasts/  ---> $HOME/iPodderData/downloads
       |
       +--- other_music/


the 'podcasts' directory is pointing to the podcast download directory of ipodder.

Here is how the script 'sansa.sh' works

Script takes an optional argument of where Sansa is mounted.  

./sansa.sh "/mnt/Sansa e260"

(make sure to quote spaces, if no mount point is provided it assumes Sansa is at '/media/sansa')

The script needs to know another directory where the music is

# configure this to point to your music collection
# every thing underneath will be copied under sansa music folder

MY_MUSIC_DIR=$HOME/sansa
It will upload all the files under this directory into  Sansa player.
  • The script will check the SANSA_MOUNT is actually a sansa player
  • Script uses rsync, so only the changes will be propagated.  This eliminates lots of unnecessary file transfers and speeds up the program
  • You don't have to have your entire music collection under MUSIC_DIR.  You can just place 'symlinks' here to point to the desired music collection, depending on what music you want to take it on the go.
  • if you delete content within music directory, they are removed from sansa as well
Once all the files are copied, it will make playlists for each directory & sub directory.  Lets say this is the structure of your MUSIC_DIR

$HOME/sansa
   |
   +-- podcasts
   |      +--A
   |      |  +-- a1.mp3
   |      +--B
   |         +-- b1.mp3
   +-- themes
         +-- t1.mp3



The script will create the following playlists
  •  podcasts_A  : contains : a1.mp3
  •  podcasts_B  : contains : b1.mp3
  •  podcasts      : contains : a1.mp3,   b1.mp3
  •  themes         : contains : t1.mp3
A separate playlist for each directory works well.  I can group each podcast into its own playlist.  Also I like the playlists of parent directories including all content of sub directories as well, so for example, if you want to listen to all podcasts, you can just listen to the 'podcasts' playlist !

Day to Day running

leave IPodder running, it will check and download podcasts
Plugin in Sansa via USB
Invoke the script :  ./sansa.sh  "/media/Sansa  e260"  (or where ever your sansa is mounted)


That's it !

Some of my favourite podcasts

  1. KQED Forum : current affairs talk show in San Francisco (podcast)
  2. Market Place : money talk, non-boring (podcast)
  3. On the Media : Analysis of how media analyses events (podcast)
  4. NPR Fresh Air : current events (podcast)
  5. NPR Car Talk : very funny talk show about cars (podcast)
  6. PodRunner : techno music for excercise (podcast)

Trouble Shoot

When Sansa becomes corrupted (readonly files system) run dosfsck on sansa disk

Credit

Many thanks to Assaf Gordon [agordon88(AT)gmail(DOT)com] for helping with playlist format


** Comment on this article **