From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JrsFN-0001Uk-Sw for qemu-devel@nongnu.org; Fri, 02 May 2008 06:12:09 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JrsFN-0001U7-2C for qemu-devel@nongnu.org; Fri, 02 May 2008 06:12:09 -0400 Received: from [199.232.76.173] (port=52542 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JrsFM-0001U1-QE for qemu-devel@nongnu.org; Fri, 02 May 2008 06:12:08 -0400 Received: from ug-out-1314.google.com ([66.249.92.175]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JrsFM-0002Mw-J0 for qemu-devel@nongnu.org; Fri, 02 May 2008 06:12:08 -0400 Received: by ug-out-1314.google.com with SMTP id m2so1928726uge.4 for ; Fri, 02 May 2008 03:12:07 -0700 (PDT) Message-ID: Date: Fri, 2 May 2008 12:12:07 +0200 From: "andrzej zaborowski" Subject: Re: [Qemu-devel] [PATCH 1/2] Introduce AUD_set_volume In-Reply-To: <481AC5BC.9000402@web.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <481462F8.3050806@web.de> <481AC5BC.9000402@web.de> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: qemu-devel@nongnu.org On 02/05/2008, Jan Kiszka wrote: > andrzej zaborowski wrote: > > The user still needs to disable NOVOL if they really want volume control. > > What is the "user" here? wm8750? musicpal? I just hope it is not the > real user... :) Whoever builds qemu. You don't want it enabled by default and globally. > > [ QEMU audio setup is already weird enough: I recently tried to get ALSA > running to overcome outdated OSS - well, tricky. Needs fixing. ] Yup, I had alsa running but normally (for example now) I just run qemu through "aoss". > > > diff --git a/audio/audio.c b/audio/audio.c > > index 9e7fe80..1231ec5 100644 > > --- a/audio/audio.c > > +++ b/audio/audio.c > > @@ -1955,3 +1955,21 @@ void AUD_del_capture (CaptureVoiceOut *cap, > > void *cb_opaque) > > } > > } > > } > > + > > +void AUD_set_volume_out (SWVoiceOut *sw, int mute, uint8_t lvol, uint8_t rvol) > > +{ > > + if (sw) { > > + sw->vol.mute = mute; > > + sw->vol.l = nominal_volume.l * lvol / 255; > > + sw->vol.r = nominal_volume.r * rvol / 255; Oops, it may be wrong indeed because it might overflow on machines with sizeof(int) >= sizeof(int64_t) and no FLOAT_MIXENG. I first wrote (nominal_volume.l / 255) * lvol and then immediately changed it, but that was better. Regards -- Please do not print this email unless absolutely necessary. Spread environmental awareness.