qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] hw/usb/dev-audio.c: make USB audio card sound perfect
@ 2015-09-22 23:32 Programmingkid
  2015-10-16 12:15 ` Stefan Hajnoczi
  0 siblings, 1 reply; 17+ messages in thread
From: Programmingkid @ 2015-09-22 23:32 UTC (permalink / raw)
  To: qemu-devel qemu-devel; +Cc: Stefan Hajnoczi, H. Peter Anvin, Gerd Hoffmann

The USB audio card would not play audio well because its buffer was too small. 
Increasing it made it play perfectly. All the crackling and dropouts are gone.  

Signed-off-by: John Arbuckle <programmingkidx@gmail.com>

---
This patch was tested on qemu-system-ppc running Linux and qemu-system-i386
running Windows XP. Windows XP sound output thru the USB audio card sounded
perfect. Linux did improve in sound quality, but it still wasn't perfect. I
think there are problems with the hcd-ohci.c file. The Mac OS 10.2 guest in 
qemu-system-ppc did not play sound due to USB issues unrelated to this patch. 

 hw/usb/dev-audio.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/hw/usb/dev-audio.c b/hw/usb/dev-audio.c
index f092bb8..e4e4989 100644
--- a/hw/usb/dev-audio.c
+++ b/hw/usb/dev-audio.c
@@ -88,6 +88,7 @@ static const USBDescStrings usb_audio_stringtable = {
 #define USBAUDIO_PACKET_SIZE     192
 #define USBAUDIO_SAMPLE_RATE     48000
 #define USBAUDIO_PACKET_INTERVAL 1
+#define BUFFER_MULTIPLIER        32
 
 static const USBDescIface desc_iface[] = {
     {
@@ -664,7 +665,7 @@ static const VMStateDescription vmstate_usb_audio = {
 static Property usb_audio_properties[] = {
     DEFINE_PROP_UINT32("debug", USBAudioState, debug, 0),
     DEFINE_PROP_UINT32("buffer", USBAudioState, buffer,
-                       8 * USBAUDIO_PACKET_SIZE),
+                       BUFFER_MULTIPLIER * USBAUDIO_PACKET_SIZE),
     DEFINE_PROP_END_OF_LIST(),
 };
 
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2015-11-02 13:49 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-22 23:32 [Qemu-devel] [PATCH] hw/usb/dev-audio.c: make USB audio card sound perfect Programmingkid
2015-10-16 12:15 ` Stefan Hajnoczi
2015-10-16 13:54   ` Programmingkid
2015-10-16 14:00     ` Peter Maydell
2015-10-16 14:06       ` Programmingkid
2015-10-26 11:00     ` Stefan Hajnoczi
2015-10-26 12:24       ` Gerd Hoffmann
2015-10-26 16:05         ` Programmingkid
2015-10-28 10:58         ` Stefan Hajnoczi
2015-10-28 12:07           ` Gerd Hoffmann
2015-10-28 13:59           ` Programmingkid
2015-10-29 15:08             ` Stefan Hajnoczi
2015-10-29 16:02               ` Programmingkid
2015-10-30 10:59                 ` Gerd Hoffmann
2015-11-02 13:07                   ` Stefan Hajnoczi
2015-11-02 13:49                     ` Gerd Hoffmann
2015-10-26 15:16       ` Programmingkid

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).