diff mbox

[47/51] package/qemu: enable sound

Message ID 1354146890-27380-48-git-send-email-yann.morin.1998@free.fr
State Changes Requested
Headers show

Commit Message

Yann E. MORIN Nov. 28, 2012, 11:54 p.m. UTC
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
 package/qemu/Config.in |   38 ++++++++++++++++++++++++++++++++++++++
 package/qemu/qemu.mk   |   19 +++++++++++++++++--
 2 files changed, 55 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/package/qemu/Config.in b/package/qemu/Config.in
index fd14c3c..6c50746 100644
--- a/package/qemu/Config.in
+++ b/package/qemu/Config.in
@@ -205,6 +205,44 @@  config BR2_PACKAGE_QEMU_VDE
 	  Say 'y' here to have QEMU connect to VDE (Virtual Distributed
 	  Ethernet) switches.
 
+comment "Sound"
+
+config BR2_PACKAGE_QEMU_SOUND_CARDS
+	string "Enable sound cards"
+	default "ac97 es1370 hda"
+	help
+	  Enter here the list of sound cards you want QEMU to emulate.
+	  The available sound cards are:
+	    ac97 es1370 sb16 cs4231a adlib gus hda
+	  
+	  The default is: ac97 es1370 hda
+	  
+	  Note: even if you say 'n' to both alsa and SDL drivers, below, QEMU
+	  always include the 'wav' driver, which stores the generated sound
+	  into a file, and the 'none' driver, which discards generated sound.
+
+config BR2_PACKAGE_QEMU_MIXEMU
+	bool "Enable mixer emulation"
+	help
+	  Say 'y' here to have QEMU emulate a mixer device.
+
+config BR2_PACKAGE_QEMU_SOUND_SDL
+	bool "Enable sound via SDL"
+	select BR2_PACKAGE_QEMU_SDL # Requires that SDL frontend be selected
+	select BR2_PACKAGE_SDL
+	help
+	  Say 'y' here to have QEMU play sound from the VMs via SDL.
+	  
+	  Note: this is only for system emulation, not user emulation.
+
+config BR2_PACKAGE_QEMU_SOUND_ALSA
+	bool "Enable sound via alsa"
+	select BR2_PACKAGE_ALSA_LIB
+	help
+	  Say 'y' here to have QEMU play sound from the VMs via alsa.
+	  
+	  Note: this is only for system emulation, not user emulation.
+
 comment "Misc. features"
 
 config BR2_PACKAGE_QEMU_FDT
diff --git a/package/qemu/qemu.mk b/package/qemu/qemu.mk
index 0495233..80424e6 100644
--- a/package/qemu/qemu.mk
+++ b/package/qemu/qemu.mk
@@ -226,6 +226,23 @@  else
 QEMU_OPTS += --disable-vde
 endif
 
+QEMU_SND_DRV =
+ifeq ($(BR2_PACKAGE_QEMU_SOUND_ALSA),y)
+QEMU_SND_DRV += alsa
+QEMU_DEPENDENCIES += alsa-lib
+endif
+ifeq ($(BR2_PACKAGE_QEMU_SOUND_SDL),y)
+QEMU_SND_DRV += sdl
+QEMU_DEPENDENCIES += sdl
+endif
+ifneq ($(QEMU_SND_DRV),)
+QEMU_OPTS += --audio-drv-list="$(QEMU_SND_DRV)"
+endif
+QEMU_OPTS += --audio-card-list=$(BR2_PACKAGE_QEMU_SOUND_CARDS)
+ifeq ($(BR2_PACKAGE_QEMU_MIXEMU),y)
+QEMU_OPTS += --enable-mixemu
+endif
+
 ifeq ($(BR2_PACKAGE_QEMU_FDT),y)
 QEMU_OPTS += --enable-fdt
 QEMU_DEPENDENCIES += dtc
@@ -334,8 +351,6 @@  define QEMU_CONFIGURE_CMDS
 	    ./configure                             \
 	        --prefix=/usr                       \
 	        --cross-prefix=$(TARGET_CROSS)      \
-	        --audio-drv-list=                   \
-	        --audio-card-list=                  \
 	        --enable-kvm                        \
 	        --enable-nptl                       \
 	        --enable-vhost-net                  \