From mboxrd@z Thu Jan 1 00:00:00 1970 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=-8.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 EA0E3C433DB for ; Tue, 16 Mar 2021 05:10:17 +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 20BBC6505D for ; Tue, 16 Mar 2021 05:10:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 20BBC6505D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=renesas.com 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 D46CC1928; Tue, 16 Mar 2021 06:09:23 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D46CC1928 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1615871413; bh=33PRp/Y1s18mVKcbtX05CySRJPOtamLXwILsbXSFk9k=; h=Date:From:To:Subject:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=c7VuqqZjZ+uZ6wpZzPf3z6SKN8zDNKFUyJ4vduLbBCcxc3bvMsXq10TKPp+6wppi5 utpZNUF65D8YF1LTsqlxLqKCK3maKKcFdaNAg187S5FHRbzYwL6zG8NEv06RQtzU/C 0uxUikeZIC3FdxvjRqPMQfGK0KZuL8tFthAki7kI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 4DEE5F80156; Tue, 16 Mar 2021 06:09:23 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 36EF2F80163; Tue, 16 Mar 2021 06:09:21 +0100 (CET) Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by alsa1.perex.cz (Postfix) with ESMTP id D62AFF80137 for ; Tue, 16 Mar 2021 06:09:12 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D62AFF80137 Date: 16 Mar 2021 14:09:10 +0900 X-IronPort-AV: E=Sophos;i="5.81,251,1610377200"; d="scan'208";a="75300402" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 16 Mar 2021 14:09:10 +0900 Received: from mercury.renesas.com (unknown [10.166.252.133]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 3ED7741B3258; Tue, 16 Mar 2021 14:09:10 +0900 (JST) Message-ID: <87ft0vadmx.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto To: mdurnev@gmail.com Subject: Re: [PATCH v0] ASoC: rsnd: core: Check convert rate in rsnd_hw_params In-Reply-To: <1615870055-13954-1-git-send-email-mikhail_durnev@mentor.com> References: <1615870055-13954-1-git-send-email-mikhail_durnev@mentor.com> User-Agent: Wanderlust/2.15.9 Emacs/26.3 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Cc: alsa-devel@alsa-project.org, broonie@kernel.org, lgirdwood@gmail.com, mikhail_durnev@mentor.com 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" Hi Mikhail > From: Mikhail Durnev > > snd_pcm_hw_params_set_rate_near can return incorrect sample rate in > some cases, e.g. when the backend output rate is set to some value higher > than 48000 Hz and the input rate is 8000 Hz. So passing the value returned > by snd_pcm_hw_params_set_rate_near to snd_pcm_hw_params will result in > "FSO/FSI ratio error" and playing no audio at all while the userland > is not properly notified about the issue. > > If SRC is unable to convert the requested sample rate to the sample rate > the backend is using, then the requested sample rate should be adjusted in > rsnd_hw_params. The userland will be notified about that change in the > returned hw_params structure. > > Signed-off-by: Mikhail Durnev Thank you for your patch. Indeed it needs this kind of filter. Maybe we need to care more in the future, but it is enough so far I think. Acked-by: Kuninori Morimoto Thank you for your help !! Best regards --- Kuninori Morimoto