From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Oleksandr Dmytryshyn <oleksandr.dmytryshyn@globallogic.com>,
xen-devel@lists.xen.org
Cc: Iurii Konovalenko <iurii.konovalenko@globallogic.com>,
Keir Fraser <keir@xen.org>,
Ian Campbell <ian.campbell@citrix.com>, Tim Deegan <tim@xen.org>,
Ian Jackson <ian.jackson@eu.citrix.com>,
Jan Beulich <jbeulich@suse.com>
Subject: Re: [PATCH v5] sndif: add ABI for Para-virtual sound
Date: Thu, 22 Jan 2015 16:39:34 +0100 [thread overview]
Message-ID: <54C119B6.6070409@citrix.com> (raw)
In-Reply-To: <1421939991-20971-1-git-send-email-oleksandr.dmytryshyn@globallogic.com>
El 22/01/15 a les 16.19, Oleksandr Dmytryshyn ha escrit:
[...]
> +/*
> + * Description of the protocol between the frontend and the backend driver.
> + *
> + * The two halves of a Para-virtual sound driver communicates with
> + * each to other using an shared page and event channel.
> + * Shared page contains a ring with request/response packets.
> + * All fields within the packet are always in little-endian byte order.
> + * Almost all fields within the packet are unsigned except
> + * the field 'status' in the responses packets, which is signed.
> + *
> + *
> + * All request packets have the same length (80 bytes)
80bytes is kind of a weird size. I would rather use 64bytes, which
aligns itself more nicely with cache lines.
[...]
> + * Request read/write - used for read (for capture) or write (for playback):
> + * 0 1 2 3 4 5 6 7 octet
> + * +-----+-----+-----+-----+-----+-----+-----+-----+
> + * | id |
> + * +-----+-----+-----+-----+-----+-----+-----+-----+
> + * | operation | stream_id |
> + * +-----+-----+-----+-----+-----+-----+-----+-----+
> + * | length | gref0 |
> + * +-----+-----+-----+-----+-----+-----+-----+-----+
> + * | gref1 | gref2 |
> + * +-----+-----+-----+-----+-----+-----+-----+-----+
> + * +/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/+
> + * +-----+-----+-----+-----+-----+-----+-----+-----+
> + * | gref11 | reserved |
> + * +-----+-----+-----+-----+-----+-----+-----+-----+
> + * | reserved | reserved |
> + * +-----+-----+-----+-----+-----+-----+-----+-----+
> + *
> + * id - private guest value, echoed in resp
> + * operation - XENSND_OP_READ or XENSND_OP_WRITE
> + * stream_id - stream id, readed from the 'stream_id' XenBus node
> + * length - read or write data length
> + * gref0 - gref11 - references to a grant entries for used pages in read/write
> + * request.
I don't know much about sound, but I expect that you aim at having low
latency rather than high throughput. Why do you leave the 3 last slots
unused? Shouldn't they be gref12..14, even if they are not used by the
current implementation?
Also, how often are the sound packets sent, and which size do they have?
I'm mainly asking because I don't know if it would be more suitable to
use the same strategy as we did with indirect descriptors in the block
protocol from the start.
> + *
> + *
> + * Request set volume - set channels volume in stream:
> + * 0 1 2 3 4 5 6 7 octet
> + * +-----+-----+-----+-----+-----+-----+-----+-----+
> + * | id |
> + * +-----+-----+-----+-----+-----+-----+-----+-----+
> + * | operation | stream_id |
> + * +-----+-----+-----+-----+-----+-----+-----+-----+
> + * | vol_ch0 | vol_ch1 |
> + * +-----+-----+-----+-----+-----+-----+-----+-----+
> + * | vol_ch2 | vol_ch3 |
> + * +-----+-----+-----+-----+-----+-----+-----+-----+
> + * | vol_ch4 | vol_ch5 |
> + * +-----+-----+-----+-----+-----+-----+-----+-----+
> + * +/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/+
> + * +-----+-----+-----+-----+-----+-----+-----+-----+
> + * | vol_ch14 | vol_ch15 |
> + * +-----+-----+-----+-----+-----+-----+-----+-----+
> + *
> + * id - private guest value, echoed in resp
> + * operation - XENSND_OP_SET_VOLUME
> + * stream_id - stream id, readed from the 'stream_id' XenBus node
> + * vol_ch0 - vol_ch15 - volume level for channel0 - channel15
I would put all the vol_ch[0..15] inside of a grant page, this way we
could add more channels without problems. A single grant page could
allow for 1024 channels (4096 / 4 = 1024), which seems more than enough.
This way the size of the request/response will also be smaller, because
AFAICT this is the bigger request size.
[...]
> + * Response for XENSND_OP_GET_VOLUME request:
> + * 0 1 2 3 4 5 6 7 octet
> + * +-----+-----+-----+-----+-----+-----+-----+-----+
> + * | id |
> + * +-----+-----+-----+-----+-----+-----+-----+-----+
> + * | operation | status |
> + * +-----+-----+-----+-----+-----+-----+-----+-----+
> + * | vol_ch0 | vol_ch1 |
> + * +-----+-----+-----+-----+-----+-----+-----+-----+
> + * | vol_ch2 | vol_ch3 |
> + * +-----+-----+-----+-----+-----+-----+-----+-----+
> + * +/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/+
> + * +-----+-----+-----+-----+-----+-----+-----+-----+
> + * | vol_ch14 | vol_ch15 |
> + * +-----+-----+-----+-----+-----+-----+-----+-----+
> + *
> + * id - copied from request
> + * operation - XENSND_OP_GET_VOLUME -copied from request
> + * status - XENSND_RSP_???
> + * vol_ch0 - vol_ch15 - volume level for channel0 - channel15
> + */
See my comment about "Request set volume" which also applies here.
Roger.
next prev parent reply other threads:[~2015-01-22 15:39 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-22 15:19 [PATCH v5] sndif: add ABI for Para-virtual sound Oleksandr Dmytryshyn
2015-01-22 15:39 ` Roger Pau Monné [this message]
2015-01-22 15:50 ` Oleksandr Dmytryshyn
2015-01-22 15:56 ` Ian Jackson
2015-01-22 16:00 ` Oleksandr Dmytryshyn
2015-01-22 16:11 ` Ian Jackson
2015-01-29 11:02 ` Oleksandr Dmytryshyn
2015-01-29 11:45 ` Vitaly Chernooky
2015-01-29 15:01 ` Oleksandr Dmytryshyn
2015-01-22 15:41 ` Ian Jackson
2015-01-22 15:57 ` Oleksandr Dmytryshyn
2015-01-22 16:07 ` Ian Jackson
2015-01-23 9:04 ` Oleksandr Dmytryshyn
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=54C119B6.6070409@citrix.com \
--to=roger.pau@citrix.com \
--cc=ian.campbell@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=iurii.konovalenko@globallogic.com \
--cc=jbeulich@suse.com \
--cc=keir@xen.org \
--cc=oleksandr.dmytryshyn@globallogic.com \
--cc=tim@xen.org \
--cc=xen-devel@lists.xen.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.