From patchwork Tue Jan 29 07:25:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: b_lkasam@codeaurora.org X-Patchwork-Id: 10785649 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E8E281390 for ; Tue, 29 Jan 2019 08:03:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D75BC2B7A2 for ; Tue, 29 Jan 2019 08:03:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C84FA2B92E; Tue, 29 Jan 2019 08:03:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D28FD2B7A2 for ; Tue, 29 Jan 2019 08:03:14 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 4CB9E2674AD; Tue, 29 Jan 2019 09:03:12 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id E270E2674D1; Tue, 29 Jan 2019 09:03:09 +0100 (CET) Received: from smtp.codeaurora.org (smtp.codeaurora.org [198.145.29.96]) by alsa0.perex.cz (Postfix) with ESMTP id 7AB1C26749A for ; Tue, 29 Jan 2019 09:03:07 +0100 (CET) Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 3E16060112; Tue, 29 Jan 2019 07:25:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1548746715; bh=Tq5nK1WIyyar4460dX4SSUKrPr+OhezVuOGZ+xArawc=; h=Date:From:To:Cc:Subject:From; b=D4diOlUcvUorzTpKa2OKvKLRu+cNbZPv0+uG0QAdBQpoeyktFPrCQ0nvupzSEM1HV HnbGKcJLGzq9nBuqgHb669vCSWBKf7jZYcS/l5mJ29OsT7EclJd/aKqQufXyezVSMo Ia2EHsfxrmpIswUTzVig3nbvSOQSY9gkDxR2zqCI= Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id D818260112; Tue, 29 Jan 2019 07:25:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1548746714; bh=Tq5nK1WIyyar4460dX4SSUKrPr+OhezVuOGZ+xArawc=; h=Date:From:To:Cc:Subject:From; b=Kqw8l/teUF+WpweIc8q7HcD6n4nyaDoFED59800TJLQ1e3DG5ngSc/Db4E7TyuBun fcAqWNwXsBKgyM6IfMKR+mhlVsn2/DtDDn2yEUYWuRcHCdn3NktM9NA7r9jBJXHc8A b7Bpi7YtqalrUC+oazlubH4sgFeZVcW0vSh86iXY= MIME-Version: 1.0 Date: Tue, 29 Jan 2019 12:55:14 +0530 From: b_lkasam@codeaurora.org To: alsa-devel@alsa-project.org Message-ID: <2c502243cbd2281fabea150cedb56dc1@codeaurora.org> X-Sender: b_lkasam@codeaurora.org User-Agent: Roundcube Webmail/1.2.5 Cc: c_spanic@qti.qualcomm.com, lkasam@qti.qualcomm.com, c_smanag@qti.qualcomm.com Subject: [alsa-devel] Async ops SOC compress issue X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Hi ALSA team, Need inputs wrt one issue seen with soc-compress code. Please help check below issue seen in soc-compress file wrt handling multiple BEs with async ops ASYNC_DPCM_SND_SOC_HW_PARAMS set for given FE dailink/BE dailinks also. Issue : pcm_prepare failure when 2 BE's on same FE enabled during compress playback, seen only when both BE's have SOC_HW_PARAM defined as an async_op. Analysis: - With SOC_HW_PARAMS defined as async_op on both BE's, hw_params api for both of these BE's are scheduled for asynchronous execution. - It is observed that dpcm_be_hw_params_prepare is getting invoked twice, but for the same BE. Below are the issue logs taken for above scenario. 12-21 16:38:32.074 0 0 D SDM660 Compress1: connected new DPCM playback path SDM660 Compress1 -> INT4_MI2S_RX 12-21 16:38:32.075 0 0 D SDM660 Compress1: connected new DPCM playback path SDM660 Compress1 -> INT0_MI2S_RX 12-21 16:38:32.075 0 0 D INT0_MI2S_RX: ASoC: open playback BE INT0_MI2S_RX 12-21 16:38:32.076 0 0 D INT4_MI2S_RX: ASoC: open playback BE INT4_MI2S_RX 12-21 16:38:32.077 0 0 E soc_compr_set_params_fe: : async schedule hw_params for be INT0_MI2S_RX 12-21 16:38:32.077 0 0 E soc_compr_set_params_fe: : async schedule hw_params for be INT4_MI2S_RX 12-21 16:38:32.078 0 0 E dpcm_be_hw_params_prepare: : BE INT4_MI2S_RX -> dpcm_fe_dai_hw_params_be 12-21 16:38:32.079 0 0 E msm-dai-q6-mi2s soc: qcom,msm-dai-mi2s:qcom,msm-dai-q6-int-mi2s4: msm_dai_q6_mi2s_hw_params: dai id 11 dai_data->channels = 1 12-21 16:38:32.143 0 0 E dpcm_be_hw_params_prepare: : BE INT4_MI2S_RX -> dpcm_fe_dai_hw_params_be 12-21 16:38:32.173 0 0 E msm-dai-q6-mi2s soc: qcom,msm-dai-mi2s:qcom,msm-dai-q6-int-mi2s4: msm_dai_q6_mi2s_hw_params: ERROR dai id 11 dai_data->channels = 1 It is not clear why dpcm_be_hw_params_prepare is happening for same BE twice even though async schedule was done for both. - With async_synchronize call after scheduling of hw_param, the behavior is as expected. hw_param for both BE's are success. cstream->be = be_list[i]; dpcm_be_hw_params_prepare(cstream); With regards Laxminath Kasam diff --git a/sound/soc/soc-compress.c b/sound/soc/soc-compress.c index ad3cc68..b0a1995 100644 --- a/sound/soc/soc-compress.c +++ b/sound/soc/soc-compress.c @@ -535,6 +535,7 @@ static int soc_compr_set_params_fe(struct snd_compr_stream *cstream, } } } + async_synchronize_full_domain(&async_domain); - Adding this code fixing the issue, but looks not correct way, please suggest for (i = 0; i < j; i++) {