From mboxrd@z Thu Jan 1 00:00:00 1970 From: Clemens Ladisch Subject: Re: [alsa-devel] [PATCH 1/3] sound: Add a quirk to enforce period_bytes Date: Wed, 18 Jun 2014 10:20:59 +0200 Message-ID: <53A14BEB.1060403@ladisch.de> References: <1402762571-6316-1-git-send-email-m.chehab@samsung.com> <1402762571-6316-2-git-send-email-m.chehab@samsung.com> <539E9F25.7030504@ladisch.de> <20140616120544.10ef75f4.m.chehab@samsung.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20140616120544.10ef75f4.m.chehab@samsung.com> Sender: linux-media-owner@vger.kernel.org To: Mauro Carvalho Chehab , Devin Heitmueller Cc: Takashi Iwai , alsa-devel@alsa-project.org, Mauro Carvalho Chehab , Linux Media Mailing List List-Id: alsa-devel@alsa-project.org Mauro Carvalho Chehab wrote: > Let's see the au0828 case: > 48 kHz, 2 bytes/sample, 2 channels, 256 maxpacksize, 1 ms URB > interval (bInterval = 1). > > In this case, there is 192 bytes per 1ms period. The device's clock and the bus clock are not synchronized, so there will be _approximately_ 192 bytes per USB frame. > Let's assume that the period was set to 3456, with corresponds to > a latency of 18 ms. > > In this case, as NUM_URBS = 12, There is no symbol named NUM_URBS. > it means that the transfer buffer will be set to its maximum value of > 3072 bytes per URB pack (12 * 256) The number of URBs is not the same as the number of packets per URB. > and the URB transfer_callback will be called on every 16 ms. It will be called once per millisecond. > So, what ... definitely not ... > happens is: > > - after 16 ms, the first 3072 bytes arrive. The next > packet will take another 16ms to arrive; > - after 2 ms, underrun, as the period_size was not > filled yet. Regards, Clemens