Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp359679ybt; Tue, 30 Jun 2020 23:46:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzzzPeInCMYjIi/VQ08q9OEGs/J5YxcP0hrkOgDeKa+ysielSRTvNlIB/imCdjjNOdQ14KJ X-Received: by 2002:a05:6402:1217:: with SMTP id c23mr27278038edw.270.1593585964361; Tue, 30 Jun 2020 23:46:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593585964; cv=none; d=google.com; s=arc-20160816; b=VjybBzUCNV/0WFBHz4HCeeS4TDDFAV1blwrJbGsh5GJbuq+7gyI4rSH8pdar1iVGLv 7eaNWFhrrkT3Iq6R18W2G+blBx4/JrpTzmEp38M9HQhgidXyzheCGxTpbMxnZ/ypRKJV yz2SzbNH4AKi0W33FoRbMre60fiQg/UMLqH8ASA7NOIzSFmndBKEj5dbh75BkVBMgDIs tjhn05y/qWZUYfCTR0X1EyRKp7eg4bZZ0LihYzLDEMCBmMHbP8OSjIQ6k2qTR4vwG0ml N6TmgGJLQFluUStczos7R9Yr/9fNMkcz1sySjBkkYcgHd1/lpUP4PWwTPB4tjDsKnVnD vBuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:subject:cc:to:from:message-id :date; bh=fi6yjBLbfjMkZHroQJID1hWbTlAnnKmAtGCqzJCqsDg=; b=kVj6vqMfwkDcCLdTDpf6S8c5sMqAOB/bhmQpMBAE1d2XutCgC5RLLumWA4C1POvd5O /MSqV6woQdyrHvmLU2WC68oN8ceBict/nae7qRDANBcC5xSQHZ5uITTcNYpIw6XsvL2F UcAvoNvvyg38IWpIwM/x0xDfKQoztDiOIz91t5au8e5WmNlsrtDhikoqpYvZMFmW3YPR hhsZAqSFsQcGgktZNAvBmt/an2peWjRC3EVAZFBhG+PcH+9cPtja9Nsu0HbUwcfeJ1Lr iDfFvflffkeNAOi1eS49vy9FSsdO5lTY2WWIcb2OtmOyRKcVT/zAUKX7y6WpQvmythyY zRTQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a14si3487680ejj.334.2020.06.30.23.45.41; Tue, 30 Jun 2020 23:46:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727930AbgGAGpU (ORCPT + 99 others); Wed, 1 Jul 2020 02:45:20 -0400 Received: from mx2.suse.de ([195.135.220.15]:34030 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726144AbgGAGpT (ORCPT ); Wed, 1 Jul 2020 02:45:19 -0400 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 E7CDAADC5; Wed, 1 Jul 2020 06:45:17 +0000 (UTC) Date: Wed, 01 Jul 2020 08:45:16 +0200 Message-ID: From: Takashi Iwai To: Greg KH Cc: Sasha Levin , Alexander Tsoy , linux-kernel@vger.kernel.org, stable@vger.kernel.org, Takashi Iwai Subject: Re: [PATCH 4.9 026/191] ALSA: usb-audio: Improve frames size computation In-Reply-To: <20200630183328.GA1916087@kroah.com> References: <20200629154007.2495120-1-sashal@kernel.org> <20200629154007.2495120-27-sashal@kernel.org> <20200630165407.GZ1931@sasha-vm> <20200630183328.GA1916087@kroah.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=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 30 Jun 2020 20:33:28 +0200, Greg KH wrote: > > On Tue, Jun 30, 2020 at 12:54:07PM -0400, Sasha Levin wrote: > > On Tue, Jun 30, 2020 at 01:49:50PM +0300, Alexander Tsoy wrote: > > > В Пн, 29/06/2020 в 11:37 -0400, Sasha Levin пишет: > > > > From: Alexander Tsoy > > > > > > > > [ Upstream commit f0bd62b64016508938df9babe47f65c2c727d25c ] > > > > > > > > For computation of the the next frame size current value of fs/fps > > > > and > > > > accumulated fractional parts of fs/fps are used, where values are > > > > stored > > > > in Q16.16 format. This is quite natural for computing frame size for > > > > asynchronous endpoints driven by explicit feedback, since in this > > > > case > > > > fs/fps is a value provided by the feedback endpoint and it's already > > > > in > > > > the Q format. If an error is accumulated over time, the device can > > > > adjust fs/fps value to prevent buffer overruns/underruns. > > > > > > > > But for synchronous endpoints the accuracy provided by these > > > > computations > > > > is not enough. Due to accumulated error the driver periodically > > > > produces > > > > frames with incorrect size (+/- 1 audio sample). > > > > > > > > This patch fixes this issue by implementing a different algorithm for > > > > frame size computation. It is based on accumulating of the remainders > > > > from division fs/fps and it doesn't accumulate errors over time. This > > > > new method is enabled for synchronous and adaptive playback > > > > endpoints. > > > > > > > > Signed-off-by: Alexander Tsoy > > > > Link: > > > > https://lore.kernel.org/r/20200424022449.14972-1-alexander@tsoy.me > > > > Signed-off-by: Takashi Iwai > > > > Signed-off-by: Sasha Levin > > > > --- > > > > sound/usb/card.h | 4 ++++ > > > > sound/usb/endpoint.c | 43 ++++++++++++++++++++++++++++++++++++++-- > > > > --- > > > > sound/usb/endpoint.h | 1 + > > > > sound/usb/pcm.c | 2 ++ > > > > 4 files changed, 45 insertions(+), 5 deletions(-) > > > > > > Please drop this patch from the queue for now (and for 4.4 as well). It > > > introduced a regression for some devices. The fix is available, but not > > > accepted yet. > > > > I've dropped it from the older branches, but note that it's already in > > newer released stable kernels. Should it be reverted or should we wait > > for the fix? > > I was going to wait for the fix. The corresponding fix is now in sound git tree. But since I'm traveling in this week, the pull request to Linus will be delayed likely to the next week. thanks, Takashi