€•$MŒ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”Œ0/translations/zh_CN/sound/designs/compress-accel”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)”}”(hhh]”hŒChinese (Traditional)”…””}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ0/translations/zh_TW/sound/designs/compress-accel”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ0/translations/it_IT/sound/designs/compress-accel”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ0/translations/ja_JP/sound/designs/compress-accel”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ0/translations/ko_KR/sound/designs/compress-accel”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒPortuguese (Brazilian)”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ0/translations/pt_BR/sound/designs/compress-accel”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒSpanish”…””}”hh–sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ0/translations/sp_SP/sound/designs/compress-accel”Œ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Œ"ALSA Co-processor Acceleration API”h]”hŒ"ALSA Co-processor Acceleration API”…””}”(hh¼h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhh·h²hh³ŒJ/var/lib/git/docbuild/linux/Documentation/sound/designs/compress-accel.rst”h´KubhŒ paragraph”“”)”}”(hŒ Jaroslav Kysela ”h]”(hŒJaroslav Kysela <”…””}”(hhÍh²hh³Nh´NubhŒ reference”“”)”}”(hŒperex@perex.cz”h]”hŒperex@perex.cz”…””}”(hh×h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”Œmailto:perex@perex.cz”uh1hÕhhÍubhŒ>”…””}”(hhÍh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khh·h²hubh¶)”}”(hhh]”(h»)”}”(hŒOverview”h]”hŒOverview”…””}”(hhôh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhhñh²hh³hÊh´K ubhÌ)”}”(hŒ¢There is a requirement to expose the audio hardware that accelerates various tasks for user space such as sample rate converters, compressed stream decoders, etc.”h]”hŒ¢There is a requirement to expose the audio hardware that accelerates various tasks for user space such as sample rate converters, compressed stream decoders, etc.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K hhñh²hubhÌ)”}”(hŒ¾This is description for the API extension for the compress ALSA API which is able to handle "tasks" that are not bound to real-time operations and allows for the serialization of operations.”h]”hŒÂThis is description for the API extension for the compress ALSA API which is able to handle “tasks†that are not bound to real-time operations and allows for the serialization of operations.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khhñh²hubeh}”(h]”Œoverview”ah ]”h"]”Œoverview”ah$]”h&]”uh1hµhh·h²hh³hÊh´K ubh¶)”}”(hhh]”(h»)”}”(hŒ Requirements”h]”hŒ Requirements”…””}”(hj)h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj&h²hh³hÊh´KubhÌ)”}”(hŒThe main requirements are:”h]”hŒThe main requirements are:”…””}”(hj7h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khj&h²hubhŒ bullet_list”“”)”}”(hhh]”(hŒ list_item”“”)”}”(hŒlserialization of multiple tasks for user space to allow multiple operations without user space intervention ”h]”hÌ)”}”(hŒkserialization of multiple tasks for user space to allow multiple operations without user space intervention”h]”hŒkserialization of multiple tasks for user space to allow multiple operations without user space intervention”…””}”(hjPh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KhjLubah}”(h]”h ]”h"]”h$]”h&]”uh1jJhjGh²hh³hÊh´NubjK)”}”(hŒ5separate buffers (input + output) for each operation ”h]”hÌ)”}”(hŒ4separate buffers (input + output) for each operation”h]”hŒ4separate buffers (input + output) for each operation”…””}”(hjhh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khjdubah}”(h]”h ]”h"]”h$]”h&]”uh1jJhjGh²hh³hÊh´NubjK)”}”(hŒ(expose buffers using mmap to user space ”h]”hÌ)”}”(hŒ'expose buffers using mmap to user space”h]”hŒ'expose buffers using mmap to user space”…””}”(hj€h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khj|ubah}”(h]”h ]”h"]”h$]”h&]”uh1jJhjGh²hh³hÊh´NubjK)”}”(hŒFsignal user space when the task is finished (standard poll mechanism) ”h]”hÌ)”}”(hŒEsignal user space when the task is finished (standard poll mechanism)”h]”hŒEsignal user space when the task is finished (standard poll mechanism)”…””}”(hj˜h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khj”ubah}”(h]”h ]”h"]”h$]”h&]”uh1jJhjGh²hh³hÊh´Nubeh}”(h]”h ]”h"]”h$]”h&]”Œbullet”Œ-”uh1jEh³hÊh´Khj&h²hubeh}”(h]”Œ requirements”ah ]”h"]”Œ requirements”ah$]”h&]”uh1hµhh·h²hh³hÊh´Kubh¶)”}”(hhh]”(h»)”}”(hŒDesign”h]”hŒDesign”…””}”(hj¿h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj¼h²hh³hÊh´K"ubhÌ)”}”(hŒQA new direction SND_COMPRESS_ACCEL is introduced to identify the passthrough API.”h]”hŒQA new direction SND_COMPRESS_ACCEL is introduced to identify the passthrough API.”…””}”(hjÍh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K$hj¼h²hubhÌ)”}”(hX#The API extension shares device enumeration and parameters handling from the main compressed API. All other realtime streaming ioctls are deactivated and a new set of task related ioctls are introduced. The standard read/write/mmap I/O operations are not supported in the passthrough device.”h]”hX#The API extension shares device enumeration and parameters handling from the main compressed API. All other realtime streaming ioctls are deactivated and a new set of task related ioctls are introduced. The standard read/write/mmap I/O operations are not supported in the passthrough device.”…””}”(hjÛh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K'hj¼h²hubhÌ)”}”(hŒwDevice ("stream") state handling is reduced to OPEN/SETUP. All other states are not available for the passthrough mode.”h]”hŒ{Device (“streamâ€) state handling is reduced to OPEN/SETUP. All other states are not available for the passthrough mode.”…””}”(hjéh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K,hj¼h²hubhÌ)”}”(hŒüData I/O mechanism is using standard dma-buf interface with all advantages like mmap, standard I/O, buffer sharing etc. One buffer is used for the input data and second (separate) buffer is used for the output data. Each task have separate I/O buffers.”h]”hŒüData I/O mechanism is using standard dma-buf interface with all advantages like mmap, standard I/O, buffer sharing etc. One buffer is used for the input data and second (separate) buffer is used for the output data. Each task have separate I/O buffers.”…””}”(hj÷h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K/hj¼h²hubhÌ)”}”(hXFor the buffering parameters, the fragments means a limit of allocated tasks for given device. The fragment_size limits the input buffer size for the given device. The output buffer size is determined by the driver (may be different from the input buffer size).”h]”hXFor the buffering parameters, the fragments means a limit of allocated tasks for given device. The fragment_size limits the input buffer size for the given device. The output buffer size is determined by the driver (may be different from the input buffer size).”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K4hj¼h²hubeh}”(h]”Œdesign”ah ]”h"]”Œdesign”ah$]”h&]”uh1hµhh·h²hh³hÊh´K"ubh¶)”}”(hhh]”(h»)”}”(hŒ State Machine”h]”hŒ State Machine”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjh²hh³hÊh´K:ubhÌ)”}”(hŒ?The passthrough audio stream state machine is described below::”h]”hŒ>The passthrough audio stream state machine is described below:”…””}”(hj,h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khjh²hubeh}”(h]”Œ state-machine”ah ]”h"]”Œ state machine”ah$]”h&]”uh1hµhh·h²hh³hÊh´K:ubh¶)”}”(hhh]”(h»)”}”(hŒPassthrough operations (ioctls)”h]”hŒPassthrough operations (ioctls)”…””}”(hjWh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjTh²hh³hÊh´KRubhÌ)”}”(hŒ@All operations are protected using stream->device->lock (mutex).”h]”hŒ@All operations are protected using stream->device->lock (mutex).”…””}”(hjeh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KThjTh²hubh¶)”}”(hhh]”(h»)”}”(hŒCREATE”h]”hŒCREATE”…””}”(hjvh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjsh²hh³hÊh´KWubhÌ)”}”(hŒfCreates a set of input/output buffers. The input buffer size is fragment_size. Allocates unique seqno.”h]”hŒfCreates a set of input/output buffers. The input buffer size is fragment_size. Allocates unique seqno.”…””}”(hj„h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KXhjsh²hubhÌ)”}”(hŒÉThe hardware drivers allocate internal 'struct dma_buf' for both input and output buffers (using 'dma_buf_export()' function). The anonymous file descriptors for those buffers are passed to user space.”h]”hŒÑThe hardware drivers allocate internal ‘struct dma_buf’ for both input and output buffers (using ‘dma_buf_export()’ function). The anonymous file descriptors for those buffers are passed to user space.”…””}”(hj’h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K[hjsh²hubeh}”(h]”Œcreate”ah ]”h"]”Œcreate”ah$]”h&]”uh1hµhjTh²hh³hÊh´KWubh¶)”}”(hhh]”(h»)”}”(hŒFREE”h]”hŒFREE”…””}”(hj«h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj¨h²hh³hÊh´K`ubhÌ)”}”(hŒ–Free a set of input/output buffers. If a task is active, the stop operation is executed before. If seqno is zero, operation is executed for all tasks.”h]”hŒ–Free a set of input/output buffers. If a task is active, the stop operation is executed before. If seqno is zero, operation is executed for all tasks.”…””}”(hj¹h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kahj¨h²hubeh}”(h]”Œfree”ah ]”h"]”Œfree”ah$]”h&]”uh1hµhjTh²hh³hÊh´K`ubh¶)”}”(hhh]”(h»)”}”(hŒSTART”h]”hŒSTART”…””}”(hjÒh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjÏh²hh³hÊh´KfubhÌ)”}”(hXBStarts (queues) a task. There are two cases of the task start - right after the task is created. In this case, origin_seqno must be zero. The second case is for reusing of already finished task. The origin_seqno must identify the task to be reused. In both cases, a new seqno value is allocated and returned to user space.”h]”hXBStarts (queues) a task. There are two cases of the task start - right after the task is created. In this case, origin_seqno must be zero. The second case is for reusing of already finished task. The origin_seqno must identify the task to be reused. In both cases, a new seqno value is allocated and returned to user space.”…””}”(hjàh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KghjÏh²hubhÌ)”}”(hŒŽThe prerequisite is that application filled input dma buffer with new source data and set input_size to pass the real data size to the driver.”h]”hŒŽThe prerequisite is that application filled input dma buffer with new source data and set input_size to pass the real data size to the driver.”…””}”(hjîh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KmhjÏh²hubhÌ)”}”(hŒXThe order of data processing is preserved (first started job must be finished at first).”h]”hŒXThe order of data processing is preserved (first started job must be finished at first).”…””}”(hjüh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KphjÏh²hubhÌ)”}”(hXIf the multiple tasks require a state handling (e.g. resampling operation), the user space may set SND_COMPRESS_TFLG_NEW_STREAM flag to mark the start of the new stream data. It is useful to keep the allocated buffers for the new operation rather using open/close mechanism.”h]”hXIf the multiple tasks require a state handling (e.g. resampling operation), the user space may set SND_COMPRESS_TFLG_NEW_STREAM flag to mark the start of the new stream data. It is useful to keep the allocated buffers for the new operation rather using open/close mechanism.”…””}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KshjÏh²hubeh}”(h]”Œstart”ah ]”h"]”Œstart”ah$]”h&]”uh1hµhjTh²hh³hÊh´Kfubh¶)”}”(hhh]”(h»)”}”(hŒSTOP”h]”hŒSTOP”…””}”(hj#h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj h²hh³hÊh´KyubhÌ)”}”(hŒNStop (dequeues) a task. If seqno is zero, operation is executed for all tasks.”h]”hŒNStop (dequeues) a task. If seqno is zero, operation is executed for all tasks.”…””}”(hj1h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kzhj h²hubeh}”(h]”Œstop”ah ]”h"]”Œstop”ah$]”h&]”uh1hµhjTh²hh³hÊh´Kyubh¶)”}”(hhh]”(h»)”}”(hŒSTATUS”h]”hŒSTATUS”…””}”(hjJh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjGh²hh³hÊh´K~ubhÌ)”}”(hŒObtain the task status (active, finished). Also, the driver will set the real output data size (valid area in the output buffer).”h]”hŒObtain the task status (active, finished). Also, the driver will set the real output data size (valid area in the output buffer).”…””}”(hjXh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KhjGh²hubeh}”(h]”Œstatus”ah ]”h"]”Œstatus”ah$]”h&]”uh1hµhjTh²hh³hÊh´K~ubeh}”(h]”Œpassthrough-operations-ioctls”ah ]”h"]”Œpassthrough operations (ioctls)”ah$]”h&]”uh1hµhh·h²hh³hÊh´KRubh¶)”}”(hhh]”(h»)”}”(hŒCredits”h]”hŒCredits”…””}”(hjyh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjvh²hh³hÊh´KƒubjF)”}”(hhh]”(jK)”}”(hŒ'Shengjiu Wang ”h]”hÌ)”}”(hjŒh]”(hŒShengjiu Wang <”…””}”(hjŽh²hh³Nh´NubhÖ)”}”(hŒshengjiu.wang@gmail.com”h]”hŒshengjiu.wang@gmail.com”…””}”(hj•h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”Œmailto:shengjiu.wang@gmail.com”uh1hÕhjŽubhŒ>”…””}”(hjŽh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K„hjŠubah}”(h]”h ]”h"]”h$]”h&]”uh1jJhj‡h²hh³hÊh´NubjK)”}”(hŒTakashi Iwai ”h]”hÌ)”}”(hj·h]”(hŒTakashi Iwai <”…””}”(hj¹h²hh³Nh´NubhÖ)”}”(hŒ tiwai@suse.de”h]”hŒ tiwai@suse.de”…””}”(hjÀh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”Œmailto:tiwai@suse.de”uh1hÕhj¹ubhŒ>”…””}”(hj¹h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K…hjµubah}”(h]”h ]”h"]”h$]”h&]”uh1jJhj‡h²hh³hÊh´NubjK)”}”(hŒVinod Koul ”h]”hÌ)”}”(hjâh]”(hŒ Vinod Koul <”…””}”(hjäh²hh³Nh´NubhÖ)”}”(hŒvkoul@kernel.org”h]”hŒvkoul@kernel.org”…””}”(hjëh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”Œmailto:vkoul@kernel.org”uh1hÕhjäubhŒ>”…””}”(hjäh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K†hjàubah}”(h]”h ]”h"]”h$]”h&]”uh1jJhj‡h²hh³hÊh´Nubeh}”(h]”h ]”h"]”h$]”h&]”j²j³uh1jEh³hÊh´K„hjvh²hubeh}”(h]”Œcredits”ah ]”h"]”Œcredits”ah$]”h&]”uh1hµhh·h²hh³hÊh´Kƒubeh}”(h]”Œ"alsa-co-processor-acceleration-api”ah ]”h"]”Œ"alsa co-processor acceleration api”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”jDŒ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”}”(jjj#j j¹j¶jjjQjNjsjpj¥j¢jÌjÉjjjDjAjkjhjjuŒ nametypes”}”(j‰j#‰j¹‰j‰jQ‰js‰j¥‰j̉j‰jD‰jk‰j‰uh}”(jh·j hñj¶j&jj¼jNjjpjTj¢jsjÉj¨jjÏjAj jhjGjjvuŒ 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.