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

[-- Attachment #1: Type: text/plain, Size: 2204 bytes --]

andrzej zaborowski wrote:
> 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.

That's the totally wrong way from the usability perspective, IMHO. What
are the remaining downsides of mixer support? If there are any, I guess
they are far less than the advantages, so this switch should at least
become an option which is default off.

> 
>>  [ 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".

I had problems with parallel usage by several apps, and only true ALSA
mode resolved it. I think AOSS is purely for unconvertible legacy apps,
and I don't want to put QEMU into this category. ;)

Will follow up on this the next days.

> 
>>  > 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.

Thought a bit about it (still untested, though), and I think it should
be fine to just fix the initialization of nominal_volume from UINT_MAX
to (1ULL << 32) (because we are shifting back by 32 bits at runtime). I
had that wrong in my patch as well, BTW.

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 254 bytes --]

      reply	other threads:[~2008-05-02 10:56 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
2008-05-02 10:55         ` Jan Kiszka [this message]

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=481AF33A.6030101@web.de \
    --to=jan.kiszka@web.de \
    --cc=balrogg@gmail.com \
    --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).