From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Jsi4f-0002jj-3g for qemu-devel@nongnu.org; Sun, 04 May 2008 13:32:33 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Jsi4d-0002j5-7O for qemu-devel@nongnu.org; Sun, 04 May 2008 13:32:32 -0400 Received: from [199.232.76.173] (port=38299 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jsi4c-0002iw-R1 for qemu-devel@nongnu.org; Sun, 04 May 2008 13:32:30 -0400 Received: from fmmailgate02.web.de ([217.72.192.227]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Jsi4d-0000dg-0D for qemu-devel@nongnu.org; Sun, 04 May 2008 13:32:31 -0400 Received: from smtp07.web.de (fmsmtp07.dlan.cinetic.de [172.20.5.215]) by fmmailgate02.web.de (Postfix) with ESMTP id 42797DB35587 for ; Sun, 4 May 2008 19:31:42 +0200 (CEST) Received: from [88.64.12.179] (helo=[192.168.1.198]) by smtp07.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.109 #226) id 1Jsi3q-0005Vh-00 for qemu-devel@nongnu.org; Sun, 04 May 2008 19:31:42 +0200 Message-ID: <481DF2FD.2080606@web.de> Date: Sun, 04 May 2008 19:31:41 +0200 From: Jan Kiszka MIME-Version: 1.0 Subject: Re: [Qemu-devel] [4321] First cut at WM8750 volume control (Jan Kiszka). References: <481D944E.7090703@web.de> In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigDFF057A796D4C7C39C0752AE" 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: qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigDFF057A796D4C7C39C0752AE Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable andrzej zaborowski wrote: > On 04/05/2008, andrzej zaborowski wrote: >> On 04/05/2008, Jan Kiszka wrote: >> > -#define NOVOL >> > +//#define NOVOL >> > >> > /* 8 bit */ >> > #define ENDIAN_CONVERSION natural >> > >> > to make the MusicPal work out-of-the-box (muting is now broken aga= in, >> > causing loud noise during channel switches and while in suspended = mode). >> >> >> Right, as I said you need to disable NOVOL manually if you want volume= >> control. Changing this would affect users of all machines of all >> architectures and until now everyone was fine with using the host >> mixer instead of software mixing in qemu. >> >> BTW, I noticed that on some radio stations I get double speed >> playback, not sure what's causing this. My recent commit, while >> correct (I think), doesn't fix this. For a test case try connecting >=20 > Ok, seems to be fixed now - it (logically) happened everytime Linux > was trying to play a mono channel stream. Cool! Just a minor nit (to avoid that the compiler gets upset): Index: qemu/hw/musicpal.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- qemu/hw/musicpal.c (Revision 4332) +++ qemu/hw/musicpal.c (Arbeitskopie) @@ -255,7 +255,8 @@ typedef struct musicpal_audio_state { static void audio_callback(void *opaque, int free_out, int free_in) { musicpal_audio_state *s =3D opaque; - int16_t *codec_buffer, *mem_buffer; + int16_t *codec_buffer; + void *mem_buffer; int pos, block_size; =20 if (!(s->playback_mode & MP_AUDIO_PLAYBACK_EN)) @@ -276,8 +277,9 @@ static void audio_callback(void *opaque, if (s->playback_mode & MP_AUDIO_MONO) { codec_buffer =3D wm8750_dac_buffer(s->wm, block_size >> 1); for (pos =3D 0; pos < block_size; pos +=3D 2) { - *codec_buffer++ =3D *mem_buffer; - *codec_buffer++ =3D *mem_buffer++; + *codec_buffer++ =3D *(uint16_t *)mem_buffer; + *codec_buffer++ =3D *(uint16_t *)mem_buffer; + mem_buffer +=3D 2; } } else memcpy(wm8750_dac_buffer(s->wm, block_size >> 2), @@ -286,14 +288,14 @@ static void audio_callback(void *opaque, if (s->playback_mode & MP_AUDIO_MONO) { codec_buffer =3D wm8750_dac_buffer(s->wm, block_size); for (pos =3D 0; pos < block_size; pos++) { - *codec_buffer++ =3D cpu_to_le16(256 * *((int8_t *)mem_bu= ffer)); - *codec_buffer++ =3D cpu_to_le16(256 * *((int8_t *)mem_bu= ffer)++); + *codec_buffer++ =3D cpu_to_le16(256 * *(int8_t *)mem_buf= fer); + *codec_buffer++ =3D cpu_to_le16(256 * *(int8_t *)mem_buf= fer++); } } else { codec_buffer =3D wm8750_dac_buffer(s->wm, block_size >> 1); for (pos =3D 0; pos < block_size; pos +=3D 2) { - *codec_buffer++ =3D cpu_to_le16(256 * *((int8_t *)mem_bu= ffer)++); - *codec_buffer++ =3D cpu_to_le16(256 * *((int8_t *)mem_bu= ffer)++); + *codec_buffer++ =3D cpu_to_le16(256 * *(int8_t *)mem_buf= fer++); + *codec_buffer++ =3D cpu_to_le16(256 * *(int8_t *)mem_buf= fer++); } } } --------------enigDFF057A796D4C7C39C0752AE 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 iD8DBQFIHfL9niDOoMHTA+kRApkjAJ0bn7PmOJFgVFqxlhkvx0mbBfA7awCfUG6X TMB1N53xtm2ENU+b+hQ0ndk= =gYu3 -----END PGP SIGNATURE----- --------------enigDFF057A796D4C7C39C0752AE--