Giter Site home page Giter Site logo

sd3rd's Introduction

---
iTunesSD 3rd gen
-- Write up the of database for the iPod shuffle 3rd & 4th gen
---- writing this because the original is on a wiki that went down
---- https://web.archive.org/web/20131016014401/http://shuffle3db.wikispaces.com/iTunesSD3gen
---
Usage & Placement & Meaning
-- SD stands for Shuffle Database
---- as such this is the database file the shuffle (3rd/4th gen) uses
-- It is found at <mount point>/iPod_Control/iTunes/iTunesSD
-- Compared to the 2nd/1st gen versions it is very different with only the hexcode
---- for file format remaining the same
---
Byte Usage
-- Each set of 4 bits is 2 bytes
---- 0000 0000 = 4 bytes
----   00 00   = 2 Bytes
----    0 0    = 1 Bytes*
------ *: blocks are in sets of 2 bytes
---
Layout
-- base layout of said iTunesSD file
----------
| Header |
----------
  |    ----------------
  '->  | Track Header |
       ----------------
        |   -----------
        '-> | Track 1 |
            -----------
        |
        '-> ...
  |    -------------------
  '->  | Playlist Header |
       -------------------
        |   --------------
        '-> | Playlist 1 |
            --------------
        |   --------------
        '-> | Playlist 2 |
            --------------
---
Base Hex Layout
-- Follows same as above but with the literal values
-- Values are in hex
--------------------
| bdhs  0300 0002  | Header
--------------------
 |
 '-> --------
     | hths | Track Header | Offsets cause max size to be undefined
     --------
      |
      '-> --------
          | rths | Track #? header | Repeats for each track
          --------
      |
      '-> --------
          | .... |
          --------
 |
 '-> --------
     | hphs | Playlists Header | Offsets cause max size to be undefined
     --------
      |
      '-> --------
          | lphs | Playlist #? header | Repeats for each playlist
          --------
      |
      '-> --------
          | .... |
          --------
---
Full Hex Layout
---
--------------------
| bdhs  0300 0002  | Header
--------------------
 |   ---------------
 '-> |  4000 0000  | Size of header | Always 4000 0000
     ---------------
 |   ---------------
 '-> |  ??00 0000  | Numer of tracks | All 4 bytes may be used
     ---------------
 |   ---------------
 '-> |  ??00 0000  | Number of Playlists | All 4 bytes may be used
     ---------------
 |   ---------------
 '-> |  0000 0000  | Padding
     |  0000 0000  |
     ---------------
 |   ---------------
 '-> |     0 ?     | Volume Limit | 00 = UNSET | 03 = MIN | 02 = MAX 
     ---------------
 |   ---------------
 '-> |     0 ?     | Voiceover Enabled | 1 = ENABLED | 0 = DISABLED
     ---------------
 |   ---------------
 '-> |    00 00    | Padding (?)
     ---------------
 |   --------------- 
 '-> |  ??00 0000  | Number of tracks | Without audiobooks/podcasts | All 4 bytes may be used
     ---------------
 |   ---------------
 '-> |  4000 0000  | Offset
     ---------------
 |   ---------------
 '-> |  64b9 0000  | Playlist Offset
     ---------------
 |   ---------------
 '-> |  0000 0000  |
     |  0000 0000  |
     |  0000 0000  | Padding
     |  0000 0000  |
     |  0000 0000  | 
     ---------------
 -----------------
 | END OF HEADER |
 -----------------
--------
| hths | Tracks Header | Offsets cause max size to be undefined  
--------
 |   ---------------
 '-> |  ???? 0000  | Length
     ---------------
 |   ---------------
 '-> |  ??00 0000  | Number of tracks | All 4 bytes may be used
     ---------------
 |   ---------------
 '-> |  0000 0000  | Padding
     |  0000 0000  |
     ---------------
 |   ---------------
 '-> |  ???? 0000  | Offest 0 -> ... 
     |  ???? 0000  |
     |  ???? 0000  |
     |  ???? 0000  |
     |  ???? 0000  |
     |  .... ....  |
     ---------------
 ------------------------
 | END OF TRACKS HEADER |
 ------------------------
--------
| rths | Track #? header | Repeats for each track
--------
 |   ---------------
 '-> |  ???? 0000  | Length
     ---------------
 |   ---------------
 '-> |  ???? ????  | Starting position | MiliSeconds | Typically 0000 0000
     ---------------
 |   ---------------
 '-> |  ???? ????  | Ending position | Length of Track (or less) in MiliSeconds 
     ---------------
 |   ---------------
 '-> |  0000 0000  | Volume gain | 00 -> 100
     ---------------
 |   ---------------
 '-> |  0?00 0000  | File Type | 01 = MP3 | 02 = AAC,MP4,M4A | 04 = WAV
     ---------------
 |   ---------------
 ->  |  ???? ????  | File Name | /iPod_Control/Music/???/NAME.TYPE
     |  ???? ????  | 256 Bytes Max
     |  ???? ????  |
     |  ???? ????  |
     |  ???? ????  |
     |  ???? ????  |
     |  ???? ????  |
     |  .... ....  |
     ---------------
 |   ---------------
 '-> |  0000 0000  | Bookmark | MiliSeconds | For Audiobooks
     ---------------
 |   ---------------
 '-> |     0 ?     | Shuffle Skip | 01 = NO SKIP | 00 = SKIP
     ---------------
 |   ---------------
 '-> |     0 0     | Remember Playing position | 00 = YES | 01 = NO
     ---------------
 |   ---------------
 '-> |     0 0     | `uninterruptable_album` | Meaning/Usage ?
     ---------------
 |   ---------------
 '-> |     0 0     | Unknown
     ---------------
 |   ---------------
 '-> |  ???? ????  | Pre gap  | Usage ?
     ---------------
 |   ---------------
 '-> |  ???? ????  | Post gap | ^^^^^^^
     ---------------
 |   ---------------
 '-> |  ???? ????  | Number of samples | Max 4 bytes | May limit quality
     ---------------
 |   ---------------
 '-> |     ? ?     | Unknown file data
     ---------------
 |   ---------------
 '-> |  ???? ????  | Gapless Data | Usage ?
     ---------------
 |   ---------------
 '-> |     ? ?     | Unknown file data 2
     ---------------
 |   ---------------
 '-> |  0000 0000  | Album ID
     ---------------
 |   ---------------
 '-> |    01 00    | Track Number | Max 2 bytes | Reason why multiple folders are needed
     ---------------
 |   ---------------
 '-> |    0? 00    | Disc Number  | As above
     ---------------
 |   ---------------
 '-> |  0000 0000  | Padding
     |  0000 0000  |
     ---------------
 |   ---------------
 '-> |  0000 0000  | Voiceover filename
     |  0000 0000  |
     ---------------
 |   ---------------
 '-> |  ???? ????  | Artist ID
     ---------------
 |   ---------------
 ->  |  0000 0000  | Padding
     |  0000 0000  |
     |  0000 0000  |
     |  0000 0000  | 
     |  0000 0000  | 
     |  0000 0000  |
     |  0000 0000  |
     |  0000 0000  |
     ---------------
 ----------------
 | END OF TRACK |
 ----------------
--------
| hphs | Playlists Header | Offsets cause max size to be undefined  
--------
 |   ---------------
 '-> |  0000 0000  | Length
     ---------------
 |   ---------------
 '-> |  0000 0000  | Number of Playlist | wiki states size is unknown
     ---------------
 |   ---------------
 '-> |    00 00    | Number of Non-podcast playlists
     ---------------
 |   ---------------
 '-> |    00 00    | Number of master playlists
     ---------------
 |   ---------------
 '-> |    00 00    | Number of Non-audiobook playlists
     ---------------
 |   ---------------
 '-> |    00 00    | Unknown | Possibly Padding
     ---------------
 |   ---------------
 '-> |  0000 0000  | Offset of playlist
     ---------------
 |   ---------------
 '-> |  0000 0000  | Offset of playlist
     ---------------
 |   ---------------
 '-> |  .... ....  | Continuing Offsets
     ---------------
 --------------------------
 | END OF PLAYLIST HEADER |
 --------------------------
--------
| lphs | Playlist #? header | Repeats for each playlist 
--------
 |   ---------------
 '-> |  0000 0000  | Length
     ---------------
 |   ---------------
 '-> |  0000 0000  | Number of songs
     ---------------
 |   ---------------
 '-> |  0000 0000  | Number of Non-podcast/audiobook songs
     ---------------
 |   ---------------
 '-> |  0000 0000  | Voiceover filename
     |  0000 0000  | 
     ---------------
 |   ---------------
 '-> |  0?00 0000  | Type of playlist | 01 = MASTER | 02 = NORMAL | 03 = PODCASE | 04 = AUDIOBOOK
     ---------------
 |   ---------------
 '-> |  0000 0000  | Unknown | Likely padding
     |  0000 0000  |
     |  0000 0000  |
     |  0000 0000  |
     ---------------
 |   ---------------
 '-> |  0000 0000  | Playlist track
     ---------------
 |   ---------------
 '-> |  .... ....  | Continuing...
     ---------------
 -------
 | END |
 -------
---

sd3rd's People

Contributors

mia-rain avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.