€•BLŒ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Œ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.”…””}”(hhîhž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.”…””}”(hhühž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”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hjhžhhŸh¶h Kubh¸)”}”(hŒThe main requirements are:”h]”hŒThe main requirements are:”…””}”(hj#hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Khjhž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”…””}”(hj<hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Khj8ubah}”(h]”h ]”h"]”h$]”h&]”uh1j6hj3hžhhŸh¶h Nubj7)”}”(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”…””}”(hjThžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h KhjPubah}”(h]”h ]”h"]”h$]”h&]”uh1j6hj3hžhhŸh¶h Nubj7)”}”(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”…””}”(hjlhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Khjhubah}”(h]”h ]”h"]”h$]”h&]”uh1j6hj3hžhhŸh¶h Nubj7)”}”(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&]”uh1j6hj3hžhhŸh¶h Nubeh}”(h]”h ]”h"]”h$]”h&]”Œbullet”Œ-”uh1j1hŸh¶h Khjhž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).”…””}”(hjñhž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”…””}”(hj hž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:”…””}”(hjhž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)”…””}”(hjChžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hj@hž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).”…””}”(hjQhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h KThj@hžhubh¢)”}”(hhh]”(h§)”}”(hŒCREATE”h]”hŒCREATE”…””}”(hjbhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hj_hž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.”…””}”(hjphžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h KXhj_hž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[hj_hžhubeh}”(h]”Œcreate”ah ]”h"]”Œcreate”ah$]”h&]”uh1h¡hj@hž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¡hj@hž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¡hj@hžhhŸh¶h Kfubh¢)”}”(hhh]”(h§)”}”(hŒSTOP”h]”hŒSTOP”…””}”(hjhž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.”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Kzhj hžhubeh}”(h]”Œstop”ah ]”h"]”Œstop”ah$]”h&]”uh1h¡hj@hžhhŸh¶h Kyubh¢)”}”(hhh]”(h§)”}”(hŒSTATUS”h]”hŒSTATUS”…””}”(hj6hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hj3hž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).”…””}”(hjDhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Khj3hžhubeh}”(h]”Œstatus”ah ]”h"]”Œstatus”ah$]”h&]”uh1h¡hj@hž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”…””}”(hjehžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hjbhžhhŸh¶h Kƒubj2)”}”(hhh]”(j7)”}”(hŒ'Shengjiu Wang ”h]”h¸)”}”(hjxh]”(hŒShengjiu Wang <”…””}”(hjzhžhhŸNh NubhÂ)”}”(hŒshengjiu.wang@gmail.com”h]”hŒshengjiu.wang@gmail.com”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”Œmailto:shengjiu.wang@gmail.com”uh1hÁhjzubhŒ>”…””}”(hjzhžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K„hjvubah}”(h]”h ]”h"]”h$]”h&]”uh1j6hjshžhhŸh¶h Nubj7)”}”(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&]”uh1j6hjshžhhŸh¶h Nubj7)”}”(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&]”uh1j6hjshžhhŸh¶h Nubeh}”(h]”h ]”h"]”h$]”h&]”jžjŸuh1j1hŸh¶h K„hjbhž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”j0Œ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 jjj j¥j¢jjj=j:j_j\j‘jŽj¸jµj jj0j-jWjTjjÿuŒ nametypes”}”(j ‰j‰j¥‰j‰j=‰j_‰j‘‰j¸‰j ‰j0‰jW‰j‰uh}”(jh£j hÝj¢jjj¨j:jj\j@jŽj_jµj”jj»j-j jTj3jÿjbuŒ 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.