Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6027BC433DF for ; Thu, 13 Aug 2020 14:21:10 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D228520791 for ; Thu, 13 Aug 2020 14:21:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="EWngu0m8" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D228520791 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 4B6561612; Thu, 13 Aug 2020 16:20:18 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 4B6561612 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1597328468; bh=kSZKBQ2YucwcSPPZrb6eKQGIAcjzE57QMJ34BQVhHGo=; h=Date:From:To:Subject:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=EWngu0m8Plx1iaxaAY/hPT3fWDtikZQlEXZgbflJ1jzBecNE8gNnoiwfIeuHsB+UV vqNg9UGDu1U5dHzDM4o0iL/lj0sU3EfOF4KsjJvXxjhD5h4ewhKDmsY+d4Fa+oEKKS Ke9HRurjuLRXes4GeoftcTVxWcl3qwBANSBKZd1U= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id C1020F8014C; Thu, 13 Aug 2020 16:20:17 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5206BF8015B; Thu, 13 Aug 2020 16:20:16 +0200 (CEST) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id E4F44F80100; Thu, 13 Aug 2020 16:20:08 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz E4F44F80100 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id A649FB1E3; Thu, 13 Aug 2020 14:20:30 +0000 (UTC) Date: Thu, 13 Aug 2020 16:20:07 +0200 Message-ID: From: Takashi Iwai To: "Vijay Palaniswamy (RBEI/ECF3)" Subject: Re: [PATCH] pcm: dmix: fix access to sum-buffer in non-interleaved mixing mode In-Reply-To: <23d65e0d76d047a3aa833eb699e7d7c8@in.bosch.com> References: <23d65e0d76d047a3aa833eb699e7d7c8@in.bosch.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Cc: "Devi Laxmi \(RBEI/ECF3\)" , "alsa-devel@alsa-project.org" , "patch@alsa-project.org" , "Pape Andreas \(ADITG/ESS1\)" , "Channaiah Vanitha \(RBEI/ECF3\)" X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" On Wed, 12 Aug 2020 08:18:25 +0200, Vijay Palaniswamy (RBEI/ECF3) wrote: > > Hi All, > > When dmix uses non-interleaved mixing mode the offset and step width to > sum_buffer was calculated by using the dmix channels instead of the slave > channels. This leads to audio distortions due to frame corruption. > > Issue happens while doing channel wise mixing of src and destination buffers. > > Attached the patch to fix the offset and step width calculation based on slave > channels for sum buffer. So mixed data will be saved in respective channels of > sum buffer. > > Steps to reproduce the issue: > > With below configuratio, Do aplay on both device in parallel for audio > distortion > > pcm.dmix_2_channels { > > type dmix > > ipc_key 5678293 > > ipc_perm 0660 > > ipc_gid audio > > bindings [0 1] > > slave { > > pcm "hardware" > > channels 2 > > periods 4 > > period_time 40000 > > } > > } > > pcm.dmix_1_channels { > > type dmix > > ipc_key 5678293 > > ipc_perm 0660 > > ipc_gid audio > > bindings [0] > > slave { > > pcm "hardware" > > channels 1 > > periods 4 > > period_time 40000 > > } > > } > > pcm.hardware { > > type hw > > card 0 > > channels 2 > > rate 48000 > > format S16_LE > > } > > Best regards > > Palaniswamy Vijay Applied now. Thanks. Takashi