]>
Commit | Line | Data |
---|---|---|
e38eb2c8 AP |
1 | This file summarizes information on basic testing of USB functions |
2 | provided by gadgets. | |
3 | ||
4 | 1. ACM function | |
d5862ca6 | 5 | 2. ECM function |
7bfbc6e3 | 6 | 3. ECM subset function |
4ca560a6 | 7 | 4. EEM function |
2c0f62f9 | 8 | 5. FFS function |
f7e3c3cd | 9 | 6. HID function |
ec91aff7 | 10 | 7. LOOPBACK function |
cdbe287d | 11 | 8. MASS STORAGE function |
0d6be59a | 12 | 9. MIDI function |
4d0fa79e | 13 | 10. NCM function |
d81b85dc | 14 | 11. OBEX function |
da2907d2 | 15 | 12. PHONET function |
ddb72244 | 16 | 13. RNDIS function |
4dfcec8a | 17 | 14. SERIAL function |
480a912b | 18 | 15. SOURCESINK function |
dae03586 | 19 | 16. UAC1 function |
020c6f93 | 20 | 17. UAC2 function |
e38eb2c8 AP |
21 | |
22 | ||
23 | 1. ACM function | |
24 | =============== | |
25 | ||
26 | The function is provided by usb_f_acm.ko module. | |
27 | ||
28 | Function-specific configfs interface | |
29 | ------------------------------------ | |
30 | ||
31 | The function name to use when creating the function directory is "acm". | |
32 | The ACM function provides just one attribute in its function directory: | |
33 | ||
34 | port_num | |
35 | ||
36 | The attribute is read-only. | |
37 | ||
38 | There can be at most 4 ACM/generic serial/OBEX ports in the system. | |
39 | ||
40 | ||
41 | Testing the ACM function | |
42 | ------------------------ | |
43 | ||
44 | On the host: cat > /dev/ttyACM<X> | |
45 | On the device : cat /dev/ttyGS<Y> | |
46 | ||
47 | then the other way round | |
48 | ||
49 | On the device: cat > /dev/ttyGS<Y> | |
50 | On the host: cat /dev/ttyACM<X> | |
d5862ca6 AP |
51 | |
52 | 2. ECM function | |
53 | =============== | |
54 | ||
55 | The function is provided by usb_f_ecm.ko module. | |
56 | ||
57 | Function-specific configfs interface | |
58 | ------------------------------------ | |
59 | ||
60 | The function name to use when creating the function directory is "ecm". | |
61 | The ECM function provides these attributes in its function directory: | |
62 | ||
63 | ifname - network device interface name associated with this | |
64 | function instance | |
65 | qmult - queue length multiplier for high and super speed | |
66 | host_addr - MAC address of host's end of this | |
67 | Ethernet over USB link | |
68 | dev_addr - MAC address of device's end of this | |
69 | Ethernet over USB link | |
70 | ||
71 | and after creating the functions/ecm.<instance name> they contain default | |
72 | values: qmult is 5, dev_addr and host_addr are randomly selected. | |
73 | Except for ifname they can be written to until the function is linked to a | |
74 | configuration. The ifname is read-only and contains the name of the interface | |
75 | which was assigned by the net core, e. g. usb0. | |
76 | ||
77 | Testing the ECM function | |
78 | ------------------------ | |
79 | ||
80 | Configure IP addresses of the device and the host. Then: | |
81 | ||
82 | On the device: ping <host's IP> | |
83 | On the host: ping <device's IP> | |
7bfbc6e3 AP |
84 | |
85 | 3. ECM subset function | |
86 | ====================== | |
87 | ||
88 | The function is provided by usb_f_ecm_subset.ko module. | |
89 | ||
90 | Function-specific configfs interface | |
91 | ------------------------------------ | |
92 | ||
93 | The function name to use when creating the function directory is "geth". | |
94 | The ECM subset function provides these attributes in its function directory: | |
95 | ||
96 | ifname - network device interface name associated with this | |
97 | function instance | |
98 | qmult - queue length multiplier for high and super speed | |
99 | host_addr - MAC address of host's end of this | |
100 | Ethernet over USB link | |
101 | dev_addr - MAC address of device's end of this | |
102 | Ethernet over USB link | |
103 | ||
104 | and after creating the functions/ecm.<instance name> they contain default | |
105 | values: qmult is 5, dev_addr and host_addr are randomly selected. | |
106 | Except for ifname they can be written to until the function is linked to a | |
107 | configuration. The ifname is read-only and contains the name of the interface | |
108 | which was assigned by the net core, e. g. usb0. | |
109 | ||
110 | Testing the ECM subset function | |
111 | ------------------------------- | |
112 | ||
113 | Configure IP addresses of the device and the host. Then: | |
114 | ||
115 | On the device: ping <host's IP> | |
116 | On the host: ping <device's IP> | |
4ca560a6 AP |
117 | |
118 | 4. EEM function | |
119 | =============== | |
120 | ||
121 | The function is provided by usb_f_eem.ko module. | |
122 | ||
123 | Function-specific configfs interface | |
124 | ------------------------------------ | |
125 | ||
126 | The function name to use when creating the function directory is "eem". | |
127 | The EEM function provides these attributes in its function directory: | |
128 | ||
129 | ifname - network device interface name associated with this | |
130 | function instance | |
131 | qmult - queue length multiplier for high and super speed | |
132 | host_addr - MAC address of host's end of this | |
133 | Ethernet over USB link | |
134 | dev_addr - MAC address of device's end of this | |
135 | Ethernet over USB link | |
136 | ||
137 | and after creating the functions/eem.<instance name> they contain default | |
138 | values: qmult is 5, dev_addr and host_addr are randomly selected. | |
139 | Except for ifname they can be written to until the function is linked to a | |
140 | configuration. The ifname is read-only and contains the name of the interface | |
141 | which was assigned by the net core, e. g. usb0. | |
142 | ||
143 | Testing the EEM function | |
144 | ------------------------ | |
145 | ||
146 | Configure IP addresses of the device and the host. Then: | |
147 | ||
148 | On the device: ping <host's IP> | |
149 | On the host: ping <device's IP> | |
2c0f62f9 AP |
150 | |
151 | 5. FFS function | |
152 | =============== | |
153 | ||
154 | The function is provided by usb_f_fs.ko module. | |
155 | ||
156 | Function-specific configfs interface | |
157 | ------------------------------------ | |
158 | ||
159 | The function name to use when creating the function directory is "ffs". | |
160 | The function directory is intentionally empty and not modifiable. | |
161 | ||
162 | After creating the directory there is a new instance (a "device") of FunctionFS | |
163 | available in the system. Once a "device" is available, the user should follow | |
164 | the standard procedure for using FunctionFS (mount it, run the userspace | |
165 | process which implements the function proper). The gadget should be enabled | |
166 | by writing a suitable string to usb_gadget/<gadget>/UDC. | |
167 | ||
168 | Testing the FFS function | |
169 | ------------------------ | |
170 | ||
171 | On the device: start the function's userspace daemon, enable the gadget | |
172 | On the host: use the USB function provided by the device | |
f7e3c3cd AP |
173 | |
174 | 6. HID function | |
175 | =============== | |
176 | ||
177 | The function is provided by usb_f_hid.ko module. | |
178 | ||
179 | Function-specific configfs interface | |
180 | ------------------------------------ | |
181 | ||
182 | The function name to use when creating the function directory is "hid". | |
183 | The HID function provides these attributes in its function directory: | |
184 | ||
185 | protocol - HID protocol to use | |
186 | report_desc - data to be used in HID reports, except data | |
187 | passed with /dev/hidg<X> | |
188 | report_length - HID report length | |
189 | subclass - HID subclass to use | |
190 | ||
191 | For a keyboard the protocol and the subclass are 1, the report_length is 8, | |
192 | while the report_desc is: | |
193 | ||
194 | $ hd my_report_desc | |
195 | 00000000 05 01 09 06 a1 01 05 07 19 e0 29 e7 15 00 25 01 |..........)...%.| | |
196 | 00000010 75 01 95 08 81 02 95 01 75 08 81 03 95 05 75 01 |u.......u.....u.| | |
197 | 00000020 05 08 19 01 29 05 91 02 95 01 75 03 91 03 95 06 |....).....u.....| | |
198 | 00000030 75 08 15 00 25 65 05 07 19 00 29 65 81 00 c0 |u...%e....)e...| | |
199 | 0000003f | |
200 | ||
201 | Such a sequence of bytes can be stored to the attribute with echo: | |
202 | ||
203 | $ echo -ne \\x05\\x01\\x09\\x06\\xa1..... | |
204 | ||
205 | Testing the HID function | |
206 | ------------------------ | |
207 | ||
208 | Device: | |
209 | - create the gadget | |
210 | - connect the gadget to a host, preferably not the one used | |
211 | to control the gadget | |
212 | - run a program which writes to /dev/hidg<N>, e.g. | |
213 | a userspace program found in Documentation/usb/gadget_hid.txt: | |
214 | ||
215 | $ ./hid_gadget_test /dev/hidg0 keyboard | |
216 | ||
217 | Host: | |
218 | - observe the keystrokes from the gadget | |
ec91aff7 AP |
219 | |
220 | 7. LOOPBACK function | |
221 | ==================== | |
222 | ||
223 | The function is provided by usb_f_ss_lb.ko module. | |
224 | ||
225 | Function-specific configfs interface | |
226 | ------------------------------------ | |
227 | ||
228 | The function name to use when creating the function directory is "Loopback". | |
229 | The LOOPBACK function provides these attributes in its function directory: | |
230 | ||
231 | qlen - depth of loopback queue | |
232 | bulk_buflen - buffer length | |
233 | ||
234 | Testing the LOOPBACK function | |
235 | ----------------------------- | |
236 | ||
237 | device: run the gadget | |
238 | host: test-usb | |
239 | ||
240 | http://www.linux-usb.org/usbtest/testusb.c | |
cdbe287d AP |
241 | |
242 | 8. MASS STORAGE function | |
243 | ======================== | |
244 | ||
245 | The function is provided by usb_f_mass_storage.ko module. | |
246 | ||
247 | Function-specific configfs interface | |
248 | ------------------------------------ | |
249 | ||
250 | The function name to use when creating the function directory is "mass_storage". | |
251 | The MASS STORAGE function provides these attributes in its directory: | |
252 | files: | |
253 | ||
254 | stall - Set to permit function to halt bulk endpoints. | |
255 | Disabled on some USB devices known not to work | |
256 | correctly. You should set it to true. | |
257 | num_buffers - Number of pipeline buffers. Valid numbers | |
258 | are 2..4. Available only if | |
259 | CONFIG_USB_GADGET_DEBUG_FILES is set. | |
260 | ||
261 | and a default lun.0 directory corresponding to SCSI LUN #0. | |
262 | ||
263 | A new lun can be added with mkdir: | |
264 | ||
265 | $ mkdir functions/mass_storage.0/partition.5 | |
266 | ||
267 | Lun numbering does not have to be continuous, except for lun #0 which is | |
268 | created by default. A maximum of 8 luns can be specified and they all must be | |
269 | named following the <name>.<number> scheme. The numbers can be 0..8. | |
270 | Probably a good convention is to name the luns "lun.<number>", | |
271 | although it is not mandatory. | |
272 | ||
273 | In each lun directory there are the following attribute files: | |
274 | ||
275 | file - The path to the backing file for the LUN. | |
276 | Required if LUN is not marked as removable. | |
277 | ro - Flag specifying access to the LUN shall be | |
278 | read-only. This is implied if CD-ROM emulation | |
279 | is enabled as well as when it was impossible | |
280 | to open "filename" in R/W mode. | |
281 | removable - Flag specifying that LUN shall be indicated as | |
282 | being removable. | |
283 | cdrom - Flag specifying that LUN shall be reported as | |
284 | being a CD-ROM. | |
285 | nofua - Flag specifying that FUA flag | |
286 | in SCSI WRITE(10,12) | |
287 | ||
288 | Testing the MASS STORAGE function | |
289 | --------------------------------- | |
290 | ||
291 | device: connect the gadget, enable it | |
292 | host: dmesg, see the USB drives appear (if system configured to automatically | |
293 | mount) | |
0d6be59a AP |
294 | |
295 | 9. MIDI function | |
296 | ================ | |
297 | ||
298 | The function is provided by usb_f_midi.ko module. | |
299 | ||
300 | Function-specific configfs interface | |
301 | ------------------------------------ | |
302 | ||
303 | The function name to use when creating the function directory is "midi". | |
304 | The MIDI function provides these attributes in its function directory: | |
305 | ||
306 | buflen - MIDI buffer length | |
307 | id - ID string for the USB MIDI adapter | |
308 | in_ports - number of MIDI input ports | |
309 | index - index value for the USB MIDI adapter | |
310 | out_ports - number of MIDI output ports | |
311 | qlen - USB read request queue length | |
312 | ||
313 | Testing the MIDI function | |
314 | ------------------------- | |
315 | ||
316 | There are two cases: playing a mid from the gadget to | |
317 | the host and playing a mid from the host to the gadget. | |
318 | ||
319 | 1) Playing a mid from the gadget to the host | |
320 | host) | |
321 | ||
322 | $ arecordmidi -l | |
323 | Port Client name Port name | |
324 | 14:0 Midi Through Midi Through Port-0 | |
325 | 24:0 MIDI Gadget MIDI Gadget MIDI 1 | |
326 | $ arecordmidi -p 24:0 from_gadget.mid | |
327 | ||
328 | gadget) | |
329 | ||
330 | $ aplaymidi -l | |
331 | Port Client name Port name | |
332 | 20:0 f_midi f_midi | |
333 | ||
334 | $ aplaymidi -p 20:0 to_host.mid | |
335 | ||
336 | 2) Playing a mid from the host to the gadget | |
337 | gadget) | |
338 | ||
339 | $ arecordmidi -l | |
340 | Port Client name Port name | |
341 | 20:0 f_midi f_midi | |
342 | ||
343 | $ arecordmidi -p 20:0 from_host.mid | |
344 | ||
345 | host) | |
346 | ||
347 | $ aplaymidi -l | |
348 | Port Client name Port name | |
349 | 14:0 Midi Through Midi Through Port-0 | |
350 | 24:0 MIDI Gadget MIDI Gadget MIDI 1 | |
351 | ||
352 | $ aplaymidi -p24:0 to_gadget.mid | |
353 | ||
354 | The from_gadget.mid should sound identical to the to_host.mid. | |
355 | The from_host.id should sound identical to the to_gadget.mid. | |
356 | ||
357 | MIDI files can be played to speakers/headphones with e.g. timidity installed | |
358 | ||
359 | $ aplaymidi -l | |
360 | Port Client name Port name | |
361 | 14:0 Midi Through Midi Through Port-0 | |
362 | 24:0 MIDI Gadget MIDI Gadget MIDI 1 | |
363 | 128:0 TiMidity TiMidity port 0 | |
364 | 128:1 TiMidity TiMidity port 1 | |
365 | 128:2 TiMidity TiMidity port 2 | |
366 | 128:3 TiMidity TiMidity port 3 | |
367 | ||
368 | $ aplaymidi -p 128:0 file.mid | |
369 | ||
370 | MIDI ports can be logically connected using the aconnect utility, e.g.: | |
371 | ||
372 | $ aconnect 24:0 128:0 # try it on the host | |
373 | ||
374 | After the gadget's MIDI port is connected to timidity's MIDI port, | |
375 | whatever is played at the gadget side with aplaymidi -l is audible | |
376 | in host's speakers/headphones. | |
4d0fa79e AP |
377 | |
378 | 10. NCM function | |
379 | ================ | |
380 | ||
381 | The function is provided by usb_f_ncm.ko module. | |
382 | ||
383 | Function-specific configfs interface | |
384 | ------------------------------------ | |
385 | ||
386 | The function name to use when creating the function directory is "ncm". | |
387 | The NCM function provides these attributes in its function directory: | |
388 | ||
389 | ifname - network device interface name associated with this | |
390 | function instance | |
391 | qmult - queue length multiplier for high and super speed | |
392 | host_addr - MAC address of host's end of this | |
393 | Ethernet over USB link | |
394 | dev_addr - MAC address of device's end of this | |
395 | Ethernet over USB link | |
396 | ||
397 | and after creating the functions/ncm.<instance name> they contain default | |
398 | values: qmult is 5, dev_addr and host_addr are randomly selected. | |
399 | Except for ifname they can be written to until the function is linked to a | |
400 | configuration. The ifname is read-only and contains the name of the interface | |
401 | which was assigned by the net core, e. g. usb0. | |
402 | ||
403 | Testing the NCM function | |
404 | ------------------------ | |
405 | ||
406 | Configure IP addresses of the device and the host. Then: | |
407 | ||
408 | On the device: ping <host's IP> | |
409 | On the host: ping <device's IP> | |
d81b85dc AP |
410 | |
411 | 11. OBEX function | |
412 | ================= | |
413 | ||
414 | The function is provided by usb_f_obex.ko module. | |
415 | ||
416 | Function-specific configfs interface | |
417 | ------------------------------------ | |
418 | ||
419 | The function name to use when creating the function directory is "obex". | |
420 | The OBEX function provides just one attribute in its function directory: | |
421 | ||
422 | port_num | |
423 | ||
424 | The attribute is read-only. | |
425 | ||
426 | There can be at most 4 ACM/generic serial/OBEX ports in the system. | |
427 | ||
428 | Testing the OBEX function | |
429 | ------------------------- | |
430 | ||
431 | On device: seriald -f /dev/ttyGS<Y> -s 1024 | |
432 | On host: serialc -v <vendorID> -p <productID> -i<interface#> -a1 -s1024 \ | |
433 | -t<out endpoint addr> -r<in endpoint addr> | |
434 | ||
435 | where seriald and serialc are Felipe's utilities found here: | |
436 | ||
437 | https://git.gitorious.org/usb/usb-tools.git master | |
da2907d2 AP |
438 | |
439 | 12. PHONET function | |
440 | =================== | |
441 | ||
442 | The function is provided by usb_f_phonet.ko module. | |
443 | ||
444 | Function-specific configfs interface | |
445 | ------------------------------------ | |
446 | ||
447 | The function name to use when creating the function directory is "phonet". | |
448 | The PHONET function provides just one attribute in its function directory: | |
449 | ||
450 | ifname - network device interface name associated with this | |
451 | function instance | |
452 | ||
453 | Testing the PHONET function | |
454 | --------------------------- | |
455 | ||
456 | It is not possible to test the SOCK_STREAM protocol without a specific piece | |
457 | of hardware, so only SOCK_DGRAM has been tested. For the latter to work, | |
458 | in the past I had to apply the patch mentioned here: | |
459 | ||
460 | http://www.spinics.net/lists/linux-usb/msg85689.html | |
461 | ||
462 | These tools are required: | |
463 | ||
464 | git://git.gitorious.org/meego-cellular/phonet-utils.git | |
465 | ||
466 | On the host: | |
467 | ||
468 | $ ./phonet -a 0x10 -i usbpn0 | |
469 | $ ./pnroute add 0x6c usbpn0 | |
470 | $./pnroute add 0x10 usbpn0 | |
471 | $ ifconfig usbpn0 up | |
472 | ||
473 | On the device: | |
474 | ||
475 | $ ./phonet -a 0x6c -i upnlink0 | |
476 | $ ./pnroute add 0x10 upnlink0 | |
477 | $ ifconfig upnlink0 up | |
478 | ||
479 | Then a test program can be used: | |
480 | ||
481 | http://www.spinics.net/lists/linux-usb/msg85690.html | |
482 | ||
483 | On the device: | |
484 | ||
485 | $ ./pnxmit -a 0x6c -r | |
486 | ||
487 | On the host: | |
488 | ||
489 | $ ./pnxmit -a 0x10 -s 0x6c | |
490 | ||
491 | As a result some data should be sent from host to device. | |
492 | Then the other way round: | |
493 | ||
494 | On the host: | |
495 | ||
496 | $ ./pnxmit -a 0x10 -r | |
497 | ||
498 | On the device: | |
499 | ||
500 | $ ./pnxmit -a 0x6c -s 0x10 | |
ddb72244 AP |
501 | |
502 | 13. RNDIS function | |
503 | ================== | |
504 | ||
505 | The function is provided by usb_f_rndis.ko module. | |
506 | ||
507 | Function-specific configfs interface | |
508 | ------------------------------------ | |
509 | ||
510 | The function name to use when creating the function directory is "rndis". | |
511 | The RNDIS function provides these attributes in its function directory: | |
512 | ||
513 | ifname - network device interface name associated with this | |
514 | function instance | |
515 | qmult - queue length multiplier for high and super speed | |
516 | host_addr - MAC address of host's end of this | |
517 | Ethernet over USB link | |
518 | dev_addr - MAC address of device's end of this | |
519 | Ethernet over USB link | |
520 | ||
521 | and after creating the functions/rndis.<instance name> they contain default | |
522 | values: qmult is 5, dev_addr and host_addr are randomly selected. | |
523 | Except for ifname they can be written to until the function is linked to a | |
524 | configuration. The ifname is read-only and contains the name of the interface | |
525 | which was assigned by the net core, e. g. usb0. | |
526 | ||
527 | By default there can be only 1 RNDIS interface in the system. | |
528 | ||
529 | Testing the RNDIS function | |
530 | -------------------------- | |
531 | ||
532 | Configure IP addresses of the device and the host. Then: | |
533 | ||
534 | On the device: ping <host's IP> | |
535 | On the host: ping <device's IP> | |
4dfcec8a AP |
536 | |
537 | 14. SERIAL function | |
538 | =================== | |
539 | ||
540 | The function is provided by usb_f_gser.ko module. | |
541 | ||
542 | Function-specific configfs interface | |
543 | ------------------------------------ | |
544 | ||
545 | The function name to use when creating the function directory is "gser". | |
546 | The SERIAL function provides just one attribute in its function directory: | |
547 | ||
548 | port_num | |
549 | ||
550 | The attribute is read-only. | |
551 | ||
552 | There can be at most 4 ACM/generic serial/OBEX ports in the system. | |
553 | ||
554 | Testing the SERIAL function | |
555 | --------------------------- | |
556 | ||
557 | On host: insmod usbserial | |
558 | echo VID PID >/sys/bus/usb-serial/drivers/generic/new_id | |
559 | On host: cat > /dev/ttyUSB<X> | |
560 | On target: cat /dev/ttyGS<Y> | |
561 | ||
562 | then the other way round | |
563 | ||
564 | On target: cat > /dev/ttyGS<Y> | |
565 | On host: cat /dev/ttyUSB<X> | |
480a912b AP |
566 | |
567 | 15. SOURCESINK function | |
568 | ======================= | |
569 | ||
570 | The function is provided by usb_f_ss_lb.ko module. | |
571 | ||
572 | Function-specific configfs interface | |
573 | ------------------------------------ | |
574 | ||
575 | The function name to use when creating the function directory is "SourceSink". | |
576 | The SOURCESINK function provides these attributes in its function directory: | |
577 | ||
578 | pattern - 0 (all zeros), 1 (mod63), 2 (none) | |
579 | isoc_interval - 1..16 | |
580 | isoc_maxpacket - 0 - 1023 (fs), 0 - 1024 (hs/ss) | |
581 | isoc_mult - 0..2 (hs/ss only) | |
582 | isoc_maxburst - 0..15 (ss only) | |
583 | bulk_buflen - buffer length | |
584 | ||
585 | Testing the SOURCESINK function | |
586 | ------------------------------- | |
587 | ||
588 | device: run the gadget | |
589 | host: test-usb | |
590 | ||
591 | http://www.linux-usb.org/usbtest/testusb.c | |
dae03586 AP |
592 | |
593 | 16. UAC1 function | |
594 | ================= | |
595 | ||
596 | The function is provided by usb_f_uac1.ko module. | |
597 | ||
598 | Function-specific configfs interface | |
599 | ------------------------------------ | |
600 | ||
601 | The function name to use when creating the function directory is "uac1". | |
602 | The uac1 function provides these attributes in its function directory: | |
603 | ||
604 | audio_buf_size - audio buffer size | |
605 | fn_cap - capture pcm device file name | |
606 | fn_cntl - control device file name | |
607 | fn_play - playback pcm device file name | |
608 | req_buf_size - ISO OUT endpoint request buffer size | |
609 | req_count - ISO OUT endpoint request count | |
610 | ||
611 | The attributes have sane default values. | |
612 | ||
613 | Testing the UAC1 function | |
614 | ------------------------- | |
615 | ||
616 | device: run the gadget | |
617 | host: aplay -l # should list our USB Audio Gadget | |
020c6f93 AP |
618 | |
619 | 17. UAC2 function | |
620 | ================= | |
621 | ||
622 | The function is provided by usb_f_uac2.ko module. | |
623 | ||
624 | Function-specific configfs interface | |
625 | ------------------------------------ | |
626 | ||
627 | The function name to use when creating the function directory is "uac2". | |
628 | The uac2 function provides these attributes in its function directory: | |
629 | ||
630 | chmask - capture channel mask | |
631 | c_srate - capture sampling rate | |
632 | c_ssize - capture sample size (bytes) | |
633 | p_chmask - playback channel mask | |
634 | p_srate - playback sampling rate | |
635 | p_ssize - playback sample size (bytes) | |
636 | ||
637 | The attributes have sane default values. | |
638 | ||
639 | Testing the UAC2 function | |
640 | ------------------------- | |
641 | ||
642 | device: run the gadget | |
643 | host: aplay -l # should list our USB Audio Gadget | |
644 | ||
645 | This function does not require real hardware support, it just | |
646 | sends a stream of audio data to/from the host. In order to | |
647 | actually hear something at the device side, a command similar | |
648 | to this must be used at the device side: | |
649 | ||
650 | $ arecord -f dat -t wav -D hw:2,0 | aplay -D hw:0,0 & | |
651 | ||
652 | e.g.: | |
653 | ||
654 | $ arecord -f dat -t wav -D hw:CARD=UAC2Gadget,DEV=0 | \ | |
655 | aplay -D default:CARD=OdroidU3 |