sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}(hhparenthuba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget&/translations/zh_CN/usb/gadget-testingmodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}(hhhh2ubah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget&/translations/zh_TW/usb/gadget-testingmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}(hhhhFubah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget&/translations/it_IT/usb/gadget-testingmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}(hhhhZubah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget&/translations/ja_JP/usb/gadget-testingmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}(hhhhnubah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget&/translations/ko_KR/usb/gadget-testingmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}(hhhhubah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget&/translations/sp_SP/usb/gadget-testingmodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhsection)}(hhh](htitle)}(hGadget Testingh]hGadget Testing}(hhhhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhh@/var/lib/git/docbuild/linux/Documentation/usb/gadget-testing.rsthKubh paragraph)}(hWThis file summarizes information on basic testing of USB functions provided by gadgets.h]hWThis file summarizes information on basic testing of USB functions provided by gadgets.}(hhhhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubhcomment)}(hXcontents 1. ACM function 2. ECM function 3. ECM subset function 4. EEM function 5. FFS function 6. HID function 7. LOOPBACK function 8. MASS STORAGE function 9. MIDI function 10. NCM function 11. OBEX function 12. PHONET function 13. RNDIS function 14. SERIAL function 15. SOURCESINK function 16. UAC1 function (legacy implementation) 17. UAC2 function 18. UVC function 19. PRINTER function 20. UAC1 function (new API) 21. MIDI2 functionh]hXcontents 1. ACM function 2. ECM function 3. ECM subset function 4. EEM function 5. FFS function 6. HID function 7. LOOPBACK function 8. MASS STORAGE function 9. MIDI function 10. NCM function 11. OBEX function 12. PHONET function 13. RNDIS function 14. SERIAL function 15. SOURCESINK function 16. UAC1 function (legacy implementation) 17. UAC2 function 18. UVC function 19. PRINTER function 20. UAC1 function (new API) 21. MIDI2 function}(hhhhubah}(h]h ]h"]h$]h&] xml:spacepreserveuh1hhhhhhhhK ubh)}(hhh](h)}(h1. ACM functionh]h1. ACM function}(hhhhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhK"ubh)}(h0The function is provided by usb_f_acm.ko module.h]h0The function is provided by usb_f_acm.ko module.}(hhhhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK$hhhhubh)}(hhh](h)}(h$Function-specific configfs interfaceh]h$Function-specific configfs interface}(hhhhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhK'ubh)}(hThe function name to use when creating the function directory is "acm". The ACM function provides just one attribute in its function directory:h]hThe function name to use when creating the function directory is “acm”. The ACM function provides just one attribute in its function directory:}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK)hhhhubh block_quote)}(hhh]h)}(hport_numh]hport_num}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK,hjubah}(h]h ]h"]h$]h&]uh1jhhhhhhhNubh)}(hThe attribute is read-only.h]hThe attribute is read-only.}(hj2hj0hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK.hhhhubh)}(hCThere can be at most 4 ACM/generic serial/OBEX ports in the system.h]hCThere can be at most 4 ACM/generic serial/OBEX ports in the system.}(hj@hj>hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK0hhhhubeh}(h]$function-specific-configfs-interfaceah ]h"]h$]$function-specific configfs interfaceah&]uh1hhhhhhhhK' referencedKubh)}(hhh](h)}(hTesting the ACM functionh]hTesting the ACM function}(hjZhjXhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjUhhhhhK4ubh)}(h On the host::h]h On the host:}(h On the host:hjfhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK6hjUhhubh literal_block)}(hcat > /dev/ttyACMh]hcat > /dev/ttyACM}(hhhjwubah}(h]h ]h"]h$]h&]hhuh1juhhhK8hjUhhubh)}(hOn the device::h]hOn the device:}(hOn the device:hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK:hjUhhubjv)}(hcat /dev/ttyGSh]hcat /dev/ttyGS}(hhhjubah}(h]h ]h"]h$]h&]hhuh1juhhhKhjUhhubh)}(hOn the device::h]hOn the device:}(hOn the device:hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK@hjUhhubjv)}(hcat > /dev/ttyGSh]hcat > /dev/ttyGS}(hhhjubah}(h]h ]h"]h$]h&]hhuh1juhhhKBhjUhhubh)}(h On the host::h]h On the host:}(h On the host:hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKDhjUhhubjv)}(hcat /dev/ttyACMh]hcat /dev/ttyACM}(hhhjubah}(h]h ]h"]h$]h&]hhuh1juhhhKFhjUhhubeh}(h]testing-the-acm-functionah ]h"]testing the acm functionah$]h&]uh1hhhhhhhhK4ubeh}(h] acm-functionah ]h"]1. acm functionah$]h&]uh1hhhhhhhhK"ubh)}(hhh](h)}(h2. ECM functionh]h2. ECM function}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKIubh)}(h0The function is provided by usb_f_ecm.ko module.h]h0The function is provided by usb_f_ecm.ko module.}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKKhjhhubh)}(hhh](h)}(h$Function-specific configfs interfaceh]h$Function-specific configfs interface}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKNubh)}(hThe function name to use when creating the function directory is "ecm". The ECM function provides these attributes in its function directory:h]hThe function name to use when creating the function directory is “ecm”. The ECM function provides these attributes in its function directory:}(hj,hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKPhjhhubj)}(hhh]htable)}(hhh]htgroup)}(hhh](hcolspec)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1jEhjBubjF)}(hhh]h}(h]h ]h"]h$]h&]colwidthK2uh1jEhjBubhtbody)}(hhh](hrow)}(hhh](hentry)}(hhh]h)}(hifnameh]hifname}(hjlhjjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKThjgubah}(h]h ]h"]h$]h&]uh1jehjbubjf)}(hhh]h)}(hDnetwork device interface name associated with this function instanceh]hDnetwork device interface name associated with this function instance}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKThj~ubah}(h]h ]h"]h$]h&]uh1jehjbubeh}(h]h ]h"]h$]h&]uh1j`hj]ubja)}(hhh](jf)}(hhh]h)}(hqmulth]hqmult}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKVhjubah}(h]h ]h"]h$]h&]uh1jehjubjf)}(hhh]h)}(h0queue length multiplier for high and super speedh]h0queue length multiplier for high and super speed}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKVhjubah}(h]h ]h"]h$]h&]uh1jehjubeh}(h]h ]h"]h$]h&]uh1j`hj]ubja)}(hhh](jf)}(hhh]h)}(h host_addrh]h host_addr}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKWhjubah}(h]h ]h"]h$]h&]uh1jehjubjf)}(hhh]h)}(h8MAC address of host's end of this Ethernet over USB linkh]h:MAC address of host’s end of this Ethernet over USB link}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKWhjubah}(h]h ]h"]h$]h&]uh1jehjubeh}(h]h ]h"]h$]h&]uh1j`hj]ubja)}(hhh](jf)}(hhh]h)}(hdev_addrh]hdev_addr}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKYhj ubah}(h]h ]h"]h$]h&]uh1jehj ubjf)}(hhh]h)}(h:MAC address of device's end of this Ethernet over USB linkh]h they contain default values: qmult is 5, dev_addr and host_addr are randomly selected. The ifname can be written to if the function is not bound. A write must be an interface pattern such as "usb%d", which will cause the net core to choose the next free usbX interface. By default, it is set to "usb%d".h]hXland after creating the functions/ecm. they contain default values: qmult is 5, dev_addr and host_addr are randomly selected. The ifname can be written to if the function is not bound. A write must be an interface pattern such as “usb%d”, which will cause the net core to choose the next free usbX interface. By default, it is set to “usb%d”.}(hj[hjYhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK]hjhhubeh}(h]id1ah ]h"]h$]jRah&]uh1hhjhhhhhKNjTKubh)}(hhh](h)}(hTesting the ECM functionh]hTesting the ECM function}(hjshjqhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjnhhhhhKdubh)}(h8Configure IP addresses of the device and the host. Then:h]h8Configure IP addresses of the device and the host. Then:}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKfhjnhhubh)}(hOn the device::h]hOn the device:}(hOn the device:hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhjnhhubjv)}(hping h]hping }(hhhjubah}(h]h ]h"]h$]h&]hhuh1juhhhKjhjnhhubh)}(h On the host::h]h On the host:}(h On the host:hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKlhjnhhubjv)}(hping h]hping }(hhhjubah}(h]h ]h"]h$]h&]hhuh1juhhhKnhjnhhubeh}(h]testing-the-ecm-functionah ]h"]testing the ecm functionah$]h&]uh1hhjhhhhhKdubeh}(h] ecm-functionah ]h"]2. ecm functionah$]h&]uh1hhhhhhhhKIubh)}(hhh](h)}(h3. ECM subset functionh]h3. ECM subset function}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKqubh)}(h7The function is provided by usb_f_ecm_subset.ko module.h]h7The function is provided by usb_f_ecm_subset.ko module.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKshjhhubh)}(hhh](h)}(h$Function-specific configfs interfaceh]h$Function-specific configfs interface}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKvubh)}(hThe function name to use when creating the function directory is "geth". The ECM subset function provides these attributes in its function directory:h]hThe function name to use when creating the function directory is “geth”. The ECM subset function provides these attributes in its function directory:}(hj hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKxhjhhubj)}(hhh]j<)}(hhh]jA)}(hhh](jF)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1jEhjubjF)}(hhh]h}(h]h ]h"]h$]h&]colwidthK2uh1jEhjubj\)}(hhh](ja)}(hhh](jf)}(hhh]h)}(hifnameh]hifname}(hj=hj;hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK|hj8ubah}(h]h ]h"]h$]h&]uh1jehj5ubjf)}(hhh]h)}(hDnetwork device interface name associated with this function instanceh]hDnetwork device interface name associated with this function instance}(hjThjRhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK|hjOubah}(h]h ]h"]h$]h&]uh1jehj5ubeh}(h]h ]h"]h$]h&]uh1j`hj2ubja)}(hhh](jf)}(hhh]h)}(hqmulth]hqmult}(hjthjrhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK~hjoubah}(h]h ]h"]h$]h&]uh1jehjlubjf)}(hhh]h)}(h0queue length multiplier for high and super speedh]h0queue length multiplier for high and super speed}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK~hjubah}(h]h ]h"]h$]h&]uh1jehjlubeh}(h]h ]h"]h$]h&]uh1j`hj2ubja)}(hhh](jf)}(hhh]h)}(h host_addrh]h host_addr}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jehjubjf)}(hhh]h)}(h8MAC address of host's end of this Ethernet over USB linkh]h:MAC address of host’s end of this Ethernet over USB link}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jehjubeh}(h]h ]h"]h$]h&]uh1j`hj2ubja)}(hhh](jf)}(hhh]h)}(hdev_addrh]hdev_addr}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jehjubjf)}(hhh]h)}(h:MAC address of device's end of this Ethernet over USB linkh]h they contain default values: qmult is 5, dev_addr and host_addr are randomly selected. The ifname can be written to if the function is not bound. A write must be an interface pattern such as "usb%d", which will cause the net core to choose the next free usbX interface. By default, it is set to "usb%d".h]hXland after creating the functions/ecm. they contain default values: qmult is 5, dev_addr and host_addr are randomly selected. The ifname can be written to if the function is not bound. A write must be an interface pattern such as “usb%d”, which will cause the net core to choose the next free usbX interface. By default, it is set to “usb%d”.}(hj,hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubeh}(h]id2ah ]h"]h$]$function-specific configfs interfaceah&]uh1hhjhhhhhKvjTKubh)}(hhh](h)}(hTesting the ECM subset functionh]hTesting the ECM subset function}(hjEhjChhhNhNubah}(h]h ]h"]h$]h&]uh1hhj@hhhhhKubh)}(h8Configure IP addresses of the device and the host. Then:h]h8Configure IP addresses of the device and the host. Then:}(hjShjQhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj@hhubh)}(hOn the device::h]hOn the device:}(hOn the device:hj_hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj@hhubjv)}(hping h]hping }(hhhjnubah}(h]h ]h"]h$]h&]hhuh1juhhhKhj@hhubh)}(h On the host::h]h On the host:}(h On the host:hj|hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj@hhubjv)}(hping h]hping }(hhhjubah}(h]h ]h"]h$]h&]hhuh1juhhhKhj@hhubeh}(h]testing-the-ecm-subset-functionah ]h"]testing the ecm subset functionah$]h&]uh1hhjhhhhhKubeh}(h]ecm-subset-functionah ]h"]3. ecm subset functionah$]h&]uh1hhhhhhhhKqubh)}(hhh](h)}(h4. EEM functionh]h4. EEM function}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(h0The function is provided by usb_f_eem.ko module.h]h0The function is provided by usb_f_eem.ko module.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hhh](h)}(h$Function-specific configfs interfaceh]h$Function-specific configfs interface}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hThe function name to use when creating the function directory is "eem". The EEM function provides these attributes in its function directory:h]hThe function name to use when creating the function directory is “eem”. The EEM function provides these attributes in its function directory:}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj)}(hhh]j<)}(hhh]jA)}(hhh](jF)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1jEhjubjF)}(hhh]h}(h]h ]h"]h$]h&]colwidthK2uh1jEhjubj\)}(hhh](ja)}(hhh](jf)}(hhh]h)}(hifnameh]hifname}(hjhj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jehjubjf)}(hhh]h)}(hDnetwork device interface name associated with this function instanceh]hDnetwork device interface name associated with this function instance}(hj&hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj!ubah}(h]h ]h"]h$]h&]uh1jehjubeh}(h]h ]h"]h$]h&]uh1j`hjubja)}(hhh](jf)}(hhh]h)}(hqmulth]hqmult}(hjFhjDhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjAubah}(h]h ]h"]h$]h&]uh1jehj>ubjf)}(hhh]h)}(h0queue length multiplier for high and super speedh]h0queue length multiplier for high and super speed}(hj]hj[hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjXubah}(h]h ]h"]h$]h&]uh1jehj>ubeh}(h]h ]h"]h$]h&]uh1j`hjubja)}(hhh](jf)}(hhh]h)}(h host_addrh]h host_addr}(hj}hj{hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjxubah}(h]h ]h"]h$]h&]uh1jehjuubjf)}(hhh]h)}(h8MAC address of host's end of this Ethernet over USB linkh]h:MAC address of host’s end of this Ethernet over USB link}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jehjuubeh}(h]h ]h"]h$]h&]uh1j`hjubja)}(hhh](jf)}(hhh]h)}(hdev_addrh]hdev_addr}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jehjubjf)}(hhh]h)}(h:MAC address of device's end of this Ethernet over USB linkh]h they contain default values: qmult is 5, dev_addr and host_addr are randomly selected. The ifname can be written to if the function is not bound. A write must be an interface pattern such as "usb%d", which will cause the net core to choose the next free usbX interface. By default, it is set to "usb%d".h]hXland after creating the functions/eem. they contain default values: qmult is 5, dev_addr and host_addr are randomly selected. The ifname can be written to if the function is not bound. A write must be an interface pattern such as “usb%d”, which will cause the net core to choose the next free usbX interface. By default, it is set to “usb%d”.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubeh}(h]id3ah ]h"]h$]$function-specific configfs interfaceah&]uh1hhjhhhhhKjTKubh)}(hhh](h)}(hTesting the EEM functionh]hTesting the EEM function}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(h8Configure IP addresses of the device and the host. Then:h]h8Configure IP addresses of the device and the host. Then:}(hj%hj#hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hOn the device::h]hOn the device:}(hOn the device:hj1hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubjv)}(hping h]hping }(hhhj@ubah}(h]h ]h"]h$]h&]hhuh1juhhhKhjhhubh)}(h On the host::h]h On the host:}(h On the host:hjNhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubjv)}(hping h]hping }(hhhj]ubah}(h]h ]h"]h$]h&]hhuh1juhhhKhjhhubeh}(h]testing-the-eem-functionah ]h"]testing the eem functionah$]h&]uh1hhjhhhhhKubeh}(h] eem-functionah ]h"]4. eem functionah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h5. FFS functionh]h5. FFS function}(hjhj~hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj{hhhhhKubh)}(h/The function is provided by usb_f_fs.ko module.h]h/The function is provided by usb_f_fs.ko module.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj{hhubh)}(hhh](h)}(h$Function-specific configfs interfaceh]h$Function-specific configfs interface}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hThe function name to use when creating the function directory is "ffs". The function directory is intentionally empty and not modifiable.h]hThe function name to use when creating the function directory is “ffs”. The function directory is intentionally empty and not modifiable.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hXkAfter creating the directory there is a new instance (a "device") of FunctionFS available in the system. Once a "device" is available, the user should follow the standard procedure for using FunctionFS (mount it, run the userspace process which implements the function proper). The gadget should be enabled by writing a suitable string to usb_gadget//UDC.h]hXsAfter creating the directory there is a new instance (a “device”) of FunctionFS available in the system. Once a “device” is available, the user should follow the standard procedure for using FunctionFS (mount it, run the userspace process which implements the function proper). The gadget should be enabled by writing a suitable string to usb_gadget//UDC.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hGThe FFS function provides just one attribute in its function directory:h]hGThe FFS function provides just one attribute in its function directory:}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj)}(hhh]h)}(hreadyh]hready}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubh)}(hThe attribute is read-only and signals if the function is ready (1) to be used, E.G. if userspace has written descriptors and strings to ep0, so the gadget can be enabled.h]hThe attribute is read-only and signals if the function is ready (1) to be used, E.G. if userspace has written descriptors and strings to ep0, so the gadget can be enabled.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubeh}(h]id4ah ]h"]h$]$function-specific configfs interfaceah&]uh1hhj{hhhhhKjTKubh)}(hhh](h)}(hTesting the FFS functionh]hTesting the FFS function}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hGOn the device: start the function's userspace daemon, enable the gadgeth]hIOn the device: start the function’s userspace daemon, enable the gadget}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(h8On the host: use the USB function provided by the deviceh]h8On the host: use the USB function provided by the device}(hj#hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubeh}(h]testing-the-ffs-functionah ]h"]testing the ffs functionah$]h&]uh1hhj{hhhhhKubeh}(h] ffs-functionah ]h"]5. ffs functionah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h6. HID functionh]h6. HID function}(hjDhjBhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj?hhhhhKubh)}(h0The function is provided by usb_f_hid.ko module.h]h0The function is provided by usb_f_hid.ko module.}(hjRhjPhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj?hhubh)}(hhh](h)}(h$Function-specific configfs interfaceh]h$Function-specific configfs interface}(hjchjahhhNhNubah}(h]h ]h"]h$]h&]uh1hhj^hhhhhKubh)}(hThe function name to use when creating the function directory is "hid". The HID function provides these attributes in its function directory:h]hThe function name to use when creating the function directory is “hid”. The HID function provides these attributes in its function directory:}(hjqhjohhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj^hhubj)}(hhh]j<)}(hhh]jA)}(hhh](jF)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1jEhjubjF)}(hhh]h}(h]h ]h"]h$]h&]colwidthK+uh1jEhjubj\)}(hhh](ja)}(hhh](jf)}(hhh]h)}(hprotocolh]hprotocol}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jehjubjf)}(hhh]h)}(hHID protocol to useh]hHID protocol to use}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jehjubeh}(h]h ]h"]h$]h&]uh1j`hjubja)}(hhh](jf)}(hhh]h)}(h report_desch]h report_desc}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jehjubjf)}(hhh]h)}(hDdata to be used in HID reports, except data passed with /dev/hidgh]hDdata to be used in HID reports, except data passed with /dev/hidg}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jehjubeh}(h]h ]h"]h$]h&]uh1j`hjubja)}(hhh](jf)}(hhh]h)}(h report_lengthh]h report_length}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jehj ubjf)}(hhh]h)}(hHID report lengthh]hHID report length}(hj* hj( hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj% ubah}(h]h ]h"]h$]h&]uh1jehj ubeh}(h]h ]h"]h$]h&]uh1j`hjubja)}(hhh](jf)}(hhh]h)}(hsubclassh]hsubclass}(hjJ hjH hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjE ubah}(h]h ]h"]h$]h&]uh1jehjB ubjf)}(hhh]h)}(hHID subclass to useh]hHID subclass to use}(hja hj_ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj\ ubah}(h]h ]h"]h$]h&]uh1jehjB ubeh}(h]h ]h"]h$]h&]uh1j`hjubeh}(h]h ]h"]h$]h&]uh1j[hjubeh}(h]h ]h"]h$]h&]colsKuh1j@hjubah}(h]h ]h"]h$]h&]uh1j;hj}ubah}(h]h ]h"]h$]h&]uh1jhj^hhhhhNubh)}(hfFor a keyboard the protocol and the subclass are 1, the report_length is 8, while the report_desc is::h]heFor a keyboard the protocol and the subclass are 1, the report_length is 8, while the report_desc is:}(heFor a keyboard the protocol and the subclass are 1, the report_length is 8, while the report_desc is:hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj^hhubjv)}(hXW$ hd my_report_desc 00000000 05 01 09 06 a1 01 05 07 19 e0 29 e7 15 00 25 01 |..........)...%.| 00000010 75 01 95 08 81 02 95 01 75 08 81 03 95 05 75 01 |u.......u.....u.| 00000020 05 08 19 01 29 05 91 02 95 01 75 03 91 03 95 06 |....).....u.....| 00000030 75 08 15 00 25 65 05 07 19 00 29 65 81 00 c0 |u...%e....)e...| 0000003fh]hXW$ hd my_report_desc 00000000 05 01 09 06 a1 01 05 07 19 e0 29 e7 15 00 25 01 |..........)...%.| 00000010 75 01 95 08 81 02 95 01 75 08 81 03 95 05 75 01 |u.......u.....u.| 00000020 05 08 19 01 29 05 91 02 95 01 75 03 91 03 95 06 |....).....u.....| 00000030 75 08 15 00 25 65 05 07 19 00 29 65 81 00 c0 |u...%e....)e...| 0000003f}(hhhj ubah}(h]h ]h"]h$]h&]hhuh1juhhhKhj^hhubh)}(hCSuch a sequence of bytes can be stored to the attribute with echo::h]hBSuch a sequence of bytes can be stored to the attribute with echo:}(hBSuch a sequence of bytes can be stored to the attribute with echo:hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj^hhubjv)}(h)$ echo -ne \\x05\\x01\\x09\\x06\\xa1.....h]h)$ echo -ne \\x05\\x01\\x09\\x06\\xa1.....}(hhhj ubah}(h]h ]h"]h$]h&]hhuh1juhhhKhj^hhubeh}(h]id5ah ]h"]h$]$function-specific configfs interfaceah&]uh1hhj?hhhhhKjTKubh)}(hhh](h)}(hTesting the HID functionh]hTesting the HID function}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhMubh)}(hDevice:h]hDevice:}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh bullet_list)}(hhh](h list_item)}(hcreate the gadgeth]h)}(hj h]hcreate the gadget}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj ubah}(h]h ]h"]h$]h&]uh1j hj hhhhhNubj )}(hOconnect the gadget to a host, preferably not the one used to control the gadgeth]h)}(hOconnect the gadget to a host, preferably not the one used to control the gadgeth]hOconnect the gadget to a host, preferably not the one used to control the gadget}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj ubah}(h]h ]h"]h$]h&]uh1j hj hhhhhNubj )}(hrun a program which writes to /dev/hidg, e.g. a userspace program found in Documentation/usb/gadget_hid.rst:: $ ./hid_gadget_test /dev/hidg0 keyboard h](h)}(hprun a program which writes to /dev/hidg, e.g. a userspace program found in Documentation/usb/gadget_hid.rst::h]horun a program which writes to /dev/hidg, e.g. a userspace program found in Documentation/usb/gadget_hid.rst:}(horun a program which writes to /dev/hidg, e.g. a userspace program found in Documentation/usb/gadget_hid.rst:hj- hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hj) ubjv)}(h'$ ./hid_gadget_test /dev/hidg0 keyboardh]h'$ ./hid_gadget_test /dev/hidg0 keyboard}(hhhj< ubah}(h]h ]h"]h$]h&]hhuh1juhhhM hj) ubeh}(h]h ]h"]h$]h&]uh1j hj hhhhhNubeh}(h]h ]h"]h$]h&]bullet-uh1j hhhMhj hhubh)}(hHost:h]hHost:}(hjZ hjX hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubj )}(hhh]j )}(h'observe the keystrokes from the gadget h]h)}(h&observe the keystrokes from the gadgeth]h&observe the keystrokes from the gadget}(hjo hjm hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhji ubah}(h]h ]h"]h$]h&]uh1j hjf hhhhhNubah}(h]h ]h"]h$]h&]jV jW uh1j hhhMhj hhubeh}(h]testing-the-hid-functionah ]h"]testing the hid functionah$]h&]uh1hhj?hhhhhMubeh}(h] hid-functionah ]h"]6. hid functionah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h7. LOOPBACK functionh]h7. LOOPBACK function}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhMubh)}(h2The function is provided by usb_f_ss_lb.ko module.h]h2The function is provided by usb_f_ss_lb.ko module.}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(hhh](h)}(h$Function-specific configfs interfaceh]h$Function-specific configfs interface}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhMubh)}(hThe function name to use when creating the function directory is "Loopback". The LOOPBACK function provides these attributes in its function directory:h]hThe function name to use when creating the function directory is “Loopback”. The LOOPBACK function provides these attributes in its function directory:}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubj)}(hhh]j<)}(hhh]jA)}(hhh](jF)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1jEhj ubjF)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1jEhj ubj\)}(hhh](ja)}(hhh](jf)}(hhh]h)}(hqlenh]hqlen}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj ubah}(h]h ]h"]h$]h&]uh1jehj ubjf)}(hhh]h)}(hdepth of loopback queueh]hdepth of loopback queue}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj ubah}(h]h ]h"]h$]h&]uh1jehj ubeh}(h]h ]h"]h$]h&]uh1j`hj ubja)}(hhh](jf)}(hhh]h)}(h bulk_buflenh]h bulk_buflen}(hj4 hj2 hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj/ ubah}(h]h ]h"]h$]h&]uh1jehj, ubjf)}(hhh]h)}(h buffer lengthh]h buffer length}(hjK hjI hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjF ubah}(h]h ]h"]h$]h&]uh1jehj, ubeh}(h]h ]h"]h$]h&]uh1j`hj ubeh}(h]h ]h"]h$]h&]uh1j[hj ubeh}(h]h ]h"]h$]h&]colsKuh1j@hj ubah}(h]h ]h"]h$]h&]uh1j;hj ubah}(h]h ]h"]h$]h&]uh1jhj hhhhhNubeh}(h]id6ah ]h"]h$]$function-specific configfs interfaceah&]uh1hhj hhhhhMjTKubh)}(hhh](h)}(hTesting the LOOPBACK functionh]hTesting the LOOPBACK function}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhM#ubh)}(hdevice: run the gadgeth]hdevice: run the gadget}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM%hj hhubh)}(h$host: test-usb (tools/usb/testusb.c)h]h$host: test-usb (tools/usb/testusb.c)}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM'hj hhubeh}(h]testing-the-loopback-functionah ]h"]testing the loopback functionah$]h&]uh1hhj hhhhhM#ubeh}(h]loopback-functionah ]h"]7. loopback functionah$]h&]uh1hhhhhhhhMubh)}(hhh](h)}(h8. MASS STORAGE functionh]h8. MASS STORAGE function}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhM*ubh)}(h9The function is provided by usb_f_mass_storage.ko module.h]h9The function is provided by usb_f_mass_storage.ko module.}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM,hj hhubh)}(hhh](h)}(h$Function-specific configfs interfaceh]h$Function-specific configfs interface}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhM/ubh)}(hThe function name to use when creating the function directory is "mass_storage". The MASS STORAGE function provides these attributes in its directory: files:h]hThe function name to use when creating the function directory is “mass_storage”. The MASS STORAGE function provides these attributes in its directory: files:}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM1hj hhubj)}(hhh]j<)}(hhh]jA)}(hhh](jF)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1jEhj ubjF)}(hhh]h}(h]h ]h"]h$]h&]colwidthK.uh1jEhj ubj\)}(hhh](ja)}(hhh](jf)}(hhh]h)}(hstallh]hstall}(hj' hj% hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM6hj" ubah}(h]h ]h"]h$]h&]uh1jehj ubjf)}(hhh]h)}(hSet to permit function to halt bulk endpoints. Disabled on some USB devices known not to work correctly. You should set it to true.h]hSet to permit function to halt bulk endpoints. Disabled on some USB devices known not to work correctly. You should set it to true.}(hj> hj< hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM6hj9 ubah}(h]h ]h"]h$]h&]uh1jehj ubeh}(h]h ]h"]h$]h&]uh1j`hj ubja)}(hhh](jf)}(hhh]h)}(h num_buffersh]h num_buffers}(hj^ hj\ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM9hjY ubah}(h]h ]h"]h$]h&]uh1jehjV ubjf)}(hhh]h)}(hkNumber of pipeline buffers. Valid numbers are 2..4. Available only if CONFIG_USB_GADGET_DEBUG_FILES is set.h]hkNumber of pipeline buffers. Valid numbers are 2..4. Available only if CONFIG_USB_GADGET_DEBUG_FILES is set.}(hju hjs hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM9hjp ubah}(h]h ]h"]h$]h&]uh1jehjV ubeh}(h]h ]h"]h$]h&]uh1j`hj ubeh}(h]h ]h"]h$]h&]uh1j[hj ubeh}(h]h ]h"]h$]h&]colsKuh1j@hj ubah}(h]h ]h"]h$]h&]uh1j;hj ubah}(h]h ]h"]h$]h&]uh1jhj hhhhhNubh)}(h;and a default lun.0 directory corresponding to SCSI LUN #0.h]h;and a default lun.0 directory corresponding to SCSI LUN #0.}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM>hj hhubh)}(h#A new lun can be added with mkdir::h]h"A new lun can be added with mkdir:}(h"A new lun can be added with mkdir:hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM@hj hhubjv)}(h,$ mkdir functions/mass_storage.0/partition.5h]h,$ mkdir functions/mass_storage.0/partition.5}(hhhj ubah}(h]h ]h"]h$]h&]hhuh1juhhhMBhj hhubh)}(hX8Lun numbering does not have to be continuous, except for lun #0 which is created by default. A maximum of 8 luns can be specified and they all must be named following the . scheme. The numbers can be 0..8. Probably a good convention is to name the luns "lun.", although it is not mandatory.h]hX<Lun numbering does not have to be continuous, except for lun #0 which is created by default. A maximum of 8 luns can be specified and they all must be named following the . scheme. The numbers can be 0..8. Probably a good convention is to name the luns “lun.”, although it is not mandatory.}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMDhj hhubh)}(h>In each lun directory there are the following attribute files:h]h>In each lun directory there are the following attribute files:}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMJhj hhubj)}(hhh]j<)}(hhh]jA)}(hhh](jF)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1jEhj ubjF)}(hhh]h}(h]h ]h"]h$]h&]colwidthK.uh1jEhj ubj\)}(hhh](ja)}(hhh](jf)}(hhh]h)}(hfileh]hfile}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMMhj ubah}(h]h ]h"]h$]h&]uh1jehj ubjf)}(hhh]h)}(hUThe path to the backing file for the LUN. Required if LUN is not marked as removable.h]hUThe path to the backing file for the LUN. Required if LUN is not marked as removable.}(hj, hj* hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMMhj' ubah}(h]h ]h"]h$]h&]uh1jehj ubeh}(h]h ]h"]h$]h&]uh1j`hj ubja)}(hhh](jf)}(hhh]h)}(hroh]hro}(hjL hjJ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMOhjG ubah}(h]h ]h"]h$]h&]uh1jehjD ubjf)}(hhh]h)}(hFlag specifying access to the LUN shall be read-only. This is implied if CD-ROM emulation is enabled as well as when it was impossible to open "filename" in R/W mode.h]hFlag specifying access to the LUN shall be read-only. This is implied if CD-ROM emulation is enabled as well as when it was impossible to open “filename” in R/W mode.}(hjc hja hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMOhj^ ubah}(h]h ]h"]h$]h&]uh1jehjD ubeh}(h]h ]h"]h$]h&]uh1j`hj ubja)}(hhh](jf)}(hhh]h)}(h removableh]h removable}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMShj~ ubah}(h]h ]h"]h$]h&]uh1jehj{ ubjf)}(hhh]h)}(h?Flag specifying that LUN shall be indicated as being removable.h]h?Flag specifying that LUN shall be indicated as being removable.}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMShj ubah}(h]h ]h"]h$]h&]uh1jehj{ ubeh}(h]h ]h"]h$]h&]uh1j`hj ubja)}(hhh](jf)}(hhh]h)}(hcdromh]hcdrom}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMUhj ubah}(h]h ]h"]h$]h&]uh1jehj ubjf)}(hhh]h)}(h=Flag specifying that LUN shall be reported as being a CD-ROM.h]h=Flag specifying that LUN shall be reported as being a CD-ROM.}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMUhj ubah}(h]h ]h"]h$]h&]uh1jehj ubeh}(h]h ]h"]h$]h&]uh1j`hj ubja)}(hhh](jf)}(hhh]h)}(hnofuah]hnofua}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMWhj ubah}(h]h ]h"]h$]h&]uh1jehj ubjf)}(hhh]h)}(h2Flag specifying that FUA flag in SCSI WRITE(10,12)h]h2Flag specifying that FUA flag in SCSI WRITE(10,12)}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMWhjubah}(h]h ]h"]h$]h&]uh1jehj ubeh}(h]h ]h"]h$]h&]uh1j`hj ubja)}(hhh](jf)}(hhh]h)}(h forced_ejecth]h forced_eject}(hj(hj&hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMYhj#ubah}(h]h ]h"]h$]h&]uh1jehj ubjf)}(hhh]h)}(hThis write-only file is useful only when the function is active. It causes the backing file to be forcibly detached from the LUN, regardless of whether the host has allowed it. Any non-zero number of bytes written will result in ejection.h]hThis write-only file is useful only when the function is active. It causes the backing file to be forcibly detached from the LUN, regardless of whether the host has allowed it. Any non-zero number of bytes written will result in ejection.}(hj?hj=hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMYhj:ubah}(h]h ]h"]h$]h&]uh1jehj ubeh}(h]h ]h"]h$]h&]uh1j`hj ubeh}(h]h ]h"]h$]h&]uh1j[hj ubeh}(h]h ]h"]h$]h&]colsKuh1j@hj ubah}(h]h ]h"]h$]h&]uh1j;hj ubah}(h]h ]h"]h$]h&]uh1jhj hhhhhNubeh}(h]id7ah ]h"]h$]$function-specific configfs interfaceah&]uh1hhj hhhhhM/jTKubh)}(hhh](h)}(h!Testing the MASS STORAGE functionh]h!Testing the MASS STORAGE function}(hj}hj{hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjxhhhhhMbubh)}(hzdevice: connect the gadget, enable it host: dmesg, see the USB drives appear (if system configured to automatically mount)h]hzdevice: connect the gadget, enable it host: dmesg, see the USB drives appear (if system configured to automatically mount)}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMdhjxhhubeh}(h]!testing-the-mass-storage-functionah ]h"]!testing the mass storage functionah$]h&]uh1hhj hhhhhMbubeh}(h]mass-storage-functionah ]h"]8. mass storage functionah$]h&]uh1hhhhhhhhM*ubh)}(hhh](h)}(h9. MIDI functionh]h9. MIDI function}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMiubh)}(h1The function is provided by usb_f_midi.ko module.h]h1The function is provided by usb_f_midi.ko module.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMkhjhhubh)}(hhh](h)}(h$Function-specific configfs interfaceh]h$Function-specific configfs interface}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMnubh)}(hThe function name to use when creating the function directory is "midi". The MIDI function provides these attributes in its function directory:h]hThe function name to use when creating the function directory is “midi”. The MIDI function provides these attributes in its function directory:}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMphjhhubj)}(hhh]j<)}(hhh]jA)}(hhh](jF)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1jEhjubjF)}(hhh]h}(h]h ]h"]h$]h&]colwidthK$uh1jEhjubj\)}(hhh](ja)}(hhh](jf)}(hhh]h)}(hbuflenh]hbuflen}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMthjubah}(h]h ]h"]h$]h&]uh1jehjubjf)}(hhh]h)}(hMIDI buffer lengthh]hMIDI buffer length}(hj$hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMthjubah}(h]h ]h"]h$]h&]uh1jehjubeh}(h]h ]h"]h$]h&]uh1j`hjubja)}(hhh](jf)}(hhh]h)}(hidh]hid}(hjDhjBhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMuhj?ubah}(h]h ]h"]h$]h&]uh1jehj<ubjf)}(hhh]h)}(h"ID string for the USB MIDI adapterh]h"ID string for the USB MIDI adapter}(hj[hjYhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMuhjVubah}(h]h ]h"]h$]h&]uh1jehj<ubeh}(h]h ]h"]h$]h&]uh1j`hjubja)}(hhh](jf)}(hhh]h)}(hin_portsh]hin_ports}(hj{hjyhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMvhjvubah}(h]h ]h"]h$]h&]uh1jehjsubjf)}(hhh]h)}(hnumber of MIDI input portsh]hnumber of MIDI input ports}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMvhjubah}(h]h ]h"]h$]h&]uh1jehjsubeh}(h]h ]h"]h$]h&]uh1j`hjubja)}(hhh](jf)}(hhh]h)}(hindexh]hindex}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMwhjubah}(h]h ]h"]h$]h&]uh1jehjubjf)}(hhh]h)}(h$index value for the USB MIDI adapterh]h$index value for the USB MIDI adapter}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMwhjubah}(h]h ]h"]h$]h&]uh1jehjubeh}(h]h ]h"]h$]h&]uh1j`hjubja)}(hhh](jf)}(hhh]h)}(h out_portsh]h out_ports}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMxhjubah}(h]h ]h"]h$]h&]uh1jehjubjf)}(hhh]h)}(hnumber of MIDI output portsh]hnumber of MIDI output ports}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMxhjubah}(h]h ]h"]h$]h&]uh1jehjubeh}(h]h ]h"]h$]h&]uh1j`hjubja)}(hhh](jf)}(hhh]h)}(hqlenh]hqlen}(hj hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMyhjubah}(h]h ]h"]h$]h&]uh1jehjubjf)}(hhh]h)}(hUSB read request queue lengthh]hUSB read request queue length}(hj7hj5hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMyhj2ubah}(h]h ]h"]h$]h&]uh1jehjubeh}(h]h ]h"]h$]h&]uh1j`hjubeh}(h]h ]h"]h$]h&]uh1j[hjubeh}(h]h ]h"]h$]h&]colsKuh1j@hjubah}(h]h ]h"]h$]h&]uh1j;hjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubeh}(h]id8ah ]h"]h$]$function-specific configfs interfaceah&]uh1hhjhhhhhMnjTKubh)}(hhh](h)}(hTesting the MIDI functionh]hTesting the MIDI function}(hjuhjshhhNhNubah}(h]h ]h"]h$]h&]uh1hhjphhhhhM}ubh)}(hmThere are two cases: playing a mid from the gadget to the host and playing a mid from the host to the gadget.h]hmThere are two cases: playing a mid from the gadget to the host and playing a mid from the host to the gadget.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjphhubhenumerated_list)}(hhh]j )}(h+Playing a mid from the gadget to the host: h]h)}(h*Playing a mid from the gadget to the host:h]h*Playing a mid from the gadget to the host:}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1j hjhhhhhNubah}(h]h ]h"]h$]h&]enumtypearabicprefixhsuffix)uh1jhjphhhhhMubh)}(hhost::h]hhost:}(hhost:hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjphhubjv)}(h$ arecordmidi -l Port Client name Port name 14:0 Midi Through Midi Through Port-0 24:0 MIDI Gadget MIDI Gadget MIDI 1 $ arecordmidi -p 24:0 from_gadget.midh]h$ arecordmidi -l Port Client name Port name 14:0 Midi Through Midi Through Port-0 24:0 MIDI Gadget MIDI Gadget MIDI 1 $ arecordmidi -p 24:0 from_gadget.mid}(hhhjubah}(h]h ]h"]h$]h&]hhuh1juhhhMhjphhubh)}(hgadget::h]hgadget:}(hgadget:hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjphhubjv)}(h$ aplaymidi -l Port Client name Port name 20:0 f_midi f_midi $ aplaymidi -p 20:0 to_host.midh]h$ aplaymidi -l Port Client name Port name 20:0 f_midi f_midi $ aplaymidi -p 20:0 to_host.mid}(hhhjubah}(h]h ]h"]h$]h&]hhuh1juhhhMhjphhubj)}(hhh]j )}(h*Playing a mid from the host to the gadget h]h)}(h)Playing a mid from the host to the gadgeth]h)Playing a mid from the host to the gadget}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1j hjhhhhhNubah}(h]h ]h"]h$]h&]jjjhjjstartKuh1jhjphhhhhMubh)}(hgadget::h]hgadget:}(hgadget:hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjphhubjv)}(h$ arecordmidi -l Port Client name Port name 20:0 f_midi f_midi $ arecordmidi -p 20:0 from_host.midh]h$ arecordmidi -l Port Client name Port name 20:0 f_midi f_midi $ arecordmidi -p 20:0 from_host.mid}(hhhj"ubah}(h]h ]h"]h$]h&]hhuh1juhhhMhjphhubh)}(hhost::h]hhost:}(hhost:hj0hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjphhubjv)}(h$ aplaymidi -l Port Client name Port name 14:0 Midi Through Midi Through Port-0 24:0 MIDI Gadget MIDI Gadget MIDI 1 $ aplaymidi -p24:0 to_gadget.midh]h$ aplaymidi -l Port Client name Port name 14:0 Midi Through Midi Through Port-0 24:0 MIDI Gadget MIDI Gadget MIDI 1 $ aplaymidi -p24:0 to_gadget.mid}(hhhj?ubah}(h]h ]h"]h$]h&]hhuh1juhhhMhjphhubh)}(h>The from_gadget.mid should sound identical to the to_host.mid.h]h>The from_gadget.mid should sound identical to the to_host.mid.}(hjOhjMhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjphhubh)}(h=The from_host.id should sound identical to the to_gadget.mid.h]h=The from_host.id should sound identical to the to_gadget.mid.}(hj]hj[hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjphhubh)}(hNMIDI files can be played to speakers/headphones with e.g. timidity installed::h]hMMIDI files can be played to speakers/headphones with e.g. timidity installed:}(hMMIDI files can be played to speakers/headphones with e.g. timidity installed:hjihhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjphhubjv)}(hX$ aplaymidi -l Port Client name Port name 14:0 Midi Through Midi Through Port-0 24:0 MIDI Gadget MIDI Gadget MIDI 1 128:0 TiMidity TiMidity port 0 128:1 TiMidity TiMidity port 1 128:2 TiMidity TiMidity port 2 128:3 TiMidity TiMidity port 3 $ aplaymidi -p 128:0 file.midh]hX$ aplaymidi -l Port Client name Port name 14:0 Midi Through Midi Through Port-0 24:0 MIDI Gadget MIDI Gadget MIDI 1 128:0 TiMidity TiMidity port 0 128:1 TiMidity TiMidity port 1 128:2 TiMidity TiMidity port 2 128:3 TiMidity TiMidity port 3 $ aplaymidi -p 128:0 file.mid}(hhhjxubah}(h]h ]h"]h$]h&]hhuh1juhhhMhjphhubh)}(hHMIDI ports can be logically connected using the aconnect utility, e.g.::h]hGMIDI ports can be logically connected using the aconnect utility, e.g.:}(hGMIDI ports can be logically connected using the aconnect utility, e.g.:hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjphhubjv)}(h*$ aconnect 24:0 128:0 # try it on the hosth]h*$ aconnect 24:0 128:0 # try it on the host}(hhhjubah}(h]h ]h"]h$]h&]hhuh1juhhhMhjphhubh)}(hAfter the gadget's MIDI port is connected to timidity's MIDI port, whatever is played at the gadget side with aplaymidi -l is audible in host's speakers/headphones.h]hAfter the gadget’s MIDI port is connected to timidity’s MIDI port, whatever is played at the gadget side with aplaymidi -l is audible in host’s speakers/headphones.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjphhubeh}(h]testing-the-midi-functionah ]h"]testing the midi functionah$]h&]uh1hhjhhhhhM}ubeh}(h] midi-functionah ]h"]9. midi functionah$]h&]uh1hhhhhhhhMiubh)}(hhh](h)}(h10. NCM functionh]h10. NCM function}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMubh)}(h0The function is provided by usb_f_ncm.ko module.h]h0The function is provided by usb_f_ncm.ko module.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hhh](h)}(h$Function-specific configfs interfaceh]h$Function-specific configfs interface}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMubh)}(hThe function name to use when creating the function directory is "ncm". The NCM function provides these attributes in its function directory:h]hThe function name to use when creating the function directory is “ncm”. The NCM function provides these attributes in its function directory:}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubj)}(hhh]j<)}(hhh]jA)}(hhh](jF)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1jEhjubjF)}(hhh]h}(h]h ]h"]h$]h&]colwidthK2uh1jEhjubj\)}(hhh](ja)}(hhh](jf)}(hhh]h)}(hifnameh]hifname}(hj'hj%hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj"ubah}(h]h ]h"]h$]h&]uh1jehjubjf)}(hhh]h)}(hDnetwork device interface name associated with this function instanceh]hDnetwork device interface name associated with this function instance}(hj>hj<hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj9ubah}(h]h ]h"]h$]h&]uh1jehjubeh}(h]h ]h"]h$]h&]uh1j`hjubja)}(hhh](jf)}(hhh]h)}(hqmulth]hqmult}(hj^hj\hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjYubah}(h]h ]h"]h$]h&]uh1jehjVubjf)}(hhh]h)}(h0queue length multiplier for high and super speedh]h0queue length multiplier for high and super speed}(hjuhjshhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjpubah}(h]h ]h"]h$]h&]uh1jehjVubeh}(h]h ]h"]h$]h&]uh1j`hjubja)}(hhh](jf)}(hhh]h)}(h host_addrh]h host_addr}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jehjubjf)}(hhh]h)}(h8MAC address of host's end of this Ethernet over USB linkh]h:MAC address of host’s end of this Ethernet over USB link}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jehjubeh}(h]h ]h"]h$]h&]uh1j`hjubja)}(hhh](jf)}(hhh]h)}(hdev_addrh]hdev_addr}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jehjubjf)}(hhh]h)}(h:MAC address of device's end of this Ethernet over USB linkh]h they contain default values: qmult is 5, dev_addr and host_addr are randomly selected. The ifname can be written to if the function is not bound. A write must be an interface pattern such as "usb%d", which will cause the net core to choose the next free usbX interface. By default, it is set to "usb%d".h]hXland after creating the functions/ncm. they contain default values: qmult is 5, dev_addr and host_addr are randomly selected. The ifname can be written to if the function is not bound. A write must be an interface pattern such as “usb%d”, which will cause the net core to choose the next free usbX interface. By default, it is set to “usb%d”.}(hjMhjKhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubeh}(h]id9ah ]h"]h$]$function-specific configfs interfaceah&]uh1hhjhhhhhMjTKubh)}(hhh](h)}(hTesting the NCM functionh]hTesting the NCM function}(hjfhjdhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjahhhhhMubh)}(h8Configure IP addresses of the device and the host. Then:h]h8Configure IP addresses of the device and the host. Then:}(hjthjrhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjahhubh)}(hOn the device::h]hOn the device:}(hOn the device:hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjahhubjv)}(hping h]hping }(hhhjubah}(h]h ]h"]h$]h&]hhuh1juhhhMhjahhubh)}(h On the host::h]h On the host:}(h On the host:hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjahhubjv)}(hping h]hping }(hhhjubah}(h]h ]h"]h$]h&]hhuh1juhhhMhjahhubeh}(h]testing-the-ncm-functionah ]h"]testing the ncm functionah$]h&]uh1hhjhhhhhMubeh}(h] ncm-functionah ]h"]10. ncm functionah$]h&]uh1hhhhhhhhMubh)}(hhh](h)}(h11. OBEX functionh]h11. OBEX function}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMubh)}(h1The function is provided by usb_f_obex.ko module.h]h1The function is provided by usb_f_obex.ko module.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hhh](h)}(h$Function-specific configfs interfaceh]h$Function-specific configfs interface}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMubh)}(hThe function name to use when creating the function directory is "obex". The OBEX function provides just one attribute in its function directory:h]hThe function name to use when creating the function directory is “obex”. The OBEX function provides just one attribute in its function directory:}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubj)}(hhh]h)}(hport_numh]hport_num}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubh)}(hThe attribute is read-only.h]hThe attribute is read-only.}(hj!hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hCThere can be at most 4 ACM/generic serial/OBEX ports in the system.h]hCThere can be at most 4 ACM/generic serial/OBEX ports in the system.}(hj/hj-hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubeh}(h]id10ah ]h"]h$]$function-specific configfs interfaceah&]uh1hhjhhhhhMjTKubh)}(hhh](h)}(hTesting the OBEX functionh]hTesting the OBEX function}(hjHhjFhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjChhhhhMubh)}(h On device::h]h On device:}(h On device:hjThhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjChhubjv)}(h seriald -f /dev/ttyGS -s 1024h]h seriald -f /dev/ttyGS -s 1024}(hhhjcubah}(h]h ]h"]h$]h&]hhuh1juhhhMhjChhubh)}(h On host::h]hOn host:}(hOn host:hjqhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjChhubjv)}(hsserialc -v -p -i -a1 -s1024 \ -t -rh]hsserialc -v -p -i -a1 -s1024 \ -t -r}(hhhjubah}(h]h ]h"]h$]h&]hhuh1juhhhMhjChhubh)}(hwhere seriald and serialc are Felipe’s utilities found here:}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjChhubj)}(hhh]h)}(h3https://github.com/felipebalbi/usb-tools.git masterh](h reference)}(h,https://github.com/felipebalbi/usb-tools.gith]h,https://github.com/felipebalbi/usb-tools.git}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]refurijuh1jhjubh master}(h masterhjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM hjubah}(h]h ]h"]h$]h&]uh1jhjChhhhhNubeh}(h]testing-the-obex-functionah ]h"]testing the obex functionah$]h&]uh1hhjhhhhhMubeh}(h] obex-functionah ]h"]11. obex functionah$]h&]uh1hhhhhhhhMubh)}(hhh](h)}(h12. PHONET functionh]h12. PHONET function}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhM ubh)}(h3The function is provided by usb_f_phonet.ko module.h]h3The function is provided by usb_f_phonet.ko module.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hhh](h)}(h$Function-specific configfs interfaceh]h$Function-specific configfs interface}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMubh)}(hThe function name to use when creating the function directory is "phonet". The PHONET function provides just one attribute in its function directory:h]hThe function name to use when creating the function directory is “phonet”. The PHONET function provides just one attribute in its function directory:}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubj)}(hhh]j<)}(hhh]jA)}(hhh](jF)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1jEhjubjF)}(hhh]h}(h]h ]h"]h$]h&]colwidthK2uh1jEhjubj\)}(hhh]ja)}(hhh](jf)}(hhh]h)}(hifnameh]hifname}(hj;hj9hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj6ubah}(h]h ]h"]h$]h&]uh1jehj3ubjf)}(hhh]h)}(hDnetwork device interface name associated with this function instanceh]hDnetwork device interface name associated with this function instance}(hjRhjPhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjMubah}(h]h ]h"]h$]h&]uh1jehj3ubeh}(h]h ]h"]h$]h&]uh1j`hj0ubah}(h]h ]h"]h$]h&]uh1j[hjubeh}(h]h ]h"]h$]h&]colsKuh1j@hjubah}(h]h ]h"]h$]h&]uh1j;hjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubeh}(h]id11ah ]h"]h$]$function-specific configfs interfaceah&]uh1hhjhhhhhMjTKubh)}(hhh](h)}(hTesting the PHONET functionh]hTesting the PHONET function}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMubh)}(hIt is not possible to test the SOCK_STREAM protocol without a specific piece of hardware, so only SOCK_DGRAM has been tested. For the latter to work, in the past I had to apply the patch mentioned here:h]hIt is not possible to test the SOCK_STREAM protocol without a specific piece of hardware, so only SOCK_DGRAM has been tested. For the latter to work, in the past I had to apply the patch mentioned here:}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(h4http://www.spinics.net/lists/linux-usb/msg85689.htmlh]j)}(hjh]h4http://www.spinics.net/lists/linux-usb/msg85689.html}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]refurijuh1jhjubah}(h]h ]h"]h$]h&]uh1hhhhM"hjhhubh)}(hThese tools are required:h]hThese tools are required:}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM$hjhhubh)}(h7git://git.gitorious.org/meego-cellular/phonet-utils.gith]h7git://git.gitorious.org/meego-cellular/phonet-utils.git}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM&hjhhubh)}(h On the host::h]h On the host:}(h On the host:hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM(hjhhubjv)}(hh$ ./phonet -a 0x10 -i usbpn0 $ ./pnroute add 0x6c usbpn0 $./pnroute add 0x10 usbpn0 $ ifconfig usbpn0 uph]hh$ ./phonet -a 0x10 -i usbpn0 $ ./pnroute add 0x6c usbpn0 $./pnroute add 0x10 usbpn0 $ ifconfig usbpn0 up}(hhhjubah}(h]h ]h"]h$]h&]hhuh1juhhhM*hjhhubh)}(hOn the device::h]hOn the device:}(hOn the device:hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM/hjhhubjv)}(hS$ ./phonet -a 0x6c -i upnlink0 $ ./pnroute add 0x10 upnlink0 $ ifconfig upnlink0 uph]hS$ ./phonet -a 0x6c -i upnlink0 $ ./pnroute add 0x10 upnlink0 $ ifconfig upnlink0 up}(hhhj ubah}(h]h ]h"]h$]h&]hhuh1juhhhM1hjhhubh)}(h!Then a test program can be used::h]h Then a test program can be used:}(h Then a test program can be used:hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM5hjhhubjv)}(h4http://www.spinics.net/lists/linux-usb/msg85690.htmlh]h4http://www.spinics.net/lists/linux-usb/msg85690.html}(hhhj'ubah}(h]h ]h"]h$]h&]hhuh1juhhhM7hjhhubh)}(hOn the device::h]hOn the device:}(hOn the device:hj5hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM9hjhhubjv)}(h$ ./pnxmit -a 0x6c -rh]h$ ./pnxmit -a 0x6c -r}(hhhjDubah}(h]h ]h"]h$]h&]hhuh1juhhhM;hjhhubh)}(h On the host::h]h On the host:}(h On the host:hjRhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM=hjhhubjv)}(h$ ./pnxmit -a 0x10 -s 0x6ch]h$ ./pnxmit -a 0x10 -s 0x6c}(hhhjaubah}(h]h ]h"]h$]h&]hhuh1juhhhM?hjhhubh)}(hSAs a result some data should be sent from host to device. Then the other way round:h]hSAs a result some data should be sent from host to device. Then the other way round:}(hjqhjohhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMAhjhhubh)}(h On the host::h]h On the host:}(h On the host:hj}hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMDhjhhubjv)}(h$ ./pnxmit -a 0x10 -rh]h$ ./pnxmit -a 0x10 -r}(hhhjubah}(h]h ]h"]h$]h&]hhuh1juhhhMFhjhhubh)}(hOn the device::h]hOn the device:}(hOn the device:hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMHhjhhubjv)}(h$ ./pnxmit -a 0x6c -s 0x10h]h$ ./pnxmit -a 0x6c -s 0x10}(hhhjubah}(h]h ]h"]h$]h&]hhuh1juhhhMJhjhhubeh}(h]testing-the-phonet-functionah ]h"]testing the phonet functionah$]h&]uh1hhjhhhhhMubeh}(h]phonet-functionah ]h"]12. phonet functionah$]h&]uh1hhhhhhhhM ubh)}(hhh](h)}(h13. RNDIS functionh]h13. RNDIS function}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMMubh)}(h2The function is provided by usb_f_rndis.ko module.h]h2The function is provided by usb_f_rndis.ko module.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMOhjhhubh)}(hhh](h)}(h$Function-specific configfs interfaceh]h$Function-specific configfs interface}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMRubh)}(hThe function name to use when creating the function directory is "rndis". The RNDIS function provides these attributes in its function directory:h]hThe function name to use when creating the function directory is “rndis”. The RNDIS function provides these attributes in its function directory:}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMThjhhubj)}(hhh]j<)}(hhh]jA)}(hhh](jF)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1jEhj ubjF)}(hhh]h}(h]h ]h"]h$]h&]colwidthK2uh1jEhj ubj\)}(hhh](ja)}(hhh](jf)}(hhh]h)}(hifnameh]hifname}(hj-hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMXhj(ubah}(h]h ]h"]h$]h&]uh1jehj%ubjf)}(hhh]h)}(hDnetwork device interface name associated with this function instanceh]hDnetwork device interface name associated with this function instance}(hjDhjBhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMXhj?ubah}(h]h ]h"]h$]h&]uh1jehj%ubeh}(h]h ]h"]h$]h&]uh1j`hj"ubja)}(hhh](jf)}(hhh]h)}(hqmulth]hqmult}(hjdhjbhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMZhj_ubah}(h]h ]h"]h$]h&]uh1jehj\ubjf)}(hhh]h)}(h0queue length multiplier for high and super speedh]h0queue length multiplier for high and super speed}(hj{hjyhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMZhjvubah}(h]h ]h"]h$]h&]uh1jehj\ubeh}(h]h ]h"]h$]h&]uh1j`hj"ubja)}(hhh](jf)}(hhh]h)}(h host_addrh]h host_addr}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM[hjubah}(h]h ]h"]h$]h&]uh1jehjubjf)}(hhh]h)}(h8MAC address of host's end of this Ethernet over USB linkh]h:MAC address of host’s end of this Ethernet over USB link}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM[hjubah}(h]h ]h"]h$]h&]uh1jehjubeh}(h]h ]h"]h$]h&]uh1j`hj"ubja)}(hhh](jf)}(hhh]h)}(hdev_addrh]hdev_addr}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM]hjubah}(h]h ]h"]h$]h&]uh1jehjubjf)}(hhh]h)}(h:MAC address of device's end of this Ethernet over USB linkh]h they contain default values: qmult is 5, dev_addr and host_addr are randomly selected. The ifname can be written to if the function is not bound. A write must be an interface pattern such as "usb%d", which will cause the net core to choose the next free usbX interface. By default, it is set to "usb%d".h]hXnand after creating the functions/rndis. they contain default values: qmult is 5, dev_addr and host_addr are randomly selected. The ifname can be written to if the function is not bound. A write must be an interface pattern such as “usb%d”, which will cause the net core to choose the next free usbX interface. By default, it is set to “usb%d”.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMahjhhubeh}(h]id12ah ]h"]h$]$function-specific configfs interfaceah&]uh1hhjhhhhhMRjTKubh)}(hhh](h)}(hTesting the RNDIS functionh]hTesting the RNDIS function}(hj5hj3hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj0hhhhhMhubh)}(h8Configure IP addresses of the device and the host. Then:h]h8Configure IP addresses of the device and the host. Then:}(hjChjAhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMjhj0hhubh)}(hOn the device::h]hOn the device:}(hOn the device:hjOhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMlhj0hhubjv)}(hping h]hping }(hhhj^ubah}(h]h ]h"]h$]h&]hhuh1juhhhMnhj0hhubh)}(h On the host::h]h On the host:}(h On the host:hjlhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMphj0hhubjv)}(hping h]hping }(hhhj{ubah}(h]h ]h"]h$]h&]hhuh1juhhhMrhj0hhubeh}(h]testing-the-rndis-functionah ]h"]testing the rndis functionah$]h&]uh1hhjhhhhhMhubeh}(h]rndis-functionah ]h"]13. rndis functionah$]h&]uh1hhhhhhhhMMubh)}(hhh](h)}(h14. SERIAL functionh]h14. SERIAL function}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMuubh)}(h1The function is provided by usb_f_gser.ko module.h]h1The function is provided by usb_f_gser.ko module.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMwhjhhubh)}(hhh](h)}(h$Function-specific configfs interfaceh]h$Function-specific configfs interface}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMzubh)}(hThe function name to use when creating the function directory is "gser". The SERIAL function provides just one attribute in its function directory:h]hThe function name to use when creating the function directory is “gser”. The SERIAL function provides just one attribute in its function directory:}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM|hjhhubj)}(hhh]h)}(hport_numh]hport_num}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubh)}(hThe attribute is read-only.h]hThe attribute is read-only.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hCThere can be at most 4 ACM/generic serial/OBEX ports in the system.h]hCThere can be at most 4 ACM/generic serial/OBEX ports in the system.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubeh}(h]id13ah ]h"]h$]$function-specific configfs interfaceah&]uh1hhjhhhhhMzjTKubh)}(hhh](h)}(hTesting the SERIAL functionh]hTesting the SERIAL function}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMubh)}(h On host::h]hOn host:}(hOn host:hj#hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubjv)}(hIinsmod usbserial echo VID PID >/sys/bus/usb-serial/drivers/generic/new_idh]hIinsmod usbserial echo VID PID >/sys/bus/usb-serial/drivers/generic/new_id}(hhhj2ubah}(h]h ]h"]h$]h&]hhuh1juhhhMhjhhubh)}(h On host::h]hOn host:}(hOn host:hj@hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubjv)}(hcat > /dev/ttyUSBh]hcat > /dev/ttyUSB}(hhhjOubah}(h]h ]h"]h$]h&]hhuh1juhhhMhjhhubh)}(h On target::h]h On target:}(h On target:hj]hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubjv)}(hcat /dev/ttyGSh]hcat /dev/ttyGS}(hhhjlubah}(h]h ]h"]h$]h&]hhuh1juhhhMhjhhubh)}(hthen the other way roundh]hthen the other way round}(hj|hjzhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(h On target::h]h On target:}(h On target:hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubjv)}(hcat > /dev/ttyGSh]hcat > /dev/ttyGS}(hhhjubah}(h]h ]h"]h$]h&]hhuh1juhhhMhjhhubh)}(h On host::h]hOn host:}(hOn host:hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubjv)}(hcat /dev/ttyUSBh]hcat /dev/ttyUSB}(hhhjubah}(h]h ]h"]h$]h&]hhuh1juhhhMhjhhubeh}(h]testing-the-serial-functionah ]h"]testing the serial functionah$]h&]uh1hhjhhhhhMubeh}(h]serial-functionah ]h"]14. serial functionah$]h&]uh1hhhhhhhhMuubh)}(hhh](h)}(h15. SOURCESINK functionh]h15. SOURCESINK function}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMubh)}(h2The function is provided by usb_f_ss_lb.ko module.h]h2The function is provided by usb_f_ss_lb.ko module.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hhh](h)}(h$Function-specific configfs interfaceh]h$Function-specific configfs interface}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMubh)}(hThe function name to use when creating the function directory is "SourceSink". The SOURCESINK function provides these attributes in its function directory:h]hThe function name to use when creating the function directory is “SourceSink”. The SOURCESINK function provides these attributes in its function directory:}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubj)}(hhh]j<)}(hhh]jA)}(hhh](jF)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1jEhjubjF)}(hhh]h}(h]h ]h"]h$]h&]colwidthK"uh1jEhjubj\)}(hhh](ja)}(hhh](jf)}(hhh]h)}(hpatternh]hpattern}(hj8hj6hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj3ubah}(h]h ]h"]h$]h&]uh1jehj0ubjf)}(hhh]h)}(h"0 (all zeros), 1 (mod63), 2 (none)h]h"0 (all zeros), 1 (mod63), 2 (none)}(hjOhjMhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjJubah}(h]h ]h"]h$]h&]uh1jehj0ubeh}(h]h ]h"]h$]h&]uh1j`hj-ubja)}(hhh](jf)}(hhh]h)}(h isoc_intervalh]h isoc_interval}(hjohjmhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjjubah}(h]h ]h"]h$]h&]uh1jehjgubjf)}(hhh]h)}(h1..16h]h1..16}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jehjgubeh}(h]h ]h"]h$]h&]uh1j`hj-ubja)}(hhh](jf)}(hhh]h)}(hisoc_maxpacketh]hisoc_maxpacket}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jehjubjf)}(hhh]h)}(h0 - 1023 (fs), 0 - 1024 (hs/ss)h]h0 - 1023 (fs), 0 - 1024 (hs/ss)}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jehjubeh}(h]h ]h"]h$]h&]uh1j`hj-ubja)}(hhh](jf)}(hhh]h)}(h isoc_multh]h isoc_mult}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jehjubjf)}(hhh]h)}(h0..2 (hs/ss only)h]h0..2 (hs/ss only)}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jehjubeh}(h]h ]h"]h$]h&]uh1j`hj-ubja)}(hhh](jf)}(hhh]h)}(h isoc_maxbursth]h isoc_maxburst}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jehj ubjf)}(hhh]h)}(h0..15 (ss only)h]h0..15 (ss only)}(hj+hj)hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj&ubah}(h]h ]h"]h$]h&]uh1jehj ubeh}(h]h ]h"]h$]h&]uh1j`hj-ubja)}(hhh](jf)}(hhh]h)}(h bulk_buflenh]h bulk_buflen}(hjKhjIhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjFubah}(h]h ]h"]h$]h&]uh1jehjCubjf)}(hhh]h)}(h buffer lengthh]h buffer length}(hjbhj`hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj]ubah}(h]h ]h"]h$]h&]uh1jehjCubeh}(h]h ]h"]h$]h&]uh1j`hj-ubja)}(hhh](jf)}(hhh]h)}(h bulk_qlenh]h bulk_qlen}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj}ubah}(h]h ]h"]h$]h&]uh1jehjzubjf)}(hhh]h)}(hdepth of queue for bulkh]hdepth of queue for bulk}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jehjzubeh}(h]h ]h"]h$]h&]uh1j`hj-ubja)}(hhh](jf)}(hhh]h)}(hiso_qlenh]hiso_qlen}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jehjubjf)}(hhh]h)}(hdepth of queue for isoh]hdepth of queue for iso}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jehjubeh}(h]h ]h"]h$]h&]uh1j`hj-ubeh}(h]h ]h"]h$]h&]uh1j[hjubeh}(h]h ]h"]h$]h&]colsKuh1j@hjubah}(h]h ]h"]h$]h&]uh1j;hjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubeh}(h]id14ah ]h"]h$]$function-specific configfs interfaceah&]uh1hhjhhhhhMjTKubh)}(hhh](h)}(hTesting the SOURCESINK functionh]hTesting the SOURCESINK function}(hjhj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhMubh)}(hdevice: run the gadgeth]hdevice: run the gadget}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(h$host: test-usb (tools/usb/testusb.c)h]h$host: test-usb (tools/usb/testusb.c)}(hj*hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubeh}(h]testing-the-sourcesink-functionah ]h"]testing the sourcesink functionah$]h&]uh1hhjhhhhhMubeh}(h]sourcesink-functionah ]h"]15. sourcesink functionah$]h&]uh1hhhhhhhhMubh)}(hhh](h)}(h)16. UAC1 function (legacy implementation)h]h)16. UAC1 function (legacy implementation)}(hjKhjIhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjFhhhhhMubh)}(h8The function is provided by usb_f_uac1_legacy.ko module.h]h8The function is provided by usb_f_uac1_legacy.ko module.}(hjYhjWhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjFhhubh)}(hhh](h)}(h$Function-specific configfs interfaceh]h$Function-specific configfs interface}(hjjhjhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjehhhhhMubh)}(hThe function name to use when creating the function directory is "uac1_legacy". The uac1 function provides these attributes in its function directory:h]hThe function name to use when creating the function directory is “uac1_legacy”. The uac1 function provides these attributes in its function directory:}(hjxhjvhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjehhubj)}(hhh]j<)}(hhh]jA)}(hhh](jF)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1jEhjubjF)}(hhh]h}(h]h ]h"]h$]h&]colwidthK$uh1jEhjubj\)}(hhh](ja)}(hhh](jf)}(hhh]h)}(haudio_buf_sizeh]haudio_buf_size}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jehjubjf)}(hhh]h)}(haudio buffer sizeh]haudio buffer size}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jehjubeh}(h]h ]h"]h$]h&]uh1j`hjubja)}(hhh](jf)}(hhh]h)}(hfn_caph]hfn_cap}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jehjubjf)}(hhh]h)}(hcapture pcm device file nameh]hcapture pcm device file name}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jehjubeh}(h]h ]h"]h$]h&]uh1j`hjubja)}(hhh](jf)}(hhh]h)}(hfn_cntlh]hfn_cntl}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jehjubjf)}(hhh]h)}(hcontrol device file nameh]hcontrol device file name}(hj1hj/hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj,ubah}(h]h ]h"]h$]h&]uh1jehjubeh}(h]h ]h"]h$]h&]uh1j`hjubja)}(hhh](jf)}(hhh]h)}(hfn_playh]hfn_play}(hjQhjOhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjLubah}(h]h ]h"]h$]h&]uh1jehjIubjf)}(hhh]h)}(hplayback pcm device file nameh]hplayback pcm device file name}(hjhhjfhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjcubah}(h]h ]h"]h$]h&]uh1jehjIubeh}(h]h ]h"]h$]h&]uh1j`hjubja)}(hhh](jf)}(hhh]h)}(h req_buf_sizeh]h req_buf_size}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jehjubjf)}(hhh]h)}(h$ISO OUT endpoint request buffer sizeh]h$ISO OUT endpoint request buffer size}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jehjubeh}(h]h ]h"]h$]h&]uh1j`hjubja)}(hhh](jf)}(hhh]h)}(h req_counth]h req_count}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jehjubjf)}(hhh]h)}(hISO OUT endpoint request counth]hISO OUT endpoint request count}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jehjubeh}(h]h ]h"]h$]h&]uh1j`hjubeh}(h]h ]h"]h$]h&]uh1j[hjubeh}(h]h ]h"]h$]h&]colsKuh1j@hjubah}(h]h ]h"]h$]h&]uh1j;hjubah}(h]h ]h"]h$]h&]uh1jhjehhhhhNubh)}(h(The attributes have sane default values.h]h(The attributes have sane default values.}(hj hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjehhubeh}(h]id15ah ]h"]h$]$function-specific configfs interfaceah&]uh1hhjFhhhhhMjTKubh)}(hhh](h)}(hTesting the UAC1 functionh]hTesting the UAC1 function}(hj"hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMubh)}(hdevice: run the gadgeth]hdevice: run the gadget}(hj0hj.hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hhost::h]hhost:}(hhost:hj<hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubjv)}(h+aplay -l # should list our USB Audio Gadgeth]h+aplay -l # should list our USB Audio Gadget}(hhhjKubah}(h]h ]h"]h$]h&]hhuh1juhhhMhjhhubeh}(h]testing-the-uac1-functionah ]h"]h$]testing the uac1 functionah&]uh1hhjFhhhhhMjTKubeh}(h]#uac1-function-legacy-implementationah ]h"])16. uac1 function (legacy implementation)ah$]h&]uh1hhhhhhhhMubh)}(hhh](h)}(h17. UAC2 functionh]h17. UAC2 function}(hjnhjlhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjihhhhhMubh)}(h1The function is provided by usb_f_uac2.ko module.h]h1The function is provided by usb_f_uac2.ko module.}(hj|hjzhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjihhubh)}(hhh](h)}(h$Function-specific configfs interfaceh]h$Function-specific configfs interface}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMubh)}(hThe function name to use when creating the function directory is "uac2". The uac2 function provides these attributes in its function directory:h]hThe function name to use when creating the function directory is “uac2”. The uac2 function provides these attributes in its function directory:}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubj)}(hhh]j<)}(hhh]jA)}(hhh](jF)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1jEhjubjF)}(hhh]h}(h]h ]h"]h$]h&]colwidthK4uh1jEhjubj\)}(hhh](ja)}(hhh](jf)}(hhh]h)}(hc_chmaskh]hc_chmask}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jehjubjf)}(hhh]h)}(hcapture channel maskh]hcapture channel mask}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jehjubeh}(h]h ]h"]h$]h&]uh1j`hjubja)}(hhh](jf)}(hhh]h)}(hc_srateh]hc_srate}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jehjubjf)}(hhh]h)}(h0list of capture sampling rates (comma-separated)h]h0list of capture sampling rates (comma-separated)}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jehjubeh}(h]h ]h"]h$]h&]uh1j`hjubja)}(hhh](jf)}(hhh]h)}(hc_ssizeh]hc_ssize}(hj=hj;hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj8ubah}(h]h ]h"]h$]h&]uh1jehj5ubjf)}(hhh]h)}(hcapture sample size (bytes)h]hcapture sample size (bytes)}(hjThjRhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjOubah}(h]h ]h"]h$]h&]uh1jehj5ubeh}(h]h ]h"]h$]h&]uh1j`hjubja)}(hhh](jf)}(hhh]h)}(hc_synch]hc_sync}(hjthjrhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjoubah}(h]h ]h"]h$]h&]uh1jehjlubjf)}(hhh]h)}(h-capture synchronization type (async/adaptive)h]h-capture synchronization type (async/adaptive)}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jehjlubeh}(h]h ]h"]h$]h&]uh1j`hjubja)}(hhh](jf)}(hhh]h)}(hc_mute_presenth]hc_mute_present}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jehjubjf)}(hhh]h)}(hcapture mute control enableh]hcapture mute control enable}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jehjubeh}(h]h ]h"]h$]h&]uh1j`hjubja)}(hhh](jf)}(hhh]h)}(hc_volume_presenth]hc_volume_present}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jehjubjf)}(hhh]h)}(hcapture volume control enableh]hcapture volume control enable}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jehjubeh}(h]h ]h"]h$]h&]uh1j`hjubja)}(hhh](jf)}(hhh]h)}(h c_volume_minh]h c_volume_min}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj ubah}(h]h ]h"]h$]h&]uh1jehj ubjf)}(hhh]h)}(h.capture volume control min value (in 1/256 dB)h]h.capture volume control min value (in 1/256 dB)}(hj0 hj. hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj+ ubah}(h]h ]h"]h$]h&]uh1jehj ubeh}(h]h ]h"]h$]h&]uh1j`hjubja)}(hhh](jf)}(hhh]h)}(h c_volume_maxh]h c_volume_max}(hjP hjN hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjK ubah}(h]h ]h"]h$]h&]uh1jehjH ubjf)}(hhh]h)}(h.capture volume control max value (in 1/256 dB)h]h.capture volume control max value (in 1/256 dB)}(hjg hje hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjb ubah}(h]h ]h"]h$]h&]uh1jehjH ubeh}(h]h ]h"]h$]h&]uh1j`hjubja)}(hhh](jf)}(hhh]h)}(h c_volume_resh]h c_volume_res}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj ubah}(h]h ]h"]h$]h&]uh1jehj ubjf)}(hhh]h)}(h/capture volume control resolution (in 1/256 dB)h]h/capture volume control resolution (in 1/256 dB)}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj ubah}(h]h ]h"]h$]h&]uh1jehj ubeh}(h]h ]h"]h$]h&]uh1j`hjubja)}(hhh](jf)}(hhh]h)}(h c_hs_binth]h c_hs_bint}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj ubah}(h]h ]h"]h$]h&]uh1jehj ubjf)}(hhh]h)}(h1capture bInterval for HS/SS (1-4: fixed, 0: auto)h]h1capture bInterval for HS/SS (1-4: fixed, 0: auto)}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj ubah}(h]h ]h"]h$]h&]uh1jehj ubeh}(h]h ]h"]h$]h&]uh1j`hjubja)}(hhh](jf)}(hhh]h)}(hfb_maxh]hfb_max}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj ubah}(h]h ]h"]h$]h&]uh1jehj ubjf)}(hhh]h)}(h%maximum extra bandwidth in async modeh]h%maximum extra bandwidth in async mode}(hj !hj !hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj!ubah}(h]h ]h"]h$]h&]uh1jehj ubeh}(h]h ]h"]h$]h&]uh1j`hjubja)}(hhh](jf)}(hhh]h)}(hp_chmaskh]hp_chmask}(hj,!hj*!hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj'!ubah}(h]h ]h"]h$]h&]uh1jehj$!ubjf)}(hhh]h)}(hplayback channel maskh]hplayback channel mask}(hjC!hjA!hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj>!ubah}(h]h ]h"]h$]h&]uh1jehj$!ubeh}(h]h ]h"]h$]h&]uh1j`hjubja)}(hhh](jf)}(hhh]h)}(hp_srateh]hp_srate}(hjc!hja!hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj^!ubah}(h]h ]h"]h$]h&]uh1jehj[!ubjf)}(hhh]h)}(h1list of playback sampling rates (comma-separated)h]h1list of playback sampling rates (comma-separated)}(hjz!hjx!hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhju!ubah}(h]h ]h"]h$]h&]uh1jehj[!ubeh}(h]h ]h"]h$]h&]uh1j`hjubja)}(hhh](jf)}(hhh]h)}(hp_ssizeh]hp_ssize}(hj!hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj!ubah}(h]h ]h"]h$]h&]uh1jehj!ubjf)}(hhh]h)}(hplayback sample size (bytes)h]hplayback sample size (bytes)}(hj!hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj!ubah}(h]h ]h"]h$]h&]uh1jehj!ubeh}(h]h ]h"]h$]h&]uh1j`hjubja)}(hhh](jf)}(hhh]h)}(hp_mute_presenth]hp_mute_present}(hj!hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj!ubah}(h]h ]h"]h$]h&]uh1jehj!ubjf)}(hhh]h)}(hplayback mute control enableh]hplayback mute control enable}(hj!hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj!ubah}(h]h ]h"]h$]h&]uh1jehj!ubeh}(h]h ]h"]h$]h&]uh1j`hjubja)}(hhh](jf)}(hhh]h)}(hp_volume_presenth]hp_volume_present}(hj"hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj"ubah}(h]h ]h"]h$]h&]uh1jehj"ubjf)}(hhh]h)}(hplayback volume control enableh]hplayback volume control enable}(hj"hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj"ubah}(h]h ]h"]h$]h&]uh1jehj"ubeh}(h]h ]h"]h$]h&]uh1j`hjubja)}(hhh](jf)}(hhh]h)}(h p_volume_minh]h p_volume_min}(hj?"hj="hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj:"ubah}(h]h ]h"]h$]h&]uh1jehj7"ubjf)}(hhh]h)}(h/playback volume control min value (in 1/256 dB)h]h/playback volume control min value (in 1/256 dB)}(hjV"hjT"hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjQ"ubah}(h]h ]h"]h$]h&]uh1jehj7"ubeh}(h]h ]h"]h$]h&]uh1j`hjubja)}(hhh](jf)}(hhh]h)}(h p_volume_maxh]h p_volume_max}(hjv"hjt"hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjq"ubah}(h]h ]h"]h$]h&]uh1jehjn"ubjf)}(hhh]h)}(h/playback volume control max value (in 1/256 dB)h]h/playback volume control max value (in 1/256 dB)}(hj"hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj"ubah}(h]h ]h"]h$]h&]uh1jehjn"ubeh}(h]h ]h"]h$]h&]uh1j`hjubja)}(hhh](jf)}(hhh]h)}(h p_volume_resh]h p_volume_res}(hj"hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj"ubah}(h]h ]h"]h$]h&]uh1jehj"ubjf)}(hhh]h)}(h0playback volume control resolution (in 1/256 dB)h]h0playback volume control resolution (in 1/256 dB)}(hj"hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj"ubah}(h]h ]h"]h$]h&]uh1jehj"ubeh}(h]h ]h"]h$]h&]uh1j`hjubja)}(hhh](jf)}(hhh]h)}(h p_hs_binth]h p_hs_bint}(hj"hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj"ubah}(h]h ]h"]h$]h&]uh1jehj"ubjf)}(hhh]h)}(h2playback bInterval for HS/SS (1-4: fixed, 0: auto)h]h2playback bInterval for HS/SS (1-4: fixed, 0: auto)}(hj"hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj"ubah}(h]h ]h"]h$]h&]uh1jehj"ubeh}(h]h ]h"]h$]h&]uh1j`hjubja)}(hhh](jf)}(hhh]h)}(h req_numberh]h req_number}(hj#hj#hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj#ubah}(h]h ]h"]h$]h&]uh1jehj#ubjf)}(hhh]h)}(hAthe number of pre-allocated request for both capture and playbackh]hAthe number of pre-allocated request for both capture and playback}(hj2#hj0#hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj-#ubah}(h]h ]h"]h$]h&]uh1jehj#ubeh}(h]h ]h"]h$]h&]uh1j`hjubja)}(hhh](jf)}(hhh]h)}(h function_nameh]h function_name}(hjR#hjP#hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjM#ubah}(h]h ]h"]h$]h&]uh1jehjJ#ubjf)}(hhh]h)}(hname of the interfaceh]hname of the interface}(hji#hjg#hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjd#ubah}(h]h ]h"]h$]h&]uh1jehjJ#ubeh}(h]h ]h"]h$]h&]uh1j`hjubja)}(hhh](jf)}(hhh]h)}(hc_terminal_typeh]hc_terminal_type}(hj#hj#hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj#ubah}(h]h ]h"]h$]h&]uh1jehj#ubjf)}(hhh]h)}(h!code of the capture terminal typeh]h!code of the capture terminal type}(hj#hj#hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj#ubah}(h]h ]h"]h$]h&]uh1jehj#ubeh}(h]h ]h"]h$]h&]uh1j`hjubja)}(hhh](jf)}(hhh]h)}(hp_terminal_typeh]hp_terminal_type}(hj#hj#hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj#ubah}(h]h ]h"]h$]h&]uh1jehj#ubjf)}(hhh]h)}(h"code of the playback terminal typeh]h"code of the playback terminal type}(hj#hj#hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj#ubah}(h]h ]h"]h$]h&]uh1jehj#ubeh}(h]h ]h"]h$]h&]uh1j`hjubeh}(h]h ]h"]h$]h&]uh1j[hjubeh}(h]h ]h"]h$]h&]colsKuh1j@hjubah}(h]h ]h"]h$]h&]uh1j;hjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubh)}(h(The attributes have sane default values.h]h(The attributes have sane default values.}(hj $hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubeh}(h]id16ah ]h"]h$]$function-specific configfs interfaceah&]uh1hhjihhhhhMjTKubh)}(hhh](h)}(hTesting the UAC2 functionh]hTesting the UAC2 function}(hj#$hj!$hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj$hhhhhMubh)}(hHdevice: run the gadget host: aplay -l # should list our USB Audio Gadgeth]hHdevice: run the gadget host: aplay -l # should list our USB Audio Gadget}(hj1$hj/$hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hj$hhubh)}(hThis function does not require real hardware support, it just sends a stream of audio data to/from the host. In order to actually hear something at the device side, a command similar to this must be used at the device side::h]hThis function does not require real hardware support, it just sends a stream of audio data to/from the host. In order to actually hear something at the device side, a command similar to this must be used at the device side:}(hThis function does not require real hardware support, it just sends a stream of audio data to/from the host. In order to actually hear something at the device side, a command similar to this must be used at the device side:hj=$hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hj$hhubjv)}(h5$ arecord -f dat -t wav -D hw:2,0 | aplay -D hw:0,0 &h]h5$ arecord -f dat -t wav -D hw:2,0 | aplay -D hw:0,0 &}(hhhjL$ubah}(h]h ]h"]h$]h&]hhuh1juhhhMhj$hhubh)}(he.g.::h]he.g.:}(he.g.:hjZ$hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj$hhubjv)}(hX$ arecord -f dat -t wav -D hw:CARD=UAC2Gadget,DEV=0 | \ aplay -D default:CARD=OdroidU3h]hX$ arecord -f dat -t wav -D hw:CARD=UAC2Gadget,DEV=0 | \ aplay -D default:CARD=OdroidU3}(hhhji$ubah}(h]h ]h"]h$]h&]hhuh1juhhhMhj$hhubeh}(h]testing-the-uac2-functionah ]h"]testing the uac2 functionah$]h&]uh1hhjihhhhhMubeh}(h] uac2-functionah ]h"]17. uac2 functionah$]h&]uh1hhhhhhhhMubh)}(hhh](h)}(h18. UVC functionh]h18. UVC function}(hj$hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj$hhhhhMubh)}(h0The function is provided by usb_f_uvc.ko module.h]h0The function is provided by usb_f_uvc.ko module.}(hj$hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj$hhubh)}(hhh](h)}(h$Function-specific configfs interfaceh]h$Function-specific configfs interface}(hj$hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj$hhhhhMubh)}(hThe function name to use when creating the function directory is "uvc". The uvc function provides these attributes in its function directory:h]hThe function name to use when creating the function directory is “uvc”. The uvc function provides these attributes in its function directory:}(hj$hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hj$hhubj)}(hhh]j<)}(hhh]jA)}(hhh](jF)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1jEhj$ubjF)}(hhh]h}(h]h ]h"]h$]h&]colwidthK0uh1jEhj$ubj\)}(hhh](ja)}(hhh](jf)}(hhh]h)}(hstreaming_intervalh]hstreaming_interval}(hj$hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM$hj$ubah}(h]h ]h"]h$]h&]uh1jehj$ubjf)}(hhh]h)}(h0interval for polling endpoint for data transfersh]h0interval for polling endpoint for data transfers}(hj%hj%hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM$hj$ubah}(h]h ]h"]h$]h&]uh1jehj$ubeh}(h]h ]h"]h$]h&]uh1j`hj$ubja)}(hhh](jf)}(hhh]h)}(hstreaming_maxbursth]hstreaming_maxburst}(hj$%hj"%hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM%hj%ubah}(h]h ]h"]h$]h&]uh1jehj%ubjf)}(hhh]h)}(h.bMaxBurst for super speed companion descriptorh]h.bMaxBurst for super speed companion descriptor}(hj;%hj9%hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM%hj6%ubah}(h]h ]h"]h$]h&]uh1jehj%ubeh}(h]h ]h"]h$]h&]uh1j`hj$ubja)}(hhh](jf)}(hhh]h)}(hstreaming_maxpacketh]hstreaming_maxpacket}(hj[%hjY%hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM&hjV%ubah}(h]h ]h"]h$]h&]uh1jehjS%ubjf)}(hhh]h)}(hhmaximum packet size this endpoint is capable of sending or receiving when this configuration is selectedh]hhmaximum packet size this endpoint is capable of sending or receiving when this configuration is selected}(hjr%hjp%hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM&hjm%ubah}(h]h ]h"]h$]h&]uh1jehjS%ubeh}(h]h ]h"]h$]h&]uh1j`hj$ubja)}(hhh](jf)}(hhh]h)}(h function_nameh]h function_name}(hj%hj%hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM)hj%ubah}(h]h ]h"]h$]h&]uh1jehj%ubjf)}(hhh]h)}(hname of the interfaceh]hname of the interface}(hj%hj%hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM)hj%ubah}(h]h ]h"]h$]h&]uh1jehj%ubeh}(h]h ]h"]h$]h&]uh1j`hj$ubeh}(h]h ]h"]h$]h&]uh1j[hj$ubeh}(h]h ]h"]h$]h&]colsKuh1j@hj$ubah}(h]h ]h"]h$]h&]uh1j;hj$ubah}(h]h ]h"]h$]h&]uh1jhj$hhhhhNubh)}(hThere are also "control" and "streaming" subdirectories, each of which contain a number of their subdirectories. There are some sane defaults provided, but the user must provide the following:h]hThere are also “control” and “streaming” subdirectories, each of which contain a number of their subdirectories. There are some sane defaults provided, but the user must provide the following:}(hj%hj%hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM,hj$hhubj)}(hhh]j<)}(hhh]jA)}(hhh](jF)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1jEhj%ubjF)}(hhh]h}(h]h ]h"]h$]h&]colwidthK4uh1jEhj%ubj\)}(hhh](ja)}(hhh](jf)}(hhh]h)}(hcontrol headerh]hcontrol header}(hj&hj&hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM1hj &ubah}(h]h ]h"]h$]h&]uh1jehj&ubjf)}(hhh]h)}(hLcreate in control/header, link from control/class/fs and/or control/class/ssh]hLcreate in control/header, link from control/class/fs and/or control/class/ss}(hj'&hj%&hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM1hj"&ubah}(h]h ]h"]h$]h&]uh1jehj&ubeh}(h]h ]h"]h$]h&]uh1j`hj&ubja)}(hhh](jf)}(hhh]h)}(hstreaming headerh]hstreaming header}(hjG&hjE&hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM3hjB&ubah}(h]h ]h"]h$]h&]uh1jehj?&ubjf)}(hhh]h)}(hlcreate in streaming/header, link from streaming/class/fs and/or streaming/class/hs and/or streaming/class/ssh]hlcreate in streaming/header, link from streaming/class/fs and/or streaming/class/hs and/or streaming/class/ss}(hj^&hj\&hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM3hjY&ubah}(h]h ]h"]h$]h&]uh1jehj?&ubeh}(h]h ]h"]h$]h&]uh1j`hj&ubja)}(hhh](jf)}(hhh]h)}(hformat descriptionh]hformat description}(hj~&hj|&hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM6hjy&ubah}(h]h ]h"]h$]h&]uh1jehjv&ubjf)}(hhh]h)}(h7create in streaming/mjpeg and/or streaming/uncompressedh]h7create in streaming/mjpeg and/or streaming/uncompressed}(hj&hj&hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM6hj&ubah}(h]h ]h"]h$]h&]uh1jehjv&ubeh}(h]h ]h"]h$]h&]uh1j`hj&ubja)}(hhh](jf)}(hhh]h)}(hframe descriptionh]hframe description}(hj&hj&hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM8hj&ubah}(h]h ]h"]h$]h&]uh1jehj&ubjf)}(hhh]h)}(hLcreate in streaming/mjpeg/ and/or in streaming/uncompressed/h]hLcreate in streaming/mjpeg/ and/or in streaming/uncompressed/}(hj&hj&hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM8hj&ubah}(h]h ]h"]h$]h&]uh1jehj&ubeh}(h]h ]h"]h$]h&]uh1j`hj&ubeh}(h]h ]h"]h$]h&]uh1j[hj%ubeh}(h]h ]h"]h$]h&]colsKuh1j@hj%ubah}(h]h ]h"]h$]h&]uh1j;hj%ubah}(h]h ]h"]h$]h&]uh1jhj$hhhhhNubh)}(hEach frame description contains frame interval specification, and each such specification consists of a number of lines with an interval value in each line. The rules stated above are best illustrated with an example::h]hEach frame description contains frame interval specification, and each such specification consists of a number of lines with an interval value in each line. The rules stated above are best illustrated with an example:}(hEach frame description contains frame interval specification, and each such specification consists of a number of lines with an interval value in each line. The rules stated above are best illustrated with an example:hj&hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM<hj$hhubjv)}(hX8# mkdir functions/uvc.usb0/control/header/h # cd functions/uvc.usb0/control/ # ln -s header/h class/fs # ln -s header/h class/ss # mkdir -p functions/uvc.usb0/streaming/uncompressed/u/360p # cat < functions/uvc.usb0/streaming/uncompressed/u/360p/dwFrameInterval 666666 1000000 5000000 EOF # cd $GADGET_CONFIGFS_ROOT # mkdir functions/uvc.usb0/streaming/header/h # cd functions/uvc.usb0/streaming/header/h # ln -s ../../uncompressed/u # cd ../../class/fs # ln -s ../../header/h # cd ../../class/hs # ln -s ../../header/h # cd ../../class/ss # ln -s ../../header/hh]hX8# mkdir functions/uvc.usb0/control/header/h # cd functions/uvc.usb0/control/ # ln -s header/h class/fs # ln -s header/h class/ss # mkdir -p functions/uvc.usb0/streaming/uncompressed/u/360p # cat < functions/uvc.usb0/streaming/uncompressed/u/360p/dwFrameInterval 666666 1000000 5000000 EOF # cd $GADGET_CONFIGFS_ROOT # mkdir functions/uvc.usb0/streaming/header/h # cd functions/uvc.usb0/streaming/header/h # ln -s ../../uncompressed/u # cd ../../class/fs # ln -s ../../header/h # cd ../../class/hs # ln -s ../../header/h # cd ../../class/ss # ln -s ../../header/h}(hhhj 'ubah}(h]h ]h"]h$]h&]hhuh1juhhhM@hj$hhubeh}(h]id17ah ]h"]h$]$function-specific configfs interfaceah&]uh1hhj$hhhhhMjTKubh)}(hhh](h)}(hTesting the UVC functionh]hTesting the UVC function}(hj''hj%'hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj"'hhhhhMWubh)}(h(device: run the gadget, modprobe vivid::h]h'device: run the gadget, modprobe vivid:}(h'device: run the gadget, modprobe vivid:hj3'hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMYhj"'hhubjv)}(hN# uvc-gadget -u /dev/video -v /dev/videoh]hN# uvc-gadget -u /dev/video -v /dev/video}(hhhjB'ubah}(h]h ]h"]h$]h&]hhuh1juhhhM[hj"'hhubhdefinition_list)}(hhh]hdefinition_list_item)}(hMwhere uvc-gadget is this program: http://git.ideasonboard.org/uvc-gadget.git h](hterm)}(h!where uvc-gadget is this program:h]h!where uvc-gadget is this program:}(hj_'hj]'hhhNhNubah}(h]h ]h"]h$]h&]uh1j['hhhM^hjW'ubh definition)}(hhh]h)}(h*http://git.ideasonboard.org/uvc-gadget.gith]j)}(hjr'h]h*http://git.ideasonboard.org/uvc-gadget.git}(hhhjt'hhhNhNubah}(h]h ]h"]h$]h&]refurijr'uh1jhjp'ubah}(h]h ]h"]h$]h&]uh1hhhhM^hjm'ubah}(h]h ]h"]h$]h&]uh1jk'hjW'ubeh}(h]h ]h"]h$]h&]uh1jU'hhhM^hjR'ubah}(h]h ]h"]h$]h&]uh1jP'hj"'hhhhhNubh)}(hwith these patches:h]hwith these patches:}(hj'hj'hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM`hj"'hhubj)}(hhh]h)}(h4http://www.spinics.net/lists/linux-usb/msg99220.htmlh]j)}(hj'h]h4http://www.spinics.net/lists/linux-usb/msg99220.html}(hhhj'hhhNhNubah}(h]h ]h"]h$]h&]refurij'uh1jhj'ubah}(h]h ]h"]h$]h&]uh1hhhhMbhj'ubah}(h]h ]h"]h$]h&]uh1jhj"'hhhhhNubh)}(hhost::h]hhost:}(hhost:hj'hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMdhj"'hhubjv)}(hluvcview -f yuvh]hluvcview -f yuv}(hhhj'ubah}(h]h ]h"]h$]h&]hhuh1juhhhMfhj"'hhubeh}(h]testing-the-uvc-functionah ]h"]testing the uvc functionah$]h&]uh1hhj$hhhhhMWubeh}(h] uvc-functionah ]h"]18. uvc functionah$]h&]uh1hhhhhhhhMubh)}(hhh](h)}(h19. PRINTER functionh]h19. PRINTER function}(hj'hj'hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj'hhhhhMiubh)}(h4The function is provided by usb_f_printer.ko module.h]h4The function is provided by usb_f_printer.ko module.}(hj (hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMkhj'hhubh)}(hhh](h)}(h$Function-specific configfs interfaceh]h$Function-specific configfs interface}(hj(hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj(hhhhhMnubh)}(hThe function name to use when creating the function directory is "printer". The printer function provides these attributes in its function directory:h]hThe function name to use when creating the function directory is “printer”. The printer function provides these attributes in its function directory:}(hj((hj&(hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMphj(hhubj)}(hhh]j<)}(hhh]jA)}(hhh](jF)}(hhh]h}(h]h ]h"]h$]h&]colwidthK uh1jEhj:(ubjF)}(hhh]h}(h]h ]h"]h$]h&]colwidthK+uh1jEhj:(ubj\)}(hhh](ja)}(hhh](jf)}(hhh]h)}(h pnp_stringh]h pnp_string}(hj\(hjZ(hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMthjW(ubah}(h]h ]h"]h$]h&]uh1jehjT(ubjf)}(hhh]h)}(h+Data to be passed to the host in pnp stringh]h+Data to be passed to the host in pnp string}(hjs(hjq(hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMthjn(ubah}(h]h ]h"]h$]h&]uh1jehjT(ubeh}(h]h ]h"]h$]h&]uh1j`hjQ(ubja)}(hhh](jf)}(hhh]h)}(hq_lenh]hq_len}(hj(hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMuhj(ubah}(h]h ]h"]h$]h&]uh1jehj(ubjf)}(hhh]h)}(hNumber of requests per endpointh]hNumber of requests per endpoint}(hj(hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMuhj(ubah}(h]h ]h"]h$]h&]uh1jehj(ubeh}(h]h ]h"]h$]h&]uh1j`hjQ(ubeh}(h]h ]h"]h$]h&]uh1j[hj:(ubeh}(h]h ]h"]h$]h&]colsKuh1j@hj7(ubah}(h]h ]h"]h$]h&]uh1j;hj4(ubah}(h]h ]h"]h$]h&]uh1jhj(hhhhhNubeh}(h]id18ah ]h"]h$]$function-specific configfs interfaceah&]uh1hhj'hhhhhMnjTKubh)}(hhh](h)}(hTesting the PRINTER functionh]hTesting the PRINTER function}(hj(hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj(hhhhhMyubh)}(hThe most basic testing:h]hThe most basic testing:}(hj(hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM{hj(hhubh)}(hdevice: run the gadget::h]hdevice: run the gadget:}(hdevice: run the gadget:hj)hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM}hj(hhubjv)}(h,# ls -l /devices/virtual/usb_printer_gadget/h]h,# ls -l /devices/virtual/usb_printer_gadget/}(hhhj)ubah}(h]h ]h"]h$]h&]hhuh1juhhhMhj(hhubh)}(hshould show g_printer.h]hshould show g_printer.}(hj!)hj)hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj(hhubh)}(hKIf udev is active, then /dev/g_printer should appear automatically.h]hKIf udev is active, then /dev/g_printer should appear automatically.}(hj/)hj-)hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj(hhubh)}(hhost:h]hhost:}(hj=)hj;)hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj(hhubh)}(h8If udev is active, then e.g. /dev/usb/lp0 should appear.h]h8If udev is active, then e.g. /dev/usb/lp0 should appear.}(hjK)hjI)hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj(hhubh)}(hhost->device transmission:h]hhost->device transmission:}(hjY)hjW)hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj(hhubh)}(hdevice::h]hdevice:}(hdevice:hje)hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj(hhubjv)}(h# cat /dev/g_printerh]h# cat /dev/g_printer}(hhhjt)ubah}(h]h ]h"]h$]h&]hhuh1juhhhMhj(hhubh)}(hhost::h]hhost:}(hhost:hj)hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj(hhubjv)}(h# cat > /dev/usb/lp0h]h# cat > /dev/usb/lp0}(hhhj)ubah}(h]h ]h"]h$]h&]hhuh1juhhhMhj(hhubh)}(hdevice->host transmission::h]hdevice->host transmission:}(hdevice->host transmission:hj)hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj(hhubjv)}(h# cat > /dev/g_printerh]h# cat > /dev/g_printer}(hhhj)ubah}(h]h ]h"]h$]h&]hhuh1juhhhMhj(hhubh)}(hhost::h]hhost:}(hhost:hj)hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj(hhubjv)}(h# cat /dev/usb/lp0h]h# cat /dev/usb/lp0}(hhhj)ubah}(h]h ]h"]h$]h&]hhuh1juhhhMhj(hhubh)}(hiMore advanced testing can be done with the prn_example described in Documentation/usb/gadget_printer.rst.h]hiMore advanced testing can be done with the prn_example described in Documentation/usb/gadget_printer.rst.}(hj)hj)hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj(hhubeh}(h]testing-the-printer-functionah ]h"]testing the printer functionah$]h&]uh1hhj'hhhhhMyubeh}(h]printer-functionah ]h"]19. printer functionah$]h&]uh1hhhhhhhhMiubh)}(hhh](h)}(h820. UAC1 function (virtual ALSA card, using u_audio API)h]h820. UAC1 function (virtual ALSA card, using u_audio API)}(hj)hj)hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj)hhhhhMubh)}(hThe function is provided by usb_f_uac1.ko module. It will create a virtual ALSA card and the audio streams are simply sinked to and sourced from it.h]hThe function is provided by usb_f_uac1.ko module. It will create a virtual ALSA card and the audio streams are simply sinked to and sourced from it.}(hj *hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj)hhubh)}(hhh](h)}(h$Function-specific configfs interfaceh]h$Function-specific configfs interface}(hj*hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj*hhhhhMubh)}(hThe function name to use when creating the function directory is "uac1". The uac1 function provides these attributes in its function directory:h]hThe function name to use when creating the function directory is “uac1”. The uac1 function provides these attributes in its function directory:}(hj)*hj'*hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj*hhubj)}(hhh]j<)}(hhh]jA)}(hhh](jF)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1jEhj;*ubjF)}(hhh]h}(h]h ]h"]h$]h&]colwidthK5uh1jEhj;*ubj\)}(hhh](ja)}(hhh](jf)}(hhh]h)}(hc_chmaskh]hc_chmask}(hj]*hj[*hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjX*ubah}(h]h ]h"]h$]h&]uh1jehjU*ubjf)}(hhh]h)}(hcapture channel maskh]hcapture channel mask}(hjt*hjr*hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjo*ubah}(h]h ]h"]h$]h&]uh1jehjU*ubeh}(h]h ]h"]h$]h&]uh1j`hjR*ubja)}(hhh](jf)}(hhh]h)}(hc_srateh]hc_srate}(hj*hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj*ubah}(h]h ]h"]h$]h&]uh1jehj*ubjf)}(hhh]h)}(h0list of capture sampling rates (comma-separated)h]h0list of capture sampling rates (comma-separated)}(hj*hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj*ubah}(h]h ]h"]h$]h&]uh1jehj*ubeh}(h]h ]h"]h$]h&]uh1j`hjR*ubja)}(hhh](jf)}(hhh]h)}(hc_ssizeh]hc_ssize}(hj*hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj*ubah}(h]h ]h"]h$]h&]uh1jehj*ubjf)}(hhh]h)}(hcapture sample size (bytes)h]hcapture sample size (bytes)}(hj*hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj*ubah}(h]h ]h"]h$]h&]uh1jehj*ubeh}(h]h ]h"]h$]h&]uh1j`hjR*ubja)}(hhh](jf)}(hhh]h)}(hc_mute_presenth]hc_mute_present}(hj+hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj*ubah}(h]h ]h"]h$]h&]uh1jehj*ubjf)}(hhh]h)}(hcapture mute control enableh]hcapture mute control enable}(hj+hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj+ubah}(h]h ]h"]h$]h&]uh1jehj*ubeh}(h]h ]h"]h$]h&]uh1j`hjR*ubja)}(hhh](jf)}(hhh]h)}(hc_volume_presenth]hc_volume_present}(hj9+hj7+hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj4+ubah}(h]h ]h"]h$]h&]uh1jehj1+ubjf)}(hhh]h)}(hcapture volume control enableh]hcapture volume control enable}(hjP+hjN+hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjK+ubah}(h]h ]h"]h$]h&]uh1jehj1+ubeh}(h]h ]h"]h$]h&]uh1j`hjR*ubja)}(hhph](jf)}(hhh]h)}(h c_volume_minh]h c_volume_min}(hjp+hjn+hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjk+ubah}(h]h ]h"]h$]h&]uh1jehjh+ubjf)}(hhh]h)}(h.capture volume control min value (in 1/256 dB)h]h.capture volume control min value (in 1/256 dB)}(hj+hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj+ubah}(h]h ]h"]h$]h&]uh1jehjh+ubeh}(h]h ]h"]h$]h&]uh1j`hjR*ubja)}(hhh](jf)}(hhh]h)}(h c_volume_maxh]h c_volume_max}(hj+hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj+ubah}(h]h ]h"]h$]h&]uh1jehj+ubjf)}(hhh]h)}(h.capture volume control max value (in 1/256 dB)h]h.capture volume control max value (in 1/256 dB)}(hj+hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj+ubah}(h]h ]h"]h$]h&]uh1jehj+ubeh}(h]h ]h"]h$]h&]uh1j`hjR*ubja)}(hhh](jf)}(hhh]h)}(h c_volume_resh]h c_volume_res}(hj+hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj+ubah}(h]h ]h"]h$]h&]uh1jehj+ubjf)}(hhh]h)}(h/capture volume control resolution (in 1/256 dB)h]h/capture volume control resolution (in 1/256 dB)}(hj+hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj+ubah}(h]h ]h"]h$]h&]uh1jehj+ubeh}(h]h ]h"]h$]h&]uh1j`hjR*ubja)}(hhh](jf)}(hhh]h)}(hp_chmaskh]hp_chmask}(hj,hj,hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj,ubah}(h]h ]h"]h$]h&]uh1jehj ,ubjf)}(hhh]h)}(hplayback channel maskh]hplayback channel mask}(hj,,hj*,hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj',ubah}(h]h ]h"]h$]h&]uh1jehj ,ubeh}(h]h ]h"]h$]h&]uh1j`hjR*ubja)}(hhh](jf)}(hhh]h)}(hp_srateh]hp_srate}(hjL,hjJ,hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjG,ubah}(h]h ]h"]h$]h&]uh1jehjD,ubjf)}(hhh]h)}(h1list of playback sampling rates (comma-separated)h]h1list of playback sampling rates (comma-separated)}(hjc,hja,hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj^,ubah}(h]h ]h"]h$]h&]uh1jehjD,ubeh}(h]h ]h"]h$]h&]uh1j`hjR*ubja)}(hhh](jf)}(hhh]h)}(hp_ssizeh]hp_ssize}(hj,hj,hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj~,ubah}(h]h ]h"]h$]h&]uh1jehj{,ubjf)}(hhh]h)}(hplayback sample size (bytes)h]hplayback sample size (bytes)}(hj,hj,hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj,ubah}(h]h ]h"]h$]h&]uh1jehj{,ubeh}(h]h ]h"]h$]h&]uh1j`hjR*ubja)}(hhh](jf)}(hhh]h)}(hp_mute_presenth]hp_mute_present}(hj,hj,hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj,ubah}(h]h ]h"]h$]h&]uh1jehj,ubjf)}(hhh]h)}(hplayback mute control enableh]hplayback mute control enable}(hj,hj,hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj,ubah}(h]h ]h"]h$]h&]uh1jehj,ubeh}(h]h ]h"]h$]h&]uh1j`hjR*ubja)}(hhh](jf)}(hhh]h)}(hp_volume_presenth]hp_volume_present}(hj,hj,hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj,ubah}(h]h ]h"]h$]h&]uh1jehj,ubjf)}(hhh]h)}(hplayback volume control enableh]hplayback volume control enable}(hj-hj-hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj-ubah}(h]h ]h"]h$]h&]uh1jehj,ubeh}(h]h ]h"]h$]h&]uh1j`hjR*ubja)}(hhh](jf)}(hhh]h)}(h p_volume_minh]h p_volume_min}(hj(-hj&-hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj#-ubah}(h]h ]h"]h$]h&]uh1jehj -ubjf)}(hhh]h)}(h/playback volume control min value (in 1/256 dB)h]h/playback volume control min value (in 1/256 dB)}(hj?-hj=-hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj:-ubah}(h]h ]h"]h$]h&]uh1jehj -ubeh}(h]h ]h"]h$]h&]uh1j`hjR*ubja)}(hhh](jf)}(hhh]h)}(h p_volume_maxh]h p_volume_max}(hj_-hj]-hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjZ-ubah}(h]h ]h"]h$]h&]uh1jehjW-ubjf)}(hhh]h)}(h/playback volume control max value (in 1/256 dB)h]h/playback volume control max value (in 1/256 dB)}(hjv-hjt-hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjq-ubah}(h]h ]h"]h$]h&]uh1jehjW-ubeh}(h]h ]h"]h$]h&]uh1j`hjR*ubja)}(hhh](jf)}(hhh]h)}(h p_volume_resh]h p_volume_res}(hj-hj-hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj-ubah}(h]h ]h"]h$]h&]uh1jehj-ubjf)}(hhh]h)}(h0playback volume control resolution (in 1/256 dB)h]h0playback volume control resolution (in 1/256 dB)}(hj-hj-hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj-ubah}(h]h ]h"]h$]h&]uh1jehj-ubeh}(h]h ]h"]h$]h&]uh1j`hjR*ubja)}(hhh](jf)}(hhh]h)}(h req_numberh]h req_number}(hj-hj-hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj-ubah}(h]h ]h"]h$]h&]uh1jehj-ubjf)}(hhh]h)}(hBthe number of pre-allocated requests for both capture and playbackh]hBthe number of pre-allocated requests for both capture and playback}(hj-hj-hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj-ubah}(h]h ]h"]h$]h&]uh1jehj-ubeh}(h]h ]h"]h$]h&]uh1j`hjR*ubja)}(hhh](jf)}(hhh]h)}(h function_nameh]h function_name}(hj.hj.hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj-ubah}(h]h ]h"]h$]h&]uh1jehj-ubjf)}(hhh]h)}(hname of the interfaceh]hname of the interface}(hj.hj.hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj.ubah}(h]h ]h"]h$]h&]uh1jehj-ubeh}(h]h ]h"]h$]h&]uh1j`hjR*ubeh}(h]h ]h"]h$]h&]uh1j[hj;*ubeh}(h]h ]h"]h$]h&]colsKuh1j@hj8*ubah}(h]h ]h"]h$]h&]uh1j;hj5*ubah}(h]h ]h"]h$]h&]uh1jhj*hhhhhNubh)}(h(The attributes have sane default values.h]h(The attributes have sane default values.}(hjN.hjL.hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj*hhubeh}(h]id19ah ]h"]h$]$function-specific configfs interfaceah&]uh1hhj)hhhhhMjTKubh)}(hhh](h)}(hTesting the UAC1 functionh]hTesting the UAC1 function}(hjg.hje.hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjb.hhhhhMubh)}(hHdevice: run the gadget host: aplay -l # should list our USB Audio Gadgeth]hHdevice: run the gadget host: aplay -l # should list our USB Audio Gadget}(hju.hjs.hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjb.hhubh)}(hThis function does not require real hardware support, it just sends a stream of audio data to/from the host. In order to actually hear something at the device side, a command similar to this must be used at the device side::h]hThis function does not require real hardware support, it just sends a stream of audio data to/from the host. In order to actually hear something at the device side, a command similar to this must be used at the device side:}(hThis function does not require real hardware support, it just sends a stream of audio data to/from the host. In order to actually hear something at the device side, a command similar to this must be used at the device side:hj.hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjb.hhubjv)}(h5$ arecord -f dat -t wav -D hw:2,0 | aplay -D hw:0,0 &h]h5$ arecord -f dat -t wav -D hw:2,0 | aplay -D hw:0,0 &}(hhhj.ubah}(h]h ]h"]h$]h&]hhuh1juhhhMhjb.hhubh)}(he.g.::h]he.g.:}(he.g.:hj.hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjb.hhubjv)}(hX$ arecord -f dat -t wav -D hw:CARD=UAC1Gadget,DEV=0 | \ aplay -D default:CARD=OdroidU3h]hX$ arecord -f dat -t wav -D hw:CARD=UAC1Gadget,DEV=0 | \ aplay -D default:CARD=OdroidU3}(hhhj.ubah}(h]h ]h"]h$]h&]hhuh1juhhhMhjb.hhubeh}(h]id20ah ]h"]h$]j_ah&]uh1hhj)hhhhhMjTKubeh}(h]1uac1-function-virtual-alsa-card-using-u-audio-apiah ]h"]820. uac1 function (virtual alsa card, using u_audio api)ah$]h&]uh1hhhhhhhhMubh)}(hhh](h)}(h21. MIDI2 functionh]h21. MIDI2 function}(hj.hj.hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj.hhhhhMubh)}(hXThe function is provided by usb_f_midi2.ko module. It will create a virtual ALSA card containing a UMP rawmidi device where the UMP packet is looped back. In addition, a legacy rawmidi device is created. The UMP rawmidi is bound with ALSA sequencer clients, too.h]hXThe function is provided by usb_f_midi2.ko module. It will create a virtual ALSA card containing a UMP rawmidi device where the UMP packet is looped back. In addition, a legacy rawmidi device is created. The UMP rawmidi is bound with ALSA sequencer clients, too.}(hj.hj.hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj.hhubh)}(hhh](h)}(h$Function-specific configfs interfaceh]h$Function-specific configfs interface}(hj.hj.hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj.hhhhhMubh)}(hThe function name to use when creating the function directory is "midi2". The midi2 function provides these attributes in its function directory as the card top-level information:h]hThe function name to use when creating the function directory is “midi2”. The midi2 function provides these attributes in its function directory as the card top-level information:}(hj.hj.hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj.hhubj)}(hhh]j<)}(hhh]jA)}(hhh](jF)}(hhh]h}(h]h ]h"]h$]h&]colwidthK uh1jEhj/ubjF)}(hhh]h}(h]h ]h"]h$]h&]colwidthK1uh1jEhj/ubj\)}(hhh](ja)}(hhh](jf)}(hhh]h)}(h process_umph]h process_ump}(hj0/hj./hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj+/ubah}(h]h ]h"]h$]h&]uh1jehj(/ubjf)}(hhh]h)}(h1Bool flag to process UMP Stream messages (0 or 1)h]h1Bool flag to process UMP Stream messages (0 or 1)}(hjG/hjE/hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjB/ubah}(h]h ]h"]h$]h&]uh1jehj(/ubeh}(h]h ]h"]h$]h&]uh1j`hj%/ubja)}(hhh](jf)}(hhh]h)}(h static_blockh]h static_block}(hjg/hje/hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjb/ubah}(h]h ]h"]h$]h&]uh1jehj_/ubjf)}(hhh]h)}(h$Bool flag for static blocks (0 or 1)h]h$Bool flag for static blocks (0 or 1)}(hj~/hj|/hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjy/ubah}(h]h ]h"]h$]h&]uh1jehj_/ubeh}(h]h ]h"]h$]h&]uh1j`hj%/ubja)}(hhh](jf)}(hhh]h)}(h iface_nameh]h iface_name}(hj/hj/hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj/ubah}(h]h ]h"]h$]h&]uh1jehj/ubjf)}(hhh]h)}(hOptional interface name stringh]hOptional interface name string}(hj/hj/hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj/ubah}(h]h ]h"]h$]h&]uh1jehj/ubeh}(h]h ]h"]h$]h&]uh1j`hj%/ubeh}(h]h ]h"]h$]h&]uh1j[hj/ubeh}(h]h ]h"]h$]h&]colsKuh1j@hj /ubah}(h]h ]h"]h$]h&]uh1j;hj/ubah}(h]h ]h"]h$]h&]uh1jhj.hhhhhNubh)}(hThe directory contains a subdirectory "ep.0", and this provides the attributes for a UMP Endpoint (which is a pair of USB MIDI Endpoints):h]hThe directory contains a subdirectory “ep.0”, and this provides the attributes for a UMP Endpoint (which is a pair of USB MIDI Endpoints):}(hj/hj/hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj.hhubj)}(hhh]j<)}(hhh]jA)}(hhh](jF)}(hhh]h}(h]h ]h"]h$]h&]colwidthK uh1jEhj/ubjF)}(hhh]h}(h]h ]h"]h$]h&]colwidthK1uh1jEhj/ubj\)}(hhh](ja)}(hhh](jf)}(hhh]h)}(h protocol_capsh]h protocol_caps}(hj0hj0hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj0ubah}(h]h ]h"]h$]h&]uh1jehj0ubjf)}(hhh]h)}(hJMIDI protocol capabilities; 1: MIDI 1.0, 2: MIDI 2.0, or 3: both protocolsh]hJMIDI protocol capabilities; 1: MIDI 1.0, 2: MIDI 2.0, or 3: both protocols}(hj30hj10hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj.0ubah}(h]h ]h"]h$]h&]uh1jehj0ubeh}(h]h ]h"]h$]h&]uh1j`hj0ubja)}(hhh](jf)}(hhh]h)}(hprotocolh]hprotocol}(hjS0hjQ0hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjN0ubah}(h]h ]h"]h$]h&]uh1jehjK0ubjf)}(hhh]h)}(h%Default MIDI protocol (either 1 or 2)h]h%Default MIDI protocol (either 1 or 2)}(hjj0hjh0hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhje0ubah}(h]h ]h"]h$]h&]uh1jehjK0ubeh}(h]h ]h"]h$]h&]uh1j`hj0ubja)}(hhh](jf)}(hhh]h)}(hep_nameh]hep_name}(hj0hj0hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj0ubah}(h]h ]h"]h$]h&]uh1jehj0ubjf)}(hhh]h)}(hUMP Endpoint name stringh]hUMP Endpoint name string}(hj0hj0hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj0ubah}(h]h ]h"]h$]h&]uh1jehj0ubeh}(h]h ]h"]h$]h&]uh1j`hj0ubja)}(hhh](jf)}(hhh]h)}(h product_idh]h product_id}(hj0hj0hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj0ubah}(h]h ]h"]h$]h&]uh1jehj0ubjf)}(hhh]h)}(hProduct ID stringh]hProduct ID string}(hj0hj0hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj0ubah}(h]h ]h"]h$]h&]uh1jehj0ubeh}(h]h ]h"]h$]h&]uh1j`hj0ubja)}(hhh](jf)}(hhh]h)}(h manufacturerh]h manufacturer}(hj0hj0hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj0ubah}(h]h ]h"]h$]h&]uh1jehj0ubjf)}(hhh]h)}(hManufacture ID number (24 bit)h]hManufacture ID number (24 bit)}(hj1hj 1hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj 1ubah}(h]h ]h"]h$]h&]uh1jehj0ubeh}(h]h ]h"]h$]h&]uh1j`hj0ubja)}(hhh](jf)}(hhh]h)}(hfamilyh]hfamily}(hj/1hj-1hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj*1ubah}(h]h ]h"]h$]h&]uh1jehj'1ubjf)}(hhh]h)}(h Device family ID number (16 bit)h]h Device family ID number (16 bit)}(hjF1hjD1hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjA1ubah}(h]h ]h"]h$]h&]uh1jehj'1ubeh}(h]h ]h"]h$]h&]uh1j`hj0ubja)}(hhh](jf)}(hhh]h)}(hmodelh]hmodel}(hjf1hjd1hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhja1ubah}(h]h ]h"]h$]h&]uh1jehj^1ubjf)}(hhh]h)}(hDevice model ID number (16 bit)h]hDevice model ID number (16 bit)}(hj}1hj{1hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjx1ubah}(h]h ]h"]h$]h&]uh1jehj^1ubeh}(h]h ]h"]h$]h&]uh1j`hj0ubja)}(hhh](jf)}(hhh]h)}(h sw_revisionh]h sw_revision}(hj1hj1hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj1ubah}(h]h ]h"]h$]h&]uh1jehj1ubjf)}(hhh]h)}(hSoftware revision (32 bit)h]hSoftware revision (32 bit)}(hj1hj1hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj1ubah}(h]h ]h"]h$]h&]uh1jehj1ubeh}(h]h ]h"]h$]h&]uh1j`hj0ubeh}(h]h ]h"]h$]h&]uh1j[hj/ubeh}(h]h ]h"]h$]h&]colsKuh1j@hj/ubah}(h]h ]h"]h$]h&]uh1j;hj/ubah}(h]h ]h"]h$]h&]uh1jhj.hhhhhNubh)}(hEach Endpoint subdirectory contains a subdirectory "block.0", which represents the Function Block for Block 0 information. Its attributes are:h]hEach Endpoint subdirectory contains a subdirectory “block.0”, which represents the Function Block for Block 0 information. Its attributes are:}(hj1hj1hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj.hhubj)}(hhh]j<)}(hhh]jA)}(hhh](jF)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1jEhj1ubjF)}(hhh]h}(h]h ]h"]h$]h&]colwidthK/uh1jEhj1ubj\)}(hhh](ja)}(hhh](jf)}(hhh]h)}(hnameh]hname}(hj2hj2hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj2ubah}(h]h ]h"]h$]h&]uh1jehj2ubjf)}(hhh]h)}(hFunction Block name stringh]hFunction Block name string}(hj22hj02hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj-2ubah}(h]h ]h"]h$]h&]uh1jehj2ubeh}(h]h ]h"]h$]h&]uh1j`hj2ubja)}(hhh](jf)}(hhh]h)}(h directionh]h direction}(hjR2hjP2hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjM2ubah}(h]h ]h"]h$]h&]uh1jehjJ2ubjf)}(hhh]h)}(h=Direction of this FB 1: input, 2: output, or 3: bidirectionalh]h=Direction of this FB 1: input, 2: output, or 3: bidirectional}(hji2hjg2hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjd2ubah}(h]h ]h"]h$]h&]uh1jehjJ2ubeh}(h]h ]h"]h$]h&]uh1j`hj2ubja)}(hhh](jf)}(hhh]h)}(h first_grouph]h first_group}(hj2hj2hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj2ubah}(h]h ]h"]h$]h&]uh1jehj2ubjf)}(hhh]h)}(h!The first UMP Group number (0-15)h]h!The first UMP Group number (0-15)}(hj2hj2hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj2ubah}(h]h ]h"]h$]h&]uh1jehj2ubeh}(h]h ]h"]h$]h&]uh1j`hj2ubja)}(hhh](jf)}(hhh]h)}(h num_groupsh]h num_groups}(hj2hj2hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj2ubah}(h]h ]h"]h$]h&]uh1jehj2ubjf)}(hhh]h)}(h&The number of groups in this FB (1-16)h]h&The number of groups in this FB (1-16)}(hj2hj2hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj2ubah}(h]h ]h"]h$]h&]uh1jehj2ubeh}(h]h ]h"]h$]h&]uh1j`hj2ubja)}(hhh](jf)}(hhh]h)}(hmidi1_first_grouph]hmidi1_first_group}(hj2hj2hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj2ubah}(h]h ]h"]h$]h&]uh1jehj2ubjf)}(hhh]h)}(h.The first UMP Group number for MIDI 1.0 (0-15)h]h.The first UMP Group number for MIDI 1.0 (0-15)}(hj3hj 3hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj 3ubah}(h]h ]h"]h$]h&]uh1jehj2ubeh}(h]h ]h"]h$]h&]uh1j`hj2ubja)}(hhh](jf)}(hhh]h)}(hmidi1_num_groupsh]hmidi1_num_groups}(hj.3hj,3hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj)3ubah}(h]h ]h"]h$]h&]uh1jehj&3ubjf)}(hhh]h)}(h(The number of groups for MIDI 1.0 (0-16)h]h(The number of groups for MIDI 1.0 (0-16)}(hjE3hjC3hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj@3ubah}(h]h ]h"]h$]h&]uh1jehj&3ubeh}(h]h ]h"]h$]h&]uh1j`hj2ubja)}(hhh](jf)}(hhh]h)}(hui_hinth]hui_hint}(hje3hjc3hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj`3ubah}(h]h ]h"]h$]h&]uh1jehj]3ubjf)}(hhh]h)}(h>UI-hint of this FB 0: unknown, 1: receiver, 2: sender, 3: bothh]h>UI-hint of this FB 0: unknown, 1: receiver, 2: sender, 3: both}(hj|3hjz3hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjw3ubah}(h]h ]h"]h$]h&]uh1jehj]3ubeh}(h]h ]h"]h$]h&]uh1j`hj2ubja)}(hhh](jf)}(hhh]h)}(hmidi_ci_verisonh]hmidi_ci_verison}(hj3hj3hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hj3ubah}(h]h ]h"]h$]h&]uh1jehj3ubjf)}(hhh]h)}(h(Supported MIDI-CI version number (8 bit)h]h(Supported MIDI-CI version number (8 bit)}(hj3hj3hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hj3ubah}(h]h ]h"]h$]h&]uh1jehj3ubeh}(h]h ]h"]h$]h&]uh1j`hj2ubja)}(hhh](jf)}(hhh]h)}(his_midi1h]his_midi1}(hj3hj3hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hj3ubah}(h]h ]h"]h$]h&]uh1jehj3ubjf)}(hhh]h)}(hoLegacy MIDI 1.0 device (0-2) 0: MIDI 2.0 device, 1: MIDI 1.0 without restriction, or 2: MIDI 1.0 with low speedh]hoLegacy MIDI 1.0 device (0-2) 0: MIDI 2.0 device, 1: MIDI 1.0 without restriction, or 2: MIDI 1.0 with low speed}(hj3hj3hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hj3ubah}(h]h ]h"]h$]h&]uh1jehj3ubeh}(h]h ]h"]h$]h&]uh1j`hj2ubja)}(hhh](jf)}(hhh]h)}(hsysex8_streamsh]hsysex8_streams}(hj 4hj4hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj4ubah}(h]h ]h"]h$]h&]uh1jehj4ubjf)}(hhh]h)}(h$Max number of SysEx8 streams (8 bit)h]h$Max number of SysEx8 streams (8 bit)}(hj!4hj4hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj4ubah}(h]h ]h"]h$]h&]uh1jehj4ubeh}(h]h ]h"]h$]h&]uh1j`hj2ubja)}(hhh](jf)}(hhh]h)}(hactiveh]hactive}(hjA4hj?4hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj<4ubah}(h]h ]h"]h$]h&]uh1jehj94ubjf)}(hhh]h)}(h"Bool flag for FB activity (0 or 1)h]h"Bool flag for FB activity (0 or 1)}(hjX4hjV4hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjS4ubah}(h]h ]h"]h$]h&]uh1jehj94ubeh}(h]h ]h"]h$]h&]uh1j`hj2ubeh}(h]h ]h"]h$]h&]uh1j[hj1ubeh}(h]h ]h"]h$]h&]colsKuh1j@hj1ubah}(h]h ]h"]h$]h&]uh1j;hj1ubah}(h]h ]h"]h$]h&]uh1jhj.hhhhhNubh)}(hXIf multiple Function Blocks are required, you can add more Function Blocks by creating subdirectories "block." with the corresponding Function Block number (1, 2, ....). The FB subdirectories can be dynamically removed, too. Note that the Function Block numbers must be continuous.h]hX"If multiple Function Blocks are required, you can add more Function Blocks by creating subdirectories “block.” with the corresponding Function Block number (1, 2, ....). The FB subdirectories can be dynamically removed, too. Note that the Function Block numbers must be continuous.}(hj4hj4hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj.hhubh)}(hSimilarly, if you multiple UMP Endpoints are required, you can add more Endpoints by creating subdirectories "ep.". The number must be continuous.h]hSimilarly, if you multiple UMP Endpoints are required, you can add more Endpoints by creating subdirectories “ep.”. The number must be continuous.}(hj4hj4hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj.hhubh)}(hFor emulating the old MIDI 2.0 device without UMP v1.1 support, pass 0 to `process_ump` flag. Then the whole UMP v1.1 requests are ignored.h](hJFor emulating the old MIDI 2.0 device without UMP v1.1 support, pass 0 to }(hJFor emulating the old MIDI 2.0 device without UMP v1.1 support, pass 0 to hj4hhhNhNubhtitle_reference)}(h `process_ump`h]h process_ump}(hhhj4hhhNhNubah}(h]h ]h"]h$]h&]uh1j4hj4ubh4 flag. Then the whole UMP v1.1 requests are ignored.}(h4 flag. Then the whole UMP v1.1 requests are ignored.hj4hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj.hhubeh}(h]id21ah ]h"]h$]$function-specific configfs interfaceah&]uh1hhj.hhhhhMjTKubh)}(hhh](h)}(hTesting the MIDI2 functionh]hTesting the MIDI2 function}(hj4hj4hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj4hhhhhM!ubh)}(h,On the device: run the gadget, and running::h]h+On the device: run the gadget, and running:}(h+On the device: run the gadget, and running:hj4hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM#hj4hhubjv)}(h$ cat /proc/asound/cardsh]h$ cat /proc/asound/cards}(hhhj4ubah}(h]h ]h"]h$]h&]hhuh1juhhhM%hj4hhubh)}(h5will show a new sound card containing a MIDI2 device.h]h5will show a new sound card containing a MIDI2 device.}(hj5hj4hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM'hj4hhubh)}(hOTOH, on the host::h]hOTOH, on the host:}(hOTOH, on the host:hj 5hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM)hj4hhubjv)}(h$ cat /proc/asound/cardsh]h$ cat /proc/asound/cards}(hhhj5ubah}(h]h ]h"]h$]h&]hhuh1juhhhM+hj4hhubh)}(htwill show a new sound card containing either MIDI1 or MIDI2 device, depending on the USB audio driver configuration.h]htwill show a new sound card containing either MIDI1 or MIDI2 device, depending on the USB audio driver configuration.}(hj,5hj*5hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM-hj4hhubh)}(hpOn both, when ALSA sequencer is enabled on the host, you can find the UMP MIDI client such as "MIDI 2.0 Gadget".h]htOn both, when ALSA sequencer is enabled on the host, you can find the UMP MIDI client such as “MIDI 2.0 Gadget”.}(hj:5hj85hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM0hj4hhubh)}(h^As the driver simply loops back the data, there is no need for a real device just for testing.h]h^As the driver simply loops back the data, there is no need for a real device just for testing.}(hjH5hjF5hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM3hj4hhubh)}(hFor testing a MIDI input from the gadget to the host (e.g. emulating a MIDI keyboard), you can send a MIDI stream like the following.h]hFor testing a MIDI input from the gadget to the host (e.g. emulating a MIDI keyboard), you can send a MIDI stream like the following.}(hjV5hjT5hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM6hj4hhubh)}(hOn the gadget::h]hOn the gadget:}(hOn the gadget:hjb5hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM9hj4hhubjv)}(h$ aconnect -o .... client 20: 'MIDI 2.0 Gadget' [type=kernel,card=1] 0 'MIDI 2.0 ' 1 'Group 1 (MIDI 2.0 Gadget I/O)' $ aplaymidi -p 20:1 to_host.midh]h$ aconnect -o .... client 20: 'MIDI 2.0 Gadget' [type=kernel,card=1] 0 'MIDI 2.0 ' 1 'Group 1 (MIDI 2.0 Gadget I/O)' $ aplaymidi -p 20:1 to_host.mid}(hhhjq5ubah}(h]h ]h"]h$]h&]hhuh1juhhhM;hj4hhubh)}(h On the host::h]h On the host:}(h On the host:hj5hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMBhj4hhubjv)}(h$ aconnect -i .... client 24: 'MIDI 2.0 Gadget' [type=kernel,card=2] 0 'MIDI 2.0 ' 1 'Group 1 (MIDI 2.0 Gadget I/O)' $ arecordmidi -p 24:1 from_gadget.midh]h$ aconnect -i .... client 24: 'MIDI 2.0 Gadget' [type=kernel,card=2] 0 'MIDI 2.0 ' 1 'Group 1 (MIDI 2.0 Gadget I/O)' $ arecordmidi -p 24:1 from_gadget.mid}(hhhj5ubah}(h]h ]h"]h$]h&]hhuh1juhhhMDhj4hhubh)}(hIf you have a UMP-capable application, you can use the UMP port to send/receive the raw UMP packets, too. For example, aseqdump program with UMP support can receive from UMP port. On the host::h]hIf you have a UMP-capable application, you can use the UMP port to send/receive the raw UMP packets, too. For example, aseqdump program with UMP support can receive from UMP port. On the host:}(hIf you have a UMP-capable application, you can use the UMP port to send/receive the raw UMP packets, too. For example, aseqdump program with UMP support can receive from UMP port. On the host:hj5hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMKhj4hhubjv)}(h$ aseqdump -u 2 -p 24:1 Waiting for data. Press Ctrl+C to end. Source Group Event Ch Data 24:1 Group 0, Program change 0, program 0, Bank select 0:0 24:1 Group 0, Channel pressure 0, value 0x80000000h]h$ aseqdump -u 2 -p 24:1 Waiting for data. Press Ctrl+C to end. Source Group Event Ch Data 24:1 Group 0, Program change 0, program 0, Bank select 0:0 24:1 Group 0, Channel pressure 0, value 0x80000000}(hhhj5ubah}(h]h ]h"]h$]h&]hhuh1juhhhMOhj4hhubh)}(hqFor testing a MIDI output to the gadget to the host (e.g. emulating a MIDI synth), it'll be just other way round.h]hsFor testing a MIDI output to the gadget to the host (e.g. emulating a MIDI synth), it’ll be just other way round.}(hj5hj5hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMUhj4hhubh)}(hOn the gadget::h]hOn the gadget:}(hOn the gadget:hj5hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMXhj4hhubjv)}(h#$ arecordmidi -p 20:1 from_host.midh]h#$ arecordmidi -p 20:1 from_host.mid}(hhhj5ubah}(h]h ]h"]h$]h&]hhuh1juhhhMZhj4hhubh)}(h On the host::h]h On the host:}(h On the host:hj5hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM\hj4hhubjv)}(h!$ aplaymidi -p 24:1 to_gadget.midh]h!$ aplaymidi -p 24:1 to_gadget.mid}(hhhj5ubah}(h]h ]h"]h$]h&]hhuh1juhhhM^hj4hhubh)}(hThe access to MIDI 1.0 on altset 0 on the host is supported, and it's translated from/to UMP packets on the gadget. It's bound to only Function Block 0.h]hThe access to MIDI 1.0 on altset 0 on the host is supported, and it’s translated from/to UMP packets on the gadget. It’s bound to only Function Block 0.}(hj6hj6hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM`hj4hhubh)}(h}The current operation mode can be observed in ALSA control element "Operation Mode" for SND_CTL_IFACE_RAWMIDI. For example::h]hThe current operation mode can be observed in ALSA control element “Operation Mode” for SND_CTL_IFACE_RAWMIDI. For example:}(h|The current operation mode can be observed in ALSA control element "Operation Mode" for SND_CTL_IFACE_RAWMIDI. For example:hj6hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMdhj4hhubjv)}(h$ amixer -c1 contents numid=1,iface=RAWMIDI,name='Operation Mode' ; type=INTEGER,access=r--v----,values=1,min=0,max=2,step=0 : values=2h]h$ amixer -c1 contents numid=1,iface=RAWMIDI,name='Operation Mode' ; type=INTEGER,access=r--v----,values=1,min=0,max=2,step=0 : values=2}(hhhj6ubah}(h]h ]h"]h$]h&]hhuh1juhhhMghj4hhubh)}(h}where 0 = unused, 1 = MIDI 1.0 (altset 0), 2 = MIDI 2.0 (altset 1). The example above shows it's running in 2, i.e. MIDI 2.0.h]hwhere 0 = unused, 1 = MIDI 1.0 (altset 0), 2 = MIDI 2.0 (altset 1). The example above shows it’s running in 2, i.e. MIDI 2.0.}(hj.6hj,6hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMlhj4hhubeh}(h]testing-the-midi2-functionah ]h"]testing the midi2 functionah$]h&]uh1hhj.hhhhhM!ubeh}(h]midi2-functionah ]h"]21. midi2 functionah$]h&]uh1hhhhhhhhMubeh}(h]gadget-testingah ]h"]gadget testingah$]h&]uh1hhhhhhhhKubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksjefootnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerjt6error_encodingUTF-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourceh _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confapep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacefile_insertion_enabled raw_enabledKline_length_limitM'syntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_link embed_imagesenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}refids}nameids}(jO6jL6jj$function-specific configfs interfaceNjjjjjjjjjjjxjujpjmj<j9j4j1j j j j j j j j jjjjjjjjjjjjjjjjjjjjjjjjjjjjjCj@j;j8jfjctesting the uac1 functionNj$j$j|$jy$j'j'j'j'j)j)j)j)j.j.jG6jD6j?6j<6u nametypes}(jO6NjNj6NjNjNjNjNjNjxNjpNj<Nj4Nj Nj Nj Nj NjNjNjNjNjNjNjNjNjNjNjNjNjNjNjCNj;NjfNj6Nj$Nj|$Nj'Nj'Nj)Nj)Nj.NjG6Nj?6Nuh}(jL6hjhjNhjjUjjjijjjnjjj:jjj@jujj jjmjj9j{jjj1jj j?j j^j j j j j~ j j j jj jrj jjxjjjjjjjpjjj[jjjajjj=jjjCjjjjjjjjj*jjj0jjj jjjj@jjjj8j jcjFjjej[jj$jij$jjy$j$j'j$j'j$j'j"'j)j'j(j(j)j(j.j)j\.j*j.jb.jD6j.j4j.j<6j4u footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}j6KsRparse_messages](hsystem_message)}(hhh]h)}(hGDuplicate implicit target name: "function-specific configfs interface".h]hKDuplicate implicit target name: “function-specific configfs interface”.}(hhhj6hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj6ubah}(h]h ]h"]h$]h&]jialevelKtypeINFOsourcehlineKNuh1j6hjhhhhhKNubj6)}(hhh]h)}(hGDuplicate implicit target name: "function-specific configfs interface".h]hKDuplicate implicit target name: “function-specific configfs interface”.}(hhhj6hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj6ubah}(h]h ]h"]h$]h&]j:alevelKtypej6sourcehlineKvuh1j6hjhhhhhKvubj6)}(hhh]h)}(hGDuplicate implicit target name: "function-specific configfs interface".h]hKDuplicate implicit target name: “function-specific configfs interface”.}(hhhj7hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj7ubah}(h]h ]h"]h$]h&]j alevelKtypej6sourcehlineKuh1j6hjhhhhhKubj6)}(hhh]h)}(hGDuplicate implicit target name: "function-specific configfs interface".h]hKDuplicate implicit target name: “function-specific configfs interface”.}(hhhj07hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj-7ubah}(h]h ]h"]h$]h&]jalevelKtypej6sourcehlineKuh1j6hjhhhhhKubj6)}(hhh]h)}(hGDuplicate implicit target name: "function-specific configfs interface".h]hKDuplicate implicit target name: “function-specific configfs interface”.}(hhhjK7hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjH7ubah}(h]h ]h"]h$]h&]j alevelKtypej6sourcehlineKuh1j6hj^hhhhhKubj6)}(hhh]h)}(hGDuplicate implicit target name: "function-specific configfs interface".h]hKDuplicate implicit target name: “function-specific configfs interface”.}(hhhjf7hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjc7ubah}(h]h ]h"]h$]h&]j~ alevelKtypej6sourcehlineMuh1j6hj hhhhhMubj6)}(hhh]h)}(hGDuplicate implicit target name: "function-specific configfs interface".h]hKDuplicate implicit target name: “function-specific configfs interface”.}(hhhj7hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj~7ubah}(h]h ]h"]h$]h&]jralevelKtypej6sourcehlineM/uh1j6hj hhhhhM/ubj6)}(hhh]h)}(hGDuplicate implicit target name: "function-specific configfs interface".h]hKDuplicate implicit target name: “function-specific configfs interface”.}(hhhj7hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj7ubah}(h]h ]h"]h$]h&]jjalevelKtypej6sourcehlineMnuh1j6hjhhhhhMnubj6)}(hhh]h)}(h:Enumerated list start value not ordinal-1: "2" (ordinal 2)h]h>Enumerated list start value not ordinal-1: “2” (ordinal 2)}(hhhj7hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj7ubah}(h]h ]h"]h$]h&]levelKtypej6sourcehlineKuh1j6hjphhhhhMubj6)}(hhh]h)}(hGDuplicate implicit target name: "function-specific configfs interface".h]hKDuplicate implicit target name: “function-specific configfs interface”.}(hhhj7hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj7ubah}(h]h ]h"]h$]h&]j[alevelKtypej6sourcehlineMuh1j6hjhhhhhMubj6)}(hhh]h)}(hGDuplicate implicit target name: "function-specific configfs interface".h]hKDuplicate implicit target name: “function-specific configfs interface”.}(hhhj7hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj7ubah}(h]h ]h"]h$]h&]j=alevelKtypej6sourcehlineMuh1j6hjhhhhhMubj6)}(hhh]h)}(hGDuplicate implicit target name: "function-specific configfs interface".h]hKDuplicate implicit target name: “function-specific configfs interface”.}(hhhj8hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj8ubah}(h]h ]h"]h$]h&]jalevelKtypej6sourcehlineMuh1j6hjhhhhhMubj6)}(hhh]h)}(hGDuplicate implicit target name: "function-specific configfs interface".h]hKDuplicate implicit target name: “function-specific configfs interface”.}(hhhj#8hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj 8ubah}(h]h ]h"]h$]h&]j*alevelKtypej6sourcehlineMRuh1j6hjhhhhhMRubj6)}(hhh]h)}(hGDuplicate implicit target name: "function-specific configfs interface".h]hKDuplicate implicit target name: “function-specific configfs interface”.}(hhhj>8hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj;8ubah}(h]h ]h"]h$]h&]j alevelKtypej6sourcehlineMzuh1j6hjhhhhhMzubj6)}(hhh]h)}(hGDuplicate implicit target name: "function-specific configfs interface".h]hKDuplicate implicit target name: “function-specific configfs interface”.}(hhhjY8hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjV8ubah}(h]h ]h"]h$]h&]jalevelKtypej6sourcehlineMuh1j6hjhhhhhMubj6)}(hhh]h)}(hGDuplicate implicit target name: "function-specific configfs interface".h]hKDuplicate implicit target name: “function-specific configfs interface”.}(hhhjt8hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjq8ubah}(h]h ]h"]h$]h&]jalevelKtypej6sourcehlineMuh1j6hjehhhhhMubj6)}(hhh]h)}(hGDuplicate implicit target name: "function-specific configfs interface".h]hKDuplicate implicit target name: “function-specific configfs interface”.}(hhhj8hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj8ubah}(h]h ]h"]h$]h&]j$alevelKtypej6sourcehlineMuh1j6hjhhhhhMubj6)}(hhh]h)}(hGDuplicate implicit target name: "function-specific configfs interface".h]hKDuplicate implicit target name: “function-specific configfs interface”.}(hhhj8hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj8ubah}(h]h ]h"]h$]h&]j'alevelKtypej6sourcehlineMuh1j6hj$hhhhhMubj6)}(hhh]h)}(hGDuplicate implicit target name: "function-specific configfs interface".h]hKDuplicate implicit target name: “function-specific configfs interface”.}(hhhj8hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj8ubah}(h]h ]h"]h$]h&]j(alevelKtypej6sourcehlineMnuh1j6hj(hhhhhMnubj6)}(hhh]h)}(hGDuplicate implicit target name: "function-specific configfs interface".h]hKDuplicate implicit target name: “function-specific configfs interface”.}(hhhj8hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj8ubah}(h]h ]h"]h$]h&]j\.alevelKtypej6sourcehlineMuh1j6hj*hhhhhMubj6)}(hhh]h)}(h