qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "andrzej zaborowski" <balrogg@gmail.com>
To: Jan Kiszka <jan.kiszka@web.de>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 1/2] Introduce AUD_set_volume
Date: Fri, 2 May 2008 12:12:07 +0200	[thread overview]
Message-ID: <fb249edb0805020312g190011d8r568d7f217b0c25e2@mail.gmail.com> (raw)
In-Reply-To: <481AC5BC.9000402@web.de>

On 02/05/2008, Jan Kiszka <jan.kiszka@web.de> 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.

  reply	other threads:[~2008-05-02 10:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-27 11:26 [Qemu-devel] [PATCH 1/2] Introduce AUD_set_volume Jan Kiszka
2008-04-27 18:35 ` malc
2008-05-02  2:08   ` andrzej zaborowski
2008-05-02  7:41     ` Jan Kiszka
2008-05-02 10:12       ` andrzej zaborowski [this message]
2008-05-02 10:55         ` Jan Kiszka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fb249edb0805020312g190011d8r568d7f217b0c25e2@mail.gmail.com \
    --to=balrogg@gmail.com \
    --cc=jan.kiszka@web.de \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).