From patchwork Sat May 27 07:50:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 100595 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp592265qge; Sat, 27 May 2017 00:51:56 -0700 (PDT) X-Received: by 10.28.43.130 with SMTP id r124mr4221997wmr.83.1495871516655; Sat, 27 May 2017 00:51:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1495871516; cv=none; d=google.com; s=arc-20160816; b=q/S6MMfb8E/1Y9h7GdeYIj+63sGoWFwMJdr8QFK5ON1XyAu0SB5R8RPBjWMaybwDyx rSTXRWGuHrpOCGNBEnXFQftpIkGP+vjvlkkV5khTLdc0pAf3cRv/l2hrtVHpbtBUGTD2 OpRp22Orcm+cm72fAsMUA9Ewxmx2qE2dbG0PlLxGIsg+PxrNn7neL7eopP4OSGqp7n0r PwodkD1kz5KrHADuxh63V9bEy4UwbHiP7yd4vY/mYnCg7hKODN0Qte1LtaIAzAzf2ltA GQxriW49QJH7Odwxmbwv/UKSNOU1EE/oWXWaEm7laPCS8ZqaZpzCD0+EV2VwBK/bUAbU NkOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:message-id:date:to:from:dmarc-filter :delivered-to:arc-authentication-results; bh=2o9kcJKg0RvvvNX8JnqFWrx7277zmfagd3v7Z8eN6yY=; b=PRRRLOU2XT2yA1dB1SgKSXWQ6XrVHMrCiGQhgx3tKArqNXVQjRBCEyghX0sAvU6X7L xrXCYkYA2PUyuQPX1wuALo3V6kQBBefHDQBMnKD03utp0BthnXB8ahrSxA6UhDApAFTe 2SPURpzSVwBjJuFCRuH90NnBpRAKE7TenyevsI9H1q9kHj2InTC7fvr8Cb1etSA5/CwJ D/C6wog9Ji745u9UzYIkRmAILOiMt/QlDLeWNA57KQnBNvvgzKkik9DWG2gWiuyswIeW Xpk+vbRmBr0kLTdEtqJLCrtwnMrcxgf+2Uc2R3TAhmpuXwRQOL3zTw5OEC97GS7JIqMh q5YQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id t128si15772194wmg.118.2017.05.27.00.51.55; Sat, 27 May 2017 00:51:56 -0700 (PDT) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 6F821266B2C; Sat, 27 May 2017 09:51:50 +0200 (CEST) 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 8064A266B38; Sat, 27 May 2017 09:51:48 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RP_MATCHES_RCVD autolearn=disabled version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by alsa0.perex.cz (Postfix) with ESMTP id 19FC4266851 for ; Sat, 27 May 2017 09:51:43 +0200 (CEST) Received: from localhost.localdomain (li411-102.members.linode.com [106.187.91.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id ABB13239A1; Sat, 27 May 2017 07:51:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ABB13239A1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=shawnguo@kernel.org From: Shawn Guo To: Mark Brown Date: Sat, 27 May 2017 15:50:44 +0800 Message-Id: <1495871444-4307-1-git-send-email-shawnguo@kernel.org> X-Mailer: git-send-email 1.9.1 Cc: alsa-devel@alsa-project.org, Shawn Guo , Baoyou Xie , Jun Nie , Xin Zhou Subject: [alsa-devel] [PATCH] ASoC: zx-i2s: fix harsh noise with 16-bit audio 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org From: Shawn Guo The audio parameter setup in zx_i2s_hw_params() works fine with 32-bit samples, but for 16-bit ones, all we can hear is harsh noises. As suggested by vendor driver code, DMA burst size and TS width should always be 32 bits, no matter audio sample is 16-bit or 32-bit. Follow the suggestion above to fix the harsh noise issue seen with 16-bit audio samples. Signed-off-by: Shawn Guo --- sound/soc/zte/zx-i2s.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- 1.9.1 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/zte/zx-i2s.c b/sound/soc/zte/zx-i2s.c index a865f37c2a56..a7f7a56e0a2d 100644 --- a/sound/soc/zte/zx-i2s.c +++ b/sound/soc/zte/zx-i2s.c @@ -226,11 +226,12 @@ static int zx_i2s_hw_params(struct snd_pcm_substream *substream, struct zx_i2s_info *i2s = snd_soc_dai_get_drvdata(socdai); struct snd_dmaengine_dai_dma_data *dma_data; unsigned int lane, ch_num, len, ret = 0; + unsigned int ts_width = 32; unsigned long val; unsigned long chn_cfg; dma_data = snd_soc_dai_get_dma_data(socdai, substream); - dma_data->addr_width = params_width(params) >> 3; + dma_data->addr_width = ts_width >> 3; val = readl_relaxed(i2s->reg_base + ZX_I2S_TIMING_CTRL); val &= ~(ZX_I2S_TIMING_TS_WIDTH_MASK | ZX_I2S_TIMING_DATA_SIZE_MASK | @@ -251,7 +252,7 @@ static int zx_i2s_hw_params(struct snd_pcm_substream *substream, dev_err(socdai->dev, "Unknown data format\n"); return -EINVAL; } - val |= ZX_I2S_TIMING_TS_WIDTH(len) | ZX_I2S_TIMING_DATA_SIZE(len); + val |= ZX_I2S_TIMING_TS_WIDTH(ts_width) | ZX_I2S_TIMING_DATA_SIZE(len); ch_num = params_channels(params); switch (ch_num) {