Hi, Our platform use ASoC structure. Currently, we want to refactor our driver to use DPCM structure. I followed the documentation of DPCM, but have some trouble implementing hostless BE to BE dai links.
My question is: 1. Is there any code example for this(hostless BE to BE)? Since I didn't see any existing code on linux kernel. 2. From documentation, i have to assgin a snd_soc_pcm_stream for BE dais. It seems that the BE<->BE dai links can only support one spec (format/rates/ch). Or am i getting it wrong, does it support dynamically change of the spec?
Thanks in advanced!
-------------------------------------------------------------------------------------- I have tried some implementations, but failed. My linux version is 3.18.
Illustration, PCM -----------------> BE1 ↑ -------< BE2
Code snippet,
static const struct snd_soc_dapm_route machine_routes[] = { {BE1_PLAYBACK_CPU_DAI_STNAME, NULL, FE_STNAME}, {BE1_PLAYBACK_CPU_DAI_STNAME, NULL, BE2_CAPTURE_CPU_DAI_STNAME}, };
static const struct snd_soc_pcm_stream dai_params = { .formats = SNDRV_PCM_FMTBIT_S32_LE, .rate_min = 48000, .rate_max = 48000, .channels_min = 2, .channels_max = 2, };
static struct snd_soc_dai_link mt_soc_dai_common[] = { { .name = FE_PCM, .stream_name = FE_STNAME, .cpu_dai_name = FE_CPUDAINAME, // cannot use dummy!!!! .platform_name = FE_PCMNAME, .codec_name = "snd-soc-dummy", .codec_dai_name = "snd-soc-dummy-dai", .init = mt_soc_audio_init3, .ops = &kc_snd_soc_ops, .dynamic = 1, .dpcm_playback = 1, .trigger = {SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST}, }, /* BE DAIs */ { .name = "BE2", .cpu_dai_name = BE2_PLAYBACK_CPU_DAI, //"snd-soc-dummy-dai", .platform_name = "snd-soc-dummy", .codec_name = "snd-soc-dummy", .codec_dai_name = "snd-soc-dummy-dai", .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS, .no_pcm = 1, .dpcm_playback = 1, .dpcm_capture = 1, .ignore_suspend = 1, .ignore_pmdown_time = 1, .params = &dai_params, }, { .name = BE1_PLAYBACK, .cpu_dai_name = BE1_PLAYBACK_CPU_DAI, .platform_name = "snd-soc-dummy", .codec_name = "snd-soc-dummy", .codec_dai_name = "snd-soc-dummy-dai", .no_pcm = 1, .dpcm_playback = 1, .dpcm_capture = 1, .ignore_suspend = 1, .ignore_pmdown_time = 1, .params = &dai_params, },
1. when only routes PCM-->BE1, If i add .params in BE1 soc dai link, when i start PCM, it will crash. and get "Unable to handle kernel NULL pointer dereference at virtual address 000000d0" Seems to crash in dpcm_be_dai_startup() If i removed .params, it will not crash, and play normally.
2. when only with BE2--> BE1, BE2 is never trigger, where did i get wrong?
Thanks.
************* Email Confidentiality Notice ******************** The information contained in this e-mail message (including any attachments) may be confidential, proprietary, privileged, or otherwise exempt from disclosure under applicable laws. It is intended to be conveyed only to the designated recipient(s). Any use, dissemination, distribution, printing, retaining or copying of this e-mail (including its attachments) by unintended recipient(s) is strictly prohibited and may be unlawful. If you are not an intended recipient of this e-mail, or believe that you have received this e-mail in error, please notify the sender immediately (by replying to this e-mail), delete any and all copies of this e-mail (including any attachments) from your system, and do not disclose the content of this e-mail to any other person. Thank you!