Received: from eggs.gnu.org ([2001:4830:134:3::10]:44695) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZgUo-0002NJ-8r for qemu-devel@nongnu.org; Wed, 09 Sep 2015 10:37:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZZgUk-0005Oo-2R for qemu-devel@nongnu.org; Wed, 09 Sep 2015 10:37:10 -0400 Received: from mail-qg0-x236.google.com ([2607:f8b0:400d:c04::236]:33915) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZgUj-0005Ok-Ur for qemu-devel@nongnu.org; Wed, 09 Sep 2015 10:37:06 -0400 Received: by qgez77 with SMTP id z77so9253699qge.1 for ; Wed, 09 Sep 2015 07:37:05 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Programmingkid In-Reply-To: <20150909091755.GC9777@stefanha-thinkpad.redhat.com> Date: Wed, 9 Sep 2015 10:37:03 -0400 Content-Transfer-Encoding: quoted-printable Message-Id: References: <499BD4FC-8B37-4181-BA5F-0DAA2F012E25@gmail.com> <20150909091755.GC9777@stefanha-thinkpad.redhat.com> Subject: Re: [Qemu-devel] wav output sounds good - what does this mean? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Gerd Hoffmann , qemu-devel qemu-devel On Sep 9, 2015, at 5:17 AM, Stefan Hajnoczi wrote: > On Sun, Sep 06, 2015 at 04:53:29PM -0400, Programmingkid wrote: >> I have been working on making the sound output from the USB sound = card actually sound good. When the audio is sent to CoreAudio, the sound = is not very good. But when I use the wav file output option, the sound = in the wave file sounds perfect. What does this mean?=20 What I meant by doesn't sound very good is that the audio has a lot of = static in it. It kind of sounds like a vinyl record being played back. = There is also this deformed audio sound. Hard to describe in words. I = could send you a sample of the audio, but I think it might be easier for = you to try it yourself. If you are on Linux, use this command to build = QEMU: ./configure --target-list=3Di386-softmmu --audio-drv-list=3Dalsa = --enable-sdl && make To test the wav output option, use this command before starting QEMU: export QEMU_AUDIO_DRV=3Dwav To test out live playback, use this command before starting QEMU: export QEMU_AUDIO_DRV=3Dalsa Then to use the usb audio card, just add this to the command options you = send to QEMU: -usb -device usb-audio or "device_add usb-audio" in QEMU's monitor I use qemu-system-ppc, but this problem is also present on = qemu-system-i386. I have used Windows XP, Debian Linux, and Mac OS 10.2 = as a guest, and they all have problems playing back audio using the usb = sound card. So anyone of these operating systems can be used in the = guest for testing. Using a Linux guest would probably yield better = results.=20 My attempts to 'make' QEMU on a Linux host haven't been very good = lately, so I can't test it out right now. I probably need to reinstall = Linux. It would be interesting to see how the usb-audio card sounds for = you on Linux. If you do try, could you let us know how it sounds? > You didn't describe or post an example of the "not very good" sound = via > CoreAudio. >=20 > Perhaps QEMU is not filling playback buffers quickly enough, causing > underruns? These are drop-outs in the audio and are caused by missing > the real-time deadlines for filling playback audio buffers. I was thinking it was a buffer issue also. :) Maybe increasing the size = of the buffer would help. >=20 > The wav output wouldn't have that problem since data is appended while > QEMU is running but you only listen to it later. So the timing = doesn't > matter and it will sound fine. >=20 > Another possibility is that QEMU isn't writing audio samples in the > format that CoreAudio expects, so you hear weird artifacts.=20 I have tried every other format I could find. By that I mean these: AUD_FMT_U8 AUD_FMT_S8 AUD_FMT_S16 AUD_FMT_U16 AUD_FMT_U32 AUD_FMT_S32 The best sounding one is the one that is currently being used: = AUD_FMT_S16. >=20 > More info is needed... >=20 > Stefan On second thought, I will send you audio samples of both live playback = and wav output in a second email.