| 1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
| 2 |
<html> |
| 3 |
<head> |
| 4 |
<title>NetMD USB Protocol</title> |
| 5 |
</head> |
| 6 |
<body> |
| 7 |
<h1>Index</h1> |
| 8 |
|
| 9 |
<ul> |
| 10 |
<li><a href="#notes">Technical Notes</a></li> |
| 11 |
<li><a href="#req_disc">Request Disc Header</a></li> |
| 12 |
<li><a href="#req_track">Request Track Title</a></li> |
| 13 |
<li><a href="#set_disc">Set Disc Header</a></li> |
| 14 |
<li><a href="#set_track">Set Track Title</a></li> |
| 15 |
<li><a href="#move_track">Move Track</a></li> |
| 16 |
<li><a href="#track_time">Get Track Time</a></li> |
| 17 |
<li><a href="#codec">Get Track Codec</a></li> |
| 18 |
<li><a href="#bitrate">Get Track Bitrate</a></li> |
| 19 |
<li><a href="#header">Header layout</a></li> |
| 20 |
</ul> |
| 21 |
<hr> |
| 22 |
<a name=notes><h3>Technical notes.</h3></a> |
| 23 |
<ul> |
| 24 |
<li>All Value and Index values in the URB's are 0 for all URB's that I've discovered</li> |
| 25 |
<li>Reqeust 80 means the setup packet should start with 41h</li> |
| 26 |
<li>Reqeust 81 means the setup packet should start with C1h</li> |
| 27 |
<li>Reqeust 01 means the setup packet should start with C1h</li> |
| 28 |
<li>Track numbers are zero based, so track 1 on the disc is refered to as 00 in the protocol</li> |
| 29 |
<li>Almost all numbers are in hex, get used to it.</li> |
| 30 |
<li>Out indicates data leaving the PC</li> |
| 31 |
<li>In indicates data coming from the USB device.</li> |
| 32 |
</ul> |
| 33 |
|
| 34 |
<h3><a name="req_disc">Request Disc Header</a></h3> |
| 35 |
Direction: Out<br> |
| 36 |
Request: 80<br> |
| 37 |
Data Length: 13<br> |
| 38 |
Data: 00 18 06 02 20 18 02 00 00 30 00 0a 00 ff 00 00 00 00 00 |
| 39 |
<P> |
| 40 |
Direction: Out<br> |
| 41 |
Request: 01<br> |
| 42 |
Data Length: 04<br> |
| 43 |
Data: buffer of length 4<p> |
| 44 |
Upon completion buffer is filled in for you as 01 81 hh 00 where hh is the length of the buffer |
| 45 |
needed to hold the Disc Header (plus protocol information) |
| 46 |
<P> |
| 47 |
Request: 81<br> |
| 48 |
Data Lenth: hh from above<br> |
| 49 |
Data: buffer of length hh<p> |
| 50 |
Upon completion the buffer holds hh bytes of data. The first 19h bytes are protocol information, |
| 51 |
you are interested in the remaining data.<br> |
| 52 |
|
| 53 |
<hr> |
| 54 |
|
| 55 |
<h3><a name="req_track">Request Track Title</a></h3> |
| 56 |
Direction: Out<br> |
| 57 |
Request: 80<br> |
| 58 |
Data Length: 13<br> |
| 59 |
Data: 00 18 06 02 20 18 01 00 HH 30 00 0a 00 ff 00 00 00 00 00<P> |
| 60 |
HH is the track number. |
| 61 |
<P> |
| 62 |
Direction: Out<br> |
| 63 |
Request: 01<br> |
| 64 |
Data Length: 04<br> |
| 65 |
Data: buffer of length 4<p> |
| 66 |
Upon completion buffer is filled in for you as 01 81 hh 00 where hh is the length of the buffer |
| 67 |
needed to hold the Track Title (plus protocol information) |
| 68 |
<P> |
| 69 |
Request: 81<br> |
| 70 |
Data Lenth: hh from above<br> |
| 71 |
Data: buffer of length hh<p> |
| 72 |
Upon completion the buffer holds hh bytes of data. The first 19h bytes are protocol information, |
| 73 |
you are interested in the remaining data.<br> |
| 74 |
|
| 75 |
<hr> |
| 76 |
|
| 77 |
<h3><a name="set_disc">Set Disc Header</a></h3> |
| 78 |
Direction: Out<br> |
| 79 |
Request: 80<br> |
| 80 |
Data Length: 13<br> |
| 81 |
Data: 00 18 07 02 20 18 01 00 00 30 00 0a 00 50 00 00<Br> |
| 82 |
HH 00 00 00 JJ (Header)<P> |
| 83 |
Where HH is the length of the Header, JJ is the length the header used to be, and (Header) is the full complete Header List<BR> |
| 84 |
See <a href="#header">Header</a> for information on how the Disc Header is structured. |
| 85 |
|
| 86 |
<hr> |
| 87 |
|
| 88 |
<h3><a name="set_track">Set Track Title</a></h3> |
| 89 |
Direction: Out<br> |
| 90 |
Request: 80<br> |
| 91 |
Data Length: 13<br> |
| 92 |
Data: 00 18 07 02 20 18 02 00 00 30 00 0a 00 50 00 00<Br> |
| 93 |
HH 00 00 00 HH (Title)<P> |
| 94 |
Where HH is the length of the Title and (Title) is the Track Title, remember that LP: is not inserted for you.<BR> |
| 95 |
|
| 96 |
<hr> |
| 97 |
|
| 98 |
<h3><a name="move_track">Move Track</a></h3> |
| 99 |
Direction: Out<br> |
| 100 |
Request: 80<br> |
| 101 |
Data Length: 13<br> |
| 102 |
Data: 00 18 43 ff 00 00 20 10 HH 00 04 20 10 01 00 JJ<P> |
| 103 |
Where HH is the track number to move and JJ is the track number to make it.<br> |
| 104 |
|
| 105 |
<hr> |
| 106 |
<h3><a name="track_time">Get Track Time</a></h3> |
| 107 |
Request: 80<br> |
| 108 |
Data Length: 13<br> |
| 109 |
Data: 00 18 06 02 20 10 01 00 TT 30 00 01 00 ff 00 00 00 00 00<P> |
| 110 |
TT is the track number. |
| 111 |
<P> |
| 112 |
Request: 01<br> |
| 113 |
Data Length: 04<br> |
| 114 |
Data: buffer of length 4<p> |
| 115 |
Upon completion buffer is filled in for you as 01 81 hh 00 where hh is the length of the buffer |
| 116 |
needed to hold the Disc Header (plus protocol information) |
| 117 |
<P> |
| 118 |
Request: 81<br> |
| 119 |
Data Lenth: hh from above<br> |
| 120 |
Data: buffer of length hh<p> |
| 121 |
Upon completion the buffer holds hh (seems to be 1f every time since its the same data per track) |
| 122 |
bytes of data. The last 3 bytes are Binary Coded Decimal representations of the track times.<P> |
| 123 |
<pre>#define BCD_TO_PROPER(x) (((((x) & 0xf0) >> 4) * 10) + ((x) & 0x0f))</pre> <P> |
| 124 |
This is a C macro which will return the proper decimal for use. |
| 125 |
<P> |
| 126 |
<hr> |
| 127 |
<h3><a name="codec">Get Track Codec</a></h3> |
| 128 |
Request: 80<br> |
| 129 |
Data Length: 13<br> |
| 130 |
Data: 00 18 06 01 20 10 01 00 tt ff 00 00 01 00 08<BR> |
| 131 |
tt is the track number. |
| 132 |
<P> |
| 133 |
Request: 01<br> |
| 134 |
Data Length: 04<br> |
| 135 |
Data: buffer of length 4<p> |
| 136 |
Upon completion buffer is filled in for you as 01 81 hh 00 where hh is the length of the buffer |
| 137 |
needed to hold reply |
| 138 |
<P> |
| 139 |
Request: 81<br> |
| 140 |
Data Lenth: hh from above<br> |
| 141 |
Data: buffer of length hh<p> |
| 142 |
Upon completion the buffer holds hh (seems to be 1f every time since its the same data per track) |
| 143 |
bytes of data. The last byte holds a hex value representing the bitrate<P> |
| 144 |
<b>Known Values</b> |
| 145 |
<ol> |
| 146 |
<li>00 - ATRAC</li> |
| 147 |
<li>03 - ATRAC3</li> |
| 148 |
</ol> |
| 149 |
<P> |
| 150 |
<hr> |
| 151 |
<h3><a name="bitrate">Get Track Bitrate</a></h3> |
| 152 |
Request: 80<br> |
| 153 |
Data Length: 13<br> |
| 154 |
Data: 00 18 06 02 20 10 01 00 tt 30 80 07 00 ff 00 00 00 00 00<BR> |
| 155 |
tt is the track number. |
| 156 |
<P> |
| 157 |
Request: 01<br> |
| 158 |
Data Length: 04<br> |
| 159 |
Data: buffer of length 4<p> |
| 160 |
Upon completion buffer is filled in for you as 01 81 hh 00 where hh is the length of the buffer |
| 161 |
needed to hold reply |
| 162 |
<P> |
| 163 |
Request: 81<br> |
| 164 |
Data Lenth: hh from above<br> |
| 165 |
Data: buffer of length hh<p> |
| 166 |
Upon completion the buffer holds hh (seems to be 1f every time since its the same data per track) |
| 167 |
bytes of data. The second to last byte holds a hex value representing the bitrate<P> |
| 168 |
<b>Known Values</b> |
| 169 |
<ol> |
| 170 |
<li>90 - Stereo</li> |
| 171 |
<li>92 - LP2</li> |
| 172 |
</ol> |
| 173 |
<P> |
| 174 |
<HR> |
| 175 |
<h3><a name="header">Header layout</a></h3> |
| 176 |
The way Sony implemented groups is interesting, its a text string stored with the disc name.<P> |
| 177 |
So if you had a MD with the Title GroovyMix and 2 groups Thumpen and Bumpen it could look like this:<BR> |
| 178 |
0;GroovyMix//1-5;Thumpen//6-8;Bumpen// |
| 179 |
|
| 180 |
Where 1-5 and 6-8 are the NON zero based track numbers that the group contains. |
| 181 |
I ephasize non because the protocol refers to all track numbers in a zero based manner, making information tracking interesting<P> |
| 182 |
|
| 183 |
<body> |
| 184 |
</html> |