qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] hda-codec: use smaller dynamic range for input


From: Wilck, Martin
Subject: Re: [Qemu-devel] [PATCH] hda-codec: use smaller dynamic range for input amplifier
Date: Wed, 22 Apr 2015 10:01:58 +0200

> > > The "right" solution for this problem would be to implement
> > > proper dB scaling in QEMU and the audio backends (such as spice).
> 
> Can we try this please?

I would like to, but it's a rather big project and beyond my current
QEMU progamming skills. Support seems to be lacking in the generic QEMU
audio layer.

> > > While this clean solution is not available, I suggest to decrease
> > > the dynamic range for the the emulated Amps in the QEMU hda codec.
> > > Experiments showed that with 32dB dynamic range with a 0.5 dB step,
> > > it was possible to set gain values as low as 5 (-29.5dB / 8%).
> > > Actual HW seems to use similar ranges for input amplifiers.
> 
> > I am afraid guest OS won't like it the card description changes after a 
> > migration.
> > This will likely need a new VMState field, for the steps, or the amp caps.
> 
> Correct.  This is a guest-visible change, so we have to make this
> runtime-switchable for compatibility with older qemu versions.  This
> quickly becomes a bit messy, so I'd prefer to avoid this.

So what do you suggest? The current situation (not being able to control
volume properly from the guest) is messy and should be fixed. It might
look like a minor problem, but try to run a Windows application that
attempts to auto-regulate input volume (such as Microsoft Lync/Skype) -
it simply doesn't work.

In the case of migration, what has to be avoided is that the guest
attempts to set a gain value outside the allowed range. So I should
modify my patch to use the same number of steps as before (0x4a).
Modified patch is attached.

Now, if the guest migrates from "new" to "old", it will continue to
assume a 0.5dB stepping. Because the HD audio step size is a purely
virtual value (we are not using dB at the moment), this will have the
effect that volume control after migration still behaves well. Likewise,
migrating from "old" to "new" will cause my fix not to become effective
in the "new" environment, because the guest will still assume 1dB
stepping.

Other than that, I can't see what might go wrong during a migration -
but maybe I am overlooking something? I have no environment to test
migration, so my thoughts above are just theoretical.

Martin

Attachment: 0001-hda-codec-use-smaller-dynamic-range-for-input-amplif.patch
Description: 0001-hda-codec-use-smaller-dynamic-range-for-input-amplif.patch


reply via email to

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