[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/2] Introduce AUD_set_volume
From: |
andrzej zaborowski |
Subject: |
Re: [Qemu-devel] [PATCH 1/2] Introduce AUD_set_volume |
Date: |
Fri, 2 May 2008 12:12:07 +0200 |
On 02/05/2008, Jan Kiszka <address@hidden> wrote:
> andrzej zaborowski wrote:
> > The user still needs to disable NOVOL if they really want volume control.
>
> What is the "user" here? wm8750? musicpal? I just hope it is not the
> real user... :)
Whoever builds qemu. You don't want it enabled by default and globally.
>
> [ QEMU audio setup is already weird enough: I recently tried to get ALSA
> running to overcome outdated OSS - well, tricky. Needs fixing. ]
Yup, I had alsa running but normally (for example now) I just run qemu
through "aoss".
>
> > 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 = mute;
> > + sw->vol.l = nominal_volume.l * lvol / 255;
> > + sw->vol.r = nominal_volume.r * rvol / 255;
Oops, it may be wrong indeed because it might overflow on machines
with sizeof(int) >= sizeof(int64_t) and no FLOAT_MIXENG. I first
wrote (nominal_volume.l / 255) * lvol and then immediately changed it,
but that was better.
Regards
--
Please do not print this email unless absolutely necessary. Spread
environmental awareness.