* [Qemu-devel] [4321] First cut at WM8750 volume control (Jan Kiszka).
@ 2008-05-04 10:21 Andrzej Zaborowski
2008-05-04 10:47 ` Jan Kiszka
0 siblings, 1 reply; 9+ messages in thread
From: Andrzej Zaborowski @ 2008-05-04 10:21 UTC (permalink / raw)
To: qemu-devel
Revision: 4321
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4321
Author: balrog
Date: 2008-05-04 10:21:03 +0000 (Sun, 04 May 2008)
Log Message:
-----------
First cut at WM8750 volume control (Jan Kiszka).
Modified Paths:
--------------
trunk/audio/audio.c
trunk/audio/audio.h
trunk/hw/wm8750.c
Modified: trunk/audio/audio.c
===================================================================
--- trunk/audio/audio.c 2008-05-04 08:16:10 UTC (rev 4320)
+++ trunk/audio/audio.c 2008-05-04 10:21:03 UTC (rev 4321)
@@ -117,8 +117,8 @@
1.0,
1.0
#else
- UINT_MAX,
- UINT_MAX
+ 1ULL << 32,
+ 1ULL << 32
#endif
};
@@ -1955,3 +1955,21 @@
}
}
}
+
+void AUD_set_volume_out (SWVoiceOut *sw, int mute, uint8_t lvol, uint8_t rvol)
+{
+ if (sw) {
+ sw->vol.mute = mute;
+ sw->vol.l = nominal_volume.l * lvol / 255;
+ sw->vol.r = nominal_volume.r * rvol / 255;
+ }
+}
+
+void AUD_set_volume_in (SWVoiceIn *sw, int mute, uint8_t lvol, uint8_t rvol)
+{
+ if (sw) {
+ sw->vol.mute = mute;
+ sw->vol.l = nominal_volume.l * lvol / 255;
+ sw->vol.r = nominal_volume.r * rvol / 255;
+ }
+}
Modified: trunk/audio/audio.h
===================================================================
--- trunk/audio/audio.h 2008-05-04 08:16:10 UTC (rev 4320)
+++ trunk/audio/audio.h 2008-05-04 10:21:03 UTC (rev 4321)
@@ -124,6 +124,9 @@
void AUD_init_time_stamp_out (SWVoiceOut *sw, QEMUAudioTimeStamp *ts);
uint64_t AUD_get_elapsed_usec_out (SWVoiceOut *sw, QEMUAudioTimeStamp *ts);
+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,
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)
@@ -39,10 +39,18 @@
uint8_t diff[2], pol, ds, monomix[2], alc, mute;
uint8_t path[4], mpath[2], power, format;
- uint32_t inmask, outmask;
const struct wm_rate_s *rate;
};
+/* pow(10.0, -i / 20.0), i = 0..42 */
+static const uint8_t wm8750_vol_db_table[] = {
+ 255, 227, 203, 181, 161, 143, 128, 114, 102, 90, 81, 72, 64, 57, 51, 45,
+ 40, 36, 32, 29, 26, 23, 20, 18, 16, 14, 13, 11, 10, 9, 8, 7, 6, 6, 5, 5,
+ 4, 4, 3, 3, 3, 2, 2
+};
+
+#define WM8750_VOL_TRANSFORM(x) wm8750_vol_db_table[(0x7f - x) / 3]
+
static inline void wm8750_in_load(struct wm8750_s *s)
{
int acquired;
@@ -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 */
+ 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;
@@ -185,6 +219,8 @@
CODEC ".monomix", s, wm8750_audio_out_cb, &out_fmt);
/* no sense emulating OUT3 which is a mix of other outputs */
+ wm8750_vol_update(s);
+
/* We should connect the left and right channels to their
* respective inputs/outputs but we have completely no need
* for mixing or combining paths to different ports, so we
@@ -195,22 +231,6 @@
AUD_set_active_out(*s->out[0], 1);
}
-static void inline wm8750_mask_update(struct wm8750_s *s)
-{
-#define R_ONLY 0x0000ffff
-#define L_ONLY 0xffff0000
-#define BOTH (R_ONLY | L_ONLY)
-#define NONE (R_ONLY & L_ONLY)
- s->inmask =
- (s->inmute[0] ? R_ONLY : BOTH) &
- (s->inmute[1] ? L_ONLY : BOTH) &
- (s->mute ? NONE : BOTH);
- s->outmask =
- (s->outmute[0] ? R_ONLY : BOTH) &
- (s->outmute[1] ? L_ONLY : BOTH) &
- (s->mute ? NONE : BOTH);
-}
-
void wm8750_reset(i2c_slave *i2c)
{
struct wm8750_s *s = (struct wm8750_s *) i2c;
@@ -249,7 +269,7 @@
s->req_in = 0;
s->idx_out = 0;
s->req_out = 0;
- wm8750_mask_update(s);
+ wm8750_vol_update(s);
s->i2c_len = 0;
}
@@ -367,19 +387,19 @@
case WM8750_LINVOL: /* Left Channel PGA */
s->invol[0] = value & 0x3f; /* LINVOL */
s->inmute[0] = (value >> 7) & 1; /* LINMUTE */
- wm8750_mask_update(s);
+ wm8750_vol_update(s);
break;
case WM8750_RINVOL: /* Right Channel PGA */
s->invol[1] = value & 0x3f; /* RINVOL */
s->inmute[1] = (value >> 7) & 1; /* RINMUTE */
- wm8750_mask_update(s);
+ wm8750_vol_update(s);
break;
case WM8750_ADCDAC: /* ADC and DAC Control */
s->pol = (value >> 5) & 3; /* ADCPOL */
s->mute = (value >> 3) & 1; /* DACMU */
- wm8750_mask_update(s);
+ wm8750_vol_update(s);
break;
case WM8750_ADCTL3: /* Additional Control (3) */
@@ -437,19 +457,21 @@
break;
case WM8750_LOUT1V: /* LOUT1 Volume */
- s->outvol[2] = value & 0x7f; /* LOUT2VOL */
+ s->outvol[2] = value & 0x7f; /* LOUT1VOL */
break;
case WM8750_LOUT2V: /* LOUT2 Volume */
s->outvol[4] = value & 0x7f; /* LOUT2VOL */
+ wm8750_vol_update(s);
break;
case WM8750_ROUT1V: /* ROUT1 Volume */
- s->outvol[3] = value & 0x7f; /* ROUT2VOL */
+ s->outvol[3] = value & 0x7f; /* ROUT1VOL */
break;
case WM8750_ROUT2V: /* ROUT2 Volume */
s->outvol[5] = value & 0x7f; /* ROUT2VOL */
+ wm8750_vol_update(s);
break;
case WM8750_MOUTV: /* MONOOUT Volume */
@@ -531,8 +553,6 @@
qemu_put_8s(f, &s->mpath[i]);
qemu_put_8s(f, &s->format);
qemu_put_8s(f, &s->power);
- qemu_put_be32s(f, &s->inmask);
- qemu_put_be32s(f, &s->outmask);
qemu_put_byte(f, (s->rate - wm_rate_table) / sizeof(*s->rate));
i2c_slave_save(f, &s->i2c);
}
@@ -573,8 +593,6 @@
qemu_get_8s(f, &s->mpath[i]);
qemu_get_8s(f, &s->format);
qemu_get_8s(f, &s->power);
- qemu_get_be32s(f, &s->inmask);
- qemu_get_be32s(f, &s->outmask);
s->rate = &wm_rate_table[(uint8_t) qemu_get_byte(f) & 0x1f];
i2c_slave_load(f, &s->i2c);
return 0;
@@ -619,8 +637,7 @@
void wm8750_dac_dat(void *opaque, uint32_t sample)
{
struct wm8750_s *s = (struct wm8750_s *) opaque;
- uint32_t *data = (uint32_t *) &s->data_out[s->idx_out];
- *data = sample & s->outmask;
+ *(uint32_t *) &s->data_out[s->idx_out] = sample;
s->req_out -= 4;
s->idx_out += 4;
if (s->idx_out >= sizeof(s->data_out) || s->req_out <= 0)
@@ -654,5 +671,5 @@
data = (uint32_t *) &s->data_in[s->idx_in];
s->req_in -= 4;
s->idx_in += 4;
- return *data & s->inmask;
+ return *data;
}
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] [4321] First cut at WM8750 volume control (Jan Kiszka).
2008-05-04 10:21 [Qemu-devel] [4321] First cut at WM8750 volume control (Jan Kiszka) Andrzej Zaborowski
@ 2008-05-04 10:47 ` Jan Kiszka
2008-05-04 12:31 ` andrzej zaborowski
0 siblings, 1 reply; 9+ messages in thread
From: Jan Kiszka @ 2008-05-04 10:47 UTC (permalink / raw)
To: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 2554 bytes --]
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 #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 254 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] [4321] First cut at WM8750 volume control (Jan Kiszka).
2008-05-04 10:47 ` Jan Kiszka
@ 2008-05-04 12:31 ` andrzej zaborowski
2008-05-04 15:49 ` andrzej zaborowski
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: andrzej zaborowski @ 2008-05-04 12:31 UTC (permalink / raw)
To: qemu-devel
On 04/05/2008, Jan Kiszka <jan.kiszka@web.de> wrote:
> -#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).
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
to:
Internet Radio -> Countries -> Europe -> Spain -> All Stations ->
Caroline International,
the firmware sets both the WM8750 sample rate and the CPUs audio iface
to 24 KHz but correct value is 12KHz or so. (I by no means recommend
that station for listening).
Also BTW, do you want to add a qemu-doc.texi piece describing -M
musicpal? Otherwise I'll add something.
Regards
--
Please do not print this email unless absolutely necessary. Spread
environmental awareness.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] [4321] First cut at WM8750 volume control (Jan Kiszka).
2008-05-04 12:31 ` andrzej zaborowski
@ 2008-05-04 15:49 ` andrzej zaborowski
2008-05-04 17:31 ` Jan Kiszka
2008-05-04 17:31 ` Jan Kiszka
2008-05-04 21:33 ` [Qemu-devel] [PATCH] musicpal: doc fragment Jan Kiszka
2 siblings, 1 reply; 9+ messages in thread
From: andrzej zaborowski @ 2008-05-04 15:49 UTC (permalink / raw)
To: qemu-devel
On 04/05/2008, andrzej zaborowski <balrogg@gmail.com> wrote:
> On 04/05/2008, Jan Kiszka <jan.kiszka@web.de> wrote:
> > -#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).
>
>
> 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
Ok, seems to be fixed now - it (logically) happened everytime Linux
was trying to play a mono channel stream.
Regards
--
Please do not print this email unless absolutely necessary. Spread
environmental awareness.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] [4321] First cut at WM8750 volume control (Jan Kiszka).
2008-05-04 15:49 ` andrzej zaborowski
@ 2008-05-04 17:31 ` Jan Kiszka
0 siblings, 0 replies; 9+ messages in thread
From: Jan Kiszka @ 2008-05-04 17:31 UTC (permalink / raw)
To: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 3315 bytes --]
andrzej zaborowski wrote:
> On 04/05/2008, andrzej zaborowski <balrogg@gmail.com> wrote:
>> On 04/05/2008, Jan Kiszka <jan.kiszka@web.de> wrote:
>> > -#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).
>>
>>
>> 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
>
> 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
===================================================================
--- 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 = opaque;
- int16_t *codec_buffer, *mem_buffer;
+ int16_t *codec_buffer;
+ void *mem_buffer;
int pos, block_size;
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 = wm8750_dac_buffer(s->wm, block_size >> 1);
for (pos = 0; pos < block_size; pos += 2) {
- *codec_buffer++ = *mem_buffer;
- *codec_buffer++ = *mem_buffer++;
+ *codec_buffer++ = *(uint16_t *)mem_buffer;
+ *codec_buffer++ = *(uint16_t *)mem_buffer;
+ mem_buffer += 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 = wm8750_dac_buffer(s->wm, block_size);
for (pos = 0; pos < block_size; pos++) {
- *codec_buffer++ = cpu_to_le16(256 * *((int8_t *)mem_buffer));
- *codec_buffer++ = cpu_to_le16(256 * *((int8_t *)mem_buffer)++);
+ *codec_buffer++ = cpu_to_le16(256 * *(int8_t *)mem_buffer);
+ *codec_buffer++ = cpu_to_le16(256 * *(int8_t *)mem_buffer++);
}
} else {
codec_buffer = wm8750_dac_buffer(s->wm, block_size >> 1);
for (pos = 0; pos < block_size; pos += 2) {
- *codec_buffer++ = cpu_to_le16(256 * *((int8_t *)mem_buffer)++);
- *codec_buffer++ = cpu_to_le16(256 * *((int8_t *)mem_buffer)++);
+ *codec_buffer++ = cpu_to_le16(256 * *(int8_t *)mem_buffer++);
+ *codec_buffer++ = cpu_to_le16(256 * *(int8_t *)mem_buffer++);
}
}
}
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 254 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] [4321] First cut at WM8750 volume control (Jan Kiszka).
2008-05-04 12:31 ` andrzej zaborowski
2008-05-04 15:49 ` andrzej zaborowski
@ 2008-05-04 17:31 ` Jan Kiszka
2008-05-04 23:59 ` andrzej zaborowski
2008-05-04 21:33 ` [Qemu-devel] [PATCH] musicpal: doc fragment Jan Kiszka
2 siblings, 1 reply; 9+ messages in thread
From: Jan Kiszka @ 2008-05-04 17:31 UTC (permalink / raw)
To: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 1121 bytes --]
andrzej zaborowski wrote:
> On 04/05/2008, Jan Kiszka <jan.kiszka@web.de> wrote:
>> -#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).
>
> 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.
Well, this is a weak argument. So far there was no alternative available.
I don't let you go with this ;): How should we find out what needs to be
fixed - given that hardly anyone is able to test on its own all the
supported boards with appropriate sound scenarios? What regressions are
you aware of when we switch NOVOL off? That's why I was asking for a
roadmap: If there are known one, then keep NOVOL set for those arch. But
we won't make progress if we just stick with "this was OK so far."
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 254 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] [4321] First cut at WM8750 volume control (Jan Kiszka).
2008-05-04 17:31 ` Jan Kiszka
@ 2008-05-04 23:59 ` andrzej zaborowski
2008-05-05 18:43 ` [Qemu-devel] [PATCH] Enable volume control globally (was: First cut at WM8750 volume control) Jan Kiszka
0 siblings, 1 reply; 9+ messages in thread
From: andrzej zaborowski @ 2008-05-04 23:59 UTC (permalink / raw)
To: qemu-devel
On 04/05/2008, Jan Kiszka <jan.kiszka@web.de> wrote:
> andrzej zaborowski wrote:
> > On 04/05/2008, Jan Kiszka <jan.kiszka@web.de> wrote:
> >> -#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).
> >
> > 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.
>
>
> Well, this is a weak argument. So far there was no alternative available.
I'm sure there would be an alternative if anybody wanted it.
>
> I don't let you go with this ;): How should we find out what needs to be
> fixed - given that hardly anyone is able to test on its own all the
> supported boards with appropriate sound scenarios? What regressions are
> you aware of when we switch NOVOL off?
The regression is the overhead of two 32bit multiplications per sample
per channel even if the virtual sound card you use has no volume
control. For the wm8750 that's not easily noticeable but I'm
personally not making it a default and not globally. (But I won't
oppose if there's a wider agreement).
Regards
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Qemu-devel] [PATCH] Enable volume control globally (was: First cut at WM8750 volume control)
2008-05-04 23:59 ` andrzej zaborowski
@ 2008-05-05 18:43 ` Jan Kiszka
0 siblings, 0 replies; 9+ messages in thread
From: Jan Kiszka @ 2008-05-05 18:43 UTC (permalink / raw)
To: qemu-devel
andrzej zaborowski wrote:
> On 04/05/2008, Jan Kiszka <jan.kiszka@web.de> wrote:
>> andrzej zaborowski wrote:
>> > On 04/05/2008, Jan Kiszka <jan.kiszka@web.de> wrote:
>> >> -#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).
>> >
>> > 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.
>>
>>
>> Well, this is a weak argument. So far there was no alternative available.
>
> I'm sure there would be an alternative if anybody wanted it.
>
>> I don't let you go with this ;): How should we find out what needs to be
>> fixed - given that hardly anyone is able to test on its own all the
>> supported boards with appropriate sound scenarios? What regressions are
>> you aware of when we switch NOVOL off?
>
> The regression is the overhead of two 32bit multiplications per sample
> per channel even if the virtual sound card you use has no volume
> control. For the wm8750 that's not easily noticeable but I'm
> personally not making it a default and not globally. (But I won't
> oppose if there's a wider agreement).
Well, let's start like below, and if someone complains, think about a
step-wise move towards out-of-the-box mixer support in QEMU.
----------
As we now have the possibility to set per-channel volume levels, thus to
emulated sound hardware more realistically, we just need to enable the
application of this values by disabling 'NOVOL'. Users can still disable
this support if desired or required, but it should be the aim now to
fix potential remaining issues of the soft-mixer.
This patch also unbreaks the MusicPal emulation, which depends on the
mute control so that users have to tweak the source code right now.
Signed-off-by: Jan Kiszka <jan.kiszka@web.de>
---
audio/mixeng.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: b/audio/mixeng.c
===================================================================
--- a/audio/mixeng.c
+++ b/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
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Qemu-devel] [PATCH] musicpal: doc fragment
2008-05-04 12:31 ` andrzej zaborowski
2008-05-04 15:49 ` andrzej zaborowski
2008-05-04 17:31 ` Jan Kiszka
@ 2008-05-04 21:33 ` Jan Kiszka
2 siblings, 0 replies; 9+ messages in thread
From: Jan Kiszka @ 2008-05-04 21:33 UTC (permalink / raw)
To: qemu-devel
andrzej zaborowski wrote:
> ...
> Also BTW, do you want to add a qemu-doc.texi piece describing -M
> musicpal? Otherwise I'll add something.
Something like this?
Index: qemu/qemu-doc.texi
===================================================================
--- qemu/qemu-doc.texi (Revision 4334)
+++ qemu/qemu-doc.texi (Arbeitskopie)
@@ -87,6 +87,7 @@ For system emulation, the following hard
@item Freescale MCF5208EVB (ColdFire V2).
@item Arnewsh MCF5206 evaluation board (ColdFire V2).
@item Palm Tungsten|E PDA (OMAP310 processor)
+@item MusicPal (MV88W8618 ARM processor)
@end itemize
For user emulation, x86, PowerPC, ARM, 32-bit MIPS, Sparc32/64 and ColdFire(m68k) CPUs are supported.
@@ -2466,6 +2467,25 @@ Timers, UARTs, ADC, I@math{^2}C and SSI
OSRAM Pictiva 128x64 OLED with SSD0323 controller connected via SSI.
@end itemize
+The Freecom MusicPal emulation includes the following elements:
+
+@itemize @minus
+@item
+Marvel MV88W8618 ARM core.
+@item
+32 MB RAM, 256 KB SRAM, 8 MB flash.
+@item
+up to 2 16550 UARTs
+@item
+MV88W8xx8 Ethernet controller
+@item
+MV88W8618 audio controller, WM8750 CODEC and mixer
+@item
+128×64 display with brightness control
+@item
+2 buttons, 2 navigation wheels with button function
+@end itemize
+
A Linux 2.6 test image is available on the QEMU web site. More
information is available in the QEMU mailing-list archive.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2008-05-05 18:44 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-04 10:21 [Qemu-devel] [4321] First cut at WM8750 volume control (Jan Kiszka) Andrzej Zaborowski
2008-05-04 10:47 ` Jan Kiszka
2008-05-04 12:31 ` andrzej zaborowski
2008-05-04 15:49 ` andrzej zaborowski
2008-05-04 17:31 ` Jan Kiszka
2008-05-04 17:31 ` Jan Kiszka
2008-05-04 23:59 ` andrzej zaborowski
2008-05-05 18:43 ` [Qemu-devel] [PATCH] Enable volume control globally (was: First cut at WM8750 volume control) Jan Kiszka
2008-05-04 21:33 ` [Qemu-devel] [PATCH] musicpal: doc fragment Jan Kiszka
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).