From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JrqCy-0003J2-66 for qemu-devel@nongnu.org; Fri, 02 May 2008 04:01:32 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JrqCw-0003Id-MK for qemu-devel@nongnu.org; Fri, 02 May 2008 04:01:31 -0400 Received: from [199.232.76.173] (port=36023 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JrqCw-0003Ia-Jc for qemu-devel@nongnu.org; Fri, 02 May 2008 04:01:30 -0400 Received: from mx20.gnu.org ([199.232.41.8]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JrqCw-0003Ku-0P for qemu-devel@nongnu.org; Fri, 02 May 2008 04:01:30 -0400 Received: from fmmailgate02.web.de ([217.72.192.227]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Jrpty-0000BW-Vk for qemu-devel@nongnu.org; Fri, 02 May 2008 03:41:55 -0400 Message-ID: <481AC5BC.9000402@web.de> Date: Fri, 02 May 2008 09:41:48 +0200 From: Jan Kiszka MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 1/2] Introduce AUD_set_volume References: <481462F8.3050806@web.de> In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigC82B42DE6923A3B31338FF54" 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) --------------enigC82B42DE6923A3B31338FF54 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable andrzej zaborowski wrote: > I'd like to merge the following instead, I see no point in removing > per voice volume control if we're still doing scaling in software. On > top of that I would apply your wm8750 patch - I have it running now > and volume setting in MusicPal UI works nicely. No fundamental concerns. >=20 > The user still needs to disable NOVOL if they really want volume contro= l. What is the "user" here? wm8750? musicpal? I just hope it is not the real user... :) [ QEMU audio setup is already weird enough: I recently tried to get ALSA running to overcome outdated OSS - well, tricky. Needs fixing. ] > 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 =3D mute; > + sw->vol.l =3D nominal_volume.l * lvol / 255; > + sw->vol.r =3D nominal_volume.r * rvol / 255; As this scaling looks fairly different from my version, I have to test and think about it first. But my current feeling is that you do not get the same range. But the API is fine. > + } > +} > + > +void AUD_set_volume_in (SWVoiceIn *sw, int mute, uint8_t lvol, uint8_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; > + } > +} > diff --git a/audio/audio.h b/audio/audio.h > index ec9eee4..ae29b8a 100644 > --- a/audio/audio.h > +++ b/audio/audio.h > @@ -124,6 +124,9 @@ int AUD_is_active_out (SWVoiceOut *sw); > void AUD_init_time_stamp_out (SWVoiceOut *sw, QEMUAudioTimeStamp *= ts); > uint64_t AUD_get_elapsed_usec_out (SWVoiceOut *sw, QEMUAudioTimeStamp = *ts); >=20 > +void AUD_set_volume_out (SWVoiceOut *sw, int mute, uint8_t lvol, uint8= _t rvol); > +void AUD_set_volume_in (SWVoiceIn *sw, int mute, uint8_t lvol, uint8_t= rvol); > + > SWVoiceIn *AUD_open_in ( > QEMUSoundCard *card, > SWVoiceIn *sw, Jan --------------enigC82B42DE6923A3B31338FF54 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 iD8DBQFIGsXAniDOoMHTA+kRAtLEAJ9uEiWpbmLN0t6Wof+2mXjO08NykQCfQzE4 HDvfVLSTchBCNrJSaNWVpBI= =sFYx -----END PGP SIGNATURE----- --------------enigC82B42DE6923A3B31338FF54--