Chumby as an iPod server

From Chumby Wiki
Revision as of 11:29, 26 June 2008 by Chumby (Talk | contribs)

Jump to: navigation, search

Summary

When an iPod is plugged into a Chumby's USB port, the device launches an HTTP daemon on port 8080 (called "chumbipodd") that will serve data about the iPod in XML. The Chumby's Control Panel utilizes this server to provide a simple interface to the iPod's playlists; however, the daemon provides quite a bit more information. The daemon supports a universal crossdomain.xml file, so the services are available to the Chumby widgets.

Protocol

info

Returns basic information about the iPod - number of playlists, tracks, photos, photo albums, and storage statistics

Format:

http://ip.of.the.chumby:8080/info

Response:

<?xml version="1.0" encoding="UTF-8"?>
<info>
  <iPod id='0' mountPoint='/mnt/ipod' trackCount='1170' playlistCount='23' totalSpace='28521' freeSpace='20120' photoCount='2165' photoAlbumCount='29' >
    <name><![CDATA[My iPod]]></name>
  </iPod>
</info>

playlists

Returns a list of the playlists on the device. The "fullTrackCount" attribute includes tracks that cannot be played on the chumby (such as tracks purchased from the iTMS), while the "trackCount" attributes is filtered to include only those tracks that are playable (MP3 and M4A). The standard chumby Control Panel will typically not show playlists with a trackCount of 0.

Format:

http://ip.of.the.chumby:8080/playlists

Response:

<?xml version="1.0" encoding="UTF-8"?>
<playlists>
  <playlist id='0' trackCount='1145' fullTrackCount='1170' >
    <name><![CDATA[My iPod]]></name>
  </playlist>
  <playlist id='1' trackCount='6' fullTrackCount='6' >
    <name><![CDATA[Nighttime Mix]]></name>
  </playlist>
   ...
  <playlist id='22' trackCount='35' fullTrackCount='50' >
    <name><![CDATA[Wedding]]></name>
  </playlist>
</playlists>

playlistIDs

Returns a list of track IDs of the tracks in a playlist - this is a quicker fetch than the more detailed "playlist" fetch and is useful if you don't need all of the track details in one shot.

Format:

http://ip.of.the.chumby:8080/playlistIDs/(id_of_playlist)

Response:

<?xml version="1.0" encoding="UTF-8"?>
<playlistIDs index='1'>
  <name><![CDATA[Nighttime Mix]]></name>
  <trackIDs>1390,1388,1389,1391,1387,1386</trackIDs>
</playlistIDs>

playlist

Returns detailed track information about the tracks in a playlist

Format:

http://ip.of.the.chumby:8080/playlist/(id_of_playlist)

Response:

<?xml version="1.0" encoding="UTF-8"?>
<playlist index='1'>
  <name><![CDATA[Nighttime Mix]]></name>
  <tracks>
    <track id='1390' duration='5:21' path='/mnt/ipod/iPod_Control/Music/F14/THUT.m4a' >
      <artist><![CDATA[Peace Division]]></artist>
      <album><![CDATA[Fabric 28]]></album>
      <title><![CDATA[01 Club Therapy]]></title>
    </track>
    <track id='1388' duration='5:21' path='/mnt/ipod/iPod_Control/Music/F21/BELB.m4a' >
      <artist><![CDATA[Peace Division]]></artist>
      <album><![CDATA[Fabric 28]]></album>
      <title><![CDATA[02 Club Therapy]]></title>
    </track>
    ...
    <track id='1386' duration='5:21' path='/mnt/ipod/iPod_Control/Music/F43/FYWV.m4a' >
      <artist><![CDATA[Peace Division]]></artist>
      <album><![CDATA[Fabric 28]]></album>
      <title><![CDATA[06 Club Therapy]]></title>
    </track>
  </tracks>
</playlist>

track

Returns detailed information about a track

Format:

http://ip.of.the.chumby:8080/track/(id_of_track)

Response:

<?xml version="1.0" encoding="UTF-8"?>
<track id='1390' >
  <title><![CDATA[01 Club Therapy]]></title>
  <artist><![CDATA[Peace Division]]></artist>
  <album><![CDATA[Fabric 28]]></album>
  <year>2006</year>
  <genre><![CDATA[Electronica/Dance]]></genre>
  <tracknum>4</tracknum>
  <trackcount>18</trackcount>
  <path>/mnt/ipod/iPod_Control/Music/F14/THUT.m4a</path>
  <duration>5:21</duration>
  <bitrate>128</bitrate>
  <samplerate>44100</samplerate>
  <filesize>5216001</filesize>
  <artcount>0</artcount>
  <rating>0</rating>
  <playcount>0</playcount>
</track>

trackfile

Returns the audio file for a track

Format:

http://ip.of.the.chumby:8080/trackfile/(id_of_track)

photoalbums

Returns a list of photo albums.

Format:

http://ip.of.the.chumby:8080/photoalbums

Return:

<?xml version="1.0" encoding="UTF-8"?>
<photoalbums>
  <photoalbum id='0' photoCount='2165' >
    <name><![CDATA[Library]]></name>
  </photoalbum>
  <photoalbum id='1' photoCount='37' >
    <name><![CDATA[Last Roll]]></name>
  </photoalbum>
  ...
  <photoalbum id='28' photoCount='15' >
     <name><![CDATA[Slumber party]]></name>
  </photoalbum>
</photoalbums>

photoalbum

Returns the list of photos in a photo album

Format:

http://ip.of.the.chumby:8080/photoalbum/(id_of_photo_album)

Response:

<?xml version="1.0" encoding="UTF-8"?>
<photoalbum index='28'>
  <name><![CDATA[Wedding photos]]></name>
  <photos>
    <photo id='2084' >
      <name><![CDATA[Cutting the cake]]></name>
    </photo>
    <photo id='2114' >
      <name><![CDATA[First dance]]></name>
    </photo>
    ...
    <photo id='2514' >
      <name><![CDATA[Throwing the bouquet]]></name>
    </photo>
  </photos>
</photoalbum>

photo

Return the information about a particular photo. Photos are typically available in several resolutions, which vary across iPod models.

Format:

http://ip.of.the.chumby:8080/photo/(id_of_photo)

Response:

<?xml version="1.0" encoding="UTF-8"?>
<photo id='2085' >
  <name><![CDATA[Cutting the cake]></name>
  <image id='33360' width='720' height='480' />
  <image id='33361' width='130' height='88' />
  <image id='33362' width='320' height='240' />
  <image id='33363' width='50' height='41' />
</photo>

These are some of the known image sizes that are available for various models of the iPod - note that the pixels in the NTSC images are not square.

raw size height width encoding model
691200 480 720 UYVY PhotoPod and VideoPod NTSC image
153600 240 320 RGB565_LE VideoPod full screen
80000 200 200 RGB565_LE VideoPod album art big version
77440 176 220 RGB565_BE_90 PhotoPod full screen
46464 132 176 RGB565_BE Nano full screen
39200 140 140 RGB565_LE PhotoPod album art big version
22880 88 130 RGB565_LE PhotoPod and VideoPod video preview
20000 100 100 RGB565_LE VideoPod album art small version, Nano album art big version
6272 56 56 RGB565_LE PhotoPod album art small version
4100 41 50 RGB565_LE VideoPod list thumbnail
3528 42 42 RGB565_LE Nano album art small version
3108 37 42 RGB565_LE Nano list thumbnail
2520 30 42 RGB565_LE PhotoPod list thumbnail

image

Returns the JPEG file for a particular image.

Format:

http://ip.of.the.chumby:8080/image/(id_of_image)