Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 7F5FBC433EF for ; Sun, 10 Apr 2022 07:41:09 +0000 (UTC) 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 DBE791735; Sun, 10 Apr 2022 09:40:16 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz DBE791735 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1649576466; bh=uhe+yQvXagV5/RyUJocK1PzYxBf73N6PdueHWKKosXY=; h=Date:From:To:Subject:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=GhLcEKBKAxzeu+yADE+8JLEYdXJ/Iuht1HBTJeSaJ5BhS80qwsYrQIu/9PZZPr8W4 oNZP7qVVFdC2cTApejnj4O3wfB78rVGpdDW7Q26eAFw73vf6HK1szj0t34kpbmH55w NPhOUkFxeY2SCJCG/ZDxBCS+1ZWg1CSTUlcQGk80= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 6CF00F80254; Sun, 10 Apr 2022 09:40:16 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id B06C4F80425; Sun, 10 Apr 2022 09:40:14 +0200 (CEST) Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 95DE6F80217 for ; Sun, 10 Apr 2022 09:40:11 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 95DE6F80217 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="t6e4Zfkr"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="c8CtlWcN" Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id F228D1F381; Sun, 10 Apr 2022 07:40:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1649576410; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=MHaBkBtaRQJRl5CcCoPPglrCNrM4dbPIu4Uo8mtxAzw=; b=t6e4ZfkrusOZsoCwfXsHLjSnHcpTPZK93xb3k/xlt/+SEeSdVKDi3kfBLiEPvRDpopLb5Q e8YYSi9l2X4GlS4AuoxvY/v2vBCs17lOx+IkbLrGxXUNZOw2rgt7CEZEuzcmW3F3toJRaa oOU134JPL9fWbhSvmBrWkeb4w/e9fxQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1649576410; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=MHaBkBtaRQJRl5CcCoPPglrCNrM4dbPIu4Uo8mtxAzw=; b=c8CtlWcNGV/u3YiN3IDdCQBJF+x6teW5/8CxgGWsWCmxD85y2uIfaA13ra51IkaDHD9vG3 tVp/uB3roG/iyXAQ== Received: from alsa1.suse.de (alsa1.suse.de [10.160.4.42]) by relay2.suse.de (Postfix) with ESMTP id E6BAEA3B82; Sun, 10 Apr 2022 07:40:10 +0000 (UTC) Date: Sun, 10 Apr 2022 09:40:10 +0200 Message-ID: From: Takashi Iwai To: Jaroslav Kysela Subject: Re: [PATCH] ALSA: usb-audio: Increase max buffer size In-Reply-To: References: <20220407212740.17920-1-tiwai@suse.de> 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: alsa-devel@alsa-project.org, Geraldo Nascimento 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 Sat, 09 Apr 2022 22:43:13 +0200, Jaroslav Kysela wrote: > > On 09. 04. 22 22:36, Geraldo Nascimento wrote: > > On Thu, Apr 07, 2022 at 11:27:40PM +0200, Takashi Iwai wrote: > >> The current limit of max buffer size 1MB seems too small for modern > >> devices with lots of channels and high sample rates. > >> Let's make bigger, 4MB. > > > > Hi Takashi, > > > > I did some math and 4MB is still too little for some extreme hardware > > like the Behringer Wing, which is USB 2.0 by the way. According to my > > calculations, at 192 KHz and 48 channels, even with this 4MB patch, we > > would still have only 151.7 ms of buffer for the Wing. > > > > Therefore my suggestion is to expose the MAX_BUFFER_BYTES as Kconf. > > > > Do you think this is plausible? > > I think that much better behaviour may be to calculate and limit the > max buffer size at runtime depending on the max channels / rate / > sample bits obtained from the USB descriptors by default. For standard > hardware, those big buffers do not make much sense and there's usually > a mix of the USB sound hardware in the system. IMO, one good way would be to leave buffer and period bytes max unlimited, while limiting buffer and period max time instead. It should cover all combinations. But involving the buffer/period time may have some alignment issue with bytes and frame sizes, so we need to check whether it works reliably (although I believe it'd work in that case). My concern by removing the limit is, however, the behavior change in certain applications. It can't be known until we really hit the issue, though. Let's see. thanks, Takashi