qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 00/27] Virtio sound card implementation
@ 2021-04-29 12:04 Shreyansh Chouhan
  2021-04-29 12:04 ` [RFC PATCH 01/27] virtio-snd: Add virtio sound header file Shreyansh Chouhan
                   ` (54 more replies)
  0 siblings, 55 replies; 74+ messages in thread
From: Shreyansh Chouhan @ 2021-04-29 12:04 UTC (permalink / raw)
  To: kraxel, mst; +Cc: Shreyansh Chouhan, qemu-devel

This patch series aims to implement the virtio sound card
as defined in the virtio specs (v8). The specs can be found
at the following github repo:
https://github.com/oasis-tcs/virtio-spec

This patch series is not complete yet, but here is what's
already been done:

    - The device is initialized properly and is recognized
      by the guest as a sound card device.
    - Output stream works but the output is very noisy. (Which
      is what I wanted coments on.)

What remains to be done:

    - Input streams yet to be done.
    - The jacks are initialized with a default config, but
      they are not mapped to any streams for now.
    - Channel maps are yet to be implemented.

I'd like to request some comments on the following points:

    - The output from the sound card is accompanied by periodic
      white noise. I do not know why this is happening. I tried
      debugging it by writing the buffers to a new wav file and
      sure enough the contents of the file were different at
      some places, but I couldn't find what must be causing it.
      (Relevant patches: #19, #20, #21 and #25.) What steps should
      I take for debugging this?

    - If I try and output a wav file of a different size, that
      sets the period_bytes to 4004, I get an assert failure in
      the object_unref function defined in qom/object.c. (Function
      defined on line #681, assert on line #690.)
                assert(obj->parent == NULL);
      I tried taking a look at the stack trace for when this failure
      happens. In the stacktrace I found out that this happened
      when QEMU was trying to unmap the out_sg from the VirtQueue
      element. This failure doesn't happen if I am using a different
      wav file, that sets the period_bytes to something else.
      (Relevant patches: #19, #20, #21 and #25.)
      What could be causing this problem?

    - What is the suggested way of waiting? When the driver issues
      the VIRTIO_SND_PCM_STOP ctrl command I want to wait for the
      buffers existing in tx vq to be consumed before closing the
      stream.

Shreyansh Chouhan (27):
  virtio-snd: Add virtio sound header file
  virtio-snd: Add jack control structures
  virtio-snd: Add PCM control structures
  virtio-snd: Add chmap control structures
  virtio-snd: Add device implementation structures
  virtio-snd: Add PCI wrapper code for VirtIOSound
  virtio-snd: Add properties for class init
  virtio-snd: Add code for get config function
  virtio-snd: Add code for set config function
  virtio-snd: Add code for the realize function
  virtio-snd: Add macros for logging
  virtio-snd: Add control virtqueue handler
  virtio-snd: Add VIRTIO_SND_R_JACK_INFO handler
  virtio-snd: Add stub for VIRTIO_SND_R_JACK_REMAP handler
  virtio-snd: Add VIRTIO_SND_R_PCM_INFO handler
  virtio-snd: Add VIRITO_SND_R_PCM_SET_PARAMS handle
  virtio-snd: Add VIRTIO_SND_R_PCM_PREPARE handler
  virtio-snd: Add default configs to realize fn
  virtio-snd: Add callback for SWVoiceOut
  virtio-snd: Add VIRITO_SND_R_PCM_START handler
  virtio-snd: Add VIRTIO_SND_R_PCM_STOP handler
  virtio-snd: Add VIRTIO_SND_R_PCM_RELEASE handler
  virtio-snd: Replaced goto with if else
  virtio-snd: Add code to device unrealize function
  virtio-snd: Add tx vq and handler
  virtio-snd: Add event vq and a handler stub
  virtio-snd: Add rx vq and stub handler

 hw/audio/Kconfig               |    5 +
 hw/audio/meson.build           |    1 +
 hw/audio/virtio-snd.c          | 1168 ++++++++++++++++++++++++++++++++
 hw/virtio/meson.build          |    1 +
 hw/virtio/virtio-snd-pci.c     |   72 ++
 include/hw/virtio/virtio-snd.h |  393 +++++++++++
 6 files changed, 1640 insertions(+)
 create mode 100644 hw/audio/virtio-snd.c
 create mode 100644 hw/virtio/virtio-snd-pci.c
 create mode 100644 include/hw/virtio/virtio-snd.h

-- 
2.25.1



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

end of thread, other threads:[~2023-02-22 13:12 UTC | newest]

Thread overview: 74+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-29 12:04 [RFC PATCH 00/27] Virtio sound card implementation Shreyansh Chouhan
2021-04-29 12:04 ` [RFC PATCH 01/27] virtio-snd: Add virtio sound header file Shreyansh Chouhan
2021-04-30  9:34   ` Gerd Hoffmann
2021-04-29 12:04 ` [RFC PATCH 02/27] virtio-snd: Add jack control structures Shreyansh Chouhan
2021-04-29 12:04 ` [RFC PATCH 03/27] virtio-snd: Add PCM " Shreyansh Chouhan
2021-04-29 12:04 ` [RFC PATCH 04/27] virtio-snd: Add chmap " Shreyansh Chouhan
2021-04-29 12:04 ` [RFC PATCH 05/27] virtio-snd: Add device implementation structures Shreyansh Chouhan
2021-04-29 12:04 ` [RFC PATCH 06/27] virtio-snd: Add PCI wrapper code for VirtIOSound Shreyansh Chouhan
2021-04-29 12:04 ` [RFC PATCH 07/27] virtio-snd: Add properties for class init Shreyansh Chouhan
2021-05-04 13:32   ` Laurent Vivier
2021-05-04 19:35     ` Shreyansh Chouhan
2021-05-04 20:30       ` Laurent Vivier
2021-05-04 21:24         ` Shreyansh Chouhan
2021-04-29 12:04 ` [RFC PATCH 08/27] virtio-snd: Add code for get config function Shreyansh Chouhan
2021-04-29 12:04 ` [RFC PATCH 09/27] virtio-snd: Add code for set " Shreyansh Chouhan
2021-04-30  9:55   ` Gerd Hoffmann
2021-04-29 12:04 ` [RFC PATCH 10/27] virtio-snd: Add code for the realize function Shreyansh Chouhan
     [not found]   ` <CANo3dkpB6Qn46mDGdGE4KTNqHpJkajNcnq_4BugNC5jd8r042Q@mail.gmail.com>
2021-07-22  4:52     ` Shreyansh Chouhan
2021-04-29 12:04 ` [RFC PATCH 11/27] virtio-snd: Add macros for logging Shreyansh Chouhan
2021-04-30  9:59   ` Gerd Hoffmann
2021-04-29 12:04 ` [RFC PATCH 12/27] virtio-snd: Add control virtqueue handler Shreyansh Chouhan
2021-04-30 10:02   ` Gerd Hoffmann
2021-04-29 12:04 ` [RFC PATCH 13/27] virtio-snd: Add VIRTIO_SND_R_JACK_INFO handler Shreyansh Chouhan
2021-04-30 10:13   ` Gerd Hoffmann
2021-04-29 12:04 ` [RFC PATCH 14/27] virtio-snd: Add stub for VIRTIO_SND_R_JACK_REMAP handler Shreyansh Chouhan
2021-04-29 12:04 ` [RFC PATCH 15/27] virtio-snd: Add VIRTIO_SND_R_PCM_INFO handler Shreyansh Chouhan
2021-04-29 12:04 ` [RFC PATCH 16/27] virtio-snd: Add VIRITO_SND_R_PCM_SET_PARAMS handle Shreyansh Chouhan
2021-04-29 12:04 ` [RFC PATCH 17/27] virtio-snd: Add VIRTIO_SND_R_PCM_PREPARE handler Shreyansh Chouhan
2021-04-29 12:04 ` [RFC PATCH 18/27] virtio-snd: Add default configs to realize fn Shreyansh Chouhan
2021-04-29 12:04 ` [RFC PATCH 19/27] virtio-snd: Add callback for SWVoiceOut Shreyansh Chouhan
2021-04-29 12:04 ` [RFC PATCH 20/27] virtio-snd: Add VIRITO_SND_R_PCM_START handler Shreyansh Chouhan
2021-04-29 12:04 ` [RFC PATCH 21/27] virtio-snd: Add VIRTIO_SND_R_PCM_STOP handler Shreyansh Chouhan
2021-04-30 10:22   ` Gerd Hoffmann
2021-04-29 12:04 ` [RFC PATCH 22/27] virtio-snd: Add VIRTIO_SND_R_PCM_RELEASE handler Shreyansh Chouhan
2021-04-29 12:04 ` [RFC PATCH 23/27] virtio-snd: Replaced goto with if else Shreyansh Chouhan
2021-04-29 12:04 ` [RFC PATCH 24/27] virtio-snd: Add code to device unrealize function Shreyansh Chouhan
2021-04-29 12:04 ` [RFC PATCH 25/27] virtio-snd: Add tx vq and handler Shreyansh Chouhan
2021-04-29 12:04 ` [RFC PATCH 26/27] virtio-snd: Add event vq and a handler stub Shreyansh Chouhan
2021-04-29 12:04 ` [RFC PATCH 27/27] virtio-snd: Add rx vq and stub handler Shreyansh Chouhan
2021-04-29 12:48 ` [RFC PATCH 00/27] Virtio sound card implementation no-reply
2021-04-30 10:56 ` Gerd Hoffmann
2022-02-11 22:12 ` [RFC PATCH v2 00/25] Virtio Sound card Implementation Shreyansh Chouhan
2022-02-12 19:08   ` Laurent Vivier
2022-02-14 10:44     ` Gerd Hoffmann
2022-02-14 11:11       ` Laurent Vivier
2023-02-22 13:11   ` Stefano Garzarella
2022-02-11 22:12 ` [RFC PATCH 01/25] virtio-snd: Add virtio sound header file Shreyansh Chouhan
2022-02-14 10:37   ` Gerd Hoffmann
2022-02-11 22:12 ` [RFC PATCH 02/25] virtio-snd: Add jack control structures Shreyansh Chouhan
2022-02-11 22:12 ` [RFC PATCH 03/25] virtio-snd: Add PCM " Shreyansh Chouhan
2022-02-11 22:12 ` [RFC PATCH 04/25] virtio-snd: Add chmap " Shreyansh Chouhan
2022-02-11 22:12 ` [RFC PATCH 05/25] virtio-snd: Add device implementation structures Shreyansh Chouhan
2022-02-11 22:13 ` [RFC PATCH 06/25] virtio-snd: Add PCI wrapper code for VirtIOSound Shreyansh Chouhan
2022-02-11 22:13 ` [RFC PATCH 07/25] virtio-snd: Add properties for class init Shreyansh Chouhan
2022-02-11 22:13 ` [RFC PATCH 08/25] virtio-snd: Add code for get config function Shreyansh Chouhan
2022-02-11 22:13 ` [RFC PATCH 09/25] virtio-snd: Add code for the realize function Shreyansh Chouhan
2022-02-11 22:13 ` [RFC PATCH 10/25] virtio-snd: Add macros for logging Shreyansh Chouhan
2022-02-11 22:13 ` [RFC PATCH 11/25] virtio-snd: Add control virtqueue handler Shreyansh Chouhan
2022-02-11 22:13 ` [RFC PATCH 12/25] virtio-snd: Add VIRTIO_SND_R_JACK_INFO handler Shreyansh Chouhan
2022-02-12 19:10   ` Laurent Vivier
2022-02-11 22:13 ` [RFC PATCH 13/25] virtio-snd: Add stub for VIRTIO_SND_R_JACK_REMAP handler Shreyansh Chouhan
2022-02-11 22:13 ` [RFC PATCH 14/25] virtio-snd: Add VIRTIO_SND_R_PCM_INFO handler Shreyansh Chouhan
2022-02-12 19:20   ` Laurent Vivier
2022-02-11 22:13 ` [RFC PATCH 15/25] virtio-snd: Add VIRITO_SND_R_PCM_SET_PARAMS handle Shreyansh Chouhan
2022-02-11 22:13 ` [RFC PATCH 16/25] virtio-snd: Add VIRTIO_SND_R_PCM_PREPARE handler Shreyansh Chouhan
2022-02-11 22:13 ` [RFC PATCH 17/25] virtio-snd: Add default configs to realize fn Shreyansh Chouhan
2022-02-11 22:13 ` [RFC PATCH 18/25] virtio-snd: Add callback for SWVoiceOut Shreyansh Chouhan
2022-02-11 22:13 ` [RFC PATCH 19/25] virtio-snd: Add start/stop handler Shreyansh Chouhan
2022-02-11 22:13 ` [RFC PATCH 20/25] virtio-snd: Add VIRTIO_SND_R_PCM_RELEASE handler Shreyansh Chouhan
2022-02-11 22:13 ` [RFC PATCH 21/25] virtio-snd: Replaced goto with if else Shreyansh Chouhan
2022-02-11 22:13 ` [RFC PATCH 22/25] virtio-snd: Add code to device unrealize function Shreyansh Chouhan
2022-02-11 22:13 ` [RFC PATCH 23/25] virtio-snd: Add xfer handler Shreyansh Chouhan
2022-02-11 22:13 ` [RFC PATCH 24/25] virtio-snd: Add event vq and a handler stub Shreyansh Chouhan
2022-02-11 22:13 ` [RFC PATCH 25/25] virtio-snd: Replaced AUD_log with tracepoints Shreyansh Chouhan

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