From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: usb sampling rate (Re: start_threshold having no effect) Date: Tue, 28 Oct 2003 11:19:09 +0100 Sender: alsa-devel-admin@lists.sourceforge.net Message-ID: References: Mime-Version: 1.0 (generated by SEMI 1.14.5 - "Awara-Onsen") Content-Type: text/plain; charset=US-ASCII Return-path: In-Reply-To: Errors-To: alsa-devel-admin@lists.sourceforge.net List-Help: List-Post: List-Subscribe: , List-Unsubscribe: , List-Archive: To: Tobias Peters Cc: alsa-devel@lists.sourceforge.net List-Id: alsa-devel@alsa-project.org At Tue, 28 Oct 2003 08:56:37 +0100, Tobias Peters wrote: > > On Tue, 21 Oct 2003 14:26:24 +0200 > Takashi Iwai wrote: > > > but 1ms period alignment is important: if you want a RT process with > > the USB audio device, choose the sample rate with multiple of 1000. > > for example, avoid 44.1kHz, but use 48k instead. > > Wouldn't the clocks of the usb and of the d/a converter get out sync > anyway, because of the drift? Why is a multiple of 1000 important then? partly because the damn USB-1.1 specification and partly because of the basic design of ALSA. the USB-1.1 always invokes the interrupts in 1ms period regardless of the sample rate. meanwhile, the ALSA assumes that the period size is constant in frames. when the sample rate is the multple of 1000, e.g. 48kHz, 1ms corresponds always to the integer frames (e.g. 48 frames). so, it's not big problem. however, when you run 44.1kHz, the interrupt frequency is not in integer frames, ie. 44.1 frames. if the period size were variable, this inconsistency can be compensated by changing the period size occasionally (such as 44, 44, ..., 45, 44...). instead, the current USB driver updates two periods to compensate the delay. this doesn't work well if you use only two periods, typically in RT apps. Takashi ------------------------------------------------------- This SF.net email is sponsored by: The SF.net Donation Program. Do you like what SourceForge.net is doing for the Open Source Community? Make a contribution, and help us add new features and functionality. Click here: http://sourceforge.net/donate/