From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Jrsvv-0000Nd-Ft for qemu-devel@nongnu.org; Fri, 02 May 2008 06:56:07 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Jrsvu-0000N6-7n for qemu-devel@nongnu.org; Fri, 02 May 2008 06:56:07 -0400 Received: from [199.232.76.173] (port=48021 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jrsvu-0000N2-1t for qemu-devel@nongnu.org; Fri, 02 May 2008 06:56:06 -0400 Received: from fmmailgate02.web.de ([217.72.192.227]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Jrsvt-0004Sc-JN for qemu-devel@nongnu.org; Fri, 02 May 2008 06:56:05 -0400 Message-ID: <481AF33A.6030101@web.de> Date: Fri, 02 May 2008 12:55:54 +0200 From: Jan Kiszka MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 1/2] Introduce AUD_set_volume References: <481462F8.3050806@web.de> <481AC5BC.9000402@web.de> In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig880BB7519D916FC3F24656E7" Sender: jan.kiszka@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: andrzej zaborowski Cc: qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig880BB7519D916FC3F24656E7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable andrzej zaborowski wrote: > On 02/05/2008, Jan Kiszka wrote: >> andrzej zaborowski wrote: >> > The user still needs to disable NOVOL if they really want volume co= ntrol. >> >> What is the "user" here? wm8750? musicpal? I just hope it is not the >> real user... :) >=20 > Whoever builds qemu. You don't want it enabled by default and globally= =2E That's the totally wrong way from the usability perspective, IMHO. What are the remaining downsides of mixer support? If there are any, I guess they are far less than the advantages, so this switch should at least become an option which is default off. >=20 >> [ QEMU audio setup is already weird enough: I recently tried to get A= LSA >> running to overcome outdated OSS - well, tricky. Needs fixing. ] >=20 > Yup, I had alsa running but normally (for example now) I just run qemu > through "aoss". I had problems with parallel usage by several apps, and only true ALSA mode resolved it. I think AOSS is purely for unconvertible legacy apps, and I don't want to put QEMU into this category. ;) Will follow up on this the next days. >=20 >> > 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, u= int8_t rvol) >> > +{ >> > + if (sw) { >> > + sw->vol.mute =3D mute; >> > + sw->vol.l =3D nominal_volume.l * lvol / 255; >> > + sw->vol.r =3D nominal_volume.r * rvol / 255; >=20 > Oops, it may be wrong indeed because it might overflow on machines > with sizeof(int) >=3D sizeof(int64_t) and no FLOAT_MIXENG. I first > wrote (nominal_volume.l / 255) * lvol and then immediately changed it, > but that was better. Thought a bit about it (still untested, though), and I think it should be fine to just fix the initialization of nominal_volume from UINT_MAX to (1ULL << 32) (because we are shifting back by 32 bits at runtime). I had that wrong in my patch as well, BTW. Jan --------------enig880BB7519D916FC3F24656E7 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4-svn0 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iD4DBQFIGvNDniDOoMHTA+kRAkhuAJ4nRFb8pMhpn2w/i52753FPfkzkWgCYy3K2 g3NMd6f6Wdco7CPNsioBiA== =pbr4 -----END PGP SIGNATURE----- --------------enig880BB7519D916FC3F24656E7--