Device Information
From wikiPodLinux
Newer (4th gen+) iPods expose data about themselves available through a SCSI INQUIRY command. The 0xC0 page code contains a list page codes for each chunk of the data.
sg_inq -p=0xc0 /dev/sda VPD INQUIRY, page code=0xc0: 00 00 c0 00 27 c2 c3 c4 c5 c6 c7 c8 c9 ca cb cc cd ...'............ 10 ce cf d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 da db dc dd ................ 20 de df e0 e1 e2 e3 e4 e5 e6 e7 e8 ...........
The 2nd byte is just the page code you requested, and the 4th byte is the length of the payload. According to the above, the device data starts at page code 0xC2 and ends at 0xE8. You can request each chunk the same way as we did above:
sg_inq -p=0xc2 /dev/sda VPD INQUIRY, page code=0xc2: 00 00 c2 00 f8 3c 3f 78 6d 6c 20 76 65 72 73 69 6f ....<?xml versio 10 6e 3d 22 31 2e 30 22 20 65 6e 63 6f 64 69 6e 67 n="1.0" encoding 20 3d 22 55 54 46 2d 38 22 3f 3e 0a 3c 21 44 4f 43 ="UTF-8"?>.<!DOC 30 54 59 50 45 20 70 6c 69 73 74 20 50 55 42 4c 49 TYPE plist PUBLI 40 43 20 22 2d 2f 2f 41 70 70 6c 65 20 43 6f 6d 70 C "-//Apple Comp 50 75 74 65 72 2f 2f 44 54 44 20 50 4c 49 53 54 20 uter//DTD PLIST 60 31 2e 30 2f 2f 45 4e 22 20 22 68 74 74 70 3a 2f 1.0//EN" "http:/ 70 2f 77 77 77 2e 61 70 70 6c 65 2e 63 6f 6d 2f 44 /www.apple.com/D 80 54 44 73 2f 50 72 6f 70 65 72 74 79 4c 69 73 74 TDs/PropertyList 90 2d 31 2e 30 2e 64 74 64 22 3e 0a 3c 70 6c 69 73 -1.0.dtd">.<plis a0 74 20 76 65 72 73 69 6f 6e 3d 22 31 2e 30 22 3e t version="1.0"> b0 0a 3c 64 69 63 74 3e 0a 3c 6b 65 79 3e 41 70 70 .<dict>.<key>App c0 6c 65 44 52 4d 56 65 72 73 69 6f 6e 3c 2f 6b 65 leDRMVersion</ke d0 79 3e 0a 3c 64 69 63 74 3e 0a 3c 6b 65 79 3e 4d y>.<dict>.<key>M e0 69 6e 69 6d 75 6d 3c 2f 6b 65 79 3e 0a 3c 69 6e inimum</key>.<in f0 74 65 67 65 72 3e 30 3c 2f 69 6e 74 teger>0</int
As you can see, the data is an xml document. It contains nice things like the serial number and supported audio/photo/video formats. An example of a complete doc from a video iPod is below:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "https://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>AppleDRMVersion</key> <dict> <key>Minimum</key> <integer>0</integer> <key>Maximum</key> <integer>4</integer> <key>Format</key> <integer>2</integer> </dict> <key>AudioCodecs</key> <dict> <key>AIFF</key> <dict> <key>Mono</key> <true/> <key>Stereo</key> <true/> <key>Multichannel</key> <false/> <key>MaximumSampleRate</key> <integer>48000</integer> <key>MaximumBitDepth</key> <integer>16</integer> </dict> <key>MP3</key> <dict> <key>Mono</key> <true/> <key>Stereo</key> <true/> <key>MaximumSampleRate</key> <integer>48000</integer> <key>MaximumDataRate</key> <integer>320</integer> </dict> <key>WAV</key> <dict> <key>Mono</key> <true/> <key>Stereo</key> <true/> <key>Multichannel</key> <false/> <key>MaximumSampleRate</key> <integer>48000</integer> <key>MaximumBitDepth</key> <integer>16</integer> </dict> <key>AAC</key> <dict> <key>AppleDRM</key> <true/> <key>MaximumSampleRate</key> <integer>48000</integer> <key>LC</key> <dict> <key>VariableBitRate</key> <true/> <key>PerceptualNoiseSubsitution</key> <true/> </dict> </dict> <key>AppleLossless</key> <dict> <key>Mono</key> <true/> <key>Stereo</key> <true/> <key>Multichannel</key> <false/> <key>MaximumBitDepth</key> <integer>32</integer> <key>MaximumBitDepthUntruncated</key> <integer>16</integer> <key>MaximumSampleRate</key> <integer>48000</integer> <key>AppleDRM</key> <true/> </dict> <key>Audible</key> <dict> <key>Type1</key> <false/> <key>Type2</key> <true/> <key>Type3</key> <true/> <key>Type4</key> <true/> </dict> </dict> <key>BuildID</key> <string>6.1.2</string> <key>ConnectedBus</key> <string>USB</string> <key>MaxTransferSpeed</key> <integer>61440</integer> <key>FamilyID</key> <integer>6</integer> <key>FireWireGUID</key> <string>000A2700157501F8</string> <key>FireWireVersion</key> <string>1.62</string> <key>ImageSpecifications</key> <array> <key>1019</key> <dict> <key>FormatId</key> <integer>1019</integer> <key>DisplayWidth</key> <integer>720</integer> <key>RenderWidth</key> <integer>640</integer> <key>RenderHeight</key> <integer>480</integer> <key>PixelFormat</key> <string>32767579</string> <key>Interlaced</key> <false/> <key>ColorAdjustment</key> <integer>1</integer> <key>GammaAdjustment</key> <real>2.2</real> <key>Crop</key> <false/> <key>AlignRowBytes</key> <false/> </dict> <key>1015</key> <dict> <key>FormatId</key> <integer>1015</integer> <key>RenderWidth</key> <integer>130</integer> <key>RenderHeight</key> <integer>88</integer> <key>PixelFormat</key> <string>4C353635</string> <key>Interlaced</key> <false/> <key>ColorAdjustment</key> <integer>0</integer> <key>GammaAdjustment</key> <real>2.2</real> <key>Crop</key> <false/> <key>AlignRowBytes</key> <true/> <key>BackColor</key> <string>00000000</string> </dict> <key>1024</key> <dict> <key>FormatId</key> <integer>1024</integer> <key>RenderWidth</key> <integer>320</integer> <key>RenderHeight</key> <integer>240</integer> <key>PixelFormat</key> <string>4C353635</string> <key>Interlaced</key> <false/> <key>ColorAdjustment</key> <integer>0</integer> <key>GammaAdjustment</key> <real>2.2</real> <key>Crop</key> <false/> <key>AlignRowBytes</key> <true/> <key>Rotation</key> <integer>0</integer> </dict> <key>1036</key> <dict> <key>FormatId</key> <integer>1036</integer> <key>RenderWidth</key> <integer>50</integer> <key>RenderHeight</key> <integer>41</integer> <key>PixelFormat</key> <string>4C353635</string> <key>Interlaced</key> <false/> <key>ColorAdjustment</key> <integer>0</integer> <key>GammaAdjustment</key> <real>2.2</real> <key>Crop</key> <true/> <key>AlignRowBytes</key> <true/> <key>BackColor</key> <string>00000000</string> </dict> </array> <key>AlbumArt</key> <array> <key>1028</key> <dict> <key>FormatId</key> <integer>1028</integer> <key>RenderWidth</key> <integer>100</integer> <key>RenderHeight</key> <integer>100</integer> <key>PixelFormat</key> <string>4C353635</string> <key>Interlaced</key> <false/> <key>ColorAdjustment</key> <integer>0</integer> <key>GammaAdjustment</key> <real>2.2</real> <key>Crop</key> <false/> <key>AlignRowBytes</key> <true/> <key>BackColor</key> <string>FFFFFFFF</string> </dict> <key>1029</key> <dict> <key>FormatId</key> <integer>1029</integer> <key>RenderWidth</key> <integer>200</integer> <key>RenderHeight</key> <integer>200</integer> <key>PixelFormat</key> <string>4C353635</string> <key>Interlaced</key> <false/> <key>ColorAdjustment</key> <integer>0</integer> <key>GammaAdjustment</key> <real>2.2</real> <key>Crop</key> <false/> <key>AlignRowBytes</key> <true/> <key>BackColor</key> <string>FFFFFFFF</string> </dict> </array> <key>PodcastsSupported</key> <true/> <key>ChapterImageSpecs</key> <array> <key>1028</key> <dict> <key>FormatId</key> <integer>1028</integer> <key>RenderWidth</key> <integer>100</integer> <key>RenderHeight</key> <integer>100</integer> <key>PixelFormat</key> <string>4C353635</string> <key>Interlaced</key> <false/> <key>ColorAdjustment</key> <integer>0</integer> <key>GammaAdjustment</key> <real>2.2</real> <key>Crop</key> <false/> <key>AlignRowBytes</key> <true/> <key>BackColor</key> <string>FFFFFFFF</string> </dict> <key>1029</key> <dict> <key>FormatId</key> <integer>1029</integer> <key>RenderWidth</key> <integer>200</integer> <key>RenderHeight</key> <integer>200</integer> <key>PixelFormat</key> <string>4C353635</string> <key>Interlaced</key> <false/> <key>ColorAdjustment</key> <integer>0</integer> <key>GammaAdjustment</key> <real>2.2</real> <key>Crop</key> <false/> <key>AlignRowBytes</key> <true/> <key>BackColor</key> <string>FFFFFFFF</string> </dict> </array> <key>MinITunesVersion</key> <string>6.0</string> <key>SerialNumber</key> <string>XXXXXXXXXXX</string> <key>UpdaterFamilyID</key> <integer>13</integer> <key>VisibleBuildID</key> <string>1.1.2</string> <key>64Bit</key> <integer>3</integer> <key>OEMID</key> <integer>0</integer> <key>OEMV</key> <integer>8</integer> <key>PowerInformation</key> <dict> <key>WillFlash</key> <true/> <key>USB</key> <true/> <key>FireWire</key> <false/> </dict> <key>VoiceMemosSupported</key> <true/> <key>VoiceMemoFormats</key> <dict> <key>WAV</key> <dict> <key>MaximumSampleRate</key> <integer>44100</integer> </dict> </dict> <key>AutoRebootAfterFirmwareUpdate</key> <true/> <key>VolumeFormat</key> <string>FAT32</string> <key>VolumeInformation</key> <dict> <key>HFSPLUS</key> <dict> <key>SupportedFormat</key> <true/> <key>ConversionSupported</key> <true/> <key>CurrentFormat</key> <false/> </dict> <key>FAT32</key> <dict> <key>SupportedFormat</key> <true/> <key>ConversionSupported</key> <false/> <key>CurrentFormat</key> <true/> </dict> </dict> <key>ForcedDiskMode</key> <false/> <key>BangFolder</key> <false/> <key>CorruptDataPartition</key> <false/> <key>CorruptFirmwarePartition</key> <false/> <key>CanFlashBacklight</key> <true/> <key>CanHibernate</key> <true/> <key>RAM</key> <integer>32</integer> <key>HotPlugState</key> <integer>0</integer> <key>vCardWithJPEGSupported</key> <true/> <key>VideoCodecs</key> <dict> <key>H.264</key> <dict> <key>AppleVideoDRM</key> <dict> <key>MaximumEncryptionPercentage</key> <real>12.5</real> </dict> <key>AAC</key> <dict> <key>AppleDRM</key> <true/> <key>MaximumSampleRate</key> <integer>48000</integer> <key>MaximumBitRate</key> <integer>160</integer> <key>LC</key> <dict> <key>VariableBitRate</key> <true/> <key>Multichannel</key> <false/> </dict> </dict> <key>Profile</key> <string>B</string> <key>Level</key> <integer>13</integer> <key>MaximumPeakBitRate</key> <integer>768</integer> <key>MaximumResolution</key> <integer>76800</integer> <key>MinimumWidth</key> <integer>16</integer> <key>MinimumHeight</key> <integer>16</integer> <key>MaximumWidth</key> <integer>4800</integer> <key>MaximumHeight</key> <integer>4800</integer> </dict> <key>MPEG4</key> <dict> <key>AppleVideoDRM</key> <dict> <key>MaximumEncryptionPercentage</key> <real>12.5</real> </dict> <key>AAC</key> <dict> <key>AppleDRM</key> <true/> <key>MaximumSampleRate</key> <integer>48000</integer> <key>MaximumBitRate</key> <integer>160</integer> <key>LC</key> <dict> <key>VariableBitRate</key> <true/> <key>Multichannel</key> <false/> </dict> </dict> <key>Profile-Level-ID</key> <integer>3</integer> <key>MaximumAverageBitRate</key> <integer>2500</integer> <key>MaximumPeakBitRate</key> <integer>0</integer> <key>MaximumBufferSize</key> <integer>0</integer> <key>MaximumResolution</key> <integer>230400</integer> <key>MinimumWidth</key> <integer>16</integer> <key>MinimumHeight</key> <integer>16</integer> <key>MaximumWidth</key> <integer>14400</integer> <key>MaximumHeight</key> <integer>14400</integer> </dict> </dict> </dict> </plist>