€•±™Œsphinx.addnodes”Œdocument”“”)”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)”}”(hhh]”(hŒ pending_xref”“”)”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…””}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ"/translations/zh_CN/usb/gadget_uvc”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)”}”(hhh]”hŒChinese (Traditional)”…””}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ"/translations/zh_TW/usb/gadget_uvc”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ"/translations/it_IT/usb/gadget_uvc”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ"/translations/ja_JP/usb/gadget_uvc”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ"/translations/ko_KR/usb/gadget_uvc”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒSpanish”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ"/translations/sp_SP/usb/gadget_uvc”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒLinux UVC Gadget Driver”h]”hŒLinux UVC Gadget Driver”…””}”(hh¨hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hh£hžhhŸŒ WIDTH=$1 HEIGHT=$2 FORMAT=$3 NAME=$4 wdir=$FUNCTION/streaming/$FORMAT/$NAME/${HEIGHT}p mkdir -p $wdir echo $WIDTH > $wdir/wWidth echo $HEIGHT > $wdir/wHeight echo $(( $WIDTH * $HEIGHT * 2 )) > $wdir/dwMaxVideoFrameBufferSize cat < $wdir/dwFrameInterval 666666 100000 5000000 EOF } create_frame 1280 720 mjpeg mjpeg create_frame 1920 1080 mjpeg mjpeg create_frame 1280 720 uncompressed yuyv create_frame 1920 1080 uncompressed yuyv”h]”hXpcreate_frame() { # Example usage: # create_frame WIDTH=$1 HEIGHT=$2 FORMAT=$3 NAME=$4 wdir=$FUNCTION/streaming/$FORMAT/$NAME/${HEIGHT}p mkdir -p $wdir echo $WIDTH > $wdir/wWidth echo $HEIGHT > $wdir/wHeight echo $(( $WIDTH * $HEIGHT * 2 )) > $wdir/dwMaxVideoFrameBufferSize cat < $wdir/dwFrameInterval 666666 100000 5000000 EOF } create_frame 1280 720 mjpeg mjpeg create_frame 1920 1080 mjpeg mjpeg create_frame 1280 720 uncompressed yuyv create_frame 1920 1080 uncompressed yuyv”…””}”hj\sbah}”(h]”h ]”h"]”h$]”h&]”jòjójô‰jõŒbash”j÷}”uh1jâhŸh¶h KchjhžhubhÉ)”}”(hŒ‹The only uncompressed format currently supported is YUYV, which is detailed at Documentation/userspace-api/media/v4l/pixfmt-packed-yuv.rst.”h]”hŒ‹The only uncompressed format currently supported is YUYV, which is detailed at Documentation/userspace-api/media/v4l/pixfmt-packed-yuv.rst.”…””}”(hjlhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈhŸh¶h K€hjhžhubeh}”(h]”Œformats-and-frames”ah ]”h"]”Œformats and frames”ah$]”h&]”uh1h¡hjIhžhhŸh¶h K9ubh¢)”}”(hhh]”(h§)”}”(hŒColor Matching Descriptors”h]”hŒColor Matching Descriptors”…””}”(hj…hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hj‚hžhhŸh¶h K„ubhÉ)”}”(hXIt's possible to specify some colometry information for each format you create. This step is optional, and default information will be included if this step is skipped; those default values follow those defined in the Color Matching Descriptor section of the UVC specification.”h]”hXIt’s possible to specify some colometry information for each format you create. This step is optional, and default information will be included if this step is skipped; those default values follow those defined in the Color Matching Descriptor section of the UVC specification.”…””}”(hj“hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈhŸh¶h K…hj‚hžhubhÉ)”}”(hŒºTo create a Color Matching Descriptor, create a configfs item and set its three attributes to your desired settings and then link to it from the format you wish it to be associated with:”h]”hŒºTo create a Color Matching Descriptor, create a configfs item and set its three attributes to your desired settings and then link to it from the format you wish it to be associated with:”…””}”(hj¡hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈhŸh¶h KŠhj‚hžhubjã)”}”(hX‹# Create a new Color Matching Descriptor mkdir $FUNCTION/streaming/color_matching/yuyv pushd $FUNCTION/streaming/color_matching/yuyv echo 1 > bColorPrimaries echo 1 > bTransferCharacteristics echo 4 > bMatrixCoefficients popd # Create a symlink to the Color Matching Descriptor from the format's config item ln -s $FUNCTION/streaming/color_matching/yuyv $FUNCTION/streaming/uncompressed/yuyv”h]”hX‹# Create a new Color Matching Descriptor mkdir $FUNCTION/streaming/color_matching/yuyv pushd $FUNCTION/streaming/color_matching/yuyv echo 1 > bColorPrimaries echo 1 > bTransferCharacteristics echo 4 > bMatrixCoefficients popd # Create a symlink to the Color Matching Descriptor from the format's config item ln -s $FUNCTION/streaming/color_matching/yuyv $FUNCTION/streaming/uncompressed/yuyv”…””}”hj¯sbah}”(h]”h ]”h"]”h$]”h&]”jòjójô‰jõŒbash”j÷}”uh1jâhŸh¶h KŽhj‚hžhubhÉ)”}”(hX™For details about the valid values, consult the UVC specification. Note that a default color matching descriptor exists and is used by any format which does not have a link to a different Color Matching Descriptor. It's possible to change the attribute settings for the default descriptor, so bear in mind that if you do that you are altering the defaults for any format that does not link to a different one.”h]”hX›For details about the valid values, consult the UVC specification. Note that a default color matching descriptor exists and is used by any format which does not have a link to a different Color Matching Descriptor. It’s possible to change the attribute settings for the default descriptor, so bear in mind that if you do that you are altering the defaults for any format that does not link to a different one.”…””}”(hj¿hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈhŸh¶h Kžhj‚hžhubeh}”(h]”Œcolor-matching-descriptors”ah ]”h"]”Œcolor matching descriptors”ah$]”h&]”uh1h¡hjIhžhhŸh¶h K„ubh¢)”}”(hhh]”(h§)”}”(hŒHeader linking”h]”hŒHeader linking”…””}”(hjØhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hjÕhžhhŸh¶h K§ubhÉ)”}”(hX}The UVC specification requires that Format and Frame descriptors be preceded by Headers detailing things such as the number and cumulative size of the different Format descriptors that follow. This and similar operations are achieved in configfs by linking between the configfs item representing the header and the config items representing those other descriptors, in this manner:”h]”hX}The UVC specification requires that Format and Frame descriptors be preceded by Headers detailing things such as the number and cumulative size of the different Format descriptors that follow. This and similar operations are achieved in configfs by linking between the configfs item representing the header and the config items representing those other descriptors, in this manner:”…””}”(hjæhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈhŸh¶h K©hjÕhžhubjã)”}”(hXKmkdir $FUNCTION/streaming/header/h # This section links the format descriptors and their associated frames # to the header cd $FUNCTION/streaming/header/h ln -s ../../uncompressed/yuyv ln -s ../../mjpeg/mjpeg # This section ensures that the header will be transmitted for each # speed's set of descriptors. If support for a particular speed is not # needed then it can be skipped here. cd ../../class/fs ln -s ../../header/h cd ../../class/hs ln -s ../../header/h cd ../../class/ss ln -s ../../header/h cd ../../../control mkdir header/h ln -s header/h class/fs ln -s header/h class/ss”h]”hXKmkdir $FUNCTION/streaming/header/h # This section links the format descriptors and their associated frames # to the header cd $FUNCTION/streaming/header/h ln -s ../../uncompressed/yuyv ln -s ../../mjpeg/mjpeg # This section ensures that the header will be transmitted for each # speed's set of descriptors. If support for a particular speed is not # needed then it can be skipped here. cd ../../class/fs ln -s ../../header/h cd ../../class/hs ln -s ../../header/h cd ../../class/ss ln -s ../../header/h cd ../../../control mkdir header/h ln -s header/h class/fs ln -s header/h class/ss”…””}”hjôsbah}”(h]”h ]”h"]”h$]”h&]”jòjójô‰jõŒbash”j÷}”uh1jâhŸh¶h K¯hjÕhžhubeh}”(h]”Œheader-linking”ah ]”h"]”Œheader linking”ah$]”h&]”uh1h¡hjIhžhhŸh¶h K§ubh¢)”}”(hhh]”(h§)”}”(hŒExtension Unit Support”h]”hŒExtension Unit Support”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hj hžhhŸh¶h KÉubhÉ)”}”(hX|A UVC Extension Unit (XU) basically provides a distinct unit to which control set and get requests can be addressed. The meaning of those control requests is entirely implementation dependent, but may be used to control settings outside of the UVC specification (for example enabling or disabling video effects). An XU can be inserted into the UVC unit chain or left free-hanging.”h]”hX|A UVC Extension Unit (XU) basically provides a distinct unit to which control set and get requests can be addressed. The meaning of those control requests is entirely implementation dependent, but may be used to control settings outside of the UVC specification (for example enabling or disabling video effects). An XU can be inserted into the UVC unit chain or left free-hanging.”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈhŸh¶h KËhj hžhubhÉ)”}”(hŒˆConfiguring an extension unit involves creating an entry in the appropriate directory and setting its attributes appropriately, like so:”h]”hŒˆConfiguring an extension unit involves creating an entry in the appropriate directory and setting its attributes appropriately, like so:”…””}”(hj+hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈhŸh¶h KÑhj hžhubjã)”}”(hX2mkdir $FUNCTION/control/extensions/xu.0 pushd $FUNCTION/control/extensions/xu.0 # Set the bUnitID of the Processing Unit as the source for this # Extension Unit echo 2 > baSourceID # Set this XU as the source of the default output terminal. This inserts # the XU into the UVC chain between the PU and OT such that the final # chain is IT > PU > XU.0 > OT cat bUnitID > ../../terminal/output/default/baSourceID # Flag some controls as being available for use. The bmControl field is # a bitmap with each bit denoting the availability of a particular # control. For example to flag the 0th, 2nd and 3rd controls available: echo 0x0d > bmControls # Set the GUID; this is a vendor-specific code identifying the XU. echo -e -n "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" > guidExtensionCode popd”h]”hX2mkdir $FUNCTION/control/extensions/xu.0 pushd $FUNCTION/control/extensions/xu.0 # Set the bUnitID of the Processing Unit as the source for this # Extension Unit echo 2 > baSourceID # Set this XU as the source of the default output terminal. This inserts # the XU into the UVC chain between the PU and OT such that the final # chain is IT > PU > XU.0 > OT cat bUnitID > ../../terminal/output/default/baSourceID # Flag some controls as being available for use. The bmControl field is # a bitmap with each bit denoting the availability of a particular # control. For example to flag the 0th, 2nd and 3rd controls available: echo 0x0d > bmControls # Set the GUID; this is a vendor-specific code identifying the XU. echo -e -n "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" > guidExtensionCode popd”…””}”hj9sbah}”(h]”h ]”h"]”h$]”h&]”jòjójô‰jõŒbash”j÷}”uh1jâhŸh¶h KÔhj hžhubhÉ)”}”(hX The bmControls attribute and the baSourceID attribute are multi-value attributes. This means that you may write multiple newline separated values to them. For example to flag the 1st, 2nd, 9th and 10th controls as being available you would need to write two values to bmControls, like so:”h]”hX The bmControls attribute and the baSourceID attribute are multi-value attributes. This means that you may write multiple newline separated values to them. For example to flag the 1st, 2nd, 9th and 10th controls as being available you would need to write two values to bmControls, like so:”…””}”(hjIhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈhŸh¶h Kìhj hžhubjã)”}”(hŒ%cat << EOF > bmControls 0x03 0x03 EOF”h]”hŒ%cat << EOF > bmControls 0x03 0x03 EOF”…””}”hjWsbah}”(h]”h ]”h"]”h$]”h&]”jòjójô‰jõŒbash”j÷}”uh1jâhŸh¶h Kñhj hžhubhÉ)”}”(hŒThe multi-value nature of the baSourceID attribute belies the fact that XUs can be multiple-input, though note that this currently has no significant effect.”h]”hŒThe multi-value nature of the baSourceID attribute belies the fact that XUs can be multiple-input, though note that this currently has no significant effect.”…””}”(hjghžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈhŸh¶h Køhj hžhubhÉ)”}”(hXœThe bControlSize attribute reflects the size of the bmControls attribute, and similarly bNrInPins reflects the size of the baSourceID attributes. Both attributes are automatically increased / decreased as you set bmControls and baSourceID. It is also possible to manually increase or decrease bControlSize which has the effect of truncating entries to the new size, or padding entries out with 0x00, for example:”h]”hXœThe bControlSize attribute reflects the size of the bmControls attribute, and similarly bNrInPins reflects the size of the baSourceID attributes. Both attributes are automatically increased / decreased as you set bmControls and baSourceID. It is also possible to manually increase or decrease bControlSize which has the effect of truncating entries to the new size, or padding entries out with 0x00, for example:”…””}”(hjuhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈhŸh¶h Kûhj hžhubjã)”}”(hŒ“$ cat bmControls 0x03 0x05 $ cat bControlSize 2 $ echo 1 > bControlSize $ cat bmControls 0x03 $ echo 2 > bControlSize $ cat bmControls 0x03 0x00”h]”hŒ“$ cat bmControls 0x03 0x05 $ cat bControlSize 2 $ echo 1 > bControlSize $ cat bmControls 0x03 $ echo 2 > bControlSize $ cat bmControls 0x03 0x00”…””}”hjƒsbah}”(h]”h ]”h"]”h$]”h&]”jòjóuh1jâhŸh¶h Mhj hžhubhÉ)”}”(hŒ2bNrInPins and baSourceID function in the same way.”h]”hŒ2bNrInPins and baSourceID function in the same way.”…””}”(hj‘hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈhŸh¶h Mhj hžhubeh}”(h]”Œextension-unit-support”ah ]”h"]”Œextension unit support”ah$]”h&]”uh1h¡hjIhžhhŸh¶h KÉubh¢)”}”(hhh]”(h§)”}”(hŒFConfiguring Supported Controls for Camera Terminal and Processing Unit”h]”hŒFConfiguring Supported Controls for Camera Terminal and Processing Unit”…””}”(hjªhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hj§hžhhŸh¶h MubhÉ)”}”(hX}The Camera Terminal and Processing Units in the UVC chain also have bmControls attributes which function similarly to the same field in an Extension Unit. Unlike XUs however, the meaning of the bitflag for these units is defined in the UVC specification; you should consult the "Camera Terminal Descriptor" and "Processing Unit Descriptor" sections for an enumeration of the flags.”h]”hX…The Camera Terminal and Processing Units in the UVC chain also have bmControls attributes which function similarly to the same field in an Extension Unit. Unlike XUs however, the meaning of the bitflag for these units is defined in the UVC specification; you should consult the “Camera Terminal Descriptor†and “Processing Unit Descriptor†sections for an enumeration of the flags.”…””}”(hj¸hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈhŸh¶h Mhj§hžhubjã)”}”(hXP# Set the Processing Unit's bmControls, flagging Brightness, Contrast # and Hue as available controls: echo 0x05 > $FUNCTION/control/processing/default/bmControls # Set the Camera Terminal's bmControls, flagging Focus Absolute and # Focus Relative as available controls: echo 0x60 > $FUNCTION/control/terminal/camera/default/bmControls”h]”hXP# Set the Processing Unit's bmControls, flagging Brightness, Contrast # and Hue as available controls: echo 0x05 > $FUNCTION/control/processing/default/bmControls # Set the Camera Terminal's bmControls, flagging Focus Absolute and # Focus Relative as available controls: echo 0x60 > $FUNCTION/control/terminal/camera/default/bmControls”…””}”hjÆsbah}”(h]”h ]”h"]”h$]”h&]”jòjójô‰jõŒbash”j÷}”uh1jâhŸh¶h Mhj§hžhubhÉ)”}”(hŒòIf you do not set these fields then by default the Auto-Exposure Mode control for the Camera Terminal and the Brightness control for the Processing Unit will be flagged as available; if they are not supported you should set the field to 0x00.”h]”hŒòIf you do not set these fields then by default the Auto-Exposure Mode control for the Camera Terminal and the Brightness control for the Processing Unit will be flagged as available; if they are not supported you should set the field to 0x00.”…””}”(hjÖhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈhŸh¶h M)hj§hžhubhÉ)”}”(hŒ«Note that the size of the bmControls field for a Camera Terminal or Processing Unit is fixed by the UVC specification, and so the bControlSize attribute is read-only here.”h]”hŒ«Note that the size of the bmControls field for a Camera Terminal or Processing Unit is fixed by the UVC specification, and so the bControlSize attribute is read-only here.”…””}”(hjähžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈhŸh¶h M.hj§hžhubeh}”(h]”ŒFconfiguring-supported-controls-for-camera-terminal-and-processing-unit”ah ]”h"]”ŒFconfiguring supported controls for camera terminal and processing unit”ah$]”h&]”uh1h¡hjIhžhhŸh¶h Mubh¢)”}”(hhh]”(h§)”}”(hŒCustom Strings Support”h]”hŒCustom Strings Support”…””}”(hjýhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hjúhžhhŸh¶h M3ubhÉ)”}”(hXString descriptors that provide a textual description for various parts of a USB device can be defined in the usual place within USB configfs, and may then be linked to from the UVC function root or from Extension Unit directories to assign those strings as descriptors:”h]”hXString descriptors that provide a textual description for various parts of a USB device can be defined in the usual place within USB configfs, and may then be linked to from the UVC function root or from Extension Unit directories to assign those strings as descriptors:”…””}”(hj hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈhŸh¶h M5hjúhžhubjã)”}”(hXN# Create a string descriptor in us-EN and link to it from the function # root. The name of the link is significant here, as it declares this # descriptor to be intended for the Interface Association Descriptor. # Other significant link names at function root are vs0_desc and vs1_desc # For the VideoStreaming Interface 0/1 Descriptors. mkdir -p $GADGET/strings/0x409/iad_desc echo -n "Interface Associaton Descriptor" > $GADGET/strings/0x409/iad_desc/s ln -s $GADGET/strings/0x409/iad_desc $FUNCTION/iad_desc # Because the link to a String Descriptor from an Extension Unit clearly # associates the two, the name of this link is not significant and may # be set freely. mkdir -p $GADGET/strings/0x409/xu.0 echo -n "A Very Useful Extension Unit" > $GADGET/strings/0x409/xu.0/s ln -s $GADGET/strings/0x409/xu.0 $FUNCTION/control/extensions/xu.0”h]”hXN# Create a string descriptor in us-EN and link to it from the function # root. The name of the link is significant here, as it declares this # descriptor to be intended for the Interface Association Descriptor. # Other significant link names at function root are vs0_desc and vs1_desc # For the VideoStreaming Interface 0/1 Descriptors. mkdir -p $GADGET/strings/0x409/iad_desc echo -n "Interface Associaton Descriptor" > $GADGET/strings/0x409/iad_desc/s ln -s $GADGET/strings/0x409/iad_desc $FUNCTION/iad_desc # Because the link to a String Descriptor from an Extension Unit clearly # associates the two, the name of this link is not significant and may # be set freely. mkdir -p $GADGET/strings/0x409/xu.0 echo -n "A Very Useful Extension Unit" > $GADGET/strings/0x409/xu.0/s ln -s $GADGET/strings/0x409/xu.0 $FUNCTION/control/extensions/xu.0”…””}”hjsbah}”(h]”h ]”h"]”h$]”h&]”jòjójô‰jõŒbash”j÷}”uh1jâhŸh¶h M:hjúhžhubeh}”(h]”Œcustom-strings-support”ah ]”h"]”Œcustom strings support”ah$]”h&]”uh1h¡hjIhžhhŸh¶h M3ubh¢)”}”(hhh]”(h§)”}”(hŒThe interrupt endpoint”h]”hŒThe interrupt endpoint”…””}”(hj4hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hj1hžhhŸh¶h MOubhÉ)”}”(hX·The VideoControl interface has an optional interrupt endpoint which is by default disabled. This is intended to support delayed response control set requests for UVC (which should respond through the interrupt endpoint rather than tying up endpoint 0). At present support for sending data through this endpoint is missing and so it is left disabled to avoid confusion. If you wish to enable it you can do so through the configfs attribute:”h]”hX·The VideoControl interface has an optional interrupt endpoint which is by default disabled. This is intended to support delayed response control set requests for UVC (which should respond through the interrupt endpoint rather than tying up endpoint 0). At present support for sending data through this endpoint is missing and so it is left disabled to avoid confusion. If you wish to enable it you can do so through the configfs attribute:”…””}”(hjBhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈhŸh¶h MQhj1hžhubjã)”}”(hŒ.echo 1 > $FUNCTION/control/enable_interrupt_ep”h]”hŒ.echo 1 > $FUNCTION/control/enable_interrupt_ep”…””}”hjPsbah}”(h]”h ]”h"]”h$]”h&]”jòjójô‰jõŒbash”j÷}”uh1jâhŸh¶h MXhj1hžhubeh}”(h]”Œthe-interrupt-endpoint”ah ]”h"]”Œthe interrupt endpoint”ah$]”h&]”uh1h¡hjIhžhhŸh¶h MOubh¢)”}”(hhh]”(h§)”}”(hŒBandwidth configuration”h]”hŒBandwidth configuration”…””}”(hjkhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hjhhžhhŸh¶h M]ubhÉ)”}”(hŒ‹There are three attributes which control the bandwidth of the USB connection. These live in the function root and can be set within limits:”h]”hŒ‹There are three attributes which control the bandwidth of the USB connection. These live in the function root and can be set within limits:”…””}”(hjyhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈhŸh¶h M_hjhhžhubjã)”}”(hX<# streaming_interval sets bInterval. Values range from 1..255 echo 1 > $FUNCTION/streaming_interval # streaming_maxpacket sets wMaxPacketSize. Valid values are 1024/2048/3072 echo 3072 > $FUNCTION/streaming_maxpacket # streaming_maxburst sets bMaxBurst. Valid values are 1..15 echo 1 > $FUNCTION/streaming_maxburst”h]”hX<# streaming_interval sets bInterval. Values range from 1..255 echo 1 > $FUNCTION/streaming_interval # streaming_maxpacket sets wMaxPacketSize. Valid values are 1024/2048/3072 echo 3072 > $FUNCTION/streaming_maxpacket # streaming_maxburst sets bMaxBurst. Valid values are 1..15 echo 1 > $FUNCTION/streaming_maxburst”…””}”hj‡sbah}”(h]”h ]”h"]”h$]”h&]”jòjójô‰jõŒbash”j÷}”uh1jâhŸh¶h MbhjhhžhubhÉ)”}”(hXThe values passed here will be clamped to valid values according to the UVC specification (which depend on the speed of the USB connection). To understand how the settings influence bandwidth you should consult the UVC specifications, but a rule of thumb is that increasing the streaming_maxpacket setting will improve bandwidth (and thus the maximum possible framerate), whilst the same is true for streaming_maxburst provided the USB connection is running at SuperSpeed. Increasing streaming_interval will reduce bandwidth and framerate.”h]”hXThe values passed here will be clamped to valid values according to the UVC specification (which depend on the speed of the USB connection). To understand how the settings influence bandwidth you should consult the UVC specifications, but a rule of thumb is that increasing the streaming_maxpacket setting will improve bandwidth (and thus the maximum possible framerate), whilst the same is true for streaming_maxburst provided the USB connection is running at SuperSpeed. Increasing streaming_interval will reduce bandwidth and framerate.”…””}”(hj—hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈhŸh¶h Mnhjhhžhubeh}”(h]”Œbandwidth-configuration”ah ]”h"]”Œbandwidth configuration”ah$]”h&]”uh1h¡hjIhžhhŸh¶h M]ubeh}”(h]”Œ'configuring-the-gadget-through-configfs”ah ]”h"]”Œ'configuring the gadget through configfs”ah$]”h&]”uh1h¡hh£hžhhŸh¶h Kubh¢)”}”(hhh]”(h§)”}”(hŒThe userspace application”h]”hŒThe userspace application”…””}”(hj¸hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hjµhžhhŸh¶h MwubhÉ)”}”(hX§By itself, the UVC Gadget driver cannot do anything particularly interesting. It must be paired with a userspace program that responds to UVC control requests and fills buffers to be queued to the V4L2 device that the driver creates. How those things are achieved is implementation dependent and beyond the scope of this document, but a reference application can be found at https://gitlab.freedesktop.org/camera/uvc-gadget”h]”(hXwBy itself, the UVC Gadget driver cannot do anything particularly interesting. It must be paired with a userspace program that responds to UVC control requests and fills buffers to be queued to the V4L2 device that the driver creates. How those things are achieved is implementation dependent and beyond the scope of this document, but a reference application can be found at ”…””}”(hjÆhžhhŸNh NubhŒ reference”“”)”}”(hŒ0https://gitlab.freedesktop.org/camera/uvc-gadget”h]”hŒ0https://gitlab.freedesktop.org/camera/uvc-gadget”…””}”(hjÐhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”jÒuh1jÎhjÆubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÈhŸh¶h Mxhjµhžhubeh}”(h]”Œthe-userspace-application”ah ]”h"]”Œthe userspace application”ah$]”h&]”uh1h¡hh£hžhhŸh¶h Mwubeh}”(h]”Œlinux-uvc-gadget-driver”ah ]”h"]”Œlinux uvc gadget driver”ah$]”h&]”uh1h¡hhhžhhŸh¶h Kubeh}”(h]”h ]”h"]”h$]”h&]”Œsource”h¶uh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)”}”(h¦NŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”Œentry”Œfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”jŒerror_encoding”Œutf-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”h¶Œ _destination”NŒ _config_files”]”Œ7/var/lib/git/docbuild/linux/Documentation/docutils.conf”aŒfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œpep_references”NŒ pep_base_url”Œhttps://peps.python.org/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œ&https://datatracker.ietf.org/doc/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œ image_loading”Œlink”Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒsection_self_link”‰Œenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œrefids”}”Œnameids”}”(jòjïjjjFjCj²j¯jÀj½jþjûjj|jÒjÏj jj¤j¡j÷jôj.j+jejbjªj§jêjçuŒ nametypes”}”(jò‰j‰jF‰j²‰jÀ‰jþ‰j‰jÒ‰j ‰j¤‰j÷‰j.‰je‰jª‰jê‰uh}”(jïh£jh·jCj"j¯jIj½jvjûjÃj|jjÏj‚jjÕj¡j jôj§j+jújbj1j§jhjçjµuŒ footnote_refs”}”Œ citation_refs”}”Œ autofootnotes”]”Œautofootnote_refs”]”Œsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”…”R”Œparse_messages”]”Œtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nhžhub.