From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33066) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c2e29-0005H3-N0 for qemu-devel@nongnu.org; Fri, 04 Nov 2016 08:55:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c2e26-0008Iv-Jy for qemu-devel@nongnu.org; Fri, 04 Nov 2016 08:55:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38196) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c2e26-0008HW-Es for qemu-devel@nongnu.org; Fri, 04 Nov 2016 08:55:46 -0400 Message-ID: <1478264143.17235.32.camel@redhat.com> From: Gerd Hoffmann Date: Fri, 04 Nov 2016 13:55:43 +0100 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 Subject: Re: [Qemu-devel] Intel HDA and ALSA audio driver hogging event loop List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: qemu-devel Hi, > > I think the QEMU ALSA sound driver should not be monitoring the > > playback file descriptor if the emulated sound card decides it needs > > to wait for the guest. I think it should never monitor the file descriptor. > > Should we add an AUD_plug_out()/AUD_unplug_out() interface to the QEMU > > audio subsystem so soundcards can suspend file descriptor monitoring? spiceaudio has a rate control which calculates the number of audio samples based on time. That works pretty well and I think it is the best way to handle it. The other audio drivers do the same. Trying to keep the alsa audio buffers full (by watching the playback file handle) does not only cause problems in case the guest hasn't enough audio data to fill them, it also increases the latency in the audio playback pipeline. cheers, Gerd