[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] hw/usb/dev-audio.c: make USB audio card sound p
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH] hw/usb/dev-audio.c: make USB audio card sound perfect |
Date: |
Fri, 16 Oct 2015 14:15:48 +0200 |
User-agent: |
Mutt/1.5.24 (2015-08-30) |
On Tue, Sep 22, 2015 at 07:32:01PM -0400, Programmingkid wrote:
> 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 <address@hidden>
>
> ---
> 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),
I'm not familiar with the code but I guess this also increases audio
latency by a factor of 4 (8 -> 32).
Gerd might have an opinion on whether that is okay or not.
Stefan
- Re: [Qemu-devel] [PATCH] hw/usb/dev-audio.c: make USB audio card sound perfect,
Stefan Hajnoczi <=
- Re: [Qemu-devel] [PATCH] hw/usb/dev-audio.c: make USB audio card sound perfect, Programmingkid, 2015/10/16
- Re: [Qemu-devel] [PATCH] hw/usb/dev-audio.c: make USB audio card sound perfect, Peter Maydell, 2015/10/16
- Re: [Qemu-devel] [PATCH] hw/usb/dev-audio.c: make USB audio card sound perfect, Stefan Hajnoczi, 2015/10/26
- Re: [Qemu-devel] [PATCH] hw/usb/dev-audio.c: make USB audio card sound perfect, Gerd Hoffmann, 2015/10/26
- Re: [Qemu-devel] [PATCH] hw/usb/dev-audio.c: make USB audio card sound perfect, Programmingkid, 2015/10/26
- Re: [Qemu-devel] [PATCH] hw/usb/dev-audio.c: make USB audio card sound perfect, Stefan Hajnoczi, 2015/10/28
- Re: [Qemu-devel] [PATCH] hw/usb/dev-audio.c: make USB audio card sound perfect, Gerd Hoffmann, 2015/10/28
- Re: [Qemu-devel] [PATCH] hw/usb/dev-audio.c: make USB audio card sound perfect, Programmingkid, 2015/10/28
- Re: [Qemu-devel] [PATCH] hw/usb/dev-audio.c: make USB audio card sound perfect, Stefan Hajnoczi, 2015/10/29