qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [4321] First cut at WM8750 volume control (Jan Kiszka).


From: Jan Kiszka
Subject: Re: [Qemu-devel] [4321] First cut at WM8750 volume control (Jan Kiszka).
Date: Sun, 04 May 2008 12:47:42 +0200
User-agent: Thunderbird 2.0.0.12 (X11/20080226)

Andrzej Zaborowski wrote:
> Modified: trunk/hw/wm8750.c
> ===================================================================
> --- trunk/hw/wm8750.c 2008-05-04 08:16:10 UTC (rev 4320)
> +++ trunk/hw/wm8750.c 2008-05-04 10:21:03 UTC (rev 4321)

...

> @@ -125,6 +133,32 @@
>      {  192, 88200,  192, 88200 },    /* SR: 11111 */
>  };
>  
> +static void wm8750_vol_update(struct wm8750_s *s)
> +{
> +    /* FIXME: multiply all volumes by s->invol[2], s->invol[3] */
> +
> +    AUD_set_volume_in(*s->in[0], s->mute,
> +                    s->inmute[0] ? 0 : 0xff,
> +                    s->inmute[1] ? 0 : 0xff);
> +
> +    /* FIXME: multiply all volumes by s->outvol[0], s->outvol[1] */
> +
> +    /* Speaker: LOUT2VOL ROUT2VOL */
> +    AUD_set_volume_out(s->dac_voice[0], s->mute,
> +                    s->outmute[0] ? 0 : WM8750_VOL_TRANSFORM(s->outvol[4]),
> +                    s->outmute[1] ? 0 : WM8750_VOL_TRANSFORM(s->outvol[5]));
> +
> +    /* Headphone: LOUT2VOL ROUT2VOL */

LOUT1VOL / ROUT1VOL

> +    AUD_set_volume_out(s->dac_voice[1], s->mute,
> +                    s->outmute[0] ? 0 : WM8750_VOL_TRANSFORM(s->outvol[2]),
> +                    s->outmute[1] ? 0 : WM8750_VOL_TRANSFORM(s->outvol[3]));
> +
> +    /* MONOOUT: MONOVOL MONOVOL */
> +    AUD_set_volume_out(s->dac_voice[2], s->mute,
> +                    s->outmute[0] ? 0 : WM8750_VOL_TRANSFORM(s->outvol[6]),
> +                    s->outmute[1] ? 0 : WM8750_VOL_TRANSFORM(s->outvol[6]));
> +}
> +
>  static void wm8750_set_format(struct wm8750_s *s)
>  {
>      int i;

...

> @@ -437,19 +457,21 @@
>          break;
>  
>      case WM8750_LOUT1V:      /* LOUT1 Volume */
> -        s->outvol[2] = value & 0x7f;         /* LOUT2VOL */
> +        s->outvol[2] = value & 0x7f;         /* LOUT1VOL */

You probably want to add wm8750_vol_update here (and to the other
channels that are now included in volume control). 


Great! This just leaves up with

Index: qemu/audio/mixeng.c
===================================================================
--- qemu.orig/audio/mixeng.c
+++ qemu/audio/mixeng.c
@@ -28,7 +28,7 @@
 #define AUDIO_CAP "mixeng"
 #include "audio_int.h"
 
-#define NOVOL
+//#define NOVOL
 
 /* 8 bit */
 #define ENDIAN_CONVERSION natural

to make the MusicPal work out-of-the-box (muting is now broken again,
causing loud noise during channel switches and while in suspended mode).

Could you comment on the remaining issuing of non-NOVOL and a roadmap to
finally overcome that switch?

Jan

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]