From: "Marc-André Lureau" <marcandre.lureau@gmail.com>
To: qemu-devel@nongnu.org
Cc: "Marc-André Lureau" <marcandre.lureau@redhat.com>
Subject: [Qemu-devel] [PATCH 10/10] Enable mixemu by default, add runtime option
Date: Thu, 22 Mar 2012 16:21:38 +0100 [thread overview]
Message-ID: <1332429698-10395-11-git-send-email-marcandre.lureau@redhat.com> (raw)
In-Reply-To: <1332429698-10395-1-git-send-email-marcandre.lureau@redhat.com>
Without MIXEMU, volume control on the guest doesn't work (except when
volume is applied by guest "emulation", in Win7 for example).
Instead rely on backend volume support, or fallback on mixeng if
backend doesn't support volume control, except if mixemu is disabled
with QEMU_MIXEMU=0.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
audio/audio.c | 10 +++++++++-
audio/mixeng.c | 6 ------
configure | 8 --------
hw/hda-audio.c | 4 ----
4 files changed, 9 insertions(+), 19 deletions(-)
diff --git a/audio/audio.c b/audio/audio.c
index bd9237e..bb94133 100644
--- a/audio/audio.c
+++ b/audio/audio.c
@@ -70,6 +70,7 @@ static struct {
int log_to_monitor;
int try_poll_in;
int try_poll_out;
+ int mixemu;
} conf = {
.fixed_out = { /* DAC fixed settings */
.enabled = 1,
@@ -100,6 +101,7 @@ static struct {
.log_to_monitor = 0,
.try_poll_in = 1,
.try_poll_out = 1,
+ .mixemu = 1,
};
static AudioState glob_audio_state;
@@ -1044,7 +1046,7 @@ int audio_pcm_sw_write (SWVoiceOut *sw, void *buf, int size)
if (swlim) {
sw->conv (sw->buf, buf, swlim);
- if (!(sw->hw->ctl_caps & VOICE_VOLUME_CAP)) {
+ if (!(sw->hw->ctl_caps & VOICE_VOLUME_CAP) && conf.mixemu) {
mixeng_volume (sw->buf, swlim, &sw->vol);
}
}
@@ -1657,6 +1659,12 @@ static struct audio_option audio_options[] = {
.valp = &conf.log_to_monitor,
.descr = "Print logging messages to monitor instead of stderr"
},
+ {
+ .name = "MIXEMU",
+ .tag = AUD_OPT_BOOL,
+ .valp = &conf.mixemu,
+ .descr = "Enable mixer emulation (1 - enabled, 0 - disabled)"
+ },
{ /* End of list */ }
};
diff --git a/audio/mixeng.c b/audio/mixeng.c
index 5446be6..0b060e3 100644
--- a/audio/mixeng.c
+++ b/audio/mixeng.c
@@ -336,7 +336,6 @@ void mixeng_clear (struct st_sample *buf, int len)
void mixeng_volume (struct st_sample *buf, int len, struct mixeng_volume *vol)
{
-#ifdef CONFIG_MIXEMU
if (vol->mute) {
mixeng_clear (buf, len);
return;
@@ -352,9 +351,4 @@ void mixeng_volume (struct st_sample *buf, int len, struct mixeng_volume *vol)
#endif
buf += 1;
}
-#else
- (void) buf;
- (void) len;
- (void) vol;
-#endif
}
diff --git a/configure b/configure
index 907a655..d13238f 100755
--- a/configure
+++ b/configure
@@ -177,7 +177,6 @@ darwin_user="no"
bsd_user="no"
guest_base=""
uname_release=""
-mixemu="no"
aix="no"
blobs="yes"
pkgversion=""
@@ -771,8 +770,6 @@ for opt do
;;
--enable-nptl) nptl="yes"
;;
- --enable-mixemu) mixemu="yes"
- ;;
--disable-linux-aio) linux_aio="no"
;;
--enable-linux-aio) linux_aio="yes"
@@ -1031,7 +1028,6 @@ echo " --audio-card-list=LIST set list of emulated audio cards [$audio_card_l
echo " Available cards: $audio_possible_cards"
echo " --block-drv-whitelist=L set block driver whitelist"
echo " (affects only QEMU, not qemu-img)"
-echo " --enable-mixemu enable mixer emulation"
echo " --disable-xen disable xen backend driver support"
echo " --enable-xen enable xen backend driver support"
echo " --disable-brlapi disable BrlAPI"
@@ -2907,7 +2903,6 @@ echo "mingw32 support $mingw32"
echo "Audio drivers $audio_drv_list"
echo "Extra audio cards $audio_card_list"
echo "Block whitelist $block_drv_whitelist"
-echo "Mixer emulation $mixemu"
echo "VirtFS support $virtfs"
echo "VNC support $vnc"
if test "$vnc" = "yes" ; then
@@ -3070,9 +3065,6 @@ if test "$audio_win_int" = "yes" ; then
echo "CONFIG_AUDIO_WIN_INT=y" >> $config_host_mak
fi
echo "CONFIG_BDRV_WHITELIST=$block_drv_whitelist" >> $config_host_mak
-if test "$mixemu" = "yes" ; then
- echo "CONFIG_MIXEMU=y" >> $config_host_mak
-fi
if test "$vnc" = "yes" ; then
echo "CONFIG_VNC=y" >> $config_host_mak
fi
diff --git a/hw/hda-audio.c b/hw/hda-audio.c
index 8995519..75f1402 100644
--- a/hw/hda-audio.c
+++ b/hw/hda-audio.c
@@ -121,15 +121,11 @@ static void hda_codec_parse_fmt(uint32_t format, struct audsettings *as)
#define QEMU_HDA_AMP_NONE (0)
#define QEMU_HDA_AMP_STEPS 0x4a
-#ifdef CONFIG_MIXEMU
#define QEMU_HDA_AMP_CAPS \
(AC_AMPCAP_MUTE | \
(QEMU_HDA_AMP_STEPS << AC_AMPCAP_OFFSET_SHIFT) | \
(QEMU_HDA_AMP_STEPS << AC_AMPCAP_NUM_STEPS_SHIFT) | \
(3 << AC_AMPCAP_STEP_SIZE_SHIFT))
-#else
-#define QEMU_HDA_AMP_CAPS QEMU_HDA_AMP_NONE
-#endif
/* common: audio output widget */
static const desc_param common_params_audio_dac[] = {
--
1.7.7.6
prev parent reply other threads:[~2012-03-22 15:22 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-22 15:21 [Qemu-devel] [PATCH 00/10] apply volume on client side v5 Marc-André Lureau
2012-03-22 15:21 ` [Qemu-devel] [PATCH 01/10] audio: add VOICE_VOLUME ctl Marc-André Lureau
2012-03-22 15:21 ` [Qemu-devel] [PATCH 02/10] audio: don't apply volume effect if backend has VOICE_VOLUME_CAP Marc-André Lureau
2012-03-22 15:21 ` [Qemu-devel] [PATCH 03/10] hw/ac97: remove USE_MIXER code Marc-André Lureau
2012-03-22 15:21 ` [Qemu-devel] [PATCH 04/10] hw/ac97: the volume mask is not only 0x1f Marc-André Lureau
2012-03-22 15:21 ` [Qemu-devel] [PATCH 05/10] hw/ac97: add support for volume control Marc-André Lureau
2012-03-22 15:21 ` [Qemu-devel] [PATCH 06/10] audio/spice: " Marc-André Lureau
2012-03-22 15:21 ` [Qemu-devel] [PATCH 07/10] Do not use pa_simple PulseAudio API Marc-André Lureau
2012-03-22 15:21 ` [Qemu-devel] [PATCH 08/10] configure: pa_simple is not needed anymore Marc-André Lureau
2012-03-22 15:21 ` [Qemu-devel] [PATCH 09/10] Allow controlling volume with PulseAudio backend Marc-André Lureau
2012-03-22 15:21 ` Marc-André Lureau [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=1332429698-10395-11-git-send-email-marcandre.lureau@redhat.com \
--to=marcandre.lureau@gmail.com \
--cc=marcandre.lureau@redhat.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).