€• 3Œsphinx.addnodes”Œdocument”“”)”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)”}”(hhh]”(hŒ pending_xref”“”)”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…””}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ,/translations/zh_CN/sound/soc/codec-to-codec”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)”}”(hhh]”hŒChinese (Traditional)”…””}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ,/translations/zh_TW/sound/soc/codec-to-codec”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ,/translations/it_IT/sound/soc/codec-to-codec”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ,/translations/ja_JP/sound/soc/codec-to-codec”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ,/translations/ko_KR/sound/soc/codec-to-codec”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒSpanish”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ,/translations/sp_SP/sound/soc/codec-to-codec”Œ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Œ.Creating codec to codec dai link for ALSA dapm”h]”hŒ.Creating codec to codec dai link for ALSA dapm”…””}”(hh¨hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hh£hžhhŸŒF/var/lib/git/docbuild/linux/Documentation/sound/soc/codec-to-codec.rst”h KubhŒ paragraph”“”)”}”(hŒZMostly the flow of audio is always from CPU to codec so your system will look as below: ::”h]”hŒWMostly the flow of audio is always from CPU to codec so your system will look as below:”…””}”(hh¹hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Khh£hžhubhŒ literal_block”“”)”}”(hŒ– --------- --------- | | dai | | CPU -------> codec | | | | --------- ---------”h]”hŒ– --------- --------- | | dai | | CPU -------> codec | | | | --------- ---------”…””}”hhÉsbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1hÇhŸh¶h K hh£hžhubh¸)”}”(hŒ&In case your system looks as below: ::”h]”hŒ#In case your system looks as below:”…””}”(hhÙhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Khh£hžhubhÈ)”}”(hXx --------- | | codec-2 | | --------- | dai-2 | ---------- --------- | | dai-1 | | CPU -------> codec-1 | | | | ---------- --------- | dai-3 | --------- | | codec-3 | | ---------”h]”hXx --------- | | codec-2 | | --------- | dai-2 | ---------- --------- | | dai-1 | | CPU -------> codec-1 | | | | ---------- --------- | dai-3 | --------- | | codec-3 | | ---------”…””}”hhçsbah}”(h]”h ]”h"]”h$]”h&]”h×hØuh1hÇhŸh¶h Khh£hžhubh¸)”}”(hX6Suppose codec-2 is a bluetooth chip and codec-3 is connected to a speaker and you have a below scenario: codec-2 will receive the audio data and the user wants to play that audio through codec-3 without involving the CPU.This aforementioned case is the ideal case when codec to codec connection should be used.”h]”hX6Suppose codec-2 is a bluetooth chip and codec-3 is connected to a speaker and you have a below scenario: codec-2 will receive the audio data and the user wants to play that audio through codec-3 without involving the CPU.This aforementioned case is the ideal case when codec to codec connection should be used.”…””}”(hhõhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K(hh£hžhubh¸)”}”(hŒ=Your dai_link should appear as below in your machine file: ::”h]”hŒ:Your dai_link should appear as below in your machine file:”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K/hh£hžhubhÈ)”}”(hXï/* * this pcm stream only supports 24 bit, 2 channel and * 48k sampling rate. */ static const struct snd_soc_pcm_stream dsp_codec_params = { .formats = SNDRV_PCM_FMTBIT_S24_LE, .rate_min = 48000, .rate_max = 48000, .channels_min = 2, .channels_max = 2, }; { .name = "CPU-DSP", .stream_name = "CPU-DSP", .cpu_dai_name = "samsung-i2s.0", .codec_name = "codec-2, .codec_dai_name = "codec-2-dai_name", .platform_name = "samsung-i2s.0", .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBP_CFP, .ignore_suspend = 1, .c2c_params = &dsp_codec_params, .num_c2c_params = 1, }, { .name = "DSP-CODEC", .stream_name = "DSP-CODEC", .cpu_dai_name = "wm0010-sdi2", .codec_name = "codec-3, .codec_dai_name = "codec-3-dai_name", .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBP_CFP, .ignore_suspend = 1, .c2c_params = &dsp_codec_params, .num_c2c_params = 1, },”h]”hXï/* * this pcm stream only supports 24 bit, 2 channel and * 48k sampling rate. */ static const struct snd_soc_pcm_stream dsp_codec_params = { .formats = SNDRV_PCM_FMTBIT_S24_LE, .rate_min = 48000, .rate_max = 48000, .channels_min = 2, .channels_max = 2, }; { .name = "CPU-DSP", .stream_name = "CPU-DSP", .cpu_dai_name = "samsung-i2s.0", .codec_name = "codec-2, .codec_dai_name = "codec-2-dai_name", .platform_name = "samsung-i2s.0", .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBP_CFP, .ignore_suspend = 1, .c2c_params = &dsp_codec_params, .num_c2c_params = 1, }, { .name = "DSP-CODEC", .stream_name = "DSP-CODEC", .cpu_dai_name = "wm0010-sdi2", .codec_name = "codec-3, .codec_dai_name = "codec-3-dai_name", .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBP_CFP, .ignore_suspend = 1, .c2c_params = &dsp_codec_params, .num_c2c_params = 1, },”…””}”hjsbah}”(h]”h ]”h"]”h$]”h&]”h×hØuh1hÇhŸh¶h K3hh£hžhubh¸)”}”(hŒBAbove code snippet is motivated from sound/soc/samsung/speyside.c.”h]”hŒBAbove code snippet is motivated from sound/soc/samsung/speyside.c.”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h KYhh£hžhubh¸)”}”(hŒjNote the "c2c_params" callback which lets the dapm know that this dai_link is a codec to codec connection.”h]”hŒnNote the “c2c_params†callback which lets the dapm know that this dai_link is a codec to codec connection.”…””}”(hj-hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K[hh£hžhubh¸)”}”(hX[In dapm core a route is created between cpu_dai playback widget and codec_dai capture widget for playback path and vice-versa is true for capture path. In order for this aforementioned route to get triggered, DAPM needs to find a valid endpoint which could be either a sink or source widget corresponding to playback and capture path respectively.”h]”hX[In dapm core a route is created between cpu_dai playback widget and codec_dai capture widget for playback path and vice-versa is true for capture path. In order for this aforementioned route to get triggered, DAPM needs to find a valid endpoint which could be either a sink or source widget corresponding to playback and capture path respectively.”…””}”(hj;hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K^hh£hžhubh¸)”}”(hŒÎIn order to trigger this dai_link widget, a thin codec driver for the speaker amp can be created as demonstrated in wm8727.c file, it sets appropriate constraints for the device even if it needs no control.”h]”hŒÎIn order to trigger this dai_link widget, a thin codec driver for the speaker amp can be created as demonstrated in wm8727.c file, it sets appropriate constraints for the device even if it needs no control.”…””}”(hjIhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Kehh£hžhubh¸)”}”(hŒÂMake sure to name your corresponding cpu and codec playback and capture dai names ending with "Playback" and "Capture" respectively as dapm core will link and power those dais based on the name.”h]”hŒÊMake sure to name your corresponding cpu and codec playback and capture dai names ending with “Playback†and “Capture†respectively as dapm core will link and power those dais based on the name.”…””}”(hjWhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Kihh£hžhubh¸)”}”(hXÖA dai_link in a "simple-audio-card" will automatically be detected as codec to codec when all DAIs on the link belong to codec components. The dai_link will be initialized with the subset of stream parameters (channels, format, sample rate) supported by all DAIs on the link. Since there is no way to provide these parameters in the device tree, this is mostly useful for communication with simple fixed-function codecs, such as a Bluetooth controller or cellular modem.”h]”hXÚA dai_link in a “simple-audio-card†will automatically be detected as codec to codec when all DAIs on the link belong to codec components. The dai_link will be initialized with the subset of stream parameters (channels, format, sample rate) supported by all DAIs on the link. Since there is no way to provide these parameters in the device tree, this is mostly useful for communication with simple fixed-function codecs, such as a Bluetooth controller or cellular modem.”…””}”(hjehžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Kmhh£hžhubeh}”(h]”Œ.creating-codec-to-codec-dai-link-for-alsa-dapm”ah ]”h"]”Œ.creating codec to codec dai link for alsa dapm”ah$]”h&]”uh1h¡hhhžhhŸh¶h Kubeh}”(h]”h ]”h"]”h$]”h&]”Œsource”h¶uh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)”}”(h¦NŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”Œentry”Œfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”jžŒerror_encoding”Œutf-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”h¶Œ _destination”NŒ _config_files”]”Œ7/var/lib/git/docbuild/linux/Documentation/docutils.conf”aŒfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œpep_references”NŒ pep_base_url”Œhttps://peps.python.org/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œ&https://datatracker.ietf.org/doc/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œ image_loading”Œlink”Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒsection_self_link”‰Œenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œrefids”}”Œnameids”}”jxjusŒ nametypes”}”jx‰sh}”juh£sŒ 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”]”hŒsystem_message”“”)”}”(hhh]”h¸)”}”(hŒfPossible title underline, too short for the title. Treating it as ordinary text because it's so short.”h]”hŒhPossible title underline, too short for the title. Treating it as ordinary text because it’s so short.”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hjubah}”(h]”h ]”h"]”h$]”h&]”Œlevel”KŒtype”ŒINFO”Œline”KŒsource”h¶uh1jhh£hžhhŸh¶h KubaŒtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nhžhub.