Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mt6tS-0002bN-EJ for qemu-devel@nongnu.org; Wed, 30 Sep 2009 17:39:26 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mt6tN-0002Ys-Bn for qemu-devel@nongnu.org; Wed, 30 Sep 2009 17:39:25 -0400 Received: from [199.232.76.173] (port=36272 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mt6tN-0002Yo-90 for qemu-devel@nongnu.org; Wed, 30 Sep 2009 17:39:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:15733) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mt6tM-0006Qc-70 for qemu-devel@nongnu.org; Wed, 30 Sep 2009 17:39:20 -0400 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n8ULdJZQ026169 for ; Wed, 30 Sep 2009 17:39:19 -0400 Received: from pike.pond.sub.org (vpn-10-47.str.redhat.com [10.32.10.47]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n8ULdIKl020891 for ; Wed, 30 Sep 2009 17:39:18 -0400 From: Markus Armbruster Date: Wed, 30 Sep 2009 23:39:17 +0200 Message-ID: <87y6nw9koq.fsf@pike.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: [Qemu-devel] Questions on audio_atexit(), possibly bugs List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Excuse my ignorance on all things audio, but I stumbled over something that could be wrong. audio_vm_change_state_handler() stops voices when the VM stops, and starts them when it continues. audio_atexit() unconditionally stops them. When a stopped VM exits, this stops voices that are already stopped. Does the audio driver contract allow stopping a stopped voice? If yes, I figured starting a running voice is fine, too. If no, we have a bug in audio_atexit(). Why is audio_atexit() needed at all? Doesn't the OS clean up just fine all by itself? If we do need manual cleanup, why do we have to stop voices before we run fini_out() and fini_in()? Unrelated, but nearby: audio_vm_change_state_handler() calls the ctl_out() callback with three arguments: hwo->pcm_ops->ctl_out (hwo, op, conf.try_poll_out); (op is either VOICE_ENABLE or VOICE_DISABLE here), while audio_atexit() calls it with two: hwo->pcm_ops->ctl_out (hwo, VOICE_DISABLE); Same for ctl_in(). Doesn't look kosher. A quick check of oss_ctl_out() and oss_ctl_in() shows use of three parameters.