From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49289) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZaluM-0000R2-Dk for qemu-devel@nongnu.org; Sat, 12 Sep 2015 10:36:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZaluI-0003X3-Dy for qemu-devel@nongnu.org; Sat, 12 Sep 2015 10:36:02 -0400 Received: from mail-wi0-x229.google.com ([2a00:1450:400c:c05::229]:38221) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZaluI-0003VX-6t for qemu-devel@nongnu.org; Sat, 12 Sep 2015 10:35:58 -0400 Received: by wiclk2 with SMTP id lk2so86350082wic.1 for ; Sat, 12 Sep 2015 07:35:56 -0700 (PDT) From: "=?UTF-8?B?S8WRdsOhZ8OzIFpvbHTDoW4=?=" References: <55F3259D.3000309@t-online.de> <55F40B4C.5000101@t-online.de> Message-ID: <55F4384C.1050707@gmail.com> Date: Sat, 12 Sep 2015 16:35:56 +0200 MIME-Version: 1.0 In-Reply-To: <55F40B4C.5000101@t-online.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH] pulseaudio: reduce 24s recording latency List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?Q?Volker_R=c3=bcmelin?= , =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= Cc: QEMU , Gerd Hoffmann 2015-09-12 13:23 keltezéssel, Volker Rümelin írta: > Hi, > > Am 12.09.2015 um 01:22 schrieb Marc-André Lureau: > >>> Current code doesn't provide pulseaudio buffer attributes for >>> recording. Without buffer attributes pulseaudio uses a default >>> buffer of 4MB. 4MB is approximately 24s 16bit stereo audio >>> data at 44.1kHz. >> Why isn't the buffer processed as soon as some data is available? >> >> > > On start up qemu opens a connection to pulseaudio in function > qpa_init_in and pulseaudio immediately starts recording to the 4MB > ringbuffer. The qemu guest, Windows 8.1 in my case, doesn't consume that > data if there is no process listening on the audio interface. Now if the > guest starts recording, it will see audio data which was recorded 24s ago. Weird, pulseaudio shouldn't delay the input more than 2 seconds in the default config. Maybe PA_STREAM_EARLY_REQUESTS help. See my patch at [1]. Alternatively we should maybe call pa_stream_flush when enabling the input to tell pulseaudio to drop previously recorded samples. [1]: https://lists.gnu.org/archive/html/qemu-devel/2015-08/msg02455.html Zoltan