sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget!/translations/zh_CN/sound/soc/usbmodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget!/translations/zh_TW/sound/soc/usbmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget!/translations/it_IT/sound/soc/usbmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget!/translations/ja_JP/sound/soc/usbmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget!/translations/ko_KR/sound/soc/usbmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget!/translations/sp_SP/sound/soc/usbmodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhsection)}(hhh](htitle)}(hASoC USB supporth]hASoC USB support}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhh;/var/lib/git/docbuild/linux/Documentation/sound/soc/usb.rsthKubh)}(hhh](h)}(hOverviewh]hOverview}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh paragraph)}(hIn order to leverage the existing USB sound device support in ALSA, the ASoC USB APIs are introduced to allow the subsystems to exchange configuration information.h]hIn order to leverage the existing USB sound device support in ALSA, the ASoC USB APIs are introduced to allow the subsystems to exchange configuration information.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hXOne potential use case would be to support USB audio offloading, which is an implementation that allows for an alternate power-optimized path in the audio subsystem to handle the transfer of audio data over the USB bus. This would let the main processor to stay in lower power modes for longer duration. The following is an example design of how the ASoC and ALSA pieces can be connected together to achieve this:h]hXOne potential use case would be to support USB audio offloading, which is an implementation that allows for an alternate power-optimized path in the audio subsystem to handle the transfer of audio data over the USB bus. This would let the main processor to stay in lower power modes for longer duration. The following is an example design of how the ASoC and ALSA pieces can be connected together to achieve this:}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hhhhubh literal_block)}(hX USB | ASoC | _________________________ | | ASoC Platform card | | |_________________________| | | | | ___V____ ____V____ | |ASoC BE | |ASoC FE | | |DAI LNK | |DAI LNK | | |________| |_________| | ^ ^ ^ | | |________| | ___V____ | | |SoC-USB | | ________ ________ | | | |USB SND |<--->|USBSND |<------------>|________| | |(card.c)| |offld |<---------- | |________| |________|___ | | | ^ ^ | | | ____________V_________ | | | | | |IPC | __ V_______________V_____ | | | |______________________| |USB SND (endpoint.c) | | | | ^ |_________________________| | | | | ^ | | | ___________V___________ | | | |->|audio DSP | ___________V_____________ | | |_______________________| |XHCI HCD |<- | |_________________________| |h]hX USB | ASoC | _________________________ | | ASoC Platform card | | |_________________________| | | | | ___V____ ____V____ | |ASoC BE | |ASoC FE | | |DAI LNK | |DAI LNK | | |________| |_________| | ^ ^ ^ | | |________| | ___V____ | | |SoC-USB | | ________ ________ | | | |USB SND |<--->|USBSND |<------------>|________| | |(card.c)| |offld |<---------- | |________| |________|___ | | | ^ ^ | | | ____________V_________ | | | | | |IPC | __ V_______________V_____ | | | |______________________| |USB SND (endpoint.c) | | | | ^ |_________________________| | | | | ^ | | | ___________V___________ | | | |->|audio DSP | ___________V_____________ | | |_______________________| |XHCI HCD |<- | |_________________________| |}hhsbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1hhhhKhhhhubeh}(h]overviewah ]h"]overviewah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hSoC USB driverh]hSoC USB driver}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhK2ubh)}(hhh](h)}(h Structuresh]h Structures}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhK4ubh)}(h``struct snd_soc_usb``h]hliteral)}(hj$h]hstruct snd_soc_usb}(hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1j&hj"ubah}(h]h ]h"]h$]h&]uh1hhhhK5hjhhubh block_quote)}(hX- ``list``: list head for SND SoC struct list - ``component``: reference to ASoC component - ``connection_status_cb``: callback to notify connection events - ``update_offload_route_info``: callback to fetch selected USB sound card/PCM device - ``priv_data``: driver data h]h bullet_list)}(hhh](h list_item)}(h+``list``: list head for SND SoC struct listh]h)}(hjJh](j')}(h``list``h]hlist}(hjOhhhNhNubah}(h]h ]h"]h$]h&]uh1j&hjLubh#: list head for SND SoC struct list}(hjLhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK7hjHubah}(h]h ]h"]h$]h&]uh1jFhjCubjG)}(h*``component``: reference to ASoC componenth]h)}(hjoh](j')}(h ``component``h]h component}(hjthhhNhNubah}(h]h ]h"]h$]h&]uh1j&hjqubh: reference to ASoC component}(hjqhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK8hjmubah}(h]h ]h"]h$]h&]uh1jFhjCubjG)}(h>``connection_status_cb``: callback to notify connection eventsh]h)}(hjh](j')}(h``connection_status_cb``h]hconnection_status_cb}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j&hjubh&: callback to notify connection events}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK9hjubah}(h]h ]h"]h$]h&]uh1jFhjCubjG)}(hS``update_offload_route_info``: callback to fetch selected USB sound card/PCM deviceh]h)}(hS``update_offload_route_info``: callback to fetch selected USB sound card/PCM deviceh](j')}(h``update_offload_route_info``h]hupdate_offload_route_info}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j&hjubh6: callback to fetch selected USB sound card/PCM device}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK:hjubah}(h]h ]h"]h$]h&]uh1jFhjCubjG)}(h``priv_data``: driver data h]h)}(h``priv_data``: driver datah](j')}(h ``priv_data``h]h priv_data}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j&hjubh : driver data}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKdev). This is created by the ASoC BE DAI link, and the USB sound entity will be able to pass information to the ASoC BE DAI link using this structure.h]hThe snd_soc_usb structure can be referenced using the ASoC platform card device, or a USB device (udev->dev). This is created by the ASoC BE DAI link, and the USB sound entity will be able to pass information to the ASoC BE DAI link using this structure.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK>hjhhubh)}(h``struct snd_soc_usb_device``h]j')}(hj!h]hstruct snd_soc_usb_device}(hj#hhhNhNubah}(h]h ]h"]h$]h&]uh1j&hjubah}(h]h ]h"]h$]h&]uh1hhhhKChjhhubj<)}(hX- ``card_idx``: sound card index associated with USB sound device - ``chip_idx``: USB sound chip array index - ``cpcm_idx``: capture pcm device indexes associated with the USB sound device - ``ppcm_idx``: playback pcm device indexes associated with the USB sound device - ``num_playback``: number of playback streams - ``num_capture``: number of capture streams - ``list``: list head for the USB sound device list h]jB)}(hhh](jG)}(h?``card_idx``: sound card index associated with USB sound deviceh]h)}(hj?h](j')}(h ``card_idx``h]hcard_idx}(hjDhhhNhNubah}(h]h ]h"]h$]h&]uh1j&hjAubh3: sound card index associated with USB sound device}(hjAhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKEhj=ubah}(h]h ]h"]h$]h&]uh1jFhj:ubjG)}(h(``chip_idx``: USB sound chip array indexh]h)}(hjdh](j')}(h ``chip_idx``h]hchip_idx}(hjihhhNhNubah}(h]h ]h"]h$]h&]uh1j&hjfubh: USB sound chip array index}(hjfhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKFhjbubah}(h]h ]h"]h$]h&]uh1jFhj:ubjG)}(hM``cpcm_idx``: capture pcm device indexes associated with the USB sound deviceh]h)}(hjh](j')}(h ``cpcm_idx``h]hcpcm_idx}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j&hjubhA: capture pcm device indexes associated with the USB sound device}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKGhjubah}(h]h ]h"]h$]h&]uh1jFhj:ubjG)}(hN``ppcm_idx``: playback pcm device indexes associated with the USB sound deviceh]h)}(hjh](j')}(h ``ppcm_idx``h]hppcm_idx}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j&hjubhB: playback pcm device indexes associated with the USB sound device}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKHhjubah}(h]h ]h"]h$]h&]uh1jFhj:ubjG)}(h,``num_playback``: number of playback streamsh]h)}(hjh](j')}(h``num_playback``h]h num_playback}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j&hjubh: number of playback streams}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKIhjubah}(h]h ]h"]h$]h&]uh1jFhj:ubjG)}(h*``num_capture``: number of capture streamsh]h)}(hjh](j')}(h``num_capture``h]h num_capture}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j&hjubh: number of capture streams}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKJhjubah}(h]h ]h"]h$]h&]uh1jFhj:ubjG)}(h2``list``: list head for the USB sound device list h]h)}(h1``list``: list head for the USB sound device listh](j')}(h``list``h]hlist}(hj#hhhNhNubah}(h]h ]h"]h$]h&]uh1j&hjubh): list head for the USB sound device list}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKKhjubah}(h]h ]h"]h$]h&]uh1jFhj:ubeh}(h]h ]h"]h$]h&]j j uh1jAhhhKEhj6ubah}(h]h ]h"]h$]h&]uh1j;hhhKEhjhhubh)}(hThe struct snd_soc_usb_device is created by the USB sound offload driver. This will carry basic parameters/limitations that will be used to determine the possible offloading paths for this USB audio device.h]hThe struct snd_soc_usb_device is created by the USB sound offload driver. This will carry basic parameters/limitations that will be used to determine the possible offloading paths for this USB audio device.}(hjMhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKMhjhhubeh}(h] structuresah ]h"] structuresah$]h&]uh1hhjhhhhhK4ubh)}(hhh](h)}(h Functionsh]h Functions}(hjfhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjchhhhhKRubh)}(htint snd_soc_usb_find_supported_format(int card_idx, struct snd_pcm_hw_params *params, int direction)h]htint snd_soc_usb_find_supported_format(int card_idx, struct snd_pcm_hw_params *params, int direction)}hjtsbah}(h]h ]h"]h$]h&]hhforcelanguagersthighlight_args}uh1hhhhKShjchhubhcomment)}(hhh]h}(h]h ]h"]h$]h&]hhuh1jhjchhhhhKWubj<)}(h- ``card_idx``: the index into the USB sound chip array. - ``params``: Requested PCM parameters from the USB DPCM BE DAI link - ``direction``: capture or playback h]jB)}(hhh](jG)}(h6``card_idx``: the index into the USB sound chip array.h]h)}(hjh](j')}(h ``card_idx``h]hcard_idx}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j&hjubh*: the index into the USB sound chip array.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKYhjubah}(h]h ]h"]h$]h&]uh1jFhjubjG)}(hB``params``: Requested PCM parameters from the USB DPCM BE DAI linkh]h)}(hjh](j')}(h ``params``h]hparams}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j&hjubh8: Requested PCM parameters from the USB DPCM BE DAI link}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKZhjubah}(h]h ]h"]h$]h&]uh1jFhjubjG)}(h#``direction``: capture or playback h]h)}(h"``direction``: capture or playbackh](j')}(h ``direction``h]h direction}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j&hjubh: capture or playback}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK[hjubah}(h]h ]h"]h$]h&]uh1jFhjubeh}(h]h ]h"]h$]h&]j j uh1jAhhhKYhjubah}(h]h ]h"]h$]h&]uh1j;hhhKYhjchhubh)}(h**snd_soc_usb_find_supported_format()** ensures that the requested audio profile being requested by the external DSP is supported by the USB device.h](hstrong)}(h'**snd_soc_usb_find_supported_format()**h]h#snd_soc_usb_find_supported_format()}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhm ensures that the requested audio profile being requested by the external DSP is supported by the USB device.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK]hjchhubh)}(h1Returns 0 on success, and -EOPNOTSUPP on failure.h]h1Returns 0 on success, and -EOPNOTSUPP on failure.}(hj3hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK`hjchhubh)}(hOint snd_soc_usb_connect(struct device *usbdev, struct snd_soc_usb_device *sdev)h]hOint snd_soc_usb_connect(struct device *usbdev, struct snd_soc_usb_device *sdev)}hjAsbah}(h]h ]h"]h$]h&]hhjjrstj}uh1hhhhKbhjchhubj)}(hhh]h}(h]h ]h"]h$]h&]hhuh1jhjchhhhhKeubj<)}(hX- ``usbdev``: the usb device that was discovered - ``sdev``: capabilities of the device h]jB)}(hhh](jG)}(h.``usbdev``: the usb device that was discoveredh]h)}(hjch](j')}(h ``usbdev``h]husbdev}(hjhhhhNhNubah}(h]h ]h"]h$]h&]uh1j&hjeubh$: the usb device that was discovered}(hjehhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKghjaubah}(h]h ]h"]h$]h&]uh1jFhj^ubjG)}(h%``sdev``: capabilities of the device h]h)}(h$``sdev``: capabilities of the deviceh](j')}(h``sdev``h]hsdev}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j&hjubh: capabilities of the device}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhhjubah}(h]h ]h"]h$]h&]uh1jFhj^ubeh}(h]h ]h"]h$]h&]j j uh1jAhhhKghjZubah}(h]h ]h"]h$]h&]uh1j;hhhKghjchhubh)}(hX**snd_soc_usb_connect()** notifies the ASoC USB DCPM BE DAI link of a USB audio device detection. This can be utilized in the BE DAI driver to keep track of available USB audio devices. This is intended to be called by the USB offload driver residing in USB SND.h](j)}(h**snd_soc_usb_connect()**h]hsnd_soc_usb_connect()}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh notifies the ASoC USB DCPM BE DAI link of a USB audio device detection. This can be utilized in the BE DAI driver to keep track of available USB audio devices. This is intended to be called by the USB offload driver residing in USB SND.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKjhjchhubh)}(h5Returns 0 on success, negative error code on failure.h]h5Returns 0 on success, negative error code on failure.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKohjchhubh)}(hRint snd_soc_usb_disconnect(struct device *usbdev, struct snd_soc_usb_device *sdev)h]hRint snd_soc_usb_disconnect(struct device *usbdev, struct snd_soc_usb_device *sdev)}hjsbah}(h]h ]h"]h$]h&]hhjjrstj}uh1hhhhKqhjchhubj)}(hhh]h}(h]h ]h"]h$]h&]hhuh1jhjchhhhhKtubj<)}(hO- ``usbdev``: the usb device that was removed - ``sdev``: capabilities to free h]jB)}(hhh](jG)}(h+``usbdev``: the usb device that was removedh]h)}(hjh](j')}(h ``usbdev``h]husbdev}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j&hjubh!: the usb device that was removed}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKvhjubah}(h]h ]h"]h$]h&]uh1jFhjubjG)}(h``sdev``: capabilities to free h]h)}(h``sdev``: capabilities to freeh](j')}(h``sdev``h]hsdev}(hj/hhhNhNubah}(h]h ]h"]h$]h&]uh1j&hj+ubh: capabilities to free}(hj+hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKwhj'ubah}(h]h ]h"]h$]h&]uh1jFhjubeh}(h]h ]h"]h$]h&]j j uh1jAhhhKvhjubah}(h]h ]h"]h$]h&]uh1j;hhhKvhjchhubh)}(h**snd_soc_usb_disconnect()** notifies the ASoC USB DCPM BE DAI link of a USB audio device removal. This is intended to be called by the USB offload driver that resides in USB SND.h](j)}(h**snd_soc_usb_disconnect()**h]hsnd_soc_usb_disconnect()}(hj]hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjYubh notifies the ASoC USB DCPM BE DAI link of a USB audio device removal. This is intended to be called by the USB offload driver that resides in USB SND.}(hjYhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKyhjchhubh)}(h7void *snd_soc_usb_find_priv_data(struct device *usbdev)h]h7void *snd_soc_usb_find_priv_data(struct device *usbdev)}hjusbah}(h]h ]h"]h$]h&]hhjjrstj}uh1hhhhK}hjchhubj)}(hhh]h}(h]h ]h"]h$]h&]hhuh1jhjchhhhhKubj<)}(h?- ``usbdev``: the usb device to reference to find private data h]jB)}(hhh]jG)}(h=``usbdev``: the usb device to reference to find private data h]h)}(h<``usbdev``: the usb device to reference to find private datah](j')}(h ``usbdev``h]husbdev}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j&hjubh2: the usb device to reference to find private data}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jFhjubah}(h]h ]h"]h$]h&]j j uh1jAhhhKhjubah}(h]h ]h"]h$]h&]uh1j;hhhKhjchhubh)}(hV**snd_soc_usb_find_priv_data()** fetches the private data saved to the SoC USB device.h](j)}(h **snd_soc_usb_find_priv_data()**h]hsnd_soc_usb_find_priv_data()}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh6 fetches the private data saved to the SoC USB device.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjchhubh)}(h9Returns pointer to priv_data on success, NULL on failure.h]h9Returns pointer to priv_data on success, NULL on failure.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjchhubh)}(hint snd_soc_usb_setup_offload_jack(struct snd_soc_component *component, struct snd_soc_jack *jack)h]hint snd_soc_usb_setup_offload_jack(struct snd_soc_component *component, struct snd_soc_jack *jack)}hjsbah}(h]h ]h"]h$]h&]hhjjrstj}uh1hhhhKhjchhubj)}(hhh]h}(h]h ]h"]h$]h&]hhuh1jhjchhhhhKubj<)}(hW- ``component``: ASoC component to add the jack - ``jack``: jack component to populate h]jB)}(hhh](jG)}(h-``component``: ASoC component to add the jackh]h)}(hjh](j')}(h ``component``h]h component}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j&hjubh : ASoC component to add the jack}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jFhjubjG)}(h%``jack``: jack component to populate h]h)}(h$``jack``: jack component to populateh](j')}(h``jack``h]hjack}(hj>hhhNhNubah}(h]h ]h"]h$]h&]uh1j&hj:ubh: jack component to populate}(hj:hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj6ubah}(h]h ]h"]h$]h&]uh1jFhjubeh}(h]h ]h"]h$]h&]j j uh1jAhhhKhj ubah}(h]h ]h"]h$]h&]uh1j;hhhKhjchhubh)}(hX**snd_soc_usb_setup_offload_jack()** is a helper to add a sound jack control to the platform sound card. This will allow for consistent naming to be used on designs that support USB audio offloading. Additionally, this will enable the jack to notify of changes.h](j)}(h$**snd_soc_usb_setup_offload_jack()**h]h snd_soc_usb_setup_offload_jack()}(hjlhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjhubh is a helper to add a sound jack control to the platform sound card. This will allow for consistent naming to be used on designs that support USB audio offloading. Additionally, this will enable the jack to notify of changes.}(hjhhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjchhubh)}(h)Returns 0 on success, negative otherwise.h]h)Returns 0 on success, negative otherwise.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjchhubh)}(hint snd_soc_usb_update_offload_route(struct device *dev, int card, int pcm, int direction, enum snd_soc_usb_kctl path, long *route)h]hint snd_soc_usb_update_offload_route(struct device *dev, int card, int pcm, int direction, enum snd_soc_usb_kctl path, long *route)}hjsbah}(h]h ]h"]h$]h&]hhjjrstj}uh1hhhhKhjchhubj)}(hhh]h}(h]h ]h"]h$]h&]hhuh1jhjchhhhhKubj<)}(hX- ``dev``: USB device to look up offload path mapping - ``card``: USB sound card index - ``pcm``: USB sound PCM device index - ``direction``: direction to fetch offload routing information - ``path``: kcontrol selector - pcm device or card index - ``route``: mapping of sound card and pcm indexes for the offload path. This is an array of two integers that will carry the card and pcm device indexes in that specific order. This can be used as the array for the kcontrol output. h]jB)}(hhh](jG)}(h3``dev``: USB device to look up offload path mappingh]h)}(hjh](j')}(h``dev``h]hdev}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j&hjubh,: USB device to look up offload path mapping}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jFhjubjG)}(h``card``: USB sound card indexh]h)}(hjh](j')}(h``card``h]hcard}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j&hjubh: USB sound card index}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jFhjubjG)}(h#``pcm``: USB sound PCM device indexh]h)}(hjh](j')}(h``pcm``h]hpcm}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j&hjubh: USB sound PCM device index}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jFhjubjG)}(h=``direction``: direction to fetch offload routing informationh]h)}(hj#h](j')}(h ``direction``h]h direction}(hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1j&hj%ubh0: direction to fetch offload routing information}(hj%hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj!ubah}(h]h ]h"]h$]h&]uh1jFhjubjG)}(h6``path``: kcontrol selector - pcm device or card indexh]h)}(hjHh](j')}(h``path``h]hpath}(hjMhhhNhNubah}(h]h ]h"]h$]h&]uh1j&hjJubh.: kcontrol selector - pcm device or card index}(hjJhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjFubah}(h]h ]h"]h$]h&]uh1jFhjubjG)}(hX ``route``: mapping of sound card and pcm indexes for the offload path. This is an array of two integers that will carry the card and pcm device indexes in that specific order. This can be used as the array for the kcontrol output. h]hdefinition_list)}(hhh]hdefinition_list_item)}(h``route``: mapping of sound card and pcm indexes for the offload path. This is an array of two integers that will carry the card and pcm device indexes in that specific order. This can be used as the array for the kcontrol output. h](hterm)}(hO``route``: mapping of sound card and pcm indexes for the offload path. This ish](j')}(h ``route``h]hroute}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j&hj|ubhF: mapping of sound card and pcm indexes for the offload path. This is}(hj|hhhNhNubeh}(h]h ]h"]h$]h&]uh1jzhhhKhjvubh definition)}(hhh]h)}(han array of two integers that will carry the card and pcm device indexes in that specific order. This can be used as the array for the kcontrol output.h]han array of two integers that will carry the card and pcm device indexes in that specific order. This can be used as the array for the kcontrol output.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjvubeh}(h]h ]h"]h$]h&]uh1jthhhKhjqubah}(h]h ]h"]h$]h&]uh1johjkubah}(h]h ]h"]h$]h&]uh1jFhjubeh}(h]h ]h"]h$]h&]j j uh1jAhhhKhjubah}(h]h ]h"]h$]h&]uh1j;hhhKhjchhubh)}(hX-**snd_soc_usb_update_offload_route()** calls a registered callback to the USB BE DAI link to fetch the information about the mapped ASoC devices for executing USB audio offload for the device. ``route`` may be a pointer to a kcontrol value output array, which carries values when the kcontrol is read.h](j)}(h&**snd_soc_usb_update_offload_route()**h]h"snd_soc_usb_update_offload_route()}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh calls a registered callback to the USB BE DAI link to fetch the information about the mapped ASoC devices for executing USB audio offload for the device. }(hjhhhNhNubj')}(h ``route``h]hroute}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j&hjubhc may be a pointer to a kcontrol value output array, which carries values when the kcontrol is read.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjchhubh)}(h)Returns 0 on success, negative otherwise.h]h)Returns 0 on success, negative otherwise.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjchhubh)}(hostruct snd_soc_usb *snd_soc_usb_allocate_port(struct snd_soc_component *component, void *data);h]hostruct snd_soc_usb *snd_soc_usb_allocate_port(struct snd_soc_component *component, void *data);}hj sbah}(h]h ]h"]h$]h&]hhjjrstj}uh1hhhhKhjchhubj)}(hhh]h}(h]h ]h"]h$]h&]hhuh1jhjchhhhhKubj<)}(hE- ``component``: DPCM BE DAI link component - ``data``: private data h]jB)}(hhh](jG)}(h)``component``: DPCM BE DAI link componenth]h)}(hj-h](j')}(h ``component``h]h component}(hj2hhhNhNubah}(h]h ]h"]h$]h&]uh1j&hj/ubh: DPCM BE DAI link component}(hj/hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj+ubah}(h]h ]h"]h$]h&]uh1jFhj(ubjG)}(h``data``: private data h]h)}(h``data``: private datah](j')}(h``data``h]hdata}(hjXhhhNhNubah}(h]h ]h"]h$]h&]uh1j&hjTubh: private data}(hjThhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjPubah}(h]h ]h"]h$]h&]uh1jFhj(ubeh}(h]h ]h"]h$]h&]j j uh1jAhhhKhj$ubah}(h]h ]h"]h$]h&]uh1j;hhhKhjchhubh)}(h**snd_soc_usb_allocate_port()** allocates a SoC USB device and populates standard parameters that is used for further operations.h](j)}(h**snd_soc_usb_allocate_port()**h]hsnd_soc_usb_allocate_port()}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhb allocates a SoC USB device and populates standard parameters that is used for further operations.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjchhubh)}(hBReturns a pointer to struct soc_usb on success, negative on error.h]hBReturns a pointer to struct soc_usb on success, negative on error.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjchhubh)}(h4void snd_soc_usb_free_port(struct snd_soc_usb *usb);h]h4void snd_soc_usb_free_port(struct snd_soc_usb *usb);}hjsbah}(h]h ]h"]h$]h&]hhjjrstj}uh1hhhhKhjchhubj)}(hhh]h}(h]h ]h"]h$]h&]hhuh1jhjchhhhhKubj<)}(h"- ``usb``: SoC USB device to free h]jB)}(hhh]jG)}(h ``usb``: SoC USB device to free h]h)}(h``usb``: SoC USB device to freeh](j')}(h``usb``h]husb}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j&hjubh: SoC USB device to free}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jFhjubah}(h]h ]h"]h$]h&]j j uh1jAhhhKhjubah}(h]h ]h"]h$]h&]uh1j;hhhKhjchhubh)}(h3**snd_soc_usb_free_port()** frees a SoC USB device.h](j)}(h**snd_soc_usb_free_port()**h]hsnd_soc_usb_free_port()}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh frees a SoC USB device.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjchhubh)}(h3void snd_soc_usb_add_port(struct snd_soc_usb *usb);h]h3void snd_soc_usb_add_port(struct snd_soc_usb *usb);}hj sbah}(h]h ]h"]h$]h&]hhjjrstj}uh1hhhhKhjchhubj)}(hhh]h}(h]h ]h"]h$]h&]hhuh1jhjchhhhhKubj<)}(h!- ``usb``: SoC USB device to add h]jB)}(hhh]jG)}(h``usb``: SoC USB device to add h]h)}(h``usb``: SoC USB device to addh](j')}(h``usb``h]husb}(hjB hhhNhNubah}(h]h ]h"]h$]h&]uh1j&hj> ubh: SoC USB device to add}(hj> hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj: ubah}(h]h ]h"]h$]h&]uh1jFhj7 ubah}(h]h ]h"]h$]h&]j j uh1jAhhhKhj3 ubah}(h]h ]h"]h$]h&]uh1j;hhhKhjchhubh)}(h**snd_soc_usb_add_port()** add an allocated SoC USB device to the SOC USB framework. Once added, this device can be referenced by further operations.h](j)}(h**snd_soc_usb_add_port()**h]hsnd_soc_usb_add_port()}(hjp hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjl ubh{ add an allocated SoC USB device to the SOC USB framework. Once added, this device can be referenced by further operations.}(hjl hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjchhubh)}(h6void snd_soc_usb_remove_port(struct snd_soc_usb *usb);h]h6void snd_soc_usb_remove_port(struct snd_soc_usb *usb);}hj sbah}(h]h ]h"]h$]h&]hhjjrstj}uh1hhhhKhjchhubj)}(hhh]h}(h]h ]h"]h$]h&]hhuh1jhjchhhhhKubj<)}(h$- ``usb``: SoC USB device to remove h]jB)}(hhh]jG)}(h"``usb``: SoC USB device to remove h]h)}(h!``usb``: SoC USB device to removeh](j')}(h``usb``h]husb}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j&hj ubh: SoC USB device to remove}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jFhj ubah}(h]h ]h"]h$]h&]j j uh1jAhhhKhj ubah}(h]h ]h"]h$]h&]uh1j;hhhKhjchhubh)}(h**snd_soc_usb_remove_port()** removes a SoC USB device from the SoC USB framework. After removing a device, any SOC USB operations would not be able to reference the device removed.h](j)}(h**snd_soc_usb_remove_port()**h]hsnd_soc_usb_remove_port()}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh removes a SoC USB device from the SoC USB framework. After removing a device, any SOC USB operations would not be able to reference the device removed.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjchhubeh}(h] functionsah ]h"] functionsah$]h&]uh1hhjhhhhhKRubh)}(hhh](h)}(hHow to Register to SoC USBh]hHow to Register to SoC USB}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhKubh)}(hThe ASoC DPCM USB BE DAI link is the entity responsible for allocating and registering the SoC USB device on the component bind. Likewise, it will also be responsible for freeing the allocated resources. An example can be shown below:h]hThe ASoC DPCM USB BE DAI link is the entity responsible for allocating and registering the SoC USB device on the component bind. Likewise, it will also be responsible for freeing the allocated resources. An example can be shown below:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj hhubh)}(hXNstatic int q6usb_component_probe(struct snd_soc_component *component) { ... data->usb = snd_soc_usb_allocate_port(component, 1, &data->priv); if (!data->usb) return -ENOMEM; usb->connection_status_cb = q6usb_alsa_connection_cb; ret = snd_soc_usb_add_port(usb); if (ret < 0) { dev_err(component->dev, "failed to add usb port\n"); goto free_usb; } ... } static void q6usb_component_remove(struct snd_soc_component *component) { ... snd_soc_usb_remove_port(data->usb); snd_soc_usb_free_port(data->usb); } static const struct snd_soc_component_driver q6usb_dai_component = { .probe = q6usb_component_probe, .remove = q6usb_component_remove, .name = "q6usb-dai-component", ... };h]hXNstatic int q6usb_component_probe(struct snd_soc_component *component) { ... data->usb = snd_soc_usb_allocate_port(component, 1, &data->priv); if (!data->usb) return -ENOMEM; usb->connection_status_cb = q6usb_alsa_connection_cb; ret = snd_soc_usb_add_port(usb); if (ret < 0) { dev_err(component->dev, "failed to add usb port\n"); goto free_usb; } ... } static void q6usb_component_remove(struct snd_soc_component *component) { ... snd_soc_usb_remove_port(data->usb); snd_soc_usb_free_port(data->usb); } static const struct snd_soc_component_driver q6usb_dai_component = { .probe = q6usb_component_probe, .remove = q6usb_component_remove, .name = "q6usb-dai-component", ... };}hj sbah}(h]h ]h"]h$]h&]hhjjrstj}uh1hhhhKhj hhubj)}(hhh]h}(h]h ]h"]h$]h&]hhuh1jhj hhhhhMubh)}(hBE DAI links can pass along vendor specific information as part of the call to allocate the SoC USB device. This will allow any BE DAI link parameters or settings to be accessed by the USB offload driver that resides in USB SND.h]hBE DAI links can pass along vendor specific information as part of the call to allocate the SoC USB device. This will allow any BE DAI link parameters or settings to be accessed by the USB offload driver that resides in USB SND.}(hj6 hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubeh}(h]how-to-register-to-soc-usbah ]h"]how to register to soc usbah$]h&]uh1hhjhhhhhKubh)}(hhh](h)}(h USB Audio Device Connection Flowh]h USB Audio Device Connection Flow}(hjO hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjL hhhhhM ubh)}(hX&USB devices can be hotplugged into the USB ports at any point in time. The BE DAI link should be aware of the current state of the physical USB port, i.e. if there are any USB devices with audio interface(s) connected. connection_status_cb() can be used to notify the BE DAI link of any change.h]hX&USB devices can be hotplugged into the USB ports at any point in time. The BE DAI link should be aware of the current state of the physical USB port, i.e. if there are any USB devices with audio interface(s) connected. connection_status_cb() can be used to notify the BE DAI link of any change.}(hj] hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjL hhubh)}(hThis is called whenever there is a USB SND interface bind or remove event, using snd_soc_usb_connect() or snd_soc_usb_disconnect():h]hThis is called whenever there is a USB SND interface bind or remove event, using snd_soc_usb_connect() or snd_soc_usb_disconnect():}(hjk hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjL hhubh)}(hXLstatic void qc_usb_audio_offload_probe(struct snd_usb_audio *chip) { ... snd_soc_usb_connect(usb_get_usb_backend(udev), sdev); ... } static void qc_usb_audio_offload_disconnect(struct snd_usb_audio *chip) { ... snd_soc_usb_disconnect(usb_get_usb_backend(chip->dev), dev->sdev); ... }h]hXLstatic void qc_usb_audio_offload_probe(struct snd_usb_audio *chip) { ... snd_soc_usb_connect(usb_get_usb_backend(udev), sdev); ... } static void qc_usb_audio_offload_disconnect(struct snd_usb_audio *chip) { ... snd_soc_usb_disconnect(usb_get_usb_backend(chip->dev), dev->sdev); ... }}hjy sbah}(h]h ]h"]h$]h&]hhjjrstj}uh1hhhhMhjL hhubj)}(hhh]h}(h]h ]h"]h$]h&]hhuh1jhjL hhhhhM$ubh)}(hIn order to account for conditions where driver or device existence is not guaranteed, USB SND exposes snd_usb_rediscover_devices() to resend the connect events for any identified USB audio interfaces. Consider the the following situation:h]hIn order to account for conditions where driver or device existence is not guaranteed, USB SND exposes snd_usb_rediscover_devices() to resend the connect events for any identified USB audio interfaces. Consider the the following situation:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM&hjL hhubj<)}(hXf**usb_audio_probe()** | --> USB audio streams allocated and saved to usb_chip[] | --> Propagate connect event to USB offload driver in USB SND | --> **snd_soc_usb_connect()** exits as USB BE DAI link is not ready BE DAI link component probe | --> DAI link is probed and SoC USB port is allocated | --> The USB audio device connect event is missed h]jp)}(hhh](ju)}(h**usb_audio_probe()** | --> USB audio streams allocated and saved to usb_chip[] | --> Propagate connect event to USB offload driver in USB SND | --> **snd_soc_usb_connect()** exits as USB BE DAI link is not ready h](j{)}(h**usb_audio_probe()**h]j)}(hj h]husb_audio_probe()}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1jzhhhM.hj ubj)}(hhh]h line_block)}(hhh](hh)}(h7--> USB audio streams allocated and saved to usb_chip[]h]h7--> USB audio streams allocated and saved to usb_chip[]}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hindentKhj hhhKubj )}(h<--> Propagate connect event to USB offload driver in USB SNDh]h<--> Propagate connect event to USB offload driver in USB SND}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hj Khj hhhKubj )}(hC--> **snd_soc_usb_connect()** exits as USB BE DAI link is not readyh](h--> }(hj hhhNhNubj)}(h**snd_soc_usb_connect()**h]hsnd_soc_usb_connect()}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh& exits as USB BE DAI link is not ready}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hj Khj hhhKubeh}(h]h ]h"]h$]h&]uh1j hj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jthhhM.hj ubju)}(hBE DAI link component probe | --> DAI link is probed and SoC USB port is allocated | --> The USB audio device connect event is missed h](j{)}(hBE DAI link component probeh]hBE DAI link component probe}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jzhhhM2hj ubj)}(hhh]j )}(hhh](j )}(h4--> DAI link is probed and SoC USB port is allocatedh]h4--> DAI link is probed and SoC USB port is allocated}(hj2 hhhNhNubah}(h]h ]h"]h$]h&]uh1hj Khj/ hhhKubj )}(h0--> The USB audio device connect event is missedh]h0--> The USB audio device connect event is missed}(hj@ hhhNhNubah}(h]h ]h"]h$]h&]uh1hj Khj/ hhhKubeh}(h]h ]h"]h$]h&]uh1j hj, ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jthhhM2hj ubeh}(h]h ]h"]h$]h&]uh1johj ubah}(h]h ]h"]h$]h&]uh1j;hhhM+hjL hhubh)}(hTo ensure connection events are not missed, **snd_usb_rediscover_devices()** is executed when the SoC USB device is registered. Now, when the BE DAI link component probe occurs, the following highlights the sequence:h](h,To ensure connection events are not missed, }(hjl hhhNhNubj)}(h **snd_usb_rediscover_devices()**h]hsnd_usb_rediscover_devices()}(hjt hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjl ubh is executed when the SoC USB device is registered. Now, when the BE DAI link component probe occurs, the following highlights the sequence:}(hjl hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM4hjL hhubj<)}(hX&BE DAI link component probe | --> DAI link is probed and SoC USB port is allocated | --> SoC USB device added, and **snd_usb_rediscover_devices()** runs **snd_usb_rediscover_devices()** | --> Traverses through usb_chip[] and for non-NULL entries issue | **connection_status_cb()** h]jp)}(hhh](ju)}(hBE DAI link component probe | --> DAI link is probed and SoC USB port is allocated | --> SoC USB device added, and **snd_usb_rediscover_devices()** runs h](j{)}(hBE DAI link component probeh]hBE DAI link component probe}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jzhhhM:hj ubj)}(hhh]j )}(hhh](j )}(h4--> DAI link is probed and SoC USB port is allocatedh]h4--> DAI link is probed and SoC USB port is allocated}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hj Khj hhhKubj )}(hC--> SoC USB device added, and **snd_usb_rediscover_devices()** runsh](h--> SoC USB device added, and }(hj hhhNhNubj)}(h **snd_usb_rediscover_devices()**h]hsnd_usb_rediscover_devices()}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh runs}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hj Khj hhhKubeh}(h]h ]h"]h$]h&]uh1j hj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jthhhM:hj ubju)}(h**snd_usb_rediscover_devices()** | --> Traverses through usb_chip[] and for non-NULL entries issue | **connection_status_cb()** h](j{)}(h **snd_usb_rediscover_devices()**h]j)}(hj h]hsnd_usb_rediscover_devices()}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1jzhhhM>hj ubj)}(hhh]j )}(hhh](j )}(h?--> Traverses through usb_chip[] and for non-NULL entries issueh]h?--> Traverses through usb_chip[] and for non-NULL entries issue}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hj Khj hhhKubj )}(hhh]j )}(h**connection_status_cb()**h]j)}(hj h]hconnection_status_cb()}(hj! hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1hj Khj hhhKubah}(h]h ]h"]h$]h&]uh1j hj ubeh}(h]h ]h"]h$]h&]uh1j hj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jthhhM>hj ubeh}(h]h ]h"]h$]h&]uh1johj ubah}(h]h ]h"]h$]h&]uh1j;hhhM8hjL hhubh)}(hIn the case where the USB offload driver is unbound, while USB SND is ready, the **snd_usb_rediscover_devices()** is called during module init. This allows for the offloading path to also be enabled with the following flow:h](hQIn the case where the USB offload driver is unbound, while USB SND is ready, the }(hjX hhhNhNubj)}(h **snd_usb_rediscover_devices()**h]hsnd_usb_rediscover_devices()}(hj` hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjX ubho is called during module init. This allows for the offloading path to also be enabled with the following flow:}(hjX hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM@hjL hhubj<)}(hX**usb_audio_probe()** | --> USB audio streams allocated and saved to usb_chip[] | --> Propagate connect event to USB offload driver in USB SND | --> USB offload driver **NOT** ready! BE DAI link component probe | --> DAI link is probed and SoC USB port is allocated | --> No USB connect event due to missing USB offload driver USB offload driver probe | --> **qc_usb_audio_offload_init()** | --> Calls **snd_usb_rediscover_devices()** to notify of devices h]jp)}(hhh](ju)}(h**usb_audio_probe()** | --> USB audio streams allocated and saved to usb_chip[] | --> Propagate connect event to USB offload driver in USB SND | --> USB offload driver **NOT** ready! h](j{)}(h**usb_audio_probe()**h]j)}(hj h]husb_audio_probe()}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1jzhhhMGhj ubj)}(hhh]j )}(hhh](j )}(h7--> USB audio streams allocated and saved to usb_chip[]h]h7--> USB audio streams allocated and saved to usb_chip[]}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hj Khj hhhKubj )}(h<--> Propagate connect event to USB offload driver in USB SNDh]h<--> Propagate connect event to USB offload driver in USB SND}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hj Khj hhhKubj )}(h%--> USB offload driver **NOT** ready!h](h--> USB offload driver }(hj hhhNhNubj)}(h**NOT**h]hNOT}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh ready!}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hj Khj hhhKubeh}(h]h ]h"]h$]h&]uh1j hj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jthhhMGhj| ubju)}(hBE DAI link component probe | --> DAI link is probed and SoC USB port is allocated | --> No USB connect event due to missing USB offload driver h](j{)}(hBE DAI link component probeh]hBE DAI link component probe}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jzhhhMKhj ubj)}(hhh]j )}(hhh](j )}(h4--> DAI link is probed and SoC USB port is allocatedh]h4--> DAI link is probed and SoC USB port is allocated}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hj Khj hhhKubj )}(h:--> No USB connect event due to missing USB offload driverh]h:--> No USB connect event due to missing USB offload driver}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hj Khj hhhKubeh}(h]h ]h"]h$]h&]uh1j hj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jthhhMKhj| ubju)}(hUSB offload driver probe | --> **qc_usb_audio_offload_init()** | --> Calls **snd_usb_rediscover_devices()** to notify of devices h](j{)}(hUSB offload driver probeh]hUSB offload driver probe}(hj8 hhhNhNubah}(h]h ]h"]h$]h&]uh1jzhhhMOhj4 ubj)}(hhh]j )}(hhh](j )}(h#--> **qc_usb_audio_offload_init()**h](h--> }(hjL hhhNhNubj)}(h**qc_usb_audio_offload_init()**h]hqc_usb_audio_offload_init()}(hjT hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjL ubeh}(h]h ]h"]h$]h&]uh1hj KhjI hhhKubj )}(h?--> Calls **snd_usb_rediscover_devices()** to notify of devicesh](h --> Calls }(hjh hhhNhNubj)}(h **snd_usb_rediscover_devices()**h]hsnd_usb_rediscover_devices()}(hjp hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjh ubh to notify of devices}(hjh hhhNhNubeh}(h]h ]h"]h$]h&]uh1hj KhjI hhhKubeh}(h]h ]h"]h$]h&]uh1j hjF ubah}(h]h ]h"]h$]h&]uh1jhj4 ubeh}(h]h ]h"]h$]h&]uh1jthhhMOhj| ubeh}(h]h ]h"]h$]h&]uh1johjx ubah}(h]h ]h"]h$]h&]uh1j;hhhMDhjL hhubeh}(h] usb-audio-device-connection-flowah ]h"] usb audio device connection flowah$]h&]uh1hhjhhhhhM ubeh}(h]soc-usb-driverah ]h"]soc usb driverah$]h&]uh1hhhhhhhhK2ubh)}(hhh](h)}(hUSB Offload Related Kcontrolsh]hUSB Offload Related Kcontrols}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhMRubh)}(hhh](h)}(hDetailsh]hDetails}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhMTubh)}(hXA set of kcontrols can be utilized by applications to help select the proper sound devices to enable USB audio offloading. SoC USB exposes the get_offload_dev() callback that designs can use to ensure that the proper indices are returned to the application.h]hXA set of kcontrols can be utilized by applications to help select the proper sound devices to enable USB audio offloading. SoC USB exposes the get_offload_dev() callback that designs can use to ensure that the proper indices are returned to the application.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMUhj hhubeh}(h]detailsah ]h"]detailsah$]h&]uh1hhj hhhhhMTubh)}(hhh](h)}(hImplementationh]hImplementation}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhM[ubh)}(h **Example:**h]j)}(hjh]hExample:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1hhhhM]hj hhubj<)}(hX3**Sound Cards**: :: 0 [SM8250MTPWCD938]: sm8250 - SM8250-MTP-WCD9380-WSA8810-VA-D SM8250-MTP-WCD9380-WSA8810-VA-DMIC 1 [Seri ]: USB-Audio - Plantronics Blackwire 3225 Seri Plantronics Plantronics Blackwire 3225 Seri at usb-xhci-hcd.1.auto-1.1, full sp 2 [C320M ]: USB-Audio - Plantronics C320-M Plantronics Plantronics C320-M at usb-xhci-hcd.1.auto-1.2, full speed **PCM Devices**: :: card 0: SM8250MTPWCD938 [SM8250-MTP-WCD9380-WSA8810-VA-D], device 0: MultiMedia1 (*) [] Subdevices: 1/1 Subdevice #0: subdevice #0 card 0: SM8250MTPWCD938 [SM8250-MTP-WCD9380-WSA8810-VA-D], device 1: MultiMedia2 (*) [] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: Seri [Plantronics Blackwire 3225 Seri], device 0: USB Audio [USB Audio] Subdevices: 1/1 Subdevice #0: subdevice #0 card 2: C320M [Plantronics C320-M], device 0: USB Audio [USB Audio] Subdevices: 1/1 Subdevice #0: subdevice #0 **USB Sound Card** - card#1: :: USB Offload Playback Card Route PCM#0 -1 (range -1->32) USB Offload Playback PCM Route PCM#0 -1 (range -1->255) **USB Sound Card** - card#2: :: USB Offload Playback Card Route PCM#0 0 (range -1->32) USB Offload Playback PCM Route PCM#0 1 (range -1->255) h](h)}(h**Sound Cards**:h](j)}(h**Sound Cards**h]h Sound Cards}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM_hjubj<)}(hX$:: 0 [SM8250MTPWCD938]: sm8250 - SM8250-MTP-WCD9380-WSA8810-VA-D SM8250-MTP-WCD9380-WSA8810-VA-DMIC 1 [Seri ]: USB-Audio - Plantronics Blackwire 3225 Seri Plantronics Plantronics Blackwire 3225 Seri at usb-xhci-hcd.1.auto-1.1, full sp 2 [C320M ]: USB-Audio - Plantronics C320-M Plantronics Plantronics C320-M at usb-xhci-hcd.1.auto-1.2, full speed h]h)}(hX0 [SM8250MTPWCD938]: sm8250 - SM8250-MTP-WCD9380-WSA8810-VA-D SM8250-MTP-WCD9380-WSA8810-VA-DMIC 1 [Seri ]: USB-Audio - Plantronics Blackwire 3225 Seri Plantronics Plantronics Blackwire 3225 Seri at usb-xhci-hcd.1.auto-1.1, full sp 2 [C320M ]: USB-Audio - Plantronics C320-M Plantronics Plantronics C320-M at usb-xhci-hcd.1.auto-1.2, full speedh]hX0 [SM8250MTPWCD938]: sm8250 - SM8250-MTP-WCD9380-WSA8810-VA-D SM8250-MTP-WCD9380-WSA8810-VA-DMIC 1 [Seri ]: USB-Audio - Plantronics Blackwire 3225 Seri Plantronics Plantronics Blackwire 3225 Seri at usb-xhci-hcd.1.auto-1.1, full sp 2 [C320M ]: USB-Audio - Plantronics C320-M Plantronics Plantronics C320-M at usb-xhci-hcd.1.auto-1.2, full speed}hj:sbah}(h]h ]h"]h$]h&]hhuh1hhhhMchj6ubah}(h]h ]h"]h$]h&]uh1j;hhhMahjubh)}(h**PCM Devices**:h](j)}(h**PCM Devices**h]h PCM Devices}(hjRhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjNubh:}(hjNhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMlhjubj<)}(hX :: card 0: SM8250MTPWCD938 [SM8250-MTP-WCD9380-WSA8810-VA-D], device 0: MultiMedia1 (*) [] Subdevices: 1/1 Subdevice #0: subdevice #0 card 0: SM8250MTPWCD938 [SM8250-MTP-WCD9380-WSA8810-VA-D], device 1: MultiMedia2 (*) [] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: Seri [Plantronics Blackwire 3225 Seri], device 0: USB Audio [USB Audio] Subdevices: 1/1 Subdevice #0: subdevice #0 card 2: C320M [Plantronics C320-M], device 0: USB Audio [USB Audio] Subdevices: 1/1 Subdevice #0: subdevice #0 h]h)}(hXcard 0: SM8250MTPWCD938 [SM8250-MTP-WCD9380-WSA8810-VA-D], device 0: MultiMedia1 (*) [] Subdevices: 1/1 Subdevice #0: subdevice #0 card 0: SM8250MTPWCD938 [SM8250-MTP-WCD9380-WSA8810-VA-D], device 1: MultiMedia2 (*) [] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: Seri [Plantronics Blackwire 3225 Seri], device 0: USB Audio [USB Audio] Subdevices: 1/1 Subdevice #0: subdevice #0 card 2: C320M [Plantronics C320-M], device 0: USB Audio [USB Audio] Subdevices: 1/1 Subdevice #0: subdevice #0h]hXcard 0: SM8250MTPWCD938 [SM8250-MTP-WCD9380-WSA8810-VA-D], device 0: MultiMedia1 (*) [] Subdevices: 1/1 Subdevice #0: subdevice #0 card 0: SM8250MTPWCD938 [SM8250-MTP-WCD9380-WSA8810-VA-D], device 1: MultiMedia2 (*) [] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: Seri [Plantronics Blackwire 3225 Seri], device 0: USB Audio [USB Audio] Subdevices: 1/1 Subdevice #0: subdevice #0 card 2: C320M [Plantronics C320-M], device 0: USB Audio [USB Audio] Subdevices: 1/1 Subdevice #0: subdevice #0}hjnsbah}(h]h ]h"]h$]h&]hhuh1hhhhMphjjubah}(h]h ]h"]h$]h&]uh1j;hhhMnhjubh)}(h**USB Sound Card** - card#1:h](j)}(h**USB Sound Card**h]hUSB Sound Card}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh - card#1:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM}hjubj<)}(h}:: USB Offload Playback Card Route PCM#0 -1 (range -1->32) USB Offload Playback PCM Route PCM#0 -1 (range -1->255) h]h)}(htUSB Offload Playback Card Route PCM#0 -1 (range -1->32) USB Offload Playback PCM Route PCM#0 -1 (range -1->255)h]htUSB Offload Playback Card Route PCM#0 -1 (range -1->32) USB Offload Playback PCM Route PCM#0 -1 (range -1->255)}hjsbah}(h]h ]h"]h$]h&]hhuh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1j;hhhMhjubh)}(h**USB Sound Card** - card#2:h](j)}(h**USB Sound Card**h]hUSB Sound Card}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh - card#2:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjubj<)}(h{:: USB Offload Playback Card Route PCM#0 0 (range -1->32) USB Offload Playback PCM Route PCM#0 1 (range -1->255) h]h)}(hrUSB Offload Playback Card Route PCM#0 0 (range -1->32) USB Offload Playback PCM Route PCM#0 1 (range -1->255)h]hrUSB Offload Playback Card Route PCM#0 0 (range -1->32) USB Offload Playback PCM Route PCM#0 1 (range -1->255)}hjsbah}(h]h ]h"]h$]h&]hhuh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1j;hhhMhjubeh}(h]h ]h"]h$]h&]uh1j;hhhM_hj hhubh)}(hX;The above example shows a scenario where the system has one ASoC platform card (card#0) and two USB sound devices connected (card#1 and card#2). When reading the available kcontrols for each USB audio device, the following kcontrols lists the mapped offload card and pcm device indexes for the specific USB device:h]hX;The above example shows a scenario where the system has one ASoC platform card (card#0) and two USB sound devices connected (card#1 and card#2). When reading the available kcontrols for each USB audio device, the following kcontrols lists the mapped offload card and pcm device indexes for the specific USB device:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubj<)}(hT``USB Offload Playback Card Route PCM#*`` ``USB Offload Playback PCM Route PCM#*`` h](h)}(h)``USB Offload Playback Card Route PCM#*``h]j')}(hjh]h%USB Offload Playback Card Route PCM#*}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j&hjubah}(h]h ]h"]h$]h&]uh1hhhhMhjubh)}(h(``USB Offload Playback PCM Route PCM#*``h]j')}(hjh]h$USB Offload Playback PCM Route PCM#*}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j&hjubah}(h]h ]h"]h$]h&]uh1hhhhMhjubeh}(h]h ]h"]h$]h&]uh1j;hhhMhj hhubh)}(hThe kcontrol is indexed, because a USB audio device could potentially have several PCM devices. The above kcontrols are defined as:h]hThe kcontrol is indexed, because a USB audio device could potentially have several PCM devices. The above kcontrols are defined as:}(hj6hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubj<)}(hX[- ``USB Offload Playback Card Route PCM#`` **(R)**: Returns the ASoC platform sound card index for a mapped offload path. The output **"0"** (card index) signifies that there is an available offload path for the USB SND device through card#0. If **"-1"** is seen, then no offload path is available for the USB SND device. This kcontrol exists for each USB audio device that exists in the system, and its expected to derive the current status of offload based on the output value for the kcontrol along with the PCM route kcontrol. - ``USB Offload Playback PCM Route PCM#`` **(R)**: Returns the ASoC platform sound PCM device index for a mapped offload path. The output **"1"** (PCM device index) signifies that there is an available offload path for the USB SND device through PCM device#0. If **"-1"** is seen, then no offload path is available for the USB\ SND device. This kcontrol exists for each USB audio device that exists in the system, and its expected to derive the current status of offload based on the output value for this kcontrol, in addition to the card route kcontrol. h]jB)}(hhh](jG)}(hX``USB Offload Playback Card Route PCM#`` **(R)**: Returns the ASoC platform sound card index for a mapped offload path. The output **"0"** (card index) signifies that there is an available offload path for the USB SND device through card#0. If **"-1"** is seen, then no offload path is available for the USB SND device. This kcontrol exists for each USB audio device that exists in the system, and its expected to derive the current status of offload based on the output value for the kcontrol along with the PCM route kcontrol. O8h]h)}(hX``USB Offload Playback Card Route PCM#`` **(R)**: Returns the ASoC platform sound card index for a mapped offload path. The output **"0"** (card index) signifies that there is an available offload path for the USB SND device through card#0. If **"-1"** is seen, then no offload path is available for the USB SND device. This kcontrol exists for each USB audio device that exists in the system, and its expected to derive the current status of offload based on the output value for the kcontrol along with the PCM route kcontrol.h](j')}(h(``USB Offload Playback Card Route PCM#``h]h$USB Offload Playback Card Route PCM#}(hjShhhNhNubah}(h]h ]h"]h$]h&]uh1j&hjOubh }(hjOhhhNhNubj)}(h**(R)**h]h(R)}(hjehhhNhNubah}(h]h ]h"]h$]h&]uh1jhjOubhT: Returns the ASoC platform sound card index for a mapped offload path. The output }(hjOhhhNhNubj)}(h**"0"**h]h“0”}(hjwhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjOubhj (card index) signifies that there is an available offload path for the USB SND device through card#0. If }(hjOhhhNhNubj)}(h**"-1"**h]h“-1”}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjOubhX is seen, then no offload path is available for the USB SND device. This kcontrol exists for each USB audio device that exists in the system, and its expected to derive the current status of offload based on the output value for the kcontrol along with the PCM route kcontrol.}(hjOhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjKubah}(h]h ]h"]h$]h&]uh1jFhjHubjG)}(hX,``USB Offload Playback PCM Route PCM#`` **(R)**: Returns the ASoC platform sound PCM device index for a mapped offload path. The output **"1"** (PCM device index) signifies that there is an available offload path for the USB SND device through PCM device#0. If **"-1"** is seen, then no offload path is available for the USB\ SND device. This kcontrol exists for each USB audio device that exists in the system, and its expected to derive the current status of offload based on the output value for this kcontrol, in addition to the card route kcontrol. h]h)}(hX+``USB Offload Playback PCM Route PCM#`` **(R)**: Returns the ASoC platform sound PCM device index for a mapped offload path. The output **"1"** (PCM device index) signifies that there is an available offload path for the USB SND device through PCM device#0. If **"-1"** is seen, then no offload path is available for the USB\ SND device. This kcontrol exists for each USB audio device that exists in the system, and its expected to derive the current status of offload based on the output value for this kcontrol, in addition to the card route kcontrol.h](j')}(h'``USB Offload Playback PCM Route PCM#``h]h#USB Offload Playback PCM Route PCM#}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j&hjubh }(hjhhhNhNubj)}(h**(R)**h]h(R)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhZ: Returns the ASoC platform sound PCM device index for a mapped offload path. The output }(hjhhhNhNubj)}(h**"1"**h]h“1”}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhv (PCM device index) signifies that there is an available offload path for the USB SND device through PCM device#0. If }(hjhhhNhNubj)}(h**"-1"**h]h“-1”}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhX is seen, then no offload path is available for the USB SND device. This kcontrol exists for each USB audio device that exists in the system, and its expected to derive the current status of offload based on the output value for this kcontrol, in addition to the card route kcontrol.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jFhjHubeh}(h]h ]h"]h$]h&]j j uh1jAhhhMhjDubah}(h]h ]h"]h$]h&]uh1j;hhhMhj hhubeh}(h]implementationah ]h"]implementationah$]h&]uh1hhj hhhhhM[ubh)}(hhh](h)}(h#USB Offload Playback Route Kcontrolh]h#USB Offload Playback Route Kcontrol}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMubh)}(hIn order to allow for vendor specific implementations on audio offloading device selection, the SoC USB layer exposes the following:h]hIn order to allow for vendor specific implementations on audio offloading device selection, the SoC USB layer exposes the following:}(hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hint (*update_offload_route_info)(struct snd_soc_component *component, int card, int pcm, int direction, enum snd_soc_usb_kctl path, long *route)h]hint (*update_offload_route_info)(struct snd_soc_component *component, int card, int pcm, int direction, enum snd_soc_usb_kctl path, long *route)}hj6sbah}(h]h ]h"]h$]h&]hhjjrstj}uh1hhhhMhjhhubj)}(hhh]h}(h]h ]h"]h$]h&]hhuh1jhjhhhhhMubh)}(hqThese are specific for the **USB Offload Playback Card Route PCM#** and **USB Offload PCM Route PCM#** kcontrols.h](hThese are specific for the }(hjOhhhNhNubj)}(h(**USB Offload Playback Card Route PCM#**h]h$USB Offload Playback Card Route PCM#}(hjWhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjOubh and }(hjOhhhNhNubj)}(h**USB Offload PCM Route PCM#**h]hUSB Offload PCM Route PCM#}(hjihhhNhNubah}(h]h ]h"]h$]h&]uh1jhjOubh kcontrols.}(hjOhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hWhen users issue get calls to the kcontrol, the registered SoC USB callbacks will execute the registered function calls to the DPCM BE DAI link.h]hWhen users issue get calls to the kcontrol, the registered SoC USB callbacks will execute the registered function calls to the DPCM BE DAI link.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(h**Callback Registration:**h]j)}(hjh]hCallback Registration:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hXAstatic int q6usb_component_probe(struct snd_soc_component *component) { ... usb = snd_soc_usb_allocate_port(component, 1, &data->priv); if (IS_ERR(usb)) return -ENOMEM; usb->connection_status_cb = q6usb_alsa_connection_cb; usb->update_offload_route_info = q6usb_get_offload_dev; ret = snd_soc_usb_add_port(usb);h]hXAstatic int q6usb_component_probe(struct snd_soc_component *component) { ... usb = snd_soc_usb_allocate_port(component, 1, &data->priv); if (IS_ERR(usb)) return -ENOMEM; usb->connection_status_cb = q6usb_alsa_connection_cb; usb->update_offload_route_info = q6usb_get_offload_dev; ret = snd_soc_usb_add_port(usb);}hjsbah}(h]h ]h"]h$]h&]hhjjrstj}uh1hhhhMhjhhubj)}(hhh]h}(h]h ]h"]h$]h&]hhuh1jhjhhhhhMubeh}(h]#usb-offload-playback-route-kcontrolah ]h"]#usb offload playback route kcontrolah$]h&]uh1hhj hhhhhMubh)}(hhh](h)}(hExisting USB Sound Kcontrolh]hExisting USB Sound Kcontrol}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMubh)}(hX With the introduction of USB offload support, the above USB offload kcontrol will be added to the pre existing list of kcontrols identified by the USB sound framework. These kcontrols are still the main controls that are used to modify characteristics pertaining to the USB audio device.h]hX With the introduction of USB offload support, the above USB offload kcontrol will be added to the pre existing list of kcontrols identified by the USB sound framework. These kcontrols are still the main controls that are used to modify characteristics pertaining to the USB audio device.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubj<)}(hX:: Number of controls: 9 ctl type num name value 0 INT 2 Capture Channel Map 0, 0 (range 0->36) 1 INT 2 Playback Channel Map 0, 0 (range 0->36) 2 BOOL 1 Headset Capture Switch On 3 INT 1 Headset Capture Volume 10 (range 0->13) 4 BOOL 1 Sidetone Playback Switch On 5 INT 1 Sidetone Playback Volume 4096 (range 0->8192) 6 BOOL 1 Headset Playback Switch On 7 INT 2 Headset Playback Volume 20, 20 (range 0->24) 8 INT 1 USB Offload Playback Card Route PCM#0 0 (range -1->32) 9 INT 1 USB Offload Playback PCM Route PCM#0 1 (range -1->255) h]h)}(hXhNumber of controls: 9 ctl type num name value 0 INT 2 Capture Channel Map 0, 0 (range 0->36) 1 INT 2 Playback Channel Map 0, 0 (range 0->36) 2 BOOL 1 Headset Capture Switch On 3 INT 1 Headset Capture Volume 10 (range 0->13) 4 BOOL 1 Sidetone Playback Switch On 5 INT 1 Sidetone Playback Volume 4096 (range 0->8192) 6 BOOL 1 Headset Playback Switch On 7 INT 2 Headset Playback Volume 20, 20 (range 0->24) 8 INT 1 USB Offload Playback Card Route PCM#0 0 (range -1->32) 9 INT 1 USB Offload Playback PCM Route PCM#0 1 (range -1->255)h]hXhNumber of controls: 9 ctl type num name value 0 INT 2 Capture Channel Map 0, 0 (range 0->36) 1 INT 2 Playback Channel Map 0, 0 (range 0->36) 2 BOOL 1 Headset Capture Switch On 3 INT 1 Headset Capture Volume 10 (range 0->13) 4 BOOL 1 Sidetone Playback Switch On 5 INT 1 Sidetone Playback Volume 4096 (range 0->8192) 6 BOOL 1 Headset Playback Switch On 7 INT 2 Headset Playback Volume 20, 20 (range 0->24) 8 INT 1 USB Offload Playback Card Route PCM#0 0 (range -1->32) 9 INT 1 USB Offload Playback PCM Route PCM#0 1 (range -1->255)}hjsbah}(h]h ]h"]h$]h&]hhuh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1j;hhhMhjhhubh)}(hSince USB audio device controls are handled over the USB control endpoint, use the existing mechanisms present in the USB mixer to set parameters, such as volume.h]hSince USB audio device controls are handled over the USB control endpoint, use the existing mechanisms present in the USB mixer to set parameters, such as volume.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubeh}(h]existing-usb-sound-kcontrolah ]h"]existing usb sound kcontrolah$]h&]uh1hhj hhhhhMubeh}(h]usb-offload-related-kcontrolsah ]h"]usb offload related kcontrolsah$]h&]uh1hhhhhhhhMRubeh}(h]asoc-usb-supportah ]h"]asoc usb supportah$]h&]uh1hhhhhhhhKubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksentryfootnote_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_handlerjGerror_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.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_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_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}refids}nameids}(j!jhhj j j`j]j j jI jF j j jjj j jjjjjju nametypes}(j!hj j`j jI j jj jjjuh}(jhhhj jj]jj jcjF j j jL jj j j jj jjjju footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}Rparse_messages]transform_messages] transformerN include_log] decorationNhhub.