Skip to content

Commit

Permalink
Add Intel HD Audio support to qemu.
Browse files Browse the repository at this point in the history
This patch adds three devices to qemu:

intel-hda
	Intel HD Audio Controller, the PCI device.  Provides a HDA bus.
	Emulates ICH6 at the moment.  Adding a ICH9 PCIE
	variant shouldn't be hard.

hda-duplex
	HDA Codec.  Attaches to the HDA bus.  Supports 16bit stereo,
	rates 16k -> 96k, playback, recording and volume control
	(with CONFIG_MIXEMU=y).

hda-output
	HDA Codec without recording support.  Subset of the hda-duplex
	codec.  Use this if you don't want your guests access your mic.

Usage: add '-device intel-hda -device hda-duplex' to your command line.

Tested guests:
 * Linux works.
 * Win7 works.
 * DOS (mpxplay) works.
 * WinXP doesn't work.

[ v2 changes ]
 * Fixed endianess, big endian hosts work now.
 * Fixed some emulation bugs.
 * Added immediate command emulation.
 * Added vmstate support.
 * Make it behave like all other sound card drivers:
   - can be configured via '--audio-card-list=hda'
   - can be added to a VM using '-soundhw hda'
 * Code style fixups.
 * Zapped guest-triggerable asserts.
 * Handle partial reads/writes of audio data correctly.

Cc: malc <[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: malc <[email protected]>
  • Loading branch information
kraxel authored and malc committed Nov 1, 2010
1 parent cdae5cf commit d61a4ce
Show file tree
Hide file tree
Showing 8 changed files with 2,946 additions and 2 deletions.
1 change: 1 addition & 0 deletions Makefile.objs
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ sound-obj-$(CONFIG_AC97) += ac97.o
sound-obj-$(CONFIG_ADLIB) += fmopl.o adlib.o
sound-obj-$(CONFIG_GUS) += gus.o gusemu_hal.o gusemu_mixer.o
sound-obj-$(CONFIG_CS4231A) += cs4231a.o
sound-obj-$(CONFIG_HDA) += intel-hda.o hda-audio.o

adlib.o fmopl.o: QEMU_CFLAGS += -DBUILD_Y8950=0
hw-obj-$(CONFIG_SOUND) += $(sound-obj-y)
Expand Down
10 changes: 10 additions & 0 deletions arch_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,16 @@ struct soundhw soundhw[] = {
},
#endif

#ifdef CONFIG_HDA
{
"hda",
"Intel HD Audio",
0,
0,
{ .init_pci = intel_hda_and_codec_init }
},
#endif

#endif /* HAS_AUDIO_CHOICE */

{ NULL, NULL, 0, 0, { NULL } }
Expand Down
4 changes: 2 additions & 2 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ sparc_cpu=""
cross_prefix=""
cc="gcc"
audio_drv_list=""
audio_card_list="ac97 es1370 sb16"
audio_possible_cards="ac97 es1370 sb16 cs4231a adlib gus"
audio_card_list="ac97 es1370 sb16 hda"
audio_possible_cards="ac97 es1370 sb16 cs4231a adlib gus hda"
block_drv_whitelist=""
host_cc="gcc"
ar="ar"
Expand Down
3 changes: 3 additions & 0 deletions hw/audiodev.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ int ac97_init(PCIBus *buf);

/* cs4231a.c */
int cs4231a_init(qemu_irq *pic);

/* intel-hda.c + hda-audio.c */
int intel_hda_and_codec_init(PCIBus *bus);
Loading

0 comments on commit d61a4ce

Please sign in to comment.