Message ID | cover.1692089917.git.manos.pitsidianakis@linaro.org (mailing list archive) |
---|---|
Headers | show |
Series | Add VIRTIO sound card | expand |
Hi Manos, I tested the virtio-sound-pci device. It seems the device works unreliably. Audio playback has a lot of dropouts. I can actually hear my mouse moving around. Audio recording with audacity doesn't work. Either recording stops with an error or the recorded stream is silent. I'll see if I can change the code so audio playback works reliably. I don't think it makes sense to review the current code as it is. I will of course report any issues I find. With best regards, Volker > This patch series adds an audio device implementing the recent virtio > sound spec (1.2) and a corresponding PCI wrapper device. > > https://github.com/epilys/qemu-virtio-snd/tree/virtio-snd-v6 > > Main differences with v5 patch series [^v5] > <cover.1690626150.git.manos.pitsidianakis@linaro.org>: > > - Free any existing PCM stream resources before allocating a new one. > - Add docs. > > [^v5]: > https://lore.kernel.org/qemu-devel/cover.1690626150.git.manos.pitsidianakis@linaro.org/ > > Previously: > > [^v4]: > https://lore.kernel.org/qemu-devel/cover.1689857559.git.manos.pitsidianakis@linaro.org/ > [^v3]: > https://lore.kernel.org/qemu-devel/cover.1689692765.git.manos.pitsidianakis@linaro.org/ > > > Emmanouil Pitsidianakis (12): > Add virtio-sound device stub > Add virtio-sound-pci device > virtio-sound: handle control messages and streams > virtio-sound: set PCM stream parameters > virtio-sound: handle VIRTIO_SND_R_PCM_INFO request > virtio-sound: handle VIRTIO_SND_R_PCM_{START,STOP} > virtio-sound: handle VIRTIO_SND_PCM_SET_PARAMS > virtio-sound: handle VIRTIO_SND_R_PCM_PREPARE > virtio-sound: handle VIRTIO_SND_PCM_RELEASE > virtio-sound: implement audio output (TX) > virtio-sound: implement audio capture (RX) > docs/system: add basic virtio-snd documentation > > MAINTAINERS | 6 + > docs/system/device-emulation.rst | 1 + > docs/system/devices/virtio-snd.rst | 36 + > hw/virtio/Kconfig | 5 + > hw/virtio/meson.build | 2 + > hw/virtio/trace-events | 20 + > hw/virtio/virtio-snd-pci.c | 91 ++ > hw/virtio/virtio-snd.c | 1308 ++++++++++++++++++++++++++++ > include/hw/pci/pci.h | 1 + > include/hw/virtio/virtio-snd.h | 158 ++++ > softmmu/qdev-monitor.c | 1 + > 11 files changed, 1629 insertions(+) > create mode 100644 docs/system/devices/virtio-snd.rst > create mode 100644 hw/virtio/virtio-snd-pci.c > create mode 100644 hw/virtio/virtio-snd.c > create mode 100644 include/hw/virtio/virtio-snd.h >
Hello Volker, On Sun, 20 Aug 2023 14:46, Volker Rümelin <vr_qemu@t-online.de> wrote: >I tested the virtio-sound-pci device. It seems the device works >unreliably. Audio playback has a lot of dropouts. I can actually hear >my mouse moving around. Audio recording with audacity doesn't work. >Either recording stops with an error or the recorded stream is silent. > >I'll see if I can change the code so audio playback works reliably. I >don't think it makes sense to review the current code as it is. I will >of course report any issues I find. have you been having this bad performance with pulseaudio/pipewire? Are you using alsa for playback/recording in the guest? I am asking because this was my setup and I was wondering if it affected the code I ended up with. For me I had normal playback, except for a short delay at first (maybe something to do with alsa buffer lengths, I am not familiar with ALSA much). If you can share your guest and host setup you used for this I can try replicating it. Manos
Am 21.08.23 um 08:10 schrieb Manos Pitsidianakis: > Hello Volker, > > On Sun, 20 Aug 2023 14:46, Volker Rümelin <vr_qemu@t-online.de> wrote: >> I tested the virtio-sound-pci device. It seems the device works >> unreliably. Audio playback has a lot of dropouts. I can actually hear >> my mouse moving around. Audio recording with audacity doesn't work. >> Either recording stops with an error or the recorded stream is silent. >> >> I'll see if I can change the code so audio playback works reliably. I >> don't think it makes sense to review the current code as it is. I >> will of course report any issues I find. > > have you been having this bad performance with pulseaudio/pipewire? > Are you using alsa for playback/recording in the guest? > > I am asking because this was my setup and I was wondering if it > affected the code I ended up with. For me I had normal playback, > except for a short delay at first (maybe something to do with alsa > buffer lengths, I am not familiar with ALSA much). > > If you can share your guest and host setup you used for this I can try > replicating it. > Hi Manos, on the host I use pipewire. The audio device used for playback and recording is a Intel HDA device. I also tested recording from the playback monitor of the HDA device. The important command line arguments are: ./qemu-system-x86_64 -machine q35 -device virtio-vga-gl,xres=1280,yres=768,bus=pcie.0 -display gtk,zoom-to-fit=off,gl=on -machine pcspk-audiodev=audio0 -device virtio-sound-pci,bus=pcie.0,audiodev=audio0 -audiodev pipewire,out.frequency=48000,in.frequency=48000,id=audio0 The guest is Linux OpenSUSE 15.5 system. The guest uses PulseAudio. This means audacity ALSA audio recording was routed through PulseAudio. Audacity doesn't really start recording but after a few seconds it reports 'Wait timed out' and 'Error opening sound device. Try changing the audio host, recording device and the project sample rate'. When I start QEMU with -audiodev pipewire,out.mixing-engine=off,in.mixing-engine=off,id=audio0 audacity only records silence. For playback I use Rhythmbox or Audacity. If you don't immediately hear dropouts try activating and deactivating the QEMU gtk window in quick succession. A slightly increased processor load like moving the mouse around also increases the dropout rate. With best regards, Volker