All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shreyansh Chouhan <chouhan.shreyansh2702@gmail.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: "Alex Bennée" <alex.bennee@linaro.org>, qemu-devel@nongnu.org
Subject: Re: Fwd: VirtioSound device emulation implementation
Date: Thu, 11 Feb 2021 10:29:17 +0530	[thread overview]
Message-ID: <CAAQ-SiMpZZ3yVCRjapCuResP38HFmtykFuLvpwH_23kEPg6v_w@mail.gmail.com> (raw)
In-Reply-To: <CAAQ-SiOU5vkcVODOvBEf=PXzRDQbhzJC6ZU3wLpnRzhD58cuGg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3808 bytes --]

On Thu, 28 Jan 2021 at 23:04, Shreyansh Chouhan <
chouhan.shreyansh2702@gmail.com> wrote:

> I think I will give it a quick look :P
>
This certainly wasn't quick I admit.

> Thanks a lot!
> --
> Shreyansh
>
> Hey! I hope you people are doing fine. :)
So colleges reopened and I was a bit busy for the past 2 weeks. Although I
did get to work on this
on weekends.

So about the audiodev setup, I checked the source code on how it is setup,
and I found out I
did not really have to do a lot for that. QEMU already registers the
audiodev passed on command
line and later makes it to an audiostate, and adds it to the list of
audiostates. And when the device
option is parsed, all its properties are set via the visitors iirc. So all
I had to do was make a new device
type, define a QEMUSoundCard property and register it, and this should be
enough to set the audio state for the QEMUSoundCard in this
new device. Do correct me if I am wrong here. (audiostates in turn contain
the audiodev)

I have some code written, but it is a bit incomplete and I would like to
complete at least the initialization
part before sending in patches for review. I wanted to ask some questions
(again :P) regarding a few things.

I read the source code for the `gus` sound device. (gus.c) And set up the
audiosettings and SWVoiceOut
from there. Here is my first question, I feel as if SWVoiceOut should be
available per stream. So the
`VirtIOSound` device would have a list of `SWVoiceOut`?

Secondly I saw in the `ac97.c` source, (which is a PCI sound device,) a lot
of PCIDev related set up in
the realize function, but they were not present in the `virtio-net.c`
source. Do I need them? (`ac97.c` set
up PCI_COMMAND, PCI_STATUS, PCI_BASE_ADDRESS and similar things in PCIDev.
For now the pci
setup in `virtio-snd-pci.c` basically mimics `virtio-net-pci.c` which uses
a `VirtIOPCIProxy` obj.)

Thirdly, the properties are registered at two different places, once in the
`virtio-net.c` source and once
in the `virtio-net-pci.c` source. I understand the the ones in
`virito-net.c`/`virtio-snd.c` they are the device
properties, as in the configurations we can set for the device and other,
well, properties. But what
exactly are the properties defined in the `virtio-net-pci.c` source file? I
have a vague idea of
what they are, but I can't exactly put my finger on it. It's almost as if
`virtio-net` and `virito-net-pci`
are two different devices each with thier own properties, and the
virtio-net-pci helps communication
between virtio-net and QEMU guest. It registers using the same `type_init`
macro, and that macro
registers modules which can later be initialized by QEMU if I am not wrong.
Since I didn't get a lot
of time I was not able to really dig into the PCI code, and taking a look
at it might make things clearer,
but once I started writing this mail, I thought I could ask this too.

Since there can be more than on streams and more than one jacks, we need to
have a list of configurations
for them, and since they should be index adressable, should I use an array
for them? When I was reading the
source I did not come across a QEMU list structure with indexed adressing.
If there is one please let me know.

Finally, I do understand what the pcm streams are, and I have been able to
set them up with hardcoded
initial configs (modulo the hda part). But I do not understand what exactly
are `jacks` and what should I do to set them up.
Which source file should I look at for this? I came across a few jack
related structs, but didn't see
a device using them. (I did not search for it as vigorously, I only tried
grepping in `hw/audio` and the
only results were from `intel-hda-defs`. They were comments on enums. Again
since I was writing
this mail I thought I should ask it here too.)

Regards,
Shreyansh Chouhan

[-- Attachment #2: Type: text/html, Size: 4990 bytes --]

  reply	other threads:[~2021-02-11  5:01 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-06 10:00 VirtioSound device emulation implementation Shreyansh Chouhan
2021-01-06 11:40 ` Alex Bennée
2021-01-07 14:58   ` Shreyansh Chouhan
2021-01-07 15:58     ` Gerd Hoffmann
2021-01-07 17:17     ` Alex Bennée
2021-01-08  7:53       ` Shreyansh Chouhan
2021-01-08  8:34       ` Gerd Hoffmann
2021-01-10  8:25         ` Shreyansh Chouhan
     [not found]           ` <CAAQ-SiPiq5NQN=2mvP3isZ9PtYO2Bu64kVEvE6T+3OJd5B-U5A@mail.gmail.com>
2021-01-11  6:29             ` Fwd: " Shreyansh Chouhan
2021-01-11 11:59               ` Alex Bennée
2021-01-14 15:00                 ` Shreyansh Chouhan
2021-01-14 17:41                   ` Alex Bennée
2021-01-15  8:00                     ` Shreyansh Chouhan
2021-01-17 10:30                       ` Shreyansh Chouhan
2021-01-18 18:53                         ` Shreyansh Chouhan
2021-01-20 11:41                           ` Shreyansh Chouhan
2021-01-25  6:02                             ` Shreyansh Chouhan
2021-01-25 11:23                               ` Alex Bennée
2021-01-28  4:28                                 ` Shreyansh Chouhan
2021-01-28 10:42                                   ` Alex Bennée
2021-01-28 15:40                                     ` Shreyansh Chouhan
2021-01-28 11:25                                   ` Gerd Hoffmann
2021-01-28 15:50                                     ` Shreyansh Chouhan
2021-01-28 16:30                                       ` Gerd Hoffmann
2021-01-28 17:34                                         ` Shreyansh Chouhan
2021-02-11  4:59                                           ` Shreyansh Chouhan [this message]
2021-02-15 14:39                                             ` Gerd Hoffmann
2021-04-04 13:55                                               ` Shreyansh Chouhan
2021-04-16 11:32                                                 ` Gerd Hoffmann
2021-04-19 12:30                                                   ` Shreyansh Chouhan
2021-04-19 12:33                                                     ` Shreyansh Chouhan
2021-04-19 13:10                                                     ` Gerd Hoffmann
     [not found]                                                       ` <CAAQ-SiMf=BV-HUudRayZkRPJjmkYWuiBuKqYHHLzYjcFnPOgLQ@mail.gmail.com>
     [not found]                                                         ` <20210419135627.dlerwnswhfxt6ciz@sirius.home.kraxel.org>
     [not found]                                                           ` <CAAQ-SiM6uWUgHTS5PQ-hSkuXNOoKC7fw6Y1ZHhJ0MCUE3oaBqg@mail.gmail.com>
     [not found]                                                             ` <20210420071304.gmndase3r6mwp5yt@sirius.home.kraxel.org>
     [not found]                                                               ` <CAAQ-SiPPNK0xqnPPSjNZgwQCs+Vj0_A5koq5xK8HzhZKDgqVJw@mail.gmail.com>
2021-12-29  5:52                                                                 ` Shreyansh Chouhan
2022-01-20 10:39                                                                   ` Laurent Vivier
2022-02-07  4:06                                                                     ` Shreyansh Chouhan
2022-02-08 17:26                                                                       ` Shreyansh Chouhan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAAQ-SiMpZZ3yVCRjapCuResP38HFmtykFuLvpwH_23kEPg6v_w@mail.gmail.com \
    --to=chouhan.shreyansh2702@gmail.com \
    --cc=alex.bennee@linaro.org \
    --cc=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.