summary refs log tree commit diff stats
path: root/hw/usb.h
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2010-09-10 14:47:56 -0700
committerGerd Hoffmann <kraxel@redhat.com>2012-01-13 10:25:44 +0100
commitb870472db5c90d3c96f4b85fbdfce87ce8076fc8 (patch)
tree20232ae712793fff9b2fd4a679fc86e49559f90e /hw/usb.h
parentcc5f13956c3e681d5974bc81b6d275c19666af4b (diff)
downloadfocaccia-qemu-b870472db5c90d3c96f4b85fbdfce87ce8076fc8.tar.gz
focaccia-qemu-b870472db5c90d3c96f4b85fbdfce87ce8076fc8.zip
usb: add audio device model
This brings a usb audio device to qemu.  Output only, fixed at
16bit stereo @ 480000 Hz.  Based on a patch from
H. Peter Anvin <hpa@linux.intel.com>

Usage: add '-device usb-audio' to your qemu command line.

Works sorta ok on a idle machine.  Known issues:

 * Is *very* sensitive to latencies.
 * Burns quite some CPU due to usb polling.

In short:  It brings the qemu usb emulation to its limits.  Enjoy!

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/usb.h')
-rw-r--r--hw/usb.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/hw/usb.h b/hw/usb.h
index 1496f7694c..b2c9479594 100644
--- a/hw/usb.h
+++ b/hw/usb.h
@@ -79,6 +79,11 @@
 #define USB_CLASS_APP_SPEC		0xfe
 #define USB_CLASS_VENDOR_SPEC		0xff
 
+#define USB_SUBCLASS_UNDEFINED          0
+#define USB_SUBCLASS_AUDIO_CONTROL      1
+#define USB_SUBCLASS_AUDIO_STREAMING    2
+#define USB_SUBCLASS_AUDIO_MIDISTREAMING 3
+
 #define USB_DIR_OUT			0
 #define USB_DIR_IN			0x80
 
@@ -132,6 +137,8 @@
 #define USB_DT_OTHER_SPEED_CONFIG       0x07
 #define USB_DT_DEBUG                    0x0A
 #define USB_DT_INTERFACE_ASSOC          0x0B
+#define USB_DT_CS_INTERFACE             0x24
+#define USB_DT_CS_ENDPOINT              0x25
 
 #define USB_ENDPOINT_XFER_CONTROL	0
 #define USB_ENDPOINT_XFER_ISOC		1