Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756261AbcLALuo (ORCPT ); Thu, 1 Dec 2016 06:50:44 -0500 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:32985 "EHLO out5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751503AbcLALun (ORCPT ); Thu, 1 Dec 2016 06:50:43 -0500 X-ME-Sender: X-Sasl-enc: 9Ed1kg/r+ZxACqeJJfJgTHs1k4FmA27sXrLYec5j+E58 1480593041 Subject: Re: [alsa-devel] [PATCH 1/3 v1] ALSA: usb-audio: more tolerant packetsize To: Takashi Iwai References: <20161130075923.15205-1-jiada_wang@mentor.com> <20161130075923.15205-2-jiada_wang@mentor.com> <1cb0aa49-62d5-b2ac-a473-bbce3f491d59@ladisch.de> <76fa143e-7092-0bc9-7d55-6a5605d4704a@ladisch.de> Cc: Jiada Wang , alsa-devel@alsa-project.org, apape@de.adit-jv.com, linux-kernel@vger.kernel.org, Mark_Craske@mentor.com From: Clemens Ladisch Message-ID: Date: Thu, 1 Dec 2016 12:50:39 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1285 Lines: 36 Takashi Iwai wrote: > Clemens Ladisch wrote: >> Takashi Iwai wrote: >>> [...] >>> In the commit mentioned above, we changed the logic to take +25% >>> frequency as the basis, and it my *reduce* if ep->maxpacksize is lower >>> than that. >>> >>> OTOH, if ep->maxpacksize is sane, we can rely on it rather than the >>> implicit +25% frequency. That said, maybe we can check >>> ep->maxpacksize whether it fits within the expected range, then adapt >>> it, or take +25% freq as fallback? >> >> You are describing how the current code behaves. The +25% limit _is_ >> what the code takes as the expected range. > > Well, the question is what is the "sane" range. +25% doesn't fit for > some devices. The USB audio specification _requires_ that there is as little jitter as possible. It's no surprise that some device violates the specification. But we don't know what the actual error is; whether we could adjust the packet size for this particular device only, or increase the limit for all devices, or use a completely different workaround. > If maxpacksize fits without +100% as this patch suggests, can we rely > on it instead? The packet size affect the following computations, like the number of packets per URB. I don't know how bad the effects would be. Regards, Clemens