Patchwork [v2,3/3] audio: remove CONFIG_MIXEMU configure option and enable mixemu by default

login
register
mail settings
Submitter Bandan Das
Date Sept. 5, 2013, 10:24 p.m.
Message ID <1378419871-31895-4-git-send-email-bsd@redhat.com>
Download mbox | patch
Permalink /patch/272988/
State New
Headers show

Comments

Bandan Das - Sept. 5, 2013, 10:24 p.m.
Set mixer property to on by default. Also, always include two versions
of devices (with and without mixemu) so that user can select one of 
them at runtime.

Signed-off-by: Bandan Das <bsd@redhat.com>
---
 audio/mixeng.c       |  6 ------
 configure            |  8 --------
 hw/audio/hda-codec.c | 35 -----------------------------------
 3 files changed, 49 deletions(-)
Gerd Hoffmann - Sept. 6, 2013, 7:35 a.m.
On Do, 2013-09-05 at 18:24 -0400, Bandan Das wrote:
> Set mixer property to on by default.

The "by default" in the commit message is a bit misleading.  There is no
default any more once CONFIG_MIXEMU is gone ...

> Also, always include two versions
> of devices (with and without mixemu) so that user can select one of 
> them at runtime.

That applies to hda audio only, and it's patch #2 actually implementing
that (for the CONFIG_MIXEMU=y case).

cheers,
  Gerd
Bandan Das - Sept. 7, 2013, 3:42 a.m.
Gerd Hoffmann <kraxel@redhat.com> writes:

> On Do, 2013-09-05 at 18:24 -0400, Bandan Das wrote:
>> Set mixer property to on by default.
>
> The "by default" in the commit message is a bit misleading.  There is no
> default any more once CONFIG_MIXEMU is gone ...

I was actually referring to the mixemu property which is 
hda-codec specific; should have worded it better. Anyway, the commit message:
"audio: remove CONFIG_MIXEMU configure option" is descriptive enough I think.

>> Also, always include two versions
>> of devices (with and without mixemu) so that user can select one of 
>> them at runtime.
>
> That applies to hda audio only, and it's patch #2 actually implementing
> that (for the CONFIG_MIXEMU=y case).
>

Yes, you are right. This is hda-codec specific and while patch 2 adds both
versions only when CONFIG_MIXEMU is defined, this change adds both versions
unconditionally. Again, probably evident enough since CONFIG_MIXEMU is being
removed, so I will remove this part from the commit message.

Thanks,
Bandan

> cheers,
>   Gerd

Patch

diff --git a/audio/mixeng.c b/audio/mixeng.c
index 02a9d9f..0e4976f 100644
--- a/audio/mixeng.c
+++ b/audio/mixeng.c
@@ -348,7 +348,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;
@@ -364,9 +363,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 18fa608..a908c5b 100755
--- a/configure
+++ b/configure
@@ -215,7 +215,6 @@  linux_user="no"
 bsd_user="no"
 guest_base="yes"
 uname_release=""
-mixemu="no"
 aix="no"
 blobs="yes"
 pkgversion=""
@@ -855,8 +854,6 @@  for opt do
   ;;
   --enable-fdt) fdt="yes"
   ;;
-  --enable-mixemu) mixemu="yes"
-  ;;
   --disable-linux-aio) linux_aio="no"
   ;;
   --enable-linux-aio) linux_aio="yes"
@@ -1067,7 +1064,6 @@  echo "                           (affects only QEMU, not qemu-img)"
 echo "  --block-drv-ro-whitelist=L"
 echo "                           set block driver read-only 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-xen-pci-passthrough"
@@ -3554,7 +3550,6 @@  echo "mingw32 support   $mingw32"
 echo "Audio drivers     $audio_drv_list"
 echo "Block whitelist (rw) $block_drv_rw_whitelist"
 echo "Block whitelist (ro) $block_drv_ro_whitelist"
-echo "Mixer emulation   $mixemu"
 echo "VirtFS support    $virtfs"
 echo "VNC support       $vnc"
 if test "$vnc" = "yes" ; then
@@ -3735,9 +3730,6 @@  if test "$audio_win_int" = "yes" ; then
 fi
 echo "CONFIG_BDRV_RW_WHITELIST=$block_drv_rw_whitelist" >> $config_host_mak
 echo "CONFIG_BDRV_RO_WHITELIST=$block_drv_ro_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/audio/hda-codec.c b/hw/audio/hda-codec.c
index b14fae5..07a43bf 100644
--- a/hw/audio/hda-codec.c
+++ b/hw/audio/hda-codec.c
@@ -118,16 +118,9 @@  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   PARAM mixemu
 #define   HDA_MIXER
 #include "hda-codec-common.h"
-#else
-/* keep the compiler quiet */
-static const desc_codec output_mixemu;
-static const desc_codec duplex_mixemu;
-static const desc_codec micro_mixemu;
-#endif
 
 #define   PARAM nomixemu
 #include  "hda-codec-common.h"
@@ -599,11 +592,7 @@  static const VMStateDescription vmstate_hda_audio = {
 
 static Property hda_audio_properties[] = {
     DEFINE_PROP_UINT32("debug", HDAAudioState, debug,   0),
-#ifdef CONFIG_MIXEMU
     DEFINE_PROP_BOOL("mixer", HDAAudioState, mixer,  true),
-#else
-    DEFINE_PROP_BOOL("mixer", HDAAudioState, mixer, false),
-#endif
     DEFINE_PROP_END_OF_LIST(),
 };
 
@@ -614,15 +603,7 @@  static int hda_audio_init_output(HDACodecDevice *hda)
     if (!a->mixer) {
         return hda_audio_init(hda, &output_nomixemu);
     } else {
-
-#ifdef CONFIG_MIXEMU
         return hda_audio_init(hda, &output_mixemu);
-#else
-        fprintf(stderr, "ERROR:
-                hda-codec : Mixer emulation has not been compiled in!\n");
-        return -1;
-#endif
-
     }
 }
 
@@ -633,15 +614,7 @@  static int hda_audio_init_duplex(HDACodecDevice *hda)
     if (!a->mixer) {
         return hda_audio_init(hda, &duplex_nomixemu);
     } else {
-
-#ifdef CONFIG_MIXEMU
         return hda_audio_init(hda, &duplex_mixemu);
-#else
-        fprintf(stderr, "ERROR:
-                hda-codec : Mixer emulation has not been compiled in!\n");
-        return -1;
-#endif
-
     }
 }
 
@@ -652,15 +625,7 @@  static int hda_audio_init_micro(HDACodecDevice *hda)
     if (!a->mixer) {
         return hda_audio_init(hda, &micro_nomixemu);
     } else {
-
-#ifdef CONFIG_MIXEMU
         return hda_audio_init(hda, &micro_mixemu);
-#else
-        fprintf(stderr, "ERROR:
-                hda-codec : Mixer emulation has not been compiled in!\n");
-        return -1;
-#endif
-
     }
 }