Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: srv_kaichieh.chaung <srv_kaichieh.chuang@mediatek.com>
To: alsa-devel@alsa-project.org
Cc: liam.r.girdwood@linux.intel.com, kaichieh.chuang@mediatek.com
Subject: DPCM: BE to BE cpu DAIs question‏
Date: Fri, 26 Jun 2015 10:16:10 +0800	[thread overview]
Message-ID: <1435284970.29759.2.camel@mtksdaap41> (raw)

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!
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

             reply	other threads:[~2015-06-26 11:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-26  2:16 srv_kaichieh.chaung [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-06-26  2:16 DPCM: BE to BE cpu DAIs question‏ srv_kaichieh.chaung
2015-06-26 11:11 ` Liam Girdwood

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1435284970.29759.2.camel@mtksdaap41 \
    --to=srv_kaichieh.chuang@mediatek.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=kaichieh.chuang@mediatek.com \
    --cc=liam.r.girdwood@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox