From: Takashi Iwai Subject: Re: DSnoop Latency Date: Fri, 07 Oct 2005 16:11:33 +0200 Message-ID: References: <997BA7FD-4755-47D7-8AB9-1DBCB4FEE445@popwire.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Return-path: Received: from mx1.suse.de (ns.suse.de [195.135.220.2]) by alsa.jcu.cz (ALSA's E-mail Delivery System) with ESMTP id 0763B174 for ; Fri, 7 Oct 2005 16:11:33 +0200 (MEST) In-Reply-To: Sender: alsa-devel-admin@lists.sourceforge.net Errors-To: alsa-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: Kenth Andersson Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Fri, 7 Oct 2005 15:51:46 +0200, Kenth Andersson wrote: > > Hi, > > I'll try to explain my problem more precise > > Alsa version: 1.0.8 Argh... too old version to debug... > My problem is that if I set the sound card to 22050Hz and try to > capture 10 seconds of sound (22050 * 10 samples). This would take > precisely 10 seconds because it's realtime, but through dsnoop it > takes more then 10 seconds, about 160 samples to long time if dsnoop > is initialized to 8000 Hz and then tries to resample to 22050. This > is a big problem then trying to capture live sound and stream it over > network in realtime, because I can't get all the sound in realtime > through dsnoop. > > DSnoop settings: > rate 8000 > period_size 1024 > period_time 0 > buffer_size 4096 > > The reason why i got rate 8000 Hz and capture at 22050 Hz it that I > got another process doing the same thing at 8000Hz (at the same time). > I read 1024 samples each time from dsnoop. > > Does this explain my problem? Currently, the interrupt timing depends on the slave PCM. That's why you get inaccurate stop time. Either increase the rate and/or decrease the period size. (The buffer size doesn't play any role here, BTW.) Also, I don't think it's a good idea to resample from 8khz to 22.5kHz from the sound quality viewpoint at all... Takashi ------------------------------------------------------- This SF.Net email is sponsored by: Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl