From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:42661) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S7D15-0007lC-Ej for qemu-devel@nongnu.org; Mon, 12 Mar 2012 17:42:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S7D0z-0007uP-5P for qemu-devel@nongnu.org; Mon, 12 Mar 2012 17:42:55 -0400 Received: from fe01x03-cgp.akado.ru ([77.232.31.164]:52110 helo=akado.ru) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S7D0y-0007u3-UK for qemu-devel@nongnu.org; Mon, 12 Mar 2012 17:42:49 -0400 Date: Tue, 13 Mar 2012 01:42:45 +0400 (MSK) From: malc In-Reply-To: Message-ID: References: <1331578211-18232-1-git-send-email-marcandre.lureau@redhat.com> <1331578211-18232-4-git-send-email-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: Re: [Qemu-devel] [PATCH 03/11] audio: use a nominal volume of UINT_MAX List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?ISO-8859-15?Q?Marc-Andr=E9_Lureau?= Cc: =?ISO-8859-15?Q?Marc-Andr=E9_Lureau?= , dnb@redhat.com, dlaor@redhat.com, qemu-devel@nongnu.org, kraxel@redhat.com On Mon, 12 Mar 2012, Marc-Andr? Lureau wrote: > On Mon, Mar 12, 2012 at 10:11 PM, malc wrote: > >> AUD_set_volume_out (SWVoiceOut *sw, int mute, uint8_t lvol..) > >> > >> sw->vol.l = nominal_volume.l * lvol / 255; > >> > >> So the range was [0..2^8-1] and then it becomes [0..2^32], which looks > >> wrong to me. > > > > It actually becomes [-2^63..2^63-1] nominal_volume.l being 64 bit signed > > and all. > > uint8_t [0..255] / 255 * 2^32 = [0..2^32] > nominal_volume.[lr] is int64_t... i don't get where you take this ^32 from. > >> And Spice uses [0..2^16-1]. So it is simpler to stay within the range > >> of an integer.. > > > > I do not get you, i really don't. > > The audio hw volume range is within a uint8 [0..2^8-1] that is then > scaled into a [0..2^32], it would be easier to stay within a > [0..2^n-1] range all the way. > > > -- mailto:av1474@comtv.ru