diff options
Diffstat (limited to 'Documentation/usb/gadget-testing.txt')
-rw-r--r-- | Documentation/usb/gadget-testing.txt | 611 |
1 files changed, 363 insertions, 248 deletions
diff --git a/Documentation/usb/gadget-testing.txt b/Documentation/usb/gadget-testing.txt index 5908a21fddb6..7d7f2340af42 100644 --- a/Documentation/usb/gadget-testing.txt +++ b/Documentation/usb/gadget-testing.txt | |||
@@ -1,26 +1,32 @@ | |||
1 | ============== | ||
2 | Gadget Testing | ||
3 | ============== | ||
4 | |||
1 | This file summarizes information on basic testing of USB functions | 5 | This file summarizes information on basic testing of USB functions |
2 | provided by gadgets. | 6 | provided by gadgets. |
3 | 7 | ||
4 | 1. ACM function | 8 | .. contents |
5 | 2. ECM function | 9 | |
6 | 3. ECM subset function | 10 | 1. ACM function |
7 | 4. EEM function | 11 | 2. ECM function |
8 | 5. FFS function | 12 | 3. ECM subset function |
9 | 6. HID function | 13 | 4. EEM function |
10 | 7. LOOPBACK function | 14 | 5. FFS function |
11 | 8. MASS STORAGE function | 15 | 6. HID function |
12 | 9. MIDI function | 16 | 7. LOOPBACK function |
13 | 10. NCM function | 17 | 8. MASS STORAGE function |
14 | 11. OBEX function | 18 | 9. MIDI function |
15 | 12. PHONET function | 19 | 10. NCM function |
16 | 13. RNDIS function | 20 | 11. OBEX function |
17 | 14. SERIAL function | 21 | 12. PHONET function |
18 | 15. SOURCESINK function | 22 | 13. RNDIS function |
19 | 16. UAC1 function (legacy implementation) | 23 | 14. SERIAL function |
20 | 17. UAC2 function | 24 | 15. SOURCESINK function |
21 | 18. UVC function | 25 | 16. UAC1 function (legacy implementation) |
22 | 19. PRINTER function | 26 | 17. UAC2 function |
23 | 20. UAC1 function (new API) | 27 | 18. UVC function |
28 | 19. PRINTER function | ||
29 | 20. UAC1 function (new API) | ||
24 | 30 | ||
25 | 31 | ||
26 | 1. ACM function | 32 | 1. ACM function |
@@ -44,13 +50,23 @@ There can be at most 4 ACM/generic serial/OBEX ports in the system. | |||
44 | Testing the ACM function | 50 | Testing the ACM function |
45 | ------------------------ | 51 | ------------------------ |
46 | 52 | ||
47 | On the host: cat > /dev/ttyACM<X> | 53 | On the host:: |
48 | On the device : cat /dev/ttyGS<Y> | 54 | |
55 | cat > /dev/ttyACM<X> | ||
56 | |||
57 | On the device:: | ||
58 | |||
59 | cat /dev/ttyGS<Y> | ||
49 | 60 | ||
50 | then the other way round | 61 | then the other way round |
51 | 62 | ||
52 | On the device: cat > /dev/ttyGS<Y> | 63 | On the device:: |
53 | On the host: cat /dev/ttyACM<X> | 64 | |
65 | cat > /dev/ttyGS<Y> | ||
66 | |||
67 | On the host:: | ||
68 | |||
69 | cat /dev/ttyACM<X> | ||
54 | 70 | ||
55 | 2. ECM function | 71 | 2. ECM function |
56 | =============== | 72 | =============== |
@@ -63,13 +79,15 @@ Function-specific configfs interface | |||
63 | The function name to use when creating the function directory is "ecm". | 79 | The function name to use when creating the function directory is "ecm". |
64 | The ECM function provides these attributes in its function directory: | 80 | The ECM function provides these attributes in its function directory: |
65 | 81 | ||
66 | ifname - network device interface name associated with this | 82 | =============== ================================================== |
83 | ifname network device interface name associated with this | ||
67 | function instance | 84 | function instance |
68 | qmult - queue length multiplier for high and super speed | 85 | qmult queue length multiplier for high and super speed |
69 | host_addr - MAC address of host's end of this | 86 | host_addr MAC address of host's end of this |
70 | Ethernet over USB link | 87 | Ethernet over USB link |
71 | dev_addr - MAC address of device's end of this | 88 | dev_addr MAC address of device's end of this |
72 | Ethernet over USB link | 89 | Ethernet over USB link |
90 | =============== ================================================== | ||
73 | 91 | ||
74 | and after creating the functions/ecm.<instance name> they contain default | 92 | and after creating the functions/ecm.<instance name> they contain default |
75 | values: qmult is 5, dev_addr and host_addr are randomly selected. | 93 | values: qmult is 5, dev_addr and host_addr are randomly selected. |
@@ -82,8 +100,13 @@ Testing the ECM function | |||
82 | 100 | ||
83 | Configure IP addresses of the device and the host. Then: | 101 | Configure IP addresses of the device and the host. Then: |
84 | 102 | ||
85 | On the device: ping <host's IP> | 103 | On the device:: |
86 | On the host: ping <device's IP> | 104 | |
105 | ping <host's IP> | ||
106 | |||
107 | On the host:: | ||
108 | |||
109 | ping <device's IP> | ||
87 | 110 | ||
88 | 3. ECM subset function | 111 | 3. ECM subset function |
89 | ====================== | 112 | ====================== |
@@ -96,13 +119,15 @@ Function-specific configfs interface | |||
96 | The function name to use when creating the function directory is "geth". | 119 | The function name to use when creating the function directory is "geth". |
97 | The ECM subset function provides these attributes in its function directory: | 120 | The ECM subset function provides these attributes in its function directory: |
98 | 121 | ||
99 | ifname - network device interface name associated with this | 122 | =============== ================================================== |
123 | ifname network device interface name associated with this | ||
100 | function instance | 124 | function instance |
101 | qmult - queue length multiplier for high and super speed | 125 | qmult queue length multiplier for high and super speed |
102 | host_addr - MAC address of host's end of this | 126 | host_addr MAC address of host's end of this |
103 | Ethernet over USB link | 127 | Ethernet over USB link |
104 | dev_addr - MAC address of device's end of this | 128 | dev_addr MAC address of device's end of this |
105 | Ethernet over USB link | 129 | Ethernet over USB link |
130 | =============== ================================================== | ||
106 | 131 | ||
107 | and after creating the functions/ecm.<instance name> they contain default | 132 | and after creating the functions/ecm.<instance name> they contain default |
108 | values: qmult is 5, dev_addr and host_addr are randomly selected. | 133 | values: qmult is 5, dev_addr and host_addr are randomly selected. |
@@ -115,8 +140,13 @@ Testing the ECM subset function | |||
115 | 140 | ||
116 | Configure IP addresses of the device and the host. Then: | 141 | Configure IP addresses of the device and the host. Then: |
117 | 142 | ||
118 | On the device: ping <host's IP> | 143 | On the device:: |
119 | On the host: ping <device's IP> | 144 | |
145 | ping <host's IP> | ||
146 | |||
147 | On the host:: | ||
148 | |||
149 | ping <device's IP> | ||
120 | 150 | ||
121 | 4. EEM function | 151 | 4. EEM function |
122 | =============== | 152 | =============== |
@@ -129,13 +159,15 @@ Function-specific configfs interface | |||
129 | The function name to use when creating the function directory is "eem". | 159 | The function name to use when creating the function directory is "eem". |
130 | The EEM function provides these attributes in its function directory: | 160 | The EEM function provides these attributes in its function directory: |
131 | 161 | ||
132 | ifname - network device interface name associated with this | 162 | =============== ================================================== |
163 | ifname network device interface name associated with this | ||
133 | function instance | 164 | function instance |
134 | qmult - queue length multiplier for high and super speed | 165 | qmult queue length multiplier for high and super speed |
135 | host_addr - MAC address of host's end of this | 166 | host_addr MAC address of host's end of this |
136 | Ethernet over USB link | 167 | Ethernet over USB link |
137 | dev_addr - MAC address of device's end of this | 168 | dev_addr MAC address of device's end of this |
138 | Ethernet over USB link | 169 | Ethernet over USB link |
170 | =============== ================================================== | ||
139 | 171 | ||
140 | and after creating the functions/eem.<instance name> they contain default | 172 | and after creating the functions/eem.<instance name> they contain default |
141 | values: qmult is 5, dev_addr and host_addr are randomly selected. | 173 | values: qmult is 5, dev_addr and host_addr are randomly selected. |
@@ -148,8 +180,13 @@ Testing the EEM function | |||
148 | 180 | ||
149 | Configure IP addresses of the device and the host. Then: | 181 | Configure IP addresses of the device and the host. Then: |
150 | 182 | ||
151 | On the device: ping <host's IP> | 183 | On the device:: |
152 | On the host: ping <device's IP> | 184 | |
185 | ping <host's IP> | ||
186 | |||
187 | On the host:: | ||
188 | |||
189 | ping <device's IP> | ||
153 | 190 | ||
154 | 5. FFS function | 191 | 5. FFS function |
155 | =============== | 192 | =============== |
@@ -172,6 +209,7 @@ Testing the FFS function | |||
172 | ------------------------ | 209 | ------------------------ |
173 | 210 | ||
174 | On the device: start the function's userspace daemon, enable the gadget | 211 | On the device: start the function's userspace daemon, enable the gadget |
212 | |||
175 | On the host: use the USB function provided by the device | 213 | On the host: use the USB function provided by the device |
176 | 214 | ||
177 | 6. HID function | 215 | 6. HID function |
@@ -185,39 +223,43 @@ Function-specific configfs interface | |||
185 | The function name to use when creating the function directory is "hid". | 223 | The function name to use when creating the function directory is "hid". |
186 | The HID function provides these attributes in its function directory: | 224 | The HID function provides these attributes in its function directory: |
187 | 225 | ||
188 | protocol - HID protocol to use | 226 | =============== =========================================== |
189 | report_desc - data to be used in HID reports, except data | 227 | protocol HID protocol to use |
228 | report_desc data to be used in HID reports, except data | ||
190 | passed with /dev/hidg<X> | 229 | passed with /dev/hidg<X> |
191 | report_length - HID report length | 230 | report_length HID report length |
192 | subclass - HID subclass to use | 231 | subclass HID subclass to use |
232 | =============== =========================================== | ||
193 | 233 | ||
194 | For a keyboard the protocol and the subclass are 1, the report_length is 8, | 234 | For a keyboard the protocol and the subclass are 1, the report_length is 8, |
195 | while the report_desc is: | 235 | while the report_desc is:: |
196 | 236 | ||
197 | $ hd my_report_desc | 237 | $ hd my_report_desc |
198 | 00000000 05 01 09 06 a1 01 05 07 19 e0 29 e7 15 00 25 01 |..........)...%.| | 238 | 00000000 05 01 09 06 a1 01 05 07 19 e0 29 e7 15 00 25 01 |..........)...%.| |
199 | 00000010 75 01 95 08 81 02 95 01 75 08 81 03 95 05 75 01 |u.......u.....u.| | 239 | 00000010 75 01 95 08 81 02 95 01 75 08 81 03 95 05 75 01 |u.......u.....u.| |
200 | 00000020 05 08 19 01 29 05 91 02 95 01 75 03 91 03 95 06 |....).....u.....| | 240 | 00000020 05 08 19 01 29 05 91 02 95 01 75 03 91 03 95 06 |....).....u.....| |
201 | 00000030 75 08 15 00 25 65 05 07 19 00 29 65 81 00 c0 |u...%e....)e...| | 241 | 00000030 75 08 15 00 25 65 05 07 19 00 29 65 81 00 c0 |u...%e....)e...| |
202 | 0000003f | 242 | 0000003f |
203 | 243 | ||
204 | Such a sequence of bytes can be stored to the attribute with echo: | 244 | Such a sequence of bytes can be stored to the attribute with echo:: |
205 | 245 | ||
206 | $ echo -ne \\x05\\x01\\x09\\x06\\xa1..... | 246 | $ echo -ne \\x05\\x01\\x09\\x06\\xa1..... |
207 | 247 | ||
208 | Testing the HID function | 248 | Testing the HID function |
209 | ------------------------ | 249 | ------------------------ |
210 | 250 | ||
211 | Device: | 251 | Device: |
252 | |||
212 | - create the gadget | 253 | - create the gadget |
213 | - connect the gadget to a host, preferably not the one used | 254 | - connect the gadget to a host, preferably not the one used |
214 | to control the gadget | 255 | to control the gadget |
215 | - run a program which writes to /dev/hidg<N>, e.g. | 256 | - run a program which writes to /dev/hidg<N>, e.g. |
216 | a userspace program found in Documentation/usb/gadget_hid.txt: | 257 | a userspace program found in Documentation/usb/gadget_hid.txt:: |
217 | 258 | ||
218 | $ ./hid_gadget_test /dev/hidg0 keyboard | 259 | $ ./hid_gadget_test /dev/hidg0 keyboard |
219 | 260 | ||
220 | Host: | 261 | Host: |
262 | |||
221 | - observe the keystrokes from the gadget | 263 | - observe the keystrokes from the gadget |
222 | 264 | ||
223 | 7. LOOPBACK function | 265 | 7. LOOPBACK function |
@@ -231,13 +273,16 @@ Function-specific configfs interface | |||
231 | The function name to use when creating the function directory is "Loopback". | 273 | The function name to use when creating the function directory is "Loopback". |
232 | The LOOPBACK function provides these attributes in its function directory: | 274 | The LOOPBACK function provides these attributes in its function directory: |
233 | 275 | ||
234 | qlen - depth of loopback queue | 276 | =============== ======================= |
235 | bulk_buflen - buffer length | 277 | qlen depth of loopback queue |
278 | bulk_buflen buffer length | ||
279 | =============== ======================= | ||
236 | 280 | ||
237 | Testing the LOOPBACK function | 281 | Testing the LOOPBACK function |
238 | ----------------------------- | 282 | ----------------------------- |
239 | 283 | ||
240 | device: run the gadget | 284 | device: run the gadget |
285 | |||
241 | host: test-usb (tools/usb/testusb.c) | 286 | host: test-usb (tools/usb/testusb.c) |
242 | 287 | ||
243 | 8. MASS STORAGE function | 288 | 8. MASS STORAGE function |
@@ -252,18 +297,20 @@ The function name to use when creating the function directory is "mass_storage". | |||
252 | The MASS STORAGE function provides these attributes in its directory: | 297 | The MASS STORAGE function provides these attributes in its directory: |
253 | files: | 298 | files: |
254 | 299 | ||
255 | stall - Set to permit function to halt bulk endpoints. | 300 | =============== ============================================== |
301 | stall Set to permit function to halt bulk endpoints. | ||
256 | Disabled on some USB devices known not to work | 302 | Disabled on some USB devices known not to work |
257 | correctly. You should set it to true. | 303 | correctly. You should set it to true. |
258 | num_buffers - Number of pipeline buffers. Valid numbers | 304 | num_buffers Number of pipeline buffers. Valid numbers |
259 | are 2..4. Available only if | 305 | are 2..4. Available only if |
260 | CONFIG_USB_GADGET_DEBUG_FILES is set. | 306 | CONFIG_USB_GADGET_DEBUG_FILES is set. |
307 | =============== ============================================== | ||
261 | 308 | ||
262 | and a default lun.0 directory corresponding to SCSI LUN #0. | 309 | and a default lun.0 directory corresponding to SCSI LUN #0. |
263 | 310 | ||
264 | A new lun can be added with mkdir: | 311 | A new lun can be added with mkdir:: |
265 | 312 | ||
266 | $ mkdir functions/mass_storage.0/partition.5 | 313 | $ mkdir functions/mass_storage.0/partition.5 |
267 | 314 | ||
268 | Lun numbering does not have to be continuous, except for lun #0 which is | 315 | Lun numbering does not have to be continuous, except for lun #0 which is |
269 | created by default. A maximum of 8 luns can be specified and they all must be | 316 | created by default. A maximum of 8 luns can be specified and they all must be |
@@ -273,18 +320,20 @@ although it is not mandatory. | |||
273 | 320 | ||
274 | In each lun directory there are the following attribute files: | 321 | In each lun directory there are the following attribute files: |
275 | 322 | ||
276 | file - The path to the backing file for the LUN. | 323 | =============== ============================================== |
324 | file The path to the backing file for the LUN. | ||
277 | Required if LUN is not marked as removable. | 325 | Required if LUN is not marked as removable. |
278 | ro - Flag specifying access to the LUN shall be | 326 | ro Flag specifying access to the LUN shall be |
279 | read-only. This is implied if CD-ROM emulation | 327 | read-only. This is implied if CD-ROM emulation |
280 | is enabled as well as when it was impossible | 328 | is enabled as well as when it was impossible |
281 | to open "filename" in R/W mode. | 329 | to open "filename" in R/W mode. |
282 | removable - Flag specifying that LUN shall be indicated as | 330 | removable Flag specifying that LUN shall be indicated as |
283 | being removable. | 331 | being removable. |
284 | cdrom - Flag specifying that LUN shall be reported as | 332 | cdrom Flag specifying that LUN shall be reported as |
285 | being a CD-ROM. | 333 | being a CD-ROM. |
286 | nofua - Flag specifying that FUA flag | 334 | nofua Flag specifying that FUA flag |
287 | in SCSI WRITE(10,12) | 335 | in SCSI WRITE(10,12) |
336 | =============== ============================================== | ||
288 | 337 | ||
289 | Testing the MASS STORAGE function | 338 | Testing the MASS STORAGE function |
290 | --------------------------------- | 339 | --------------------------------- |
@@ -304,12 +353,14 @@ Function-specific configfs interface | |||
304 | The function name to use when creating the function directory is "midi". | 353 | The function name to use when creating the function directory is "midi". |
305 | The MIDI function provides these attributes in its function directory: | 354 | The MIDI function provides these attributes in its function directory: |
306 | 355 | ||
307 | buflen - MIDI buffer length | 356 | =============== ==================================== |
308 | id - ID string for the USB MIDI adapter | 357 | buflen MIDI buffer length |
309 | in_ports - number of MIDI input ports | 358 | id ID string for the USB MIDI adapter |
310 | index - index value for the USB MIDI adapter | 359 | in_ports number of MIDI input ports |
311 | out_ports - number of MIDI output ports | 360 | index index value for the USB MIDI adapter |
312 | qlen - USB read request queue length | 361 | out_ports number of MIDI output ports |
362 | qlen USB read request queue length | ||
363 | =============== ==================================== | ||
313 | 364 | ||
314 | Testing the MIDI function | 365 | Testing the MIDI function |
315 | ------------------------- | 366 | ------------------------- |
@@ -317,60 +368,63 @@ Testing the MIDI function | |||
317 | There are two cases: playing a mid from the gadget to | 368 | There are two cases: playing a mid from the gadget to |
318 | the host and playing a mid from the host to the gadget. | 369 | the host and playing a mid from the host to the gadget. |
319 | 370 | ||
320 | 1) Playing a mid from the gadget to the host | 371 | 1) Playing a mid from the gadget to the host: |
321 | host) | 372 | |
373 | host:: | ||
322 | 374 | ||
323 | $ arecordmidi -l | 375 | $ arecordmidi -l |
324 | Port Client name Port name | 376 | Port Client name Port name |
325 | 14:0 Midi Through Midi Through Port-0 | 377 | 14:0 Midi Through Midi Through Port-0 |
326 | 24:0 MIDI Gadget MIDI Gadget MIDI 1 | 378 | 24:0 MIDI Gadget MIDI Gadget MIDI 1 |
327 | $ arecordmidi -p 24:0 from_gadget.mid | 379 | $ arecordmidi -p 24:0 from_gadget.mid |
328 | 380 | ||
329 | gadget) | 381 | gadget:: |
330 | 382 | ||
331 | $ aplaymidi -l | 383 | $ aplaymidi -l |
332 | Port Client name Port name | 384 | Port Client name Port name |
333 | 20:0 f_midi f_midi | 385 | 20:0 f_midi f_midi |
334 | 386 | ||
335 | $ aplaymidi -p 20:0 to_host.mid | 387 | $ aplaymidi -p 20:0 to_host.mid |
336 | 388 | ||
337 | 2) Playing a mid from the host to the gadget | 389 | 2) Playing a mid from the host to the gadget |
338 | gadget) | ||
339 | 390 | ||
340 | $ arecordmidi -l | 391 | gadget:: |
341 | Port Client name Port name | 392 | |
342 | 20:0 f_midi f_midi | 393 | $ arecordmidi -l |
394 | Port Client name Port name | ||
395 | 20:0 f_midi f_midi | ||
343 | 396 | ||
344 | $ arecordmidi -p 20:0 from_host.mid | 397 | $ arecordmidi -p 20:0 from_host.mid |
345 | 398 | ||
346 | host) | 399 | host:: |
347 | 400 | ||
348 | $ aplaymidi -l | 401 | $ aplaymidi -l |
349 | Port Client name Port name | 402 | Port Client name Port name |
350 | 14:0 Midi Through Midi Through Port-0 | 403 | 14:0 Midi Through Midi Through Port-0 |
351 | 24:0 MIDI Gadget MIDI Gadget MIDI 1 | 404 | 24:0 MIDI Gadget MIDI Gadget MIDI 1 |
352 | 405 | ||
353 | $ aplaymidi -p24:0 to_gadget.mid | 406 | $ aplaymidi -p24:0 to_gadget.mid |
354 | 407 | ||
355 | The from_gadget.mid should sound identical to the to_host.mid. | 408 | The from_gadget.mid should sound identical to the to_host.mid. |
409 | |||
356 | The from_host.id should sound identical to the to_gadget.mid. | 410 | The from_host.id should sound identical to the to_gadget.mid. |
357 | 411 | ||
358 | MIDI files can be played to speakers/headphones with e.g. timidity installed | 412 | MIDI files can be played to speakers/headphones with e.g. timidity installed:: |
359 | 413 | ||
360 | $ aplaymidi -l | 414 | $ aplaymidi -l |
361 | Port Client name Port name | 415 | Port Client name Port name |
362 | 14:0 Midi Through Midi Through Port-0 | 416 | 14:0 Midi Through Midi Through Port-0 |
363 | 24:0 MIDI Gadget MIDI Gadget MIDI 1 | 417 | 24:0 MIDI Gadget MIDI Gadget MIDI 1 |
364 | 128:0 TiMidity TiMidity port 0 | 418 | 128:0 TiMidity TiMidity port 0 |
365 | 128:1 TiMidity TiMidity port 1 | 419 | 128:1 TiMidity TiMidity port 1 |
366 | 128:2 TiMidity TiMidity port 2 | 420 | 128:2 TiMidity TiMidity port 2 |
367 | 128:3 TiMidity TiMidity port 3 | 421 | 128:3 TiMidity TiMidity port 3 |
368 | 422 | ||
369 | $ aplaymidi -p 128:0 file.mid | 423 | $ aplaymidi -p 128:0 file.mid |
370 | 424 | ||
371 | MIDI ports can be logically connected using the aconnect utility, e.g.: | 425 | MIDI ports can be logically connected using the aconnect utility, e.g.:: |
372 | 426 | ||
373 | $ aconnect 24:0 128:0 # try it on the host | 427 | $ aconnect 24:0 128:0 # try it on the host |
374 | 428 | ||
375 | After the gadget's MIDI port is connected to timidity's MIDI port, | 429 | After the gadget's MIDI port is connected to timidity's MIDI port, |
376 | whatever is played at the gadget side with aplaymidi -l is audible | 430 | whatever is played at the gadget side with aplaymidi -l is audible |
@@ -387,13 +441,15 @@ Function-specific configfs interface | |||
387 | The function name to use when creating the function directory is "ncm". | 441 | The function name to use when creating the function directory is "ncm". |
388 | The NCM function provides these attributes in its function directory: | 442 | The NCM function provides these attributes in its function directory: |
389 | 443 | ||
390 | ifname - network device interface name associated with this | 444 | =============== ================================================== |
445 | ifname network device interface name associated with this | ||
391 | function instance | 446 | function instance |
392 | qmult - queue length multiplier for high and super speed | 447 | qmult queue length multiplier for high and super speed |
393 | host_addr - MAC address of host's end of this | 448 | host_addr MAC address of host's end of this |
394 | Ethernet over USB link | 449 | Ethernet over USB link |
395 | dev_addr - MAC address of device's end of this | 450 | dev_addr MAC address of device's end of this |
396 | Ethernet over USB link | 451 | Ethernet over USB link |
452 | =============== ================================================== | ||
397 | 453 | ||
398 | and after creating the functions/ncm.<instance name> they contain default | 454 | and after creating the functions/ncm.<instance name> they contain default |
399 | values: qmult is 5, dev_addr and host_addr are randomly selected. | 455 | values: qmult is 5, dev_addr and host_addr are randomly selected. |
@@ -406,8 +462,13 @@ Testing the NCM function | |||
406 | 462 | ||
407 | Configure IP addresses of the device and the host. Then: | 463 | Configure IP addresses of the device and the host. Then: |
408 | 464 | ||
409 | On the device: ping <host's IP> | 465 | On the device:: |
410 | On the host: ping <device's IP> | 466 | |
467 | ping <host's IP> | ||
468 | |||
469 | On the host:: | ||
470 | |||
471 | ping <device's IP> | ||
411 | 472 | ||
412 | 11. OBEX function | 473 | 11. OBEX function |
413 | ================= | 474 | ================= |
@@ -429,13 +490,18 @@ There can be at most 4 ACM/generic serial/OBEX ports in the system. | |||
429 | Testing the OBEX function | 490 | Testing the OBEX function |
430 | ------------------------- | 491 | ------------------------- |
431 | 492 | ||
432 | On device: seriald -f /dev/ttyGS<Y> -s 1024 | 493 | On device:: |
433 | On host: serialc -v <vendorID> -p <productID> -i<interface#> -a1 -s1024 \ | 494 | |
434 | -t<out endpoint addr> -r<in endpoint addr> | 495 | seriald -f /dev/ttyGS<Y> -s 1024 |
496 | |||
497 | On host:: | ||
498 | |||
499 | serialc -v <vendorID> -p <productID> -i<interface#> -a1 -s1024 \ | ||
500 | -t<out endpoint addr> -r<in endpoint addr> | ||
435 | 501 | ||
436 | where seriald and serialc are Felipe's utilities found here: | 502 | where seriald and serialc are Felipe's utilities found here: |
437 | 503 | ||
438 | https://github.com/felipebalbi/usb-tools.git master | 504 | https://github.com/felipebalbi/usb-tools.git master |
439 | 505 | ||
440 | 12. PHONET function | 506 | 12. PHONET function |
441 | =================== | 507 | =================== |
@@ -448,8 +514,10 @@ Function-specific configfs interface | |||
448 | The function name to use when creating the function directory is "phonet". | 514 | The function name to use when creating the function directory is "phonet". |
449 | The PHONET function provides just one attribute in its function directory: | 515 | The PHONET function provides just one attribute in its function directory: |
450 | 516 | ||
451 | ifname - network device interface name associated with this | 517 | =============== ================================================== |
518 | ifname network device interface name associated with this | ||
452 | function instance | 519 | function instance |
520 | =============== ================================================== | ||
453 | 521 | ||
454 | Testing the PHONET function | 522 | Testing the PHONET function |
455 | --------------------------- | 523 | --------------------------- |
@@ -464,41 +532,41 @@ These tools are required: | |||
464 | 532 | ||
465 | git://git.gitorious.org/meego-cellular/phonet-utils.git | 533 | git://git.gitorious.org/meego-cellular/phonet-utils.git |
466 | 534 | ||
467 | On the host: | 535 | On the host:: |
468 | 536 | ||
469 | $ ./phonet -a 0x10 -i usbpn0 | 537 | $ ./phonet -a 0x10 -i usbpn0 |
470 | $ ./pnroute add 0x6c usbpn0 | 538 | $ ./pnroute add 0x6c usbpn0 |
471 | $./pnroute add 0x10 usbpn0 | 539 | $./pnroute add 0x10 usbpn0 |
472 | $ ifconfig usbpn0 up | 540 | $ ifconfig usbpn0 up |
473 | 541 | ||
474 | On the device: | 542 | On the device:: |
475 | 543 | ||
476 | $ ./phonet -a 0x6c -i upnlink0 | 544 | $ ./phonet -a 0x6c -i upnlink0 |
477 | $ ./pnroute add 0x10 upnlink0 | 545 | $ ./pnroute add 0x10 upnlink0 |
478 | $ ifconfig upnlink0 up | 546 | $ ifconfig upnlink0 up |
479 | 547 | ||
480 | Then a test program can be used: | 548 | Then a test program can be used:: |
481 | 549 | ||
482 | http://www.spinics.net/lists/linux-usb/msg85690.html | 550 | http://www.spinics.net/lists/linux-usb/msg85690.html |
483 | 551 | ||
484 | On the device: | 552 | On the device:: |
485 | 553 | ||
486 | $ ./pnxmit -a 0x6c -r | 554 | $ ./pnxmit -a 0x6c -r |
487 | 555 | ||
488 | On the host: | 556 | On the host:: |
489 | 557 | ||
490 | $ ./pnxmit -a 0x10 -s 0x6c | 558 | $ ./pnxmit -a 0x10 -s 0x6c |
491 | 559 | ||
492 | As a result some data should be sent from host to device. | 560 | As a result some data should be sent from host to device. |
493 | Then the other way round: | 561 | Then the other way round: |
494 | 562 | ||
495 | On the host: | 563 | On the host:: |
496 | 564 | ||
497 | $ ./pnxmit -a 0x10 -r | 565 | $ ./pnxmit -a 0x10 -r |
498 | 566 | ||
499 | On the device: | 567 | On the device:: |
500 | 568 | ||
501 | $ ./pnxmit -a 0x6c -s 0x10 | 569 | $ ./pnxmit -a 0x6c -s 0x10 |
502 | 570 | ||
503 | 13. RNDIS function | 571 | 13. RNDIS function |
504 | ================== | 572 | ================== |
@@ -511,13 +579,15 @@ Function-specific configfs interface | |||
511 | The function name to use when creating the function directory is "rndis". | 579 | The function name to use when creating the function directory is "rndis". |
512 | The RNDIS function provides these attributes in its function directory: | 580 | The RNDIS function provides these attributes in its function directory: |
513 | 581 | ||
514 | ifname - network device interface name associated with this | 582 | =============== ================================================== |
583 | ifname network device interface name associated with this | ||
515 | function instance | 584 | function instance |
516 | qmult - queue length multiplier for high and super speed | 585 | qmult queue length multiplier for high and super speed |
517 | host_addr - MAC address of host's end of this | 586 | host_addr MAC address of host's end of this |
518 | Ethernet over USB link | 587 | Ethernet over USB link |
519 | dev_addr - MAC address of device's end of this | 588 | dev_addr MAC address of device's end of this |
520 | Ethernet over USB link | 589 | Ethernet over USB link |
590 | =============== ================================================== | ||
521 | 591 | ||
522 | and after creating the functions/rndis.<instance name> they contain default | 592 | and after creating the functions/rndis.<instance name> they contain default |
523 | values: qmult is 5, dev_addr and host_addr are randomly selected. | 593 | values: qmult is 5, dev_addr and host_addr are randomly selected. |
@@ -530,8 +600,13 @@ Testing the RNDIS function | |||
530 | 600 | ||
531 | Configure IP addresses of the device and the host. Then: | 601 | Configure IP addresses of the device and the host. Then: |
532 | 602 | ||
533 | On the device: ping <host's IP> | 603 | On the device:: |
534 | On the host: ping <device's IP> | 604 | |
605 | ping <host's IP> | ||
606 | |||
607 | On the host:: | ||
608 | |||
609 | ping <device's IP> | ||
535 | 610 | ||
536 | 14. SERIAL function | 611 | 14. SERIAL function |
537 | =================== | 612 | =================== |
@@ -553,15 +628,28 @@ There can be at most 4 ACM/generic serial/OBEX ports in the system. | |||
553 | Testing the SERIAL function | 628 | Testing the SERIAL function |
554 | --------------------------- | 629 | --------------------------- |
555 | 630 | ||
556 | On host: insmod usbserial | 631 | On host:: |
557 | echo VID PID >/sys/bus/usb-serial/drivers/generic/new_id | 632 | |
558 | On host: cat > /dev/ttyUSB<X> | 633 | insmod usbserial |
559 | On target: cat /dev/ttyGS<Y> | 634 | echo VID PID >/sys/bus/usb-serial/drivers/generic/new_id |
635 | |||
636 | On host:: | ||
637 | |||
638 | cat > /dev/ttyUSB<X> | ||
639 | |||
640 | On target:: | ||
641 | |||
642 | cat /dev/ttyGS<Y> | ||
560 | 643 | ||
561 | then the other way round | 644 | then the other way round |
562 | 645 | ||
563 | On target: cat > /dev/ttyGS<Y> | 646 | On target:: |
564 | On host: cat /dev/ttyUSB<X> | 647 | |
648 | cat > /dev/ttyGS<Y> | ||
649 | |||
650 | On host:: | ||
651 | |||
652 | cat /dev/ttyUSB<X> | ||
565 | 653 | ||
566 | 15. SOURCESINK function | 654 | 15. SOURCESINK function |
567 | ======================= | 655 | ======================= |
@@ -574,24 +662,27 @@ Function-specific configfs interface | |||
574 | The function name to use when creating the function directory is "SourceSink". | 662 | The function name to use when creating the function directory is "SourceSink". |
575 | The SOURCESINK function provides these attributes in its function directory: | 663 | The SOURCESINK function provides these attributes in its function directory: |
576 | 664 | ||
577 | pattern - 0 (all zeros), 1 (mod63), 2 (none) | 665 | =============== ================================== |
578 | isoc_interval - 1..16 | 666 | pattern 0 (all zeros), 1 (mod63), 2 (none) |
579 | isoc_maxpacket - 0 - 1023 (fs), 0 - 1024 (hs/ss) | 667 | isoc_interval 1..16 |
580 | isoc_mult - 0..2 (hs/ss only) | 668 | isoc_maxpacket 0 - 1023 (fs), 0 - 1024 (hs/ss) |
581 | isoc_maxburst - 0..15 (ss only) | 669 | isoc_mult 0..2 (hs/ss only) |
582 | bulk_buflen - buffer length | 670 | isoc_maxburst 0..15 (ss only) |
583 | bulk_qlen - depth of queue for bulk | 671 | bulk_buflen buffer length |
584 | iso_qlen - depth of queue for iso | 672 | bulk_qlen depth of queue for bulk |
673 | iso_qlen depth of queue for iso | ||
674 | =============== ================================== | ||
585 | 675 | ||
586 | Testing the SOURCESINK function | 676 | Testing the SOURCESINK function |
587 | ------------------------------- | 677 | ------------------------------- |
588 | 678 | ||
589 | device: run the gadget | 679 | device: run the gadget |
680 | |||
590 | host: test-usb (tools/usb/testusb.c) | 681 | host: test-usb (tools/usb/testusb.c) |
591 | 682 | ||
592 | 683 | ||
593 | 16. UAC1 function (legacy implementation) | 684 | 16. UAC1 function (legacy implementation) |
594 | ================= | 685 | ========================================= |
595 | 686 | ||
596 | The function is provided by usb_f_uac1_legacy.ko module. | 687 | The function is provided by usb_f_uac1_legacy.ko module. |
597 | 688 | ||
@@ -602,12 +693,14 @@ The function name to use when creating the function directory | |||
602 | is "uac1_legacy". | 693 | is "uac1_legacy". |
603 | The uac1 function provides these attributes in its function directory: | 694 | The uac1 function provides these attributes in its function directory: |
604 | 695 | ||
605 | audio_buf_size - audio buffer size | 696 | =============== ==================================== |
606 | fn_cap - capture pcm device file name | 697 | audio_buf_size audio buffer size |
607 | fn_cntl - control device file name | 698 | fn_cap capture pcm device file name |
608 | fn_play - playback pcm device file name | 699 | fn_cntl control device file name |
609 | req_buf_size - ISO OUT endpoint request buffer size | 700 | fn_play playback pcm device file name |
610 | req_count - ISO OUT endpoint request count | 701 | req_buf_size ISO OUT endpoint request buffer size |
702 | req_count ISO OUT endpoint request count | ||
703 | =============== ==================================== | ||
611 | 704 | ||
612 | The attributes have sane default values. | 705 | The attributes have sane default values. |
613 | 706 | ||
@@ -615,7 +708,10 @@ Testing the UAC1 function | |||
615 | ------------------------- | 708 | ------------------------- |
616 | 709 | ||
617 | device: run the gadget | 710 | device: run the gadget |
618 | host: aplay -l # should list our USB Audio Gadget | 711 | |
712 | host:: | ||
713 | |||
714 | aplay -l # should list our USB Audio Gadget | ||
619 | 715 | ||
620 | 17. UAC2 function | 716 | 17. UAC2 function |
621 | ================= | 717 | ================= |
@@ -628,14 +724,16 @@ Function-specific configfs interface | |||
628 | The function name to use when creating the function directory is "uac2". | 724 | The function name to use when creating the function directory is "uac2". |
629 | The uac2 function provides these attributes in its function directory: | 725 | The uac2 function provides these attributes in its function directory: |
630 | 726 | ||
631 | c_chmask - capture channel mask | 727 | =============== ==================================================== |
632 | c_srate - capture sampling rate | 728 | c_chmask capture channel mask |
633 | c_ssize - capture sample size (bytes) | 729 | c_srate capture sampling rate |
634 | p_chmask - playback channel mask | 730 | c_ssize capture sample size (bytes) |
635 | p_srate - playback sampling rate | 731 | p_chmask playback channel mask |
636 | p_ssize - playback sample size (bytes) | 732 | p_srate playback sampling rate |
637 | req_number - the number of pre-allocated request for both capture | 733 | p_ssize playback sample size (bytes) |
638 | and playback | 734 | req_number the number of pre-allocated request for both capture |
735 | and playback | ||
736 | =============== ==================================================== | ||
639 | 737 | ||
640 | The attributes have sane default values. | 738 | The attributes have sane default values. |
641 | 739 | ||
@@ -648,14 +746,14 @@ host: aplay -l # should list our USB Audio Gadget | |||
648 | This function does not require real hardware support, it just | 746 | This function does not require real hardware support, it just |
649 | sends a stream of audio data to/from the host. In order to | 747 | sends a stream of audio data to/from the host. In order to |
650 | actually hear something at the device side, a command similar | 748 | actually hear something at the device side, a command similar |
651 | to this must be used at the device side: | 749 | to this must be used at the device side:: |
652 | 750 | ||
653 | $ arecord -f dat -t wav -D hw:2,0 | aplay -D hw:0,0 & | 751 | $ arecord -f dat -t wav -D hw:2,0 | aplay -D hw:0,0 & |
654 | 752 | ||
655 | e.g.: | 753 | e.g.:: |
656 | 754 | ||
657 | $ arecord -f dat -t wav -D hw:CARD=UAC2Gadget,DEV=0 | \ | 755 | $ arecord -f dat -t wav -D hw:CARD=UAC2Gadget,DEV=0 | \ |
658 | aplay -D default:CARD=OdroidU3 | 756 | aplay -D default:CARD=OdroidU3 |
659 | 757 | ||
660 | 18. UVC function | 758 | 18. UVC function |
661 | ================ | 759 | ================ |
@@ -668,66 +766,73 @@ Function-specific configfs interface | |||
668 | The function name to use when creating the function directory is "uvc". | 766 | The function name to use when creating the function directory is "uvc". |
669 | The uvc function provides these attributes in its function directory: | 767 | The uvc function provides these attributes in its function directory: |
670 | 768 | ||
671 | streaming_interval - interval for polling endpoint for data transfers | 769 | =================== ================================================ |
672 | streaming_maxburst - bMaxBurst for super speed companion descriptor | 770 | streaming_interval interval for polling endpoint for data transfers |
673 | streaming_maxpacket - maximum packet size this endpoint is capable of | 771 | streaming_maxburst bMaxBurst for super speed companion descriptor |
674 | sending or receiving when this configuration is | 772 | streaming_maxpacket maximum packet size this endpoint is capable of |
675 | selected | 773 | sending or receiving when this configuration is |
774 | selected | ||
775 | =================== ================================================ | ||
676 | 776 | ||
677 | There are also "control" and "streaming" subdirectories, each of which contain | 777 | There are also "control" and "streaming" subdirectories, each of which contain |
678 | a number of their subdirectories. There are some sane defaults provided, but | 778 | a number of their subdirectories. There are some sane defaults provided, but |
679 | the user must provide the following: | 779 | the user must provide the following: |
680 | 780 | ||
681 | control header - create in control/header, link from control/class/fs | 781 | ================== ==================================================== |
682 | and/or control/class/ss | 782 | control header create in control/header, link from control/class/fs |
683 | streaming header - create in streaming/header, link from | 783 | and/or control/class/ss |
684 | streaming/class/fs and/or streaming/class/hs and/or | 784 | streaming header create in streaming/header, link from |
685 | streaming/class/ss | 785 | streaming/class/fs and/or streaming/class/hs and/or |
686 | format description - create in streaming/mjpeg and/or | 786 | streaming/class/ss |
687 | streaming/uncompressed | 787 | format description create in streaming/mjpeg and/or |
688 | frame description - create in streaming/mjpeg/<format> and/or in | 788 | streaming/uncompressed |
689 | streaming/uncompressed/<format> | 789 | frame description create in streaming/mjpeg/<format> and/or in |
790 | streaming/uncompressed/<format> | ||
791 | ================== ==================================================== | ||
690 | 792 | ||
691 | Each frame description contains frame interval specification, and each | 793 | Each frame description contains frame interval specification, and each |
692 | such specification consists of a number of lines with an inverval value | 794 | such specification consists of a number of lines with an inverval value |
693 | in each line. The rules stated above are best illustrated with an example: | 795 | in each line. The rules stated above are best illustrated with an example:: |
694 | 796 | ||
695 | # mkdir functions/uvc.usb0/control/header/h | 797 | # mkdir functions/uvc.usb0/control/header/h |
696 | # cd functions/uvc.usb0/control/ | 798 | # cd functions/uvc.usb0/control/ |
697 | # ln -s header/h class/fs | 799 | # ln -s header/h class/fs |
698 | # ln -s header/h class/ss | 800 | # ln -s header/h class/ss |
699 | # mkdir -p functions/uvc.usb0/streaming/uncompressed/u/360p | 801 | # mkdir -p functions/uvc.usb0/streaming/uncompressed/u/360p |
700 | # cat <<EOF > functions/uvc.usb0/streaming/uncompressed/u/360p/dwFrameInterval | 802 | # cat <<EOF > functions/uvc.usb0/streaming/uncompressed/u/360p/dwFrameInterval |
701 | 666666 | 803 | 666666 |
702 | 1000000 | 804 | 1000000 |
703 | 5000000 | 805 | 5000000 |
704 | EOF | 806 | EOF |
705 | # cd $GADGET_CONFIGFS_ROOT | 807 | # cd $GADGET_CONFIGFS_ROOT |
706 | # mkdir functions/uvc.usb0/streaming/header/h | 808 | # mkdir functions/uvc.usb0/streaming/header/h |
707 | # cd functions/uvc.usb0/streaming/header/h | 809 | # cd functions/uvc.usb0/streaming/header/h |
708 | # ln -s ../../uncompressed/u | 810 | # ln -s ../../uncompressed/u |
709 | # cd ../../class/fs | 811 | # cd ../../class/fs |
710 | # ln -s ../../header/h | 812 | # ln -s ../../header/h |
711 | # cd ../../class/hs | 813 | # cd ../../class/hs |
712 | # ln -s ../../header/h | 814 | # ln -s ../../header/h |
713 | # cd ../../class/ss | 815 | # cd ../../class/ss |
714 | # ln -s ../../header/h | 816 | # ln -s ../../header/h |
715 | 817 | ||
716 | 818 | ||
717 | Testing the UVC function | 819 | Testing the UVC function |
718 | ------------------------ | 820 | ------------------------ |
719 | 821 | ||
720 | device: run the gadget, modprobe vivid | 822 | device: run the gadget, modprobe vivid:: |
721 | 823 | ||
722 | # uvc-gadget -u /dev/video<uvc video node #> -v /dev/video<vivid video node #> | 824 | # uvc-gadget -u /dev/video<uvc video node #> -v /dev/video<vivid video node #> |
723 | 825 | ||
724 | where uvc-gadget is this program: | 826 | where uvc-gadget is this program: |
725 | http://git.ideasonboard.org/uvc-gadget.git | 827 | http://git.ideasonboard.org/uvc-gadget.git |
726 | 828 | ||
727 | with these patches: | 829 | with these patches: |
728 | http://www.spinics.net/lists/linux-usb/msg99220.html | ||
729 | 830 | ||
730 | host: luvcview -f yuv | 831 | http://www.spinics.net/lists/linux-usb/msg99220.html |
832 | |||
833 | host:: | ||
834 | |||
835 | luvcview -f yuv | ||
731 | 836 | ||
732 | 19. PRINTER function | 837 | 19. PRINTER function |
733 | ==================== | 838 | ==================== |
@@ -740,16 +845,19 @@ Function-specific configfs interface | |||
740 | The function name to use when creating the function directory is "printer". | 845 | The function name to use when creating the function directory is "printer". |
741 | The printer function provides these attributes in its function directory: | 846 | The printer function provides these attributes in its function directory: |
742 | 847 | ||
743 | pnp_string - Data to be passed to the host in pnp string | 848 | ========== =========================================== |
744 | q_len - Number of requests per endpoint | 849 | pnp_string Data to be passed to the host in pnp string |
850 | q_len Number of requests per endpoint | ||
851 | ========== =========================================== | ||
745 | 852 | ||
746 | Testing the PRINTER function | 853 | Testing the PRINTER function |
747 | ---------------------------- | 854 | ---------------------------- |
748 | 855 | ||
749 | The most basic testing: | 856 | The most basic testing: |
750 | 857 | ||
751 | device: run the gadget | 858 | device: run the gadget:: |
752 | # ls -l /devices/virtual/usb_printer_gadget/ | 859 | |
860 | # ls -l /devices/virtual/usb_printer_gadget/ | ||
753 | 861 | ||
754 | should show g_printer<number>. | 862 | should show g_printer<number>. |
755 | 863 | ||
@@ -761,23 +869,28 @@ If udev is active, then e.g. /dev/usb/lp0 should appear. | |||
761 | 869 | ||
762 | host->device transmission: | 870 | host->device transmission: |
763 | 871 | ||
764 | device: | 872 | device:: |
765 | # cat /dev/g_printer<number> | ||
766 | host: | ||
767 | # cat > /dev/usb/lp0 | ||
768 | 873 | ||
769 | device->host transmission: | 874 | # cat /dev/g_printer<number> |
770 | 875 | ||
771 | # cat > /dev/g_printer<number> | 876 | host:: |
772 | host: | 877 | |
773 | # cat /dev/usb/lp0 | 878 | # cat > /dev/usb/lp0 |
879 | |||
880 | device->host transmission:: | ||
881 | |||
882 | # cat > /dev/g_printer<number> | ||
883 | |||
884 | host:: | ||
885 | |||
886 | # cat /dev/usb/lp0 | ||
774 | 887 | ||
775 | More advanced testing can be done with the prn_example | 888 | More advanced testing can be done with the prn_example |
776 | described in Documentation/usb/gadget_printer.txt. | 889 | described in Documentation/usb/gadget_printer.txt. |
777 | 890 | ||
778 | 891 | ||
779 | 20. UAC1 function (virtual ALSA card, using u_audio API) | 892 | 20. UAC1 function (virtual ALSA card, using u_audio API) |
780 | ================= | 893 | ======================================================== |
781 | 894 | ||
782 | The function is provided by usb_f_uac1.ko module. | 895 | The function is provided by usb_f_uac1.ko module. |
783 | It will create a virtual ALSA card and the audio streams are simply | 896 | It will create a virtual ALSA card and the audio streams are simply |
@@ -789,14 +902,16 @@ Function-specific configfs interface | |||
789 | The function name to use when creating the function directory is "uac1". | 902 | The function name to use when creating the function directory is "uac1". |
790 | The uac1 function provides these attributes in its function directory: | 903 | The uac1 function provides these attributes in its function directory: |
791 | 904 | ||
792 | c_chmask - capture channel mask | 905 | ========== ==================================================== |
793 | c_srate - capture sampling rate | 906 | c_chmask capture channel mask |
794 | c_ssize - capture sample size (bytes) | 907 | c_srate capture sampling rate |
795 | p_chmask - playback channel mask | 908 | c_ssize capture sample size (bytes) |
796 | p_srate - playback sampling rate | 909 | p_chmask playback channel mask |
797 | p_ssize - playback sample size (bytes) | 910 | p_srate playback sampling rate |
798 | req_number - the number of pre-allocated request for both capture | 911 | p_ssize playback sample size (bytes) |
799 | and playback | 912 | req_number the number of pre-allocated request for both capture |
913 | and playback | ||
914 | ========== ==================================================== | ||
800 | 915 | ||
801 | The attributes have sane default values. | 916 | The attributes have sane default values. |
802 | 917 | ||
@@ -809,11 +924,11 @@ host: aplay -l # should list our USB Audio Gadget | |||
809 | This function does not require real hardware support, it just | 924 | This function does not require real hardware support, it just |
810 | sends a stream of audio data to/from the host. In order to | 925 | sends a stream of audio data to/from the host. In order to |
811 | actually hear something at the device side, a command similar | 926 | actually hear something at the device side, a command similar |
812 | to this must be used at the device side: | 927 | to this must be used at the device side:: |
813 | 928 | ||
814 | $ arecord -f dat -t wav -D hw:2,0 | aplay -D hw:0,0 & | 929 | $ arecord -f dat -t wav -D hw:2,0 | aplay -D hw:0,0 & |
815 | 930 | ||
816 | e.g.: | 931 | e.g.:: |
817 | 932 | ||
818 | $ arecord -f dat -t wav -D hw:CARD=UAC1Gadget,DEV=0 | \ | 933 | $ arecord -f dat -t wav -D hw:CARD=UAC1Gadget,DEV=0 | \ |
819 | aplay -D default:CARD=OdroidU3 | 934 | aplay -D default:CARD=OdroidU3 |