Skip to contentSkip to conversation

sndif: add explicit back and front synchronization

PATCH Superseded Oleksandr Andrushchenko 4 participants 32 messages Mar 19, 2018 – Apr 12, 2018

lore
Share & tools
lore
#0 lore raw

v3 cover sndif: add explicit back and front synchronization

From: Oleksandr Andrushchenko <[email protected]>

Hello, all!

In order to provide explicit synchronization between backend and frontend the following changes are introduced in the protocol:
- bump protocol version to 2
- add new ring buffer for sending asynchronous events from backend to frontend to report number of bytes played by the frontend (XENSND_EVT_CUR_POS)
- introduce trigger events for playback control: start/stop/pause/resume
- add "req-" prefix to event-channel and ring-ref to unify naming of the Xen event channels for requests and events
- add XENSND_OP_HW_PARAM_QUERY request to read/update
stream configuration space: request passes desired intervals/formats for the stream parameters and the response returns allowed intervals and formats mask that can be used.

Changes since v2:
1. Konrad's r-b tag for version patch
2. MAJOR: changed req/resp/evt packet sizes from 32 to 64 octets
3. Reworked XENSND_OP_HW_PARAM_QUERY so it now sends all parameters at once, allowing to check all the configuration space.
4. Minor documentation cleanup (added missed "reserved" fields)

Changes since v1:

1. Changed protocol version definition from string to integer, so it can easily be used in comparisons.
Konrad, I have removed your r-b tag for the reason of this change.

2. In order to provide explicit stream parameter negotiation between backend and frontend the following changes are introduced in the protocol:
add XENSND_OP_HW_PARAM_QUERY request to read/update configuration space for the parameter given: request passes desired parameter interval (mask) and the response to this request returns min/max interval (mask) for the parameter to be used.

Parameters supported by this request/response:
- format mask
- sample rate interval
- number of channels interval
- buffer size, interval, frames
- period size, interval, frames

Oleksandr Andrushchenko (5):
sndif: Introduce protocol version
sndif: Fix missed "reserved" fields in comments
sndif: Make requests and responses 64 octets long
sndif: Add explicit back and front synchronization
sndif: Add explicit back and front parameter negotiation

 xen/include/public/io/sndif.h | 322 +++++++++++++++++++++++++++++++++++++++---
 1 file changed, 306 insertions(+), 16 deletions(-)
Signature · 1 line
2.7.4
#1 lore raw

PATCH v3 1/5 sndif: Introduce protocol version

From: Oleksandr Andrushchenko <[email protected]>

Protocol version was referenced in the protocol description, but missed its definition. Fix this by adding a constant for current protocol version.

---
 xen/include/public/io/sndif.h | 7 +++++++
 1 file changed, 7 insertions(+)
xen/include/public/io/sndif.h +7 -0
index c5c1978406b3..667e610fda2b 100644
@@ -38,6 +38,13 @@
 
 /*
  ******************************************************************************
+ *                           Protocol version
+ ******************************************************************************
+ */
+#define XENSND_PROTOCOL_VERSION         1
+
+/*
+ ******************************************************************************
  *                  Feature and Parameter Negotiation
  ******************************************************************************
  *
Signature · 1 line
2.7.4
#2 lore raw

PATCH v3 1/5 sndif: Introduce protocol version

In reply to Oleksandr Andrushchenko

From: Oleksandr Andrushchenko <[email protected]>

Protocol version was referenced in the protocol description, but missed its definition. Fix this by adding a constant for current protocol version.

---
 xen/include/public/io/sndif.h | 7 +++++++
 1 file changed, 7 insertions(+)
xen/include/public/io/sndif.h +7 -0
index c5c1978406b3..667e610fda2b 100644
@@ -38,6 +38,13 @@
 
 /*
  ******************************************************************************
+ *                           Protocol version
+ ******************************************************************************
+ */
+#define XENSND_PROTOCOL_VERSION         1
+
+/*
+ ******************************************************************************
  *                  Feature and Parameter Negotiation
  ******************************************************************************
  *
Signature · 7 lines
2.7.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#3 lore raw

PATCH v3 2/5 sndif: Fix missed "reserved" fields in comments

In reply to Oleksandr Andrushchenko

From: Oleksandr Andrushchenko <[email protected]>

Some of the request descriptions have "reserved" fields
missed: fix this by adding corresponidng entries.

---
 xen/include/public/io/sndif.h | 4 ++++
 1 file changed, 4 insertions(+)
xen/include/public/io/sndif.h +4 -0
index 667e610fda2b..916be1d3a13f 100644
@@ -680,6 +680,8 @@ struct xensnd_rw_req {
  * +----------------+----------------+----------------+----------------+
  * |                              length                               | 16
  * +----------------+----------------+----------------+----------------+
+ * |                             reserved                              | 20
+ * +----------------+----------------+----------------+----------------+
  * |/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/|
  * +----------------+----------------+----------------+----------------+
  * |                             reserved                              | 32
@@ -720,6 +722,8 @@ struct xensnd_rw_req {
  * +----------------+----------------+----------------+----------------+
  * |                              length                               | 16
  * +----------------+----------------+----------------+----------------+
+ * |                             reserved                              | 20
+ * +----------------+----------------+----------------+----------------+
  * |/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/|
  * +----------------+----------------+----------------+----------------+
  * |                             reserved                              | 32
Signature · 1 line
2.7.4
#4 lore raw

PATCH v3 2/5 sndif: Fix missed "reserved" fields in comments

In reply to Oleksandr Andrushchenko

From: Oleksandr Andrushchenko <[email protected]>

Some of the request descriptions have "reserved" fields
missed: fix this by adding corresponidng entries.

---
 xen/include/public/io/sndif.h | 4 ++++
 1 file changed, 4 insertions(+)
xen/include/public/io/sndif.h +4 -0
index 667e610fda2b..916be1d3a13f 100644
@@ -680,6 +680,8 @@ struct xensnd_rw_req {
  * +----------------+----------------+----------------+----------------+
  * |                              length                               | 16
  * +----------------+----------------+----------------+----------------+
+ * |                             reserved                              | 20
+ * +----------------+----------------+----------------+----------------+
  * |/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/|
  * +----------------+----------------+----------------+----------------+
  * |                             reserved                              | 32
@@ -720,6 +722,8 @@ struct xensnd_rw_req {
  * +----------------+----------------+----------------+----------------+
  * |                              length                               | 16
  * +----------------+----------------+----------------+----------------+
+ * |                             reserved                              | 20
+ * +----------------+----------------+----------------+----------------+
  * |/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/|
  * +----------------+----------------+----------------+----------------+
  * |                             reserved                              | 32
Signature · 7 lines
2.7.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#5 lore raw

PATCH v3 3/5 sndif: Make requests and responses 64 octets long

In reply to Oleksandr Andrushchenko

From: Oleksandr Andrushchenko <[email protected]>

Extend the size of the requests and responses to 64 octets. Bump protocol version to 2.

---
 xen/include/public/io/sndif.h | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)
xen/include/public/io/sndif.h +11 -11
index 916be1d3a13f..ec47ff990f2c 100644
@@ -41,7 +41,7 @@
  *                           Protocol version
  ******************************************************************************
  */
-#define XENSND_PROTOCOL_VERSION         1
+#define XENSND_PROTOCOL_VERSION         2
 
 /*
  ******************************************************************************
@@ -533,7 +533,7 @@
  *
  *---------------------------------- Requests ---------------------------------
  *
- * All request packets have the same length (32 octets)
+ * All request packets have the same length (64 octets)
  * All request packets have common header:
  *         0                1                 2               3        octet
  * +----------------+----------------+----------------+----------------+
@@ -570,7 +570,7 @@
  * +----------------+----------------+----------------+----------------+
  * |/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/|
  * +----------------+----------------+----------------+----------------+
- * |                             reserved                              | 32
+ * |                             reserved                              | 64
  * +----------------+----------------+----------------+----------------+
  *
  * pcm_rate - uint32_t, stream data rate, Hz
@@ -639,7 +639,7 @@ struct xensnd_page_directory {
  * +----------------+----------------+----------------+----------------+
  * |/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/|
  * +----------------+----------------+----------------+----------------+
- * |                             reserved                              | 32
+ * |                             reserved                              | 64
  * +----------------+----------------+----------------+----------------+
  *
  * Request read/write - used for read (for capture) or write (for playback):
@@ -657,7 +657,7 @@ struct xensnd_page_directory {
  * +----------------+----------------+----------------+----------------+
  * |/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/|
  * +----------------+----------------+----------------+----------------+
- * |                             reserved                              | 32
+ * |                             reserved                              | 64
  * +----------------+----------------+----------------+----------------+
  *
  * operation - XENSND_OP_READ for read or XENSND_OP_WRITE for write
@@ -684,7 +684,7 @@ struct xensnd_rw_req {
  * +----------------+----------------+----------------+----------------+
  * |/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/|
  * +----------------+----------------+----------------+----------------+
- * |                             reserved                              | 32
+ * |                             reserved                              | 64
  * +----------------+----------------+----------------+----------------+
  *
  * operation - XENSND_OP_SET_VOLUME for volume set
@@ -726,7 +726,7 @@ struct xensnd_rw_req {
  * +----------------+----------------+----------------+----------------+
  * |/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/|
  * +----------------+----------------+----------------+----------------+
- * |                             reserved                              | 32
+ * |                             reserved                              | 64
  * +----------------+----------------+----------------+----------------+
  *
  * operation - XENSND_OP_MUTE for mute or XENSND_OP_UNMUTE for unmute
@@ -759,7 +759,7 @@ struct xensnd_rw_req {
 /*
  *---------------------------------- Responses --------------------------------
  *
- * All response packets have the same length (32 octets)
+ * All response packets have the same length (64 octets)
  *
  * Response for all requests:
  *         0                1                 2               3        octet
@@ -772,7 +772,7 @@ struct xensnd_rw_req {
  * +----------------+----------------+----------------+----------------+
  * |/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/|
  * +----------------+----------------+----------------+----------------+
- * |                             reserved                              | 32
+ * |                             reserved                              | 64
  * +----------------+----------------+----------------+----------------+
  *
  * id - uint16_t, copied from the request
@@ -787,7 +787,7 @@ struct xensnd_req {
     union {
         struct xensnd_open_req open;
         struct xensnd_rw_req rw;
-        uint8_t reserved[24];
+        uint8_t reserved[56];
     } op;
 };
 
@@ -796,7 +796,7 @@ struct xensnd_resp {
     uint8_t operation;
     uint8_t reserved;
     int32_t status;
-    uint8_t reserved1[24];
+    uint8_t reserved1[56];
 };
 
 DEFINE_RING_TYPES(xen_sndif, struct xensnd_req, struct xensnd_resp);
Signature · 1 line
2.7.4
#6 lore raw

PATCH v3 3/5 sndif: Make requests and responses 64 octets long

In reply to Oleksandr Andrushchenko

From: Oleksandr Andrushchenko <[email protected]>

Extend the size of the requests and responses to 64 octets. Bump protocol version to 2.

---
 xen/include/public/io/sndif.h | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)
xen/include/public/io/sndif.h +11 -11
index 916be1d3a13f..ec47ff990f2c 100644
@@ -41,7 +41,7 @@
  *                           Protocol version
  ******************************************************************************
  */
-#define XENSND_PROTOCOL_VERSION         1
+#define XENSND_PROTOCOL_VERSION         2
 
 /*
  ******************************************************************************
@@ -533,7 +533,7 @@
  *
  *---------------------------------- Requests ---------------------------------
  *
- * All request packets have the same length (32 octets)
+ * All request packets have the same length (64 octets)
  * All request packets have common header:
  *         0                1                 2               3        octet
  * +----------------+----------------+----------------+----------------+
@@ -570,7 +570,7 @@
  * +----------------+----------------+----------------+----------------+
  * |/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/|
  * +----------------+----------------+----------------+----------------+
- * |                             reserved                              | 32
+ * |                             reserved                              | 64
  * +----------------+----------------+----------------+----------------+
  *
  * pcm_rate - uint32_t, stream data rate, Hz
@@ -639,7 +639,7 @@ struct xensnd_page_directory {
  * +----------------+----------------+----------------+----------------+
  * |/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/|
  * +----------------+----------------+----------------+----------------+
- * |                             reserved                              | 32
+ * |                             reserved                              | 64
  * +----------------+----------------+----------------+----------------+
  *
  * Request read/write - used for read (for capture) or write (for playback):
@@ -657,7 +657,7 @@ struct xensnd_page_directory {
  * +----------------+----------------+----------------+----------------+
  * |/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/|
  * +----------------+----------------+----------------+----------------+
- * |                             reserved                              | 32
+ * |                             reserved                              | 64
  * +----------------+----------------+----------------+----------------+
  *
  * operation - XENSND_OP_READ for read or XENSND_OP_WRITE for write
@@ -684,7 +684,7 @@ struct xensnd_rw_req {
  * +----------------+----------------+----------------+----------------+
  * |/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/|
  * +----------------+----------------+----------------+----------------+
- * |                             reserved                              | 32
+ * |                             reserved                              | 64
  * +----------------+----------------+----------------+----------------+
  *
  * operation - XENSND_OP_SET_VOLUME for volume set
@@ -726,7 +726,7 @@ struct xensnd_rw_req {
  * +----------------+----------------+----------------+----------------+
  * |/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/|
  * +----------------+----------------+----------------+----------------+
- * |                             reserved                              | 32
+ * |                             reserved                              | 64
  * +----------------+----------------+----------------+----------------+
  *
  * operation - XENSND_OP_MUTE for mute or XENSND_OP_UNMUTE for unmute
@@ -759,7 +759,7 @@ struct xensnd_rw_req {
 /*
  *---------------------------------- Responses --------------------------------
  *
- * All response packets have the same length (32 octets)
+ * All response packets have the same length (64 octets)
  *
  * Response for all requests:
  *         0                1                 2               3        octet
@@ -772,7 +772,7 @@ struct xensnd_rw_req {
  * +----------------+----------------+----------------+----------------+
  * |/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/|
  * +----------------+----------------+----------------+----------------+
- * |                             reserved                              | 32
+ * |                             reserved                              | 64
  * +----------------+----------------+----------------+----------------+
  *
  * id - uint16_t, copied from the request
@@ -787,7 +787,7 @@ struct xensnd_req {
     union {
         struct xensnd_open_req open;
         struct xensnd_rw_req rw;
-        uint8_t reserved[24];
+        uint8_t reserved[56];
     } op;
 };
 
@@ -796,7 +796,7 @@ struct xensnd_resp {
     uint8_t operation;
     uint8_t reserved;
     int32_t status;
-    uint8_t reserved1[24];
+    uint8_t reserved1[56];
 };
 
 DEFINE_RING_TYPES(xen_sndif, struct xensnd_req, struct xensnd_resp);
Signature · 7 lines
2.7.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#7 lore raw

PATCH v3 4/5 sndif: Add explicit back and front synchronization

In reply to Oleksandr Andrushchenko

From: Oleksandr Andrushchenko <[email protected]>

In order to provide explicit synchronization between backend and frontend the following changes are introduced in the protocol:
- add new ring buffer for sending asynchronous events from backend to frontend to report number of bytes played by the frontend (XENSND_EVT_CUR_POS)
- introduce trigger events for playback control: start/stop/pause/resume
- add "req-" prefix to event-channel and ring-ref to unify naming of the Xen event channels for requests and events

Cc Konrad Rzeszutek Wilk <[email protected]>
Cc Takashi Iwai <[email protected]>
Cc Takashi Sakamoto <[email protected]>
Cc Clemens Ladisch <[email protected]>
---
 xen/include/public/io/sndif.h | 162 +++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 161 insertions(+), 1 deletion(-)
xen/include/public/io/sndif.h +161 -1
index ec47ff990f2c..be8d7c83fa72 100644
@@ -113,6 +113,8 @@
  *
  * /local/domain/1/device/vsnd/0/0/0/ring-ref = "386"
  * /local/domain/1/device/vsnd/0/0/0/event-channel = "15"
+ * /local/domain/1/device/vsnd/0/0/0/evt-ring-ref = "1386"
+ * /local/domain/1/device/vsnd/0/0/0/evt-event-channel = "215"
  *
  *------------------------------ Stream 1, capture ----------------------------
  *
@@ -122,6 +124,8 @@
  *
  * /local/domain/1/device/vsnd/0/0/1/ring-ref = "384"
  * /local/domain/1/device/vsnd/0/0/1/event-channel = "13"
+ * /local/domain/1/device/vsnd/0/0/1/evt-ring-ref = "1384"
+ * /local/domain/1/device/vsnd/0/0/1/evt-event-channel = "213"
  *
  *------------------------------- PCM device 1 --------------------------------
  *
@@ -135,6 +139,8 @@
  *
  * /local/domain/1/device/vsnd/0/1/0/ring-ref = "387"
  * /local/domain/1/device/vsnd/0/1/0/event-channel = "151"
+ * /local/domain/1/device/vsnd/0/1/0/evt-ring-ref = "1387"
+ * /local/domain/1/device/vsnd/0/1/0/evt-event-channel = "351"
  *
  *------------------------------- PCM device 2 --------------------------------
  *
@@ -147,6 +153,8 @@
  *
  * /local/domain/1/device/vsnd/0/2/0/ring-ref = "389"
  * /local/domain/1/device/vsnd/0/2/0/event-channel = "152"
+ * /local/domain/1/device/vsnd/0/2/0/evt-ring-ref = "1389"
+ * /local/domain/1/device/vsnd/0/2/0/evt-event-channel = "452"
  *
  ******************************************************************************
  *                            Backend XenBus Nodes
@@ -292,6 +300,23 @@
  *      The Xen grant reference granting permission for the backend to map
  *      a sole page in a single page sized ring buffer.
  *
+ *--------------------- Stream Event Transport Parameters ---------------------
+ *
+ * This communication path is used to deliver asynchronous events from backend
+ * to frontend, set up per stream.
+ *
+ * evt-event-channel
+ *      Values:         <uint32_t>
+ *
+ *      The identifier of the Xen event channel used to signal activity
+ *      in the ring buffer.
+ *
+ * evt-ring-ref
+ *      Values:         <uint32_t>
+ *
+ *      The Xen grant reference granting permission for the backend to map
+ *      a sole page in a single page sized ring buffer.
+ *
  ******************************************************************************
  *                               STATE DIAGRAMS
  ******************************************************************************
@@ -439,6 +464,19 @@
 #define XENSND_OP_GET_VOLUME            5
 #define XENSND_OP_MUTE                  6
 #define XENSND_OP_UNMUTE                7
+#define XENSND_OP_TRIGGER               8
+
+#define XENSND_OP_TRIGGER_START         0
+#define XENSND_OP_TRIGGER_PAUSE         1
+#define XENSND_OP_TRIGGER_STOP          2
+#define XENSND_OP_TRIGGER_RESUME        3
+
+/*
+ ******************************************************************************
+ *                                 EVENT CODES
+ ******************************************************************************
+ */
+#define XENSND_EVT_CUR_POS              0
 
 /*
  ******************************************************************************
@@ -455,6 +493,8 @@
 #define XENSND_FIELD_VCARD_LONG_NAME    "long-name"
 #define XENSND_FIELD_RING_REF           "ring-ref"
 #define XENSND_FIELD_EVT_CHNL           "event-channel"
+#define XENSND_FIELD_EVT_RING_REF       "evt-ring-ref"
+#define XENSND_FIELD_EVT_EVT_CHNL       "evt-event-channel"
 #define XENSND_FIELD_DEVICE_NAME        "name"
 #define XENSND_FIELD_TYPE               "type"
 #define XENSND_FIELD_STREAM_UNIQUE_ID   "unique-id"
@@ -566,7 +606,9 @@
  * +----------------+----------------+----------------+----------------+
  * |                           gref_directory                          | 24
  * +----------------+----------------+----------------+----------------+
- * |                             reserved                              | 28
+ * |                             period_sz                             | 28
+ * +----------------+----------------+----------------+----------------+
+ * |                             reserved                              | 32
  * +----------------+----------------+----------------+----------------+
  * |/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/|
  * +----------------+----------------+----------------+----------------+
@@ -578,6 +620,14 @@
  * pcm_channels - uint8_t, number of channels of this stream,
  *   [channels-min; channels-max]
  * buffer_sz - uint32_t, buffer size to be allocated, octets
+ * period_sz - uint32_t, event period size, octets
+ *   This is the requested value of the period at which frontend would
+ *   like to receive XENSND_EVT_CUR_POS notifications from the backend when
+ *   stream position advances during playback/capture.
+ *   It shows how many octets are expected to be played/captured before
+ *   sending such an event.
+ *   If set to 0 no XENSND_EVT_CUR_POS events are sent by the backend.
+ *
  * gref_directory - grant_ref_t, a reference to the first shared page
  *   describing shared buffer references. At least one page exists. If shared
  *   buffer size  (buffer_sz) exceeds what can be addressed by this single page,
@@ -592,6 +642,7 @@ struct xensnd_open_req {
     uint16_t reserved;
     uint32_t buffer_sz;
     grant_ref_t gref_directory;
+    uint32_t period_sz;
 };
 
 /*
@@ -754,8 +805,32 @@ struct xensnd_rw_req {
  *
  * The 'struct xensnd_rw_req' is also used for XENSND_OP_SET_VOLUME,
  * XENSND_OP_GET_VOLUME, XENSND_OP_MUTE, XENSND_OP_UNMUTE.
+ *
+ * Request stream running state change - trigger PCM stream running state
+ * to start, stop, pause or resume:
+ *
+ *         0                1                 2               3        octet
+ * +----------------+----------------+----------------+----------------+
+ * |               id                |   _OP_TRIGGER  |    reserved    | 4
+ * +----------------+----------------+----------------+----------------+
+ * |                             reserved                              | 8
+ * +----------------+----------------+----------------+----------------+
+ * |      type      |                     reserved                     | 12
+ * +----------------+----------------+----------------+----------------+
+ * |                             reserved                              | 16
+ * +----------------+----------------+----------------+----------------+
+ * |/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/|
+ * +----------------+----------------+----------------+----------------+
+ * |                             reserved                              | 64
+ * +----------------+----------------+----------------+----------------+
+ *
+ * type - uint8_t, XENSND_OP_TRIGGER_XXX value
  */
 
+struct xensnd_trigger_req {
+    uint8_t type;
+};
+
 /*
  *---------------------------------- Responses --------------------------------
  *
@@ -778,8 +853,51 @@ struct xensnd_rw_req {
  * id - uint16_t, copied from the request
  * operation - uint8_t, XENSND_OP_* - copied from request
  * status - int32_t, response status, zero on success and -XEN_EXX on failure
+ *
+ *----------------------------------- Events ----------------------------------
+ *
+ * Events are sent via shared page allocated by the front and propagated by
+ *   evt-event-channel/evt-ring-ref XenStore entries
+ * All event packets have the same length (64 octets)
+ * All event packets have common header:
+ *         0                1                 2               3        octet
+ * +----------------+----------------+----------------+----------------+
+ * |               id                |      type      |   reserved     | 4
+ * +----------------+----------------+----------------+----------------+
+ * |                             reserved                              | 8
+ * +----------------+----------------+----------------+----------------+
+ *
+ * id - uint16_t, event id, may be used by front
+ * type - uint8_t, type of the event
+ *
+ *
+ * Current stream position - event from back to front when stream's
+ *   playback/capture position has advanced:
+ *         0                1                 2               3        octet
+ * +----------------+----------------+----------------+----------------+
+ * |               id                |   _EVT_CUR_POS |   reserved     | 4
+ * +----------------+----------------+----------------+----------------+
+ * |                             reserved                              | 8
+ * +----------------+----------------+----------------+----------------+
+ * |                         position low 32-bit                       | 12
+ * +----------------+----------------+----------------+----------------+
+ * |                         position high 32-bit                      | 16
+ * +----------------+----------------+----------------+----------------+
+ * |                             reserved                              | 20
+ * +----------------+----------------+----------------+----------------+
+ * |/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/|
+ * +----------------+----------------+----------------+----------------+
+ * |                             reserved                              | 64
+ * +----------------+----------------+----------------+----------------+
+ *
+ * position - current value of stream's playback/capture position, octets
+ *
  */
 
+struct xensnd_cur_pos_evt {
+    uint64_t position;
+};
+
 struct xensnd_req {
     uint16_t id;
     uint8_t operation;
@@ -787,6 +905,7 @@ struct xensnd_req {
     union {
         struct xensnd_open_req open;
         struct xensnd_rw_req rw;
+        struct xensnd_trigger_req trigger;
         uint8_t reserved[56];
     } op;
 };
@@ -799,8 +918,49 @@ struct xensnd_resp {
     uint8_t reserved1[56];
 };
 
+struct xensnd_evt {
+    uint16_t id;
+    uint8_t type;
+    uint8_t reserved[5];
+    union {
+        struct xensnd_cur_pos_evt cur_pos;
+        uint8_t reserved[56];
+    } op;
+};
+
 DEFINE_RING_TYPES(xen_sndif, struct xensnd_req, struct xensnd_resp);
 
+/*
+ ******************************************************************************
+ *                        Back to front events delivery
+ ******************************************************************************
+ * In order to deliver asynchronous events from back to front a shared page is
+ * allocated by front and its granted reference propagated to back via
+ * XenStore entries (evt-ring-ref/evt-event-channel).
+ * This page has a common header used by both front and back to synchronize
+ * access and control event's ring buffer, while back being a producer of the
+ * events and front being a consumer. The rest of the page after the header
+ * is used for event packets.
+ *
+ * Upon reception of an event(s) front may confirm its reception
+ * for either each event, group of events or none.
+ */
+
+struct xensnd_event_page {
+    uint32_t in_cons;
+    uint32_t in_prod;
+    uint8_t reserved[56];
+};
+
+#define XENSND_EVENT_PAGE_SIZE 4096
+#define XENSND_IN_RING_OFFS (sizeof(struct xensnd_event_page))
+#define XENSND_IN_RING_SIZE (XENSND_EVENT_PAGE_SIZE - XENSND_IN_RING_OFFS)
+#define XENSND_IN_RING_LEN (XENSND_IN_RING_SIZE / sizeof(struct xensnd_evt))
+#define XENSND_IN_RING(page) \
+    ((struct xensnd_evt *)((char *)(page) + XENSND_IN_RING_OFFS))
+#define XENSND_IN_RING_REF(page, idx) \
+    (XENSND_IN_RING((page))[(idx) % XENSND_IN_RING_LEN])
+
 #endif /* __XEN_PUBLIC_IO_SNDIF_H__ */
 
 /*
Signature · 1 line
2.7.4
#8 lore raw

PATCH v3 4/5 sndif: Add explicit back and front synchronization

In reply to Oleksandr Andrushchenko

From: Oleksandr Andrushchenko <[email protected]>

In order to provide explicit synchronization between backend and frontend the following changes are introduced in the protocol:
- add new ring buffer for sending asynchronous events from backend to frontend to report number of bytes played by the frontend (XENSND_EVT_CUR_POS)
- introduce trigger events for playback control: start/stop/pause/resume
- add "req-" prefix to event-channel and ring-ref to unify naming of the Xen event channels for requests and events

Cc Konrad Rzeszutek Wilk <[email protected]>
Cc Takashi Iwai <[email protected]>
Cc Takashi Sakamoto <[email protected]>
Cc Clemens Ladisch <[email protected]>
---
 xen/include/public/io/sndif.h | 162 +++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 161 insertions(+), 1 deletion(-)
xen/include/public/io/sndif.h +161 -1
index ec47ff990f2c..be8d7c83fa72 100644
@@ -113,6 +113,8 @@
  *
  * /local/domain/1/device/vsnd/0/0/0/ring-ref = "386"
  * /local/domain/1/device/vsnd/0/0/0/event-channel = "15"
+ * /local/domain/1/device/vsnd/0/0/0/evt-ring-ref = "1386"
+ * /local/domain/1/device/vsnd/0/0/0/evt-event-channel = "215"
  *
  *------------------------------ Stream 1, capture ----------------------------
  *
@@ -122,6 +124,8 @@
  *
  * /local/domain/1/device/vsnd/0/0/1/ring-ref = "384"
  * /local/domain/1/device/vsnd/0/0/1/event-channel = "13"
+ * /local/domain/1/device/vsnd/0/0/1/evt-ring-ref = "1384"
+ * /local/domain/1/device/vsnd/0/0/1/evt-event-channel = "213"
  *
  *------------------------------- PCM device 1 --------------------------------
  *
@@ -135,6 +139,8 @@
  *
  * /local/domain/1/device/vsnd/0/1/0/ring-ref = "387"
  * /local/domain/1/device/vsnd/0/1/0/event-channel = "151"
+ * /local/domain/1/device/vsnd/0/1/0/evt-ring-ref = "1387"
+ * /local/domain/1/device/vsnd/0/1/0/evt-event-channel = "351"
  *
  *------------------------------- PCM device 2 --------------------------------
  *
@@ -147,6 +153,8 @@
  *
  * /local/domain/1/device/vsnd/0/2/0/ring-ref = "389"
  * /local/domain/1/device/vsnd/0/2/0/event-channel = "152"
+ * /local/domain/1/device/vsnd/0/2/0/evt-ring-ref = "1389"
+ * /local/domain/1/device/vsnd/0/2/0/evt-event-channel = "452"
  *
  ******************************************************************************
  *                            Backend XenBus Nodes
@@ -292,6 +300,23 @@
  *      The Xen grant reference granting permission for the backend to map
  *      a sole page in a single page sized ring buffer.
  *
+ *--------------------- Stream Event Transport Parameters ---------------------
+ *
+ * This communication path is used to deliver asynchronous events from backend
+ * to frontend, set up per stream.
+ *
+ * evt-event-channel
+ *      Values:         <uint32_t>
+ *
+ *      The identifier of the Xen event channel used to signal activity
+ *      in the ring buffer.
+ *
+ * evt-ring-ref
+ *      Values:         <uint32_t>
+ *
+ *      The Xen grant reference granting permission for the backend to map
+ *      a sole page in a single page sized ring buffer.
+ *
  ******************************************************************************
  *                               STATE DIAGRAMS
  ******************************************************************************
@@ -439,6 +464,19 @@
 #define XENSND_OP_GET_VOLUME            5
 #define XENSND_OP_MUTE                  6
 #define XENSND_OP_UNMUTE                7
+#define XENSND_OP_TRIGGER               8
+
+#define XENSND_OP_TRIGGER_START         0
+#define XENSND_OP_TRIGGER_PAUSE         1
+#define XENSND_OP_TRIGGER_STOP          2
+#define XENSND_OP_TRIGGER_RESUME        3
+
+/*
+ ******************************************************************************
+ *                                 EVENT CODES
+ ******************************************************************************
+ */
+#define XENSND_EVT_CUR_POS              0
 
 /*
  ******************************************************************************
@@ -455,6 +493,8 @@
 #define XENSND_FIELD_VCARD_LONG_NAME    "long-name"
 #define XENSND_FIELD_RING_REF           "ring-ref"
 #define XENSND_FIELD_EVT_CHNL           "event-channel"
+#define XENSND_FIELD_EVT_RING_REF       "evt-ring-ref"
+#define XENSND_FIELD_EVT_EVT_CHNL       "evt-event-channel"
 #define XENSND_FIELD_DEVICE_NAME        "name"
 #define XENSND_FIELD_TYPE               "type"
 #define XENSND_FIELD_STREAM_UNIQUE_ID   "unique-id"
@@ -566,7 +606,9 @@
  * +----------------+----------------+----------------+----------------+
  * |                           gref_directory                          | 24
  * +----------------+----------------+----------------+----------------+
- * |                             reserved                              | 28
+ * |                             period_sz                             | 28
+ * +----------------+----------------+----------------+----------------+
+ * |                             reserved                              | 32
  * +----------------+----------------+----------------+----------------+
  * |/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/|
  * +----------------+----------------+----------------+----------------+
@@ -578,6 +620,14 @@
  * pcm_channels - uint8_t, number of channels of this stream,
  *   [channels-min; channels-max]
  * buffer_sz - uint32_t, buffer size to be allocated, octets
+ * period_sz - uint32_t, event period size, octets
+ *   This is the requested value of the period at which frontend would
+ *   like to receive XENSND_EVT_CUR_POS notifications from the backend when
+ *   stream position advances during playback/capture.
+ *   It shows how many octets are expected to be played/captured before
+ *   sending such an event.
+ *   If set to 0 no XENSND_EVT_CUR_POS events are sent by the backend.
+ *
  * gref_directory - grant_ref_t, a reference to the first shared page
  *   describing shared buffer references. At least one page exists. If shared
  *   buffer size  (buffer_sz) exceeds what can be addressed by this single page,
@@ -592,6 +642,7 @@ struct xensnd_open_req {
     uint16_t reserved;
     uint32_t buffer_sz;
     grant_ref_t gref_directory;
+    uint32_t period_sz;
 };
 
 /*
@@ -754,8 +805,32 @@ struct xensnd_rw_req {
  *
  * The 'struct xensnd_rw_req' is also used for XENSND_OP_SET_VOLUME,
  * XENSND_OP_GET_VOLUME, XENSND_OP_MUTE, XENSND_OP_UNMUTE.
+ *
+ * Request stream running state change - trigger PCM stream running state
+ * to start, stop, pause or resume:
+ *
+ *         0                1                 2               3        octet
+ * +----------------+----------------+----------------+----------------+
+ * |               id                |   _OP_TRIGGER  |    reserved    | 4
+ * +----------------+----------------+----------------+----------------+
+ * |                             reserved                              | 8
+ * +----------------+----------------+----------------+----------------+
+ * |      type      |                     reserved                     | 12
+ * +----------------+----------------+----------------+----------------+
+ * |                             reserved                              | 16
+ * +----------------+----------------+----------------+----------------+
+ * |/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/|
+ * +----------------+----------------+----------------+----------------+
+ * |                             reserved                              | 64
+ * +----------------+----------------+----------------+----------------+
+ *
+ * type - uint8_t, XENSND_OP_TRIGGER_XXX value
  */
 
+struct xensnd_trigger_req {
+    uint8_t type;
+};
+
 /*
  *---------------------------------- Responses --------------------------------
  *
@@ -778,8 +853,51 @@ struct xensnd_rw_req {
  * id - uint16_t, copied from the request
  * operation - uint8_t, XENSND_OP_* - copied from request
  * status - int32_t, response status, zero on success and -XEN_EXX on failure
+ *
+ *----------------------------------- Events ----------------------------------
+ *
+ * Events are sent via shared page allocated by the front and propagated by
+ *   evt-event-channel/evt-ring-ref XenStore entries
+ * All event packets have the same length (64 octets)
+ * All event packets have common header:
+ *         0                1                 2               3        octet
+ * +----------------+----------------+----------------+----------------+
+ * |               id                |      type      |   reserved     | 4
+ * +----------------+----------------+----------------+----------------+
+ * |                             reserved                              | 8
+ * +----------------+----------------+----------------+----------------+
+ *
+ * id - uint16_t, event id, may be used by front
+ * type - uint8_t, type of the event
+ *
+ *
+ * Current stream position - event from back to front when stream's
+ *   playback/capture position has advanced:
+ *         0                1                 2               3        octet
+ * +----------------+----------------+----------------+----------------+
+ * |               id                |   _EVT_CUR_POS |   reserved     | 4
+ * +----------------+----------------+----------------+----------------+
+ * |                             reserved                              | 8
+ * +----------------+----------------+----------------+----------------+
+ * |                         position low 32-bit                       | 12
+ * +----------------+----------------+----------------+----------------+
+ * |                         position high 32-bit                      | 16
+ * +----------------+----------------+----------------+----------------+
+ * |                             reserved                              | 20
+ * +----------------+----------------+----------------+----------------+
+ * |/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/|
+ * +----------------+----------------+----------------+----------------+
+ * |                             reserved                              | 64
+ * +----------------+----------------+----------------+----------------+
+ *
+ * position - current value of stream's playback/capture position, octets
+ *
  */
 
+struct xensnd_cur_pos_evt {
+    uint64_t position;
+};
+
 struct xensnd_req {
     uint16_t id;
     uint8_t operation;
@@ -787,6 +905,7 @@ struct xensnd_req {
     union {
         struct xensnd_open_req open;
         struct xensnd_rw_req rw;
+        struct xensnd_trigger_req trigger;
         uint8_t reserved[56];
     } op;
 };
@@ -799,8 +918,49 @@ struct xensnd_resp {
     uint8_t reserved1[56];
 };
 
+struct xensnd_evt {
+    uint16_t id;
+    uint8_t type;
+    uint8_t reserved[5];
+    union {
+        struct xensnd_cur_pos_evt cur_pos;
+        uint8_t reserved[56];
+    } op;
+};
+
 DEFINE_RING_TYPES(xen_sndif, struct xensnd_req, struct xensnd_resp);
 
+/*
+ ******************************************************************************
+ *                        Back to front events delivery
+ ******************************************************************************
+ * In order to deliver asynchronous events from back to front a shared page is
+ * allocated by front and its granted reference propagated to back via
+ * XenStore entries (evt-ring-ref/evt-event-channel).
+ * This page has a common header used by both front and back to synchronize
+ * access and control event's ring buffer, while back being a producer of the
+ * events and front being a consumer. The rest of the page after the header
+ * is used for event packets.
+ *
+ * Upon reception of an event(s) front may confirm its reception
+ * for either each event, group of events or none.
+ */
+
+struct xensnd_event_page {
+    uint32_t in_cons;
+    uint32_t in_prod;
+    uint8_t reserved[56];
+};
+
+#define XENSND_EVENT_PAGE_SIZE 4096
+#define XENSND_IN_RING_OFFS (sizeof(struct xensnd_event_page))
+#define XENSND_IN_RING_SIZE (XENSND_EVENT_PAGE_SIZE - XENSND_IN_RING_OFFS)
+#define XENSND_IN_RING_LEN (XENSND_IN_RING_SIZE / sizeof(struct xensnd_evt))
+#define XENSND_IN_RING(page) \
+    ((struct xensnd_evt *)((char *)(page) + XENSND_IN_RING_OFFS))
+#define XENSND_IN_RING_REF(page, idx) \
+    (XENSND_IN_RING((page))[(idx) % XENSND_IN_RING_LEN])
+
 #endif /* __XEN_PUBLIC_IO_SNDIF_H__ */
 
 /*
Signature · 7 lines
2.7.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#9 lore raw

PATCH v3 5/5 sndif: Add explicit back and front parameter negotiation

In reply to Oleksandr Andrushchenko

From: Oleksandr Andrushchenko <[email protected]>

In order to provide explicit stream parameter negotiation between backend and frontend the following change is introduced to the protocol:
- add XENSND_OP_HW_PARAM_QUERY request to read/update
stream configuration space: request passes desired intervals/formats for the stream parameters and the response returns allowed intervals and formats mask that can be used.

Parameters supported by this request/response:
- formats mask
- sample rate interval
- number of channels interval
- buffer size, interval, frames
- period size, interval, frames

Cc Konrad Rzeszutek Wilk <[email protected]>
Cc Takashi Iwai <[email protected]>
---
 xen/include/public/io/sndif.h | 133 +++++++++++++++++++++++++++++++++++++++---
 1 file changed, 126 insertions(+), 7 deletions(-)
xen/include/public/io/sndif.h +126 -7
index be8d7c83fa72..417d3ebc7981 100644
@@ -465,6 +465,7 @@
 #define XENSND_OP_MUTE                  6
 #define XENSND_OP_UNMUTE                7
 #define XENSND_OP_TRIGGER               8
+#define XENSND_OP_HW_PARAM_QUERY        9
 
 #define XENSND_OP_TRIGGER_START         0
 #define XENSND_OP_TRIGGER_PAUSE         1
@@ -832,28 +833,142 @@ struct xensnd_trigger_req {
 };
 
 /*
- *---------------------------------- Responses --------------------------------
+ * Request stream parameter ranges: request intervals and
+ *   masks of supported ranges for stream configuration values.
  *
- * All response packets have the same length (64 octets)
+ *   Sound device configuration for a particular stream is a limited subset
+ *   of the multidimensional configuration available on XenStore, e.g.
+ *   once the frame rate has been selected there is a limited supported range
+ *   for sample rates becomes available (which might be the same set configured
+ *   on XenStore or less). For example, selecting 96kHz sample rate may limit
+ *   number of channels available for such configuration from 4 to 2, etc.
+ *   Thus, each call to XENSND_OP_HW_PARAM_QUERY may reduce configuration
+ *   space making it possible to iteratively get the final stream configuration,
+ *   used in XENSND_OP_OPEN request.
+ *
+ *   See response format for this request.
  *
- * Response for all requests:
  *         0                1                 2               3        octet
  * +----------------+----------------+----------------+----------------+
- * |               id                |    operation   |    reserved    | 4
+ * |               id                | _HW_PARAM_QUERY|    reserved    | 4
  * +----------------+----------------+----------------+----------------+
- * |                              status                               | 8
+ * |                             reserved                              | 8
+ * +----------------+----------------+----------------+----------------+
+ * |                     formats mask low 32-bit                       | 12
+ * +----------------+----------------+----------------+----------------+
+ * |                     formats mask high 32-bit                      | 16
+ * +----------------+----------------+----------------+----------------+
+ * |                              min rate                             | 20
+ * +----------------+----------------+----------------+----------------+
+ * |                              max rate                             | 24
+ * +----------------+----------------+----------------+----------------+
+ * |                            min channels                           | 28
+ * +----------------+----------------+----------------+----------------+
+ * |                            max channels                           | 32
+ * +----------------+----------------+----------------+----------------+
+ * |                         min buffer frames                         | 36
+ * +----------------+----------------+----------------+----------------+
+ * |                         max buffer frames                         | 40
+ * +----------------+----------------+----------------+----------------+
+ * |                         min period frames                         | 44
+ * +----------------+----------------+----------------+----------------+
+ * |                         max period frames                         | 48
  * +----------------+----------------+----------------+----------------+
- * |                             reserved                              | 12
+ * |                             reserved                              | 52
  * +----------------+----------------+----------------+----------------+
  * |/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/|
  * +----------------+----------------+----------------+----------------+
  * |                             reserved                              | 64
  * +----------------+----------------+----------------+----------------+
  *
+ * formats - uint64_t, bit mask representing values of the parameter
+ *   made as bitwise OR of (1 << XENSND_PCM_FORMAT_XXX) values
+ *
+ * For interval parameters:
+ *   min - uint32_t, minimum value of the parameter
+ *   max - uint32_t, maximum value of the parameter
+ *
+ * Frame is defined as a product of the number of channels by the
+ * number of octets per one sample.
+ */
+
+struct xensnd_query_hw_param {
+    uint64_t formats;
+    struct {
+        uint32_t min;
+        uint32_t max;
+    } rates;
+    struct {
+        uint32_t min;
+        uint32_t max;
+    } channels;
+    struct {
+        uint32_t min;
+        uint32_t max;
+    } buffer;
+    struct {
+        uint32_t min;
+        uint32_t max;
+    } period;
+};
+
+/*
+ *---------------------------------- Responses --------------------------------
+ *
+ * All response packets have the same length (64 octets)
+ *
+ * All response packets have common header:
+ *         0                1                 2               3        octet
+ * +----------------+----------------+----------------+----------------+
+ * |               id                |    operation   |    reserved    | 4
+ * +----------------+----------------+----------------+----------------+
+ * |                              status                               | 8
+ * +----------------+----------------+----------------+----------------+
+ *
  * id - uint16_t, copied from the request
  * operation - uint8_t, XENSND_OP_* - copied from request
  * status - int32_t, response status, zero on success and -XEN_EXX on failure
  *
+ *
+ * HW parameter query response - response for XENSND_OP_HW_PARAM_QUERY:
+ *         0                1                 2               3        octet
+ * +----------------+----------------+----------------+----------------+
+ * |               id                |    operation   |    reserved    | 4
+ * +----------------+----------------+----------------+----------------+
+ * |                              status                               | 8
+ * +----------------+----------------+----------------+----------------+
+ * |                     formats mask low 32-bit                       | 12
+ * +----------------+----------------+----------------+----------------+
+ * |                     formats mask high 32-bit                      | 16
+ * +----------------+----------------+----------------+----------------+
+ * |                              min rate                             | 20
+ * +----------------+----------------+----------------+----------------+
+ * |                              max rate                             | 24
+ * +----------------+----------------+----------------+----------------+
+ * |                            min channels                           | 28
+ * +----------------+----------------+----------------+----------------+
+ * |                            max channels                           | 32
+ * +----------------+----------------+----------------+----------------+
+ * |                         min buffer frames                         | 36
+ * +----------------+----------------+----------------+----------------+
+ * |                         max buffer frames                         | 40
+ * +----------------+----------------+----------------+----------------+
+ * |                         min period frames                         | 44
+ * +----------------+----------------+----------------+----------------+
+ * |                         max period frames                         | 48
+ * +----------------+----------------+----------------+----------------+
+ * |                             reserved                              | 52
+ * +----------------+----------------+----------------+----------------+
+ * |/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/|
+ * +----------------+----------------+----------------+----------------+
+ * |                             reserved                              | 64
+ * +----------------+----------------+----------------+----------------+
+ *
+ * Meaning of the values in this response is the same as for
+ * XENSND_OP_HW_PARAM_QUERY request.
+ */
+
+/*
  *----------------------------------- Events ----------------------------------
  *
  * Events are sent via shared page allocated by the front and propagated by
@@ -906,6 +1021,7 @@ struct xensnd_req {
         struct xensnd_open_req open;
         struct xensnd_rw_req rw;
         struct xensnd_trigger_req trigger;
+        struct xensnd_query_hw_param hw_param;
         uint8_t reserved[56];
     } op;
 };
@@ -915,7 +1031,10 @@ struct xensnd_resp {
     uint8_t operation;
     uint8_t reserved;
     int32_t status;
-    uint8_t reserved1[56];
+    union {
+        struct xensnd_query_hw_param hw_param;
+        uint8_t reserved1[56];
+    } resp;
 };
 
 struct xensnd_evt {
Signature · 1 line
2.7.4
#10 lore raw

PATCH v3 5/5 sndif: Add explicit back and front parameter negotiation

In reply to Oleksandr Andrushchenko

From: Oleksandr Andrushchenko <[email protected]>

In order to provide explicit stream parameter negotiation between backend and frontend the following change is introduced to the protocol:
- add XENSND_OP_HW_PARAM_QUERY request to read/update
stream configuration space: request passes desired intervals/formats for the stream parameters and the response returns allowed intervals and formats mask that can be used.

Parameters supported by this request/response:
- formats mask
- sample rate interval
- number of channels interval
- buffer size, interval, frames
- period size, interval, frames

Cc Konrad Rzeszutek Wilk <[email protected]>
Cc Takashi Iwai <[email protected]>
---
 xen/include/public/io/sndif.h | 133 +++++++++++++++++++++++++++++++++++++++---
 1 file changed, 126 insertions(+), 7 deletions(-)
xen/include/public/io/sndif.h +126 -7
index be8d7c83fa72..417d3ebc7981 100644
@@ -465,6 +465,7 @@
 #define XENSND_OP_MUTE                  6
 #define XENSND_OP_UNMUTE                7
 #define XENSND_OP_TRIGGER               8
+#define XENSND_OP_HW_PARAM_QUERY        9
 
 #define XENSND_OP_TRIGGER_START         0
 #define XENSND_OP_TRIGGER_PAUSE         1
@@ -832,28 +833,142 @@ struct xensnd_trigger_req {
 };
 
 /*
- *---------------------------------- Responses --------------------------------
+ * Request stream parameter ranges: request intervals and
+ *   masks of supported ranges for stream configuration values.
  *
- * All response packets have the same length (64 octets)
+ *   Sound device configuration for a particular stream is a limited subset
+ *   of the multidimensional configuration available on XenStore, e.g.
+ *   once the frame rate has been selected there is a limited supported range
+ *   for sample rates becomes available (which might be the same set configured
+ *   on XenStore or less). For example, selecting 96kHz sample rate may limit
+ *   number of channels available for such configuration from 4 to 2, etc.
+ *   Thus, each call to XENSND_OP_HW_PARAM_QUERY may reduce configuration
+ *   space making it possible to iteratively get the final stream configuration,
+ *   used in XENSND_OP_OPEN request.
+ *
+ *   See response format for this request.
  *
- * Response for all requests:
  *         0                1                 2               3        octet
  * +----------------+----------------+----------------+----------------+
- * |               id                |    operation   |    reserved    | 4
+ * |               id                | _HW_PARAM_QUERY|    reserved    | 4
  * +----------------+----------------+----------------+----------------+
- * |                              status                               | 8
+ * |                             reserved                              | 8
+ * +----------------+----------------+----------------+----------------+
+ * |                     formats mask low 32-bit                       | 12
+ * +----------------+----------------+----------------+----------------+
+ * |                     formats mask high 32-bit                      | 16
+ * +----------------+----------------+----------------+----------------+
+ * |                              min rate                             | 20
+ * +----------------+----------------+----------------+----------------+
+ * |                              max rate                             | 24
+ * +----------------+----------------+----------------+----------------+
+ * |                            min channels                           | 28
+ * +----------------+----------------+----------------+----------------+
+ * |                            max channels                           | 32
+ * +----------------+----------------+----------------+----------------+
+ * |                         min buffer frames                         | 36
+ * +----------------+----------------+----------------+----------------+
+ * |                         max buffer frames                         | 40
+ * +----------------+----------------+----------------+----------------+
+ * |                         min period frames                         | 44
+ * +----------------+----------------+----------------+----------------+
+ * |                         max period frames                         | 48
  * +----------------+----------------+----------------+----------------+
- * |                             reserved                              | 12
+ * |                             reserved                              | 52
  * +----------------+----------------+----------------+----------------+
  * |/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/|
  * +----------------+----------------+----------------+----------------+
  * |                             reserved                              | 64
  * +----------------+----------------+----------------+----------------+
  *
+ * formats - uint64_t, bit mask representing values of the parameter
+ *   made as bitwise OR of (1 << XENSND_PCM_FORMAT_XXX) values
+ *
+ * For interval parameters:
+ *   min - uint32_t, minimum value of the parameter
+ *   max - uint32_t, maximum value of the parameter
+ *
+ * Frame is defined as a product of the number of channels by the
+ * number of octets per one sample.
+ */
+
+struct xensnd_query_hw_param {
+    uint64_t formats;
+    struct {
+        uint32_t min;
+        uint32_t max;
+    } rates;
+    struct {
+        uint32_t min;
+        uint32_t max;
+    } channels;
+    struct {
+        uint32_t min;
+        uint32_t max;
+    } buffer;
+    struct {
+        uint32_t min;
+        uint32_t max;
+    } period;
+};
+
+/*
+ *---------------------------------- Responses --------------------------------
+ *
+ * All response packets have the same length (64 octets)
+ *
+ * All response packets have common header:
+ *         0                1                 2               3        octet
+ * +----------------+----------------+----------------+----------------+
+ * |               id                |    operation   |    reserved    | 4
+ * +----------------+----------------+----------------+----------------+
+ * |                              status                               | 8
+ * +----------------+----------------+----------------+----------------+
+ *
  * id - uint16_t, copied from the request
  * operation - uint8_t, XENSND_OP_* - copied from request
  * status - int32_t, response status, zero on success and -XEN_EXX on failure
  *
+ *
+ * HW parameter query response - response for XENSND_OP_HW_PARAM_QUERY:
+ *         0                1                 2               3        octet
+ * +----------------+----------------+----------------+----------------+
+ * |               id                |    operation   |    reserved    | 4
+ * +----------------+----------------+----------------+----------------+
+ * |                              status                               | 8
+ * +----------------+----------------+----------------+----------------+
+ * |                     formats mask low 32-bit                       | 12
+ * +----------------+----------------+----------------+----------------+
+ * |                     formats mask high 32-bit                      | 16
+ * +----------------+----------------+----------------+----------------+
+ * |                              min rate                             | 20
+ * +----------------+----------------+----------------+----------------+
+ * |                              max rate                             | 24
+ * +----------------+----------------+----------------+----------------+
+ * |                            min channels                           | 28
+ * +----------------+----------------+----------------+----------------+
+ * |                            max channels                           | 32
+ * +----------------+----------------+----------------+----------------+
+ * |                         min buffer frames                         | 36
+ * +----------------+----------------+----------------+----------------+
+ * |                         max buffer frames                         | 40
+ * +----------------+----------------+----------------+----------------+
+ * |                         min period frames                         | 44
+ * +----------------+----------------+----------------+----------------+
+ * |                         max period frames                         | 48
+ * +----------------+----------------+----------------+----------------+
+ * |                             reserved                              | 52
+ * +----------------+----------------+----------------+----------------+
+ * |/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/|
+ * +----------------+----------------+----------------+----------------+
+ * |                             reserved                              | 64
+ * +----------------+----------------+----------------+----------------+
+ *
+ * Meaning of the values in this response is the same as for
+ * XENSND_OP_HW_PARAM_QUERY request.
+ */
+
+/*
  *----------------------------------- Events ----------------------------------
  *
  * Events are sent via shared page allocated by the front and propagated by
@@ -906,6 +1021,7 @@ struct xensnd_req {
         struct xensnd_open_req open;
         struct xensnd_rw_req rw;
         struct xensnd_trigger_req trigger;
+        struct xensnd_query_hw_param hw_param;
         uint8_t reserved[56];
     } op;
 };
@@ -915,7 +1031,10 @@ struct xensnd_resp {
     uint8_t operation;
     uint8_t reserved;
     int32_t status;
-    uint8_t reserved1[56];
+    union {
+        struct xensnd_query_hw_param hw_param;
+        uint8_t reserved1[56];
+    } resp;
 };
 
 struct xensnd_evt {
Signature · 7 lines
2.7.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#11 lore raw
In reply to Oleksandr Andrushchenko
Quoted 40 lines · Oleksandr Andrushchenko

From: Oleksandr Andrushchenko <[email protected]>

Hello, all!

In order to provide explicit synchronization between backend and frontend the following changes are introduced in the protocol:
- bump protocol version to 2
- add new ring buffer for sending asynchronous events from backend to frontend to report number of bytes played by the frontend (XENSND_EVT_CUR_POS)
- introduce trigger events for playback control: start/stop/pause/resume
- add "req-" prefix to event-channel and ring-ref to unify naming of the Xen event channels for requests and events
- add XENSND_OP_HW_PARAM_QUERY request to read/update
stream configuration space: request passes desired intervals/formats for the stream parameters and the response returns allowed intervals and formats mask that can be used.

Changes since v2:
1. Konrad's r-b tag for version patch
2. MAJOR: changed req/resp/evt packet sizes from 32 to 64 octets
3. Reworked XENSND_OP_HW_PARAM_QUERY so it now sends all parameters at once, allowing to check all the configuration space.
4. Minor documentation cleanup (added missed "reserved" fields)

Changes since v1:

1. Changed protocol version definition from string to integer, so it can easily be used in comparisons.
Konrad, I have removed your r-b tag for the reason of this change.

2. In order to provide explicit stream parameter negotiation between backend and frontend the following changes are introduced in the protocol:
add XENSND_OP_HW_PARAM_QUERY request to read/update configuration space for the parameter given: request passes desired parameter interval (mask) and the response to this request returns min/max interval (mask) for the parameter to be used.

Quoted 6 lines

Parameters supported by this request/response:
- format mask
- sample rate interval
- number of channels interval
- buffer size, interval, frames
- period size, interval, frames

I can't judge exactly about the protocol without the actual FE/BE implementations, but the change looks good to me, especially if you've already tested something.

If other people have no concern, let's go ahead with FE/BE stuff.

thanks,

Takashi

#12 lore raw
Quoted 47 lines · Takashi Iwai
Quoted 39 lines · Oleksandr Andrushchenko

From: Oleksandr Andrushchenko <[email protected]>

Hello, all!

In order to provide explicit synchronization between backend and frontend the following changes are introduced in the protocol:
- bump protocol version to 2
- add new ring buffer for sending asynchronous events from backend to frontend to report number of bytes played by the frontend (XENSND_EVT_CUR_POS)
- introduce trigger events for playback control: start/stop/pause/resume
- add "req-" prefix to event-channel and ring-ref to unify naming of the Xen event channels for requests and events
- add XENSND_OP_HW_PARAM_QUERY request to read/update
stream configuration space: request passes desired intervals/formats for the stream parameters and the response returns allowed intervals and formats mask that can be used.

Changes since v2:
1. Konrad's r-b tag for version patch
2. MAJOR: changed req/resp/evt packet sizes from 32 to 64 octets
3. Reworked XENSND_OP_HW_PARAM_QUERY so it now sends all parameters at once, allowing to check all the configuration space.
4. Minor documentation cleanup (added missed "reserved" fields)

Changes since v1:

1. Changed protocol version definition from string to integer, so it can easily be used in comparisons.
Konrad, I have removed your r-b tag for the reason of this change.

2. In order to provide explicit stream parameter negotiation between backend and frontend the following changes are introduced in the protocol:
add XENSND_OP_HW_PARAM_QUERY request to read/update configuration space for the parameter given: request passes desired parameter interval (mask) and the response to this request returns min/max interval (mask) for the parameter to be used.

Quoted 6 lines

Parameters supported by this request/response:
- format mask
- sample rate interval
- number of channels interval
- buffer size, interval, frames
- period size, interval, frames

Quoted 3 lines

I can't judge exactly about the protocol without the actual FE/BE implementations, but the change looks good to me, especially if you've already tested something.

Thank you, I have tested the changes and need them to start upstreaming the frontend driver used to test the protocol.
Do you mind if I put your Acked-by (or you prefer Reviewed-by?) tag to these patches:

[PATCH v3 4/5] sndif: Add explicit back and front synchronization [PATCH v3 5/5] sndif: Add explicit back and front parameter negotiation

Please note, that the changes first to be merged into Xen and then I'll prepare the same, but for the kernel

Quoted 2 lines

If other people have no concern, let's go ahead with FE/BE stuff.

Konrad, are you ok with the changes?

Quoted 4 lines

thanks,

Takashi

Thank you,
Oleksandr

Reviewed-by
#13 lore raw
Quoted 52 lines · Oleksandr Andrushchenko
Quoted 47 lines · Takashi Iwai
Quoted 39 lines · Oleksandr Andrushchenko

From: Oleksandr Andrushchenko <[email protected]>

Hello, all!

In order to provide explicit synchronization between backend and frontend the following changes are introduced in the protocol:
- bump protocol version to 2
- add new ring buffer for sending asynchronous events from backend to frontend to report number of bytes played by the frontend (XENSND_EVT_CUR_POS)
- introduce trigger events for playback control: start/stop/pause/resume
- add "req-" prefix to event-channel and ring-ref to unify naming of the Xen event channels for requests and events
- add XENSND_OP_HW_PARAM_QUERY request to read/update
stream configuration space: request passes desired intervals/formats for the stream parameters and the response returns allowed intervals and formats mask that can be used.

Changes since v2:
1. Konrad's r-b tag for version patch
2. MAJOR: changed req/resp/evt packet sizes from 32 to 64 octets
3. Reworked XENSND_OP_HW_PARAM_QUERY so it now sends all parameters at once, allowing to check all the configuration space.
4. Minor documentation cleanup (added missed "reserved" fields)

Changes since v1:

1. Changed protocol version definition from string to integer, so it can easily be used in comparisons.
Konrad, I have removed your r-b tag for the reason of this change.

2. In order to provide explicit stream parameter negotiation between backend and frontend the following changes are introduced in the protocol:
add XENSND_OP_HW_PARAM_QUERY request to read/update configuration space for the parameter given: request passes desired parameter interval (mask) and the response to this request returns min/max interval (mask) for the parameter to be used.

Quoted 6 lines

Parameters supported by this request/response:
- format mask
- sample rate interval
- number of channels interval
- buffer size, interval, frames
- period size, interval, frames

Quoted 3 lines

I can't judge exactly about the protocol without the actual FE/BE implementations, but the change looks good to me, especially if you've already tested something.

Quoted 7 lines

Thank you, I have tested the changes and need them to start upstreaming the frontend driver used to test the protocol.
Do you mind if I put your Acked-by (or you prefer Reviewed-by?) tag to these patches:

[PATCH v3 4/5] sndif: Add explicit back and front synchronization [PATCH v3 5/5] sndif: Add explicit back and front parameter negotiation

Sure, feel free to take my ack:

Takashi

Quoted 14 lines

Please note, that the changes first to be merged into Xen and then I'll prepare
the same, but for the kernel

Quoted 2 lines

If other people have no concern, let's go ahead with FE/BE stuff.

Konrad, are you ok with the changes?

Quoted 4 lines

thanks,

Takashi

Thank you,
Oleksandr

#14 lore raw
Quoted 58 lines · Takashi Iwai
Quoted 56 lines · Oleksandr Andrushchenko
Quoted 47 lines · Takashi Iwai
Quoted 39 lines · Oleksandr Andrushchenko

From: Oleksandr Andrushchenko <[email protected]>

Hello, all!

In order to provide explicit synchronization between backend and frontend the following changes are introduced in the protocol:
- bump protocol version to 2
- add new ring buffer for sending asynchronous events from backend to frontend to report number of bytes played by the frontend (XENSND_EVT_CUR_POS)
- introduce trigger events for playback control: start/stop/pause/resume
- add "req-" prefix to event-channel and ring-ref to unify naming of the Xen event channels for requests and events
- add XENSND_OP_HW_PARAM_QUERY request to read/update
stream configuration space: request passes desired intervals/formats for the stream parameters and the response returns allowed intervals and formats mask that can be used.

Changes since v2:
1. Konrad's r-b tag for version patch
2. MAJOR: changed req/resp/evt packet sizes from 32 to 64 octets
3. Reworked XENSND_OP_HW_PARAM_QUERY so it now sends all parameters at once, allowing to check all the configuration space.
4. Minor documentation cleanup (added missed "reserved" fields)

Changes since v1:

1. Changed protocol version definition from string to integer, so it can easily be used in comparisons.
Konrad, I have removed your r-b tag for the reason of this change.

2. In order to provide explicit stream parameter negotiation between backend and frontend the following changes are introduced in the protocol:
add XENSND_OP_HW_PARAM_QUERY request to read/update configuration space for the parameter given: request passes desired parameter interval (mask) and the response to this request returns min/max interval (mask) for the parameter to be used.

Quoted 6 lines

Parameters supported by this request/response:
- format mask
- sample rate interval
- number of channels interval
- buffer size, interval, frames
- period size, interval, frames

Quoted 3 lines

I can't judge exactly about the protocol without the actual FE/BE implementations, but the change looks good to me, especially if you've already tested something.

Thank you, I have tested the changes and need them to start upstreaming the frontend driver used to test the protocol.
Do you mind if I put your Acked-by (or you prefer Reviewed-by?) tag to these patches:

Quoted 4 lines
Quoted 2 lines

[PATCH v3 4/5] sndif: Add explicit back and front synchronization [PATCH v3 5/5] sndif: Add explicit back and front parameter negotiation

Sure, feel free to take my ack:

Thank you

Quoted 14 lines

Takashi

Quoted 11 lines

Please note, that the changes first to be merged into Xen and then I'll prepare
the same, but for the kernel

Quoted 1 line

If other people have no concern, let's go ahead with FE/BE stuff.

Konrad, are you ok with the changes?

Quoted 3 lines

thanks,

Takashi

Thank you,
Oleksandr

#15 lore raw

Hi, Konrad!

Could you please review?

Thank you,
Oleksandr

Quoted 59 lines · Oleksandr Andrushchenko
Quoted 58 lines · Takashi Iwai
Quoted 56 lines · Oleksandr Andrushchenko
Quoted 47 lines · Takashi Iwai
Quoted 39 lines · Oleksandr Andrushchenko

From: Oleksandr Andrushchenko <[email protected]>

Hello, all!

In order to provide explicit synchronization between backend and frontend the following changes are introduced in the protocol:
   - bump protocol version to 2
   - add new ring buffer for sending asynchronous events from backend to frontend to report number of bytes played by the frontend (XENSND_EVT_CUR_POS)
   - introduce trigger events for playback control: start/stop/pause/resume
   - add "req-" prefix to event-channel and ring-ref to unify naming of the Xen event channels for requests and events
   - add XENSND_OP_HW_PARAM_QUERY request to read/update
     stream configuration space: request passes desired intervals/formats for the stream parameters and the response returns allowed intervals and formats mask that can be used.

Changes since v2:
1. Konrad's r-b tag for version patch
2. MAJOR: changed req/resp/evt packet sizes from 32 to 64 octets
3. Reworked XENSND_OP_HW_PARAM_QUERY so it now sends all parameters at once, allowing to check all the configuration space.
4. Minor documentation cleanup (added missed "reserved" fields)

Changes since v1:

1. Changed protocol version definition from string to integer, so it can easily be used in comparisons.
Konrad, I have removed your r-b tag for the reason of this change.

2. In order to provide explicit stream parameter negotiation between backend and frontend the following changes are introduced in the protocol:
add XENSND_OP_HW_PARAM_QUERY request to read/update configuration space for the parameter given: request passes desired parameter interval (mask) and the response to this request returns min/max interval (mask) for the parameter to be used.

Quoted 6 lines

Parameters supported by this request/response:
   - format mask
   - sample rate interval
   - number of channels interval
   - buffer size, interval, frames
   - period size, interval, frames

Quoted 3 lines

I can't judge exactly about the protocol without the actual FE/BE implementations, but the change looks good to me, especially if you've already tested something.

Thank you, I have tested the changes and need them to start upstreaming the frontend driver used to test the protocol.
Do you mind if I put your Acked-by (or you prefer Reviewed-by?) tag to these patches:

Quoted 20 lines
Quoted 4 lines
Quoted 2 lines

[PATCH v3 4/5] sndif: Add explicit back and front synchronization [PATCH v3 5/5] sndif: Add explicit back and front parameter negotiation

Sure, feel free to take my ack:

Thank you

Quoted 14 lines

Takashi

Quoted 11 lines

Please note, that the changes first to be merged into Xen and then I'll prepare
the same, but for the kernel

Quoted 1 line

If other people have no concern, let's go ahead with FE/BE stuff.

Konrad, are you ok with the changes?

Quoted 3 lines

thanks,

Takashi

Thank you,
Oleksandr

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#16 lore raw

ping

Quoted 88 lines · Oleksandr Andrushchenko

Hi, Konrad!

Could you please review?

Thank you,
Oleksandr

Quoted 79 lines · Oleksandr Andrushchenko
Quoted 58 lines · Takashi Iwai
Quoted 56 lines · Oleksandr Andrushchenko
Quoted 47 lines · Takashi Iwai
Quoted 39 lines · Oleksandr Andrushchenko

From: Oleksandr Andrushchenko <[email protected]>

Hello, all!

In order to provide explicit synchronization between backend and frontend the following changes are introduced in the protocol:
   - bump protocol version to 2
   - add new ring buffer for sending asynchronous events from backend to frontend to report number of bytes played by the frontend (XENSND_EVT_CUR_POS)
   - introduce trigger events for playback control: start/stop/pause/resume
   - add "req-" prefix to event-channel and ring-ref to unify naming of the Xen event channels for requests and events
   - add XENSND_OP_HW_PARAM_QUERY request to read/update
     stream configuration space: request passes desired intervals/formats for the stream parameters and the response returns allowed intervals and formats mask that can be used.

Changes since v2:
1. Konrad's r-b tag for version patch
2. MAJOR: changed req/resp/evt packet sizes from 32 to 64 octets
3. Reworked XENSND_OP_HW_PARAM_QUERY so it now sends all parameters at once, allowing to check all the configuration space.
4. Minor documentation cleanup (added missed "reserved" fields)

Changes since v1:

1. Changed protocol version definition from string to integer, so it can easily be used in comparisons.
Konrad, I have removed your r-b tag for the reason of this change.

2. In order to provide explicit stream parameter negotiation between backend and frontend the following changes are introduced in the protocol:
add XENSND_OP_HW_PARAM_QUERY request to read/update configuration space for the parameter given: request passes desired parameter interval (mask) and the response to this request returns min/max interval (mask) for the parameter to be used.

Quoted 6 lines

Parameters supported by this request/response:
   - format mask
   - sample rate interval
   - number of channels interval
   - buffer size, interval, frames
   - period size, interval, frames

Quoted 3 lines

I can't judge exactly about the protocol without the actual FE/BE implementations, but the change looks good to me, especially if you've already tested something.

Thank you, I have tested the changes and need them to start upstreaming the frontend driver used to test the protocol.
Do you mind if I put your Acked-by (or you prefer Reviewed-by?) tag to these patches:

Quoted 4 lines
Quoted 2 lines

[PATCH v3 4/5] sndif: Add explicit back and front synchronization [PATCH v3 5/5] sndif: Add explicit back and front parameter negotiation

Sure, feel free to take my ack:

Thank you

Quoted 14 lines

Takashi

Quoted 11 lines

Please note, that the changes first to be merged into Xen and then I'll prepare
the same, but for the kernel

Quoted 1 line

If other people have no concern, let's go ahead with FE/BE stuff.

Konrad, are you ok with the changes?

Quoted 3 lines

thanks,

Takashi

Thank you,
Oleksandr

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#17 lore raw

Konrad?

Quoted 92 lines · Oleksandr Andrushchenko

ping

Quoted 88 lines · Oleksandr Andrushchenko

Hi, Konrad!

Could you please review?

Thank you,
Oleksandr

Quoted 79 lines · Oleksandr Andrushchenko
Quoted 58 lines · Takashi Iwai
Quoted 56 lines · Oleksandr Andrushchenko
Quoted 47 lines · Takashi Iwai
Quoted 39 lines · Oleksandr Andrushchenko

From: Oleksandr Andrushchenko <[email protected]>

Hello, all!

In order to provide explicit synchronization between backend and frontend the following changes are introduced in the protocol:
   - bump protocol version to 2
   - add new ring buffer for sending asynchronous events from backend to frontend to report number of bytes played by the frontend (XENSND_EVT_CUR_POS)
   - introduce trigger events for playback control: start/stop/pause/resume
   - add "req-" prefix to event-channel and ring-ref to unify naming of the Xen event channels for requests and events
   - add XENSND_OP_HW_PARAM_QUERY request to read/update
     stream configuration space: request passes desired intervals/formats for the stream parameters and the response returns allowed intervals and formats mask that can be used.

Changes since v2:
1. Konrad's r-b tag for version patch
2. MAJOR: changed req/resp/evt packet sizes from 32 to 64 octets
3. Reworked XENSND_OP_HW_PARAM_QUERY so it now sends all parameters at once, allowing to check all the configuration space.
4. Minor documentation cleanup (added missed "reserved" fields)

Changes since v1:

1. Changed protocol version definition from string to integer, so it can easily be used in comparisons.
Konrad, I have removed your r-b tag for the reason of this change.

2. In order to provide explicit stream parameter negotiation between backend and frontend the following changes are introduced in the protocol:
add XENSND_OP_HW_PARAM_QUERY request to read/update configuration space for the parameter given: request passes desired parameter interval (mask) and the response to this request returns min/max interval (mask) for the parameter to be used.

Quoted 6 lines

Parameters supported by this request/response:
   - format mask
   - sample rate interval
   - number of channels interval
   - buffer size, interval, frames
   - period size, interval, frames

Quoted 3 lines

I can't judge exactly about the protocol without the actual FE/BE implementations, but the change looks good to me, especially if you've already tested something.

Thank you, I have tested the changes and need them to start upstreaming the frontend driver used to test the protocol.
Do you mind if I put your Acked-by (or you prefer Reviewed-by?) tag to these patches:

Quoted 4 lines
Quoted 2 lines

[PATCH v3 4/5] sndif: Add explicit back and front synchronization [PATCH v3 5/5] sndif: Add explicit back and front parameter negotiation

Sure, feel free to take my ack:

Thank you

Quoted 14 lines

Takashi

Quoted 11 lines

Please note, that the changes first to be merged into Xen and then I'll prepare
the same, but for the kernel

Quoted 1 line

If other people have no concern, let's go ahead with FE/BE stuff.

Konrad, are you ok with the changes?

Quoted 3 lines

thanks,

Takashi

Thank you,
Oleksandr

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#18 lore raw
In reply to Oleksandr Andrushchenko

Konrad?

Quoted 92 lines · Oleksandr Andrushchenko

ping

Quoted 88 lines · Oleksandr Andrushchenko

Hi, Konrad!

Could you please review?

Thank you,
Oleksandr

Quoted 79 lines · Oleksandr Andrushchenko
Quoted 58 lines · Takashi Iwai
Quoted 56 lines · Oleksandr Andrushchenko
Quoted 47 lines · Takashi Iwai
Quoted 39 lines · Oleksandr Andrushchenko

From: Oleksandr Andrushchenko <[email protected]>

Hello, all!

In order to provide explicit synchronization between backend and frontend the following changes are introduced in the protocol:
   - bump protocol version to 2
   - add new ring buffer for sending asynchronous events from backend to frontend to report number of bytes played by the frontend (XENSND_EVT_CUR_POS)
   - introduce trigger events for playback control: start/stop/pause/resume
   - add "req-" prefix to event-channel and ring-ref to unify naming of the Xen event channels for requests and events
   - add XENSND_OP_HW_PARAM_QUERY request to read/update
     stream configuration space: request passes desired intervals/formats for the stream parameters and the response returns allowed intervals and formats mask that can be used.

Changes since v2:
1. Konrad's r-b tag for version patch
2. MAJOR: changed req/resp/evt packet sizes from 32 to 64 octets
3. Reworked XENSND_OP_HW_PARAM_QUERY so it now sends all parameters at once, allowing to check all the configuration space.
4. Minor documentation cleanup (added missed "reserved" fields)

Changes since v1:

1. Changed protocol version definition from string to integer, so it can easily be used in comparisons.
Konrad, I have removed your r-b tag for the reason of this change.

2. In order to provide explicit stream parameter negotiation between backend and frontend the following changes are introduced in the protocol:
add XENSND_OP_HW_PARAM_QUERY request to read/update configuration space for the parameter given: request passes desired parameter interval (mask) and the response to this request returns min/max interval (mask) for the parameter to be used.

Quoted 6 lines

Parameters supported by this request/response:
   - format mask
   - sample rate interval
   - number of channels interval
   - buffer size, interval, frames
   - period size, interval, frames

Quoted 3 lines

I can't judge exactly about the protocol without the actual FE/BE implementations, but the change looks good to me, especially if you've already tested something.

Thank you, I have tested the changes and need them to start upstreaming the frontend driver used to test the protocol.
Do you mind if I put your Acked-by (or you prefer Reviewed-by?) tag to these patches:

Quoted 4 lines
Quoted 2 lines

[PATCH v3 4/5] sndif: Add explicit back and front synchronization [PATCH v3 5/5] sndif: Add explicit back and front parameter negotiation

Sure, feel free to take my ack:

Thank you

Quoted 14 lines

Takashi

Quoted 11 lines

Please note, that the changes first to be merged into Xen and then I'll prepare
the same, but for the kernel

Quoted 1 line

If other people have no concern, let's go ahead with FE/BE stuff.

Konrad, are you ok with the changes?

Quoted 3 lines

thanks,

Takashi

Thank you,
Oleksandr

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#19 lore raw
In reply to Oleksandr Andrushchenko

ping

Quoted 88 lines · Oleksandr Andrushchenko

Hi, Konrad!

Could you please review?

Thank you,
Oleksandr

Quoted 79 lines · Oleksandr Andrushchenko
Quoted 58 lines · Takashi Iwai
Quoted 56 lines · Oleksandr Andrushchenko
Quoted 47 lines · Takashi Iwai
Quoted 39 lines · Oleksandr Andrushchenko

From: Oleksandr Andrushchenko <[email protected]>

Hello, all!

In order to provide explicit synchronization between backend and frontend the following changes are introduced in the protocol:
   - bump protocol version to 2
   - add new ring buffer for sending asynchronous events from backend to frontend to report number of bytes played by the frontend (XENSND_EVT_CUR_POS)
   - introduce trigger events for playback control: start/stop/pause/resume
   - add "req-" prefix to event-channel and ring-ref to unify naming of the Xen event channels for requests and events
   - add XENSND_OP_HW_PARAM_QUERY request to read/update
     stream configuration space: request passes desired intervals/formats for the stream parameters and the response returns allowed intervals and formats mask that can be used.

Changes since v2:
1. Konrad's r-b tag for version patch
2. MAJOR: changed req/resp/evt packet sizes from 32 to 64 octets
3. Reworked XENSND_OP_HW_PARAM_QUERY so it now sends all parameters at once, allowing to check all the configuration space.
4. Minor documentation cleanup (added missed "reserved" fields)

Changes since v1:

1. Changed protocol version definition from string to integer, so it can easily be used in comparisons.
Konrad, I have removed your r-b tag for the reason of this change.

2. In order to provide explicit stream parameter negotiation between backend and frontend the following changes are introduced in the protocol:
add XENSND_OP_HW_PARAM_QUERY request to read/update configuration space for the parameter given: request passes desired parameter interval (mask) and the response to this request returns min/max interval (mask) for the parameter to be used.

Quoted 6 lines

Parameters supported by this request/response:
   - format mask
   - sample rate interval
   - number of channels interval
   - buffer size, interval, frames
   - period size, interval, frames

Quoted 3 lines

I can't judge exactly about the protocol without the actual FE/BE implementations, but the change looks good to me, especially if you've already tested something.

Thank you, I have tested the changes and need them to start upstreaming the frontend driver used to test the protocol.
Do you mind if I put your Acked-by (or you prefer Reviewed-by?) tag to these patches:

Quoted 4 lines
Quoted 2 lines

[PATCH v3 4/5] sndif: Add explicit back and front synchronization [PATCH v3 5/5] sndif: Add explicit back and front parameter negotiation

Sure, feel free to take my ack:

Thank you

Quoted 14 lines

Takashi

Quoted 11 lines

Please note, that the changes first to be merged into Xen and then I'll prepare
the same, but for the kernel

Quoted 1 line

If other people have no concern, let's go ahead with FE/BE stuff.

Konrad, are you ok with the changes?

Quoted 3 lines

thanks,

Takashi

Thank you,
Oleksandr

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#20 lore raw
In reply to Oleksandr Andrushchenko

Hi, Konrad!

Could you please review?

Thank you,
Oleksandr

Quoted 59 lines · Oleksandr Andrushchenko
Quoted 58 lines · Takashi Iwai
Quoted 56 lines · Oleksandr Andrushchenko
Quoted 47 lines · Takashi Iwai
Quoted 39 lines · Oleksandr Andrushchenko

From: Oleksandr Andrushchenko <[email protected]>

Hello, all!

In order to provide explicit synchronization between backend and frontend the following changes are introduced in the protocol:
   - bump protocol version to 2
   - add new ring buffer for sending asynchronous events from backend to frontend to report number of bytes played by the frontend (XENSND_EVT_CUR_POS)
   - introduce trigger events for playback control: start/stop/pause/resume
   - add "req-" prefix to event-channel and ring-ref to unify naming of the Xen event channels for requests and events
   - add XENSND_OP_HW_PARAM_QUERY request to read/update
     stream configuration space: request passes desired intervals/formats for the stream parameters and the response returns allowed intervals and formats mask that can be used.

Changes since v2:
1. Konrad's r-b tag for version patch
2. MAJOR: changed req/resp/evt packet sizes from 32 to 64 octets
3. Reworked XENSND_OP_HW_PARAM_QUERY so it now sends all parameters at once, allowing to check all the configuration space.
4. Minor documentation cleanup (added missed "reserved" fields)

Changes since v1:

1. Changed protocol version definition from string to integer, so it can easily be used in comparisons.
Konrad, I have removed your r-b tag for the reason of this change.

2. In order to provide explicit stream parameter negotiation between backend and frontend the following changes are introduced in the protocol:
add XENSND_OP_HW_PARAM_QUERY request to read/update configuration space for the parameter given: request passes desired parameter interval (mask) and the response to this request returns min/max interval (mask) for the parameter to be used.

Quoted 6 lines

Parameters supported by this request/response:
   - format mask
   - sample rate interval
   - number of channels interval
   - buffer size, interval, frames
   - period size, interval, frames

Quoted 3 lines

I can't judge exactly about the protocol without the actual FE/BE implementations, but the change looks good to me, especially if you've already tested something.

Thank you, I have tested the changes and need them to start upstreaming the frontend driver used to test the protocol.
Do you mind if I put your Acked-by (or you prefer Reviewed-by?) tag to these patches:

Quoted 20 lines
Quoted 4 lines
Quoted 2 lines

[PATCH v3 4/5] sndif: Add explicit back and front synchronization [PATCH v3 5/5] sndif: Add explicit back and front parameter negotiation

Sure, feel free to take my ack:

Thank you

Quoted 14 lines

Takashi

Quoted 11 lines

Please note, that the changes first to be merged into Xen and then I'll prepare
the same, but for the kernel

Quoted 1 line

If other people have no concern, let's go ahead with FE/BE stuff.

Konrad, are you ok with the changes?

Quoted 3 lines

thanks,

Takashi

Thank you,
Oleksandr

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#21 lore raw
In reply to Takashi Iwai
Quoted 58 lines · Takashi Iwai
Quoted 56 lines · Oleksandr Andrushchenko
Quoted 47 lines · Takashi Iwai
Quoted 39 lines · Oleksandr Andrushchenko

From: Oleksandr Andrushchenko <[email protected]>

Hello, all!

In order to provide explicit synchronization between backend and frontend the following changes are introduced in the protocol:
- bump protocol version to 2
- add new ring buffer for sending asynchronous events from backend to frontend to report number of bytes played by the frontend (XENSND_EVT_CUR_POS)
- introduce trigger events for playback control: start/stop/pause/resume
- add "req-" prefix to event-channel and ring-ref to unify naming of the Xen event channels for requests and events
- add XENSND_OP_HW_PARAM_QUERY request to read/update
stream configuration space: request passes desired intervals/formats for the stream parameters and the response returns allowed intervals and formats mask that can be used.

Changes since v2:
1. Konrad's r-b tag for version patch
2. MAJOR: changed req/resp/evt packet sizes from 32 to 64 octets
3. Reworked XENSND_OP_HW_PARAM_QUERY so it now sends all parameters at once, allowing to check all the configuration space.
4. Minor documentation cleanup (added missed "reserved" fields)

Changes since v1:

1. Changed protocol version definition from string to integer, so it can easily be used in comparisons.
Konrad, I have removed your r-b tag for the reason of this change.

2. In order to provide explicit stream parameter negotiation between backend and frontend the following changes are introduced in the protocol:
add XENSND_OP_HW_PARAM_QUERY request to read/update configuration space for the parameter given: request passes desired parameter interval (mask) and the response to this request returns min/max interval (mask) for the parameter to be used.

Quoted 6 lines

Parameters supported by this request/response:
- format mask
- sample rate interval
- number of channels interval
- buffer size, interval, frames
- period size, interval, frames

Quoted 3 lines

I can't judge exactly about the protocol without the actual FE/BE implementations, but the change looks good to me, especially if you've already tested something.

Thank you, I have tested the changes and need them to start upstreaming the frontend driver used to test the protocol.
Do you mind if I put your Acked-by (or you prefer Reviewed-by?) tag to these patches:

Quoted 4 lines
Quoted 2 lines

[PATCH v3 4/5] sndif: Add explicit back and front synchronization [PATCH v3 5/5] sndif: Add explicit back and front parameter negotiation

Sure, feel free to take my ack:

Thank you

Quoted 14 lines

Takashi

Quoted 11 lines

Please note, that the changes first to be merged into Xen and then I'll prepare
the same, but for the kernel

Quoted 1 line

If other people have no concern, let's go ahead with FE/BE stuff.

Konrad, are you ok with the changes?

Quoted 3 lines

thanks,

Takashi

Thank you,
Oleksandr

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reviewed-by
#22 lore raw
In reply to Oleksandr Andrushchenko
Quoted 52 lines · Oleksandr Andrushchenko
Quoted 47 lines · Takashi Iwai
Quoted 39 lines · Oleksandr Andrushchenko

From: Oleksandr Andrushchenko <[email protected]>

Hello, all!

In order to provide explicit synchronization between backend and frontend the following changes are introduced in the protocol:
- bump protocol version to 2
- add new ring buffer for sending asynchronous events from backend to frontend to report number of bytes played by the frontend (XENSND_EVT_CUR_POS)
- introduce trigger events for playback control: start/stop/pause/resume
- add "req-" prefix to event-channel and ring-ref to unify naming of the Xen event channels for requests and events
- add XENSND_OP_HW_PARAM_QUERY request to read/update
stream configuration space: request passes desired intervals/formats for the stream parameters and the response returns allowed intervals and formats mask that can be used.

Changes since v2:
1. Konrad's r-b tag for version patch
2. MAJOR: changed req/resp/evt packet sizes from 32 to 64 octets
3. Reworked XENSND_OP_HW_PARAM_QUERY so it now sends all parameters at once, allowing to check all the configuration space.
4. Minor documentation cleanup (added missed "reserved" fields)

Changes since v1:

1. Changed protocol version definition from string to integer, so it can easily be used in comparisons.
Konrad, I have removed your r-b tag for the reason of this change.

2. In order to provide explicit stream parameter negotiation between backend and frontend the following changes are introduced in the protocol:
add XENSND_OP_HW_PARAM_QUERY request to read/update configuration space for the parameter given: request passes desired parameter interval (mask) and the response to this request returns min/max interval (mask) for the parameter to be used.

Quoted 6 lines

Parameters supported by this request/response:
- format mask
- sample rate interval
- number of channels interval
- buffer size, interval, frames
- period size, interval, frames

Quoted 3 lines

I can't judge exactly about the protocol without the actual FE/BE implementations, but the change looks good to me, especially if you've already tested something.

Quoted 7 lines

Thank you, I have tested the changes and need them to start upstreaming the frontend driver used to test the protocol.
Do you mind if I put your Acked-by (or you prefer Reviewed-by?) tag to these patches:

[PATCH v3 4/5] sndif: Add explicit back and front synchronization [PATCH v3 5/5] sndif: Add explicit back and front parameter negotiation

Sure, feel free to take my ack:

Takashi

Quoted 5 lines

Please note, that the changes first to be merged into Xen and then I'll prepare
the same, but for the kernel

Quoted 1 line
Quoted 9 lines
Quoted 1 line

If other people have no concern, let's go ahead with FE/BE stuff.

Konrad, are you ok with the changes?

Quoted 4 lines

thanks,

Takashi

Thank you,
Oleksandr

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#23 lore raw
In reply to Oleksandr Andrushchenko
Quoted 59 lines · Oleksandr Andrushchenko
Quoted 47 lines · Takashi Iwai
Quoted 39 lines · Oleksandr Andrushchenko

From: Oleksandr Andrushchenko <[email protected]>

Hello, all!

In order to provide explicit synchronization between backend and frontend the following changes are introduced in the protocol:
- bump protocol version to 2
- add new ring buffer for sending asynchronous events from backend to frontend to report number of bytes played by the frontend (XENSND_EVT_CUR_POS)
- introduce trigger events for playback control: start/stop/pause/resume
- add "req-" prefix to event-channel and ring-ref to unify naming of the Xen event channels for requests and events
- add XENSND_OP_HW_PARAM_QUERY request to read/update
stream configuration space: request passes desired intervals/formats for the stream parameters and the response returns allowed intervals and formats mask that can be used.

Changes since v2:
1. Konrad's r-b tag for version patch
2. MAJOR: changed req/resp/evt packet sizes from 32 to 64 octets
3. Reworked XENSND_OP_HW_PARAM_QUERY so it now sends all parameters at once, allowing to check all the configuration space.
4. Minor documentation cleanup (added missed "reserved" fields)

Changes since v1:

1. Changed protocol version definition from string to integer, so it can easily be used in comparisons.
Konrad, I have removed your r-b tag for the reason of this change.

2. In order to provide explicit stream parameter negotiation between backend and frontend the following changes are introduced in the protocol:
add XENSND_OP_HW_PARAM_QUERY request to read/update configuration space for the parameter given: request passes desired parameter interval (mask) and the response to this request returns min/max interval (mask) for the parameter to be used.

Quoted 6 lines

Parameters supported by this request/response:
- format mask
- sample rate interval
- number of channels interval
- buffer size, interval, frames
- period size, interval, frames

Quoted 3 lines

I can't judge exactly about the protocol without the actual FE/BE implementations, but the change looks good to me, especially if you've already tested something.

Thank you, I have tested the changes and need them to start upstreaming the frontend driver used to test the protocol.
Do you mind if I put your Acked-by (or you prefer Reviewed-by?) tag to these patches:

[PATCH v3 4/5] sndif: Add explicit back and front synchronization [PATCH v3 5/5] sndif: Add explicit back and front parameter negotiation

Quoted 6 lines

Please note, that the changes first to be merged into Xen and then I'll prepare
the same, but for the kernel

Quoted 2 lines

If other people have no concern, let's go ahead with FE/BE stuff.

Konrad, are you ok with the changes?

Yes. Thank you for your persistence.

Can you also add:

Thank you!

Quoted 6 lines
Quoted 4 lines

thanks,

Takashi

Thank you,
Oleksandr

#24 lore raw
Quoted 63 lines · Konrad Rzeszutek Wilk
Quoted 62 lines · Oleksandr Andrushchenko
Quoted 47 lines · Takashi Iwai
Quoted 39 lines · Oleksandr Andrushchenko

From: Oleksandr Andrushchenko <[email protected]>

Hello, all!

In order to provide explicit synchronization between backend and frontend the following changes are introduced in the protocol:
- bump protocol version to 2
- add new ring buffer for sending asynchronous events from backend to frontend to report number of bytes played by the frontend (XENSND_EVT_CUR_POS)
- introduce trigger events for playback control: start/stop/pause/resume
- add "req-" prefix to event-channel and ring-ref to unify naming of the Xen event channels for requests and events
- add XENSND_OP_HW_PARAM_QUERY request to read/update
stream configuration space: request passes desired intervals/formats for the stream parameters and the response returns allowed intervals and formats mask that can be used.

Changes since v2:
1. Konrad's r-b tag for version patch
2. MAJOR: changed req/resp/evt packet sizes from 32 to 64 octets
3. Reworked XENSND_OP_HW_PARAM_QUERY so it now sends all parameters at once, allowing to check all the configuration space.
4. Minor documentation cleanup (added missed "reserved" fields)

Changes since v1:

1. Changed protocol version definition from string to integer, so it can easily be used in comparisons.
Konrad, I have removed your r-b tag for the reason of this change.

2. In order to provide explicit stream parameter negotiation between backend and frontend the following changes are introduced in the protocol:
add XENSND_OP_HW_PARAM_QUERY request to read/update configuration space for the parameter given: request passes desired parameter interval (mask) and the response to this request returns min/max interval (mask) for the parameter to be used.

Quoted 6 lines

Parameters supported by this request/response:
- format mask
- sample rate interval
- number of channels interval
- buffer size, interval, frames
- period size, interval, frames

Quoted 3 lines

I can't judge exactly about the protocol without the actual FE/BE implementations, but the change looks good to me, especially if you've already tested something.

Thank you, I have tested the changes and need them to start upstreaming the frontend driver used to test the protocol.
Do you mind if I put your Acked-by (or you prefer Reviewed-by?) tag to these patches:

[PATCH v3 4/5] sndif: Add explicit back and front synchronization [PATCH v3 5/5] sndif: Add explicit back and front parameter negotiation

Please note, that the changes first to be merged into Xen and then I'll prepare
the same, but for the kernel

Quoted 7 lines
Quoted 2 lines
Quoted 1 line

If other people have no concern, let's go ahead with FE/BE stuff.

Konrad, are you ok with the changes?

Yes. Thank you for your persistence.

Can you also add:

Great, can you please add r-b tags while applying or you want me to resend with r-b tags?

Quoted 6 lines

Thank you!

Quoted 5 lines
Quoted 3 lines

thanks,

Takashi

Thank you,
Oleksandr

#25 lore raw
In reply to Konrad Rzeszutek Wilk
Quoted 63 lines · Konrad Rzeszutek Wilk
Quoted 62 lines · Oleksandr Andrushchenko
Quoted 47 lines · Takashi Iwai
Quoted 39 lines · Oleksandr Andrushchenko

From: Oleksandr Andrushchenko <[email protected]>

Hello, all!

In order to provide explicit synchronization between backend and frontend the following changes are introduced in the protocol:
- bump protocol version to 2
- add new ring buffer for sending asynchronous events from backend to frontend to report number of bytes played by the frontend (XENSND_EVT_CUR_POS)
- introduce trigger events for playback control: start/stop/pause/resume
- add "req-" prefix to event-channel and ring-ref to unify naming of the Xen event channels for requests and events
- add XENSND_OP_HW_PARAM_QUERY request to read/update
stream configuration space: request passes desired intervals/formats for the stream parameters and the response returns allowed intervals and formats mask that can be used.

Changes since v2:
1. Konrad's r-b tag for version patch
2. MAJOR: changed req/resp/evt packet sizes from 32 to 64 octets
3. Reworked XENSND_OP_HW_PARAM_QUERY so it now sends all parameters at once, allowing to check all the configuration space.
4. Minor documentation cleanup (added missed "reserved" fields)

Changes since v1:

1. Changed protocol version definition from string to integer, so it can easily be used in comparisons.
Konrad, I have removed your r-b tag for the reason of this change.

2. In order to provide explicit stream parameter negotiation between backend and frontend the following changes are introduced in the protocol:
add XENSND_OP_HW_PARAM_QUERY request to read/update configuration space for the parameter given: request passes desired parameter interval (mask) and the response to this request returns min/max interval (mask) for the parameter to be used.

Quoted 6 lines

Parameters supported by this request/response:
- format mask
- sample rate interval
- number of channels interval
- buffer size, interval, frames
- period size, interval, frames

Quoted 3 lines

I can't judge exactly about the protocol without the actual FE/BE implementations, but the change looks good to me, especially if you've already tested something.

Thank you, I have tested the changes and need them to start upstreaming the frontend driver used to test the protocol.
Do you mind if I put your Acked-by (or you prefer Reviewed-by?) tag to these patches:

[PATCH v3 4/5] sndif: Add explicit back and front synchronization [PATCH v3 5/5] sndif: Add explicit back and front parameter negotiation

Please note, that the changes first to be merged into Xen and then I'll prepare
the same, but for the kernel

Quoted 7 lines
Quoted 2 lines
Quoted 1 line

If other people have no concern, let's go ahead with FE/BE stuff.

Konrad, are you ok with the changes?

Yes. Thank you for your persistence.

Can you also add:

Great, can you please add r-b tags while applying or you want me to resend with r-b tags?

Quoted 6 lines

Thank you!

Quoted 5 lines
Quoted 3 lines

thanks,

Takashi

Thank you,
Oleksandr

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#26 lore raw
In reply to Oleksandr Andrushchenko
Quoted 59 lines · Oleksandr Andrushchenko
Quoted 47 lines · Takashi Iwai
Quoted 39 lines · Oleksandr Andrushchenko

From: Oleksandr Andrushchenko <[email protected]>

Hello, all!

In order to provide explicit synchronization between backend and frontend the following changes are introduced in the protocol:
- bump protocol version to 2
- add new ring buffer for sending asynchronous events from backend to frontend to report number of bytes played by the frontend (XENSND_EVT_CUR_POS)
- introduce trigger events for playback control: start/stop/pause/resume
- add "req-" prefix to event-channel and ring-ref to unify naming of the Xen event channels for requests and events
- add XENSND_OP_HW_PARAM_QUERY request to read/update
stream configuration space: request passes desired intervals/formats for the stream parameters and the response returns allowed intervals and formats mask that can be used.

Changes since v2:
1. Konrad's r-b tag for version patch
2. MAJOR: changed req/resp/evt packet sizes from 32 to 64 octets
3. Reworked XENSND_OP_HW_PARAM_QUERY so it now sends all parameters at once, allowing to check all the configuration space.
4. Minor documentation cleanup (added missed "reserved" fields)

Changes since v1:

1. Changed protocol version definition from string to integer, so it can easily be used in comparisons.
Konrad, I have removed your r-b tag for the reason of this change.

2. In order to provide explicit stream parameter negotiation between backend and frontend the following changes are introduced in the protocol:
add XENSND_OP_HW_PARAM_QUERY request to read/update configuration space for the parameter given: request passes desired parameter interval (mask) and the response to this request returns min/max interval (mask) for the parameter to be used.

Quoted 6 lines

Parameters supported by this request/response:
- format mask
- sample rate interval
- number of channels interval
- buffer size, interval, frames
- period size, interval, frames

Quoted 3 lines

I can't judge exactly about the protocol without the actual FE/BE implementations, but the change looks good to me, especially if you've already tested something.

Thank you, I have tested the changes and need them to start upstreaming the frontend driver used to test the protocol.
Do you mind if I put your Acked-by (or you prefer Reviewed-by?) tag to these patches:

[PATCH v3 4/5] sndif: Add explicit back and front synchronization [PATCH v3 5/5] sndif: Add explicit back and front parameter negotiation

Quoted 6 lines

Please note, that the changes first to be merged into Xen and then I'll prepare
the same, but for the kernel

Quoted 2 lines

If other people have no concern, let's go ahead with FE/BE stuff.

Konrad, are you ok with the changes?

Yes. Thank you for your persistence.

Can you also add:

Thank you!

Quoted 6 lines
Quoted 4 lines

thanks,

Takashi

Thank you,
Oleksandr

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#27 lore raw
In reply to Takashi Iwai
Quoted 47 lines · Takashi Iwai
Quoted 39 lines · Oleksandr Andrushchenko

From: Oleksandr Andrushchenko <[email protected]>

Hello, all!

In order to provide explicit synchronization between backend and frontend the following changes are introduced in the protocol:
- bump protocol version to 2
- add new ring buffer for sending asynchronous events from backend to frontend to report number of bytes played by the frontend (XENSND_EVT_CUR_POS)
- introduce trigger events for playback control: start/stop/pause/resume
- add "req-" prefix to event-channel and ring-ref to unify naming of the Xen event channels for requests and events
- add XENSND_OP_HW_PARAM_QUERY request to read/update
stream configuration space: request passes desired intervals/formats for the stream parameters and the response returns allowed intervals and formats mask that can be used.

Changes since v2:
1. Konrad's r-b tag for version patch
2. MAJOR: changed req/resp/evt packet sizes from 32 to 64 octets
3. Reworked XENSND_OP_HW_PARAM_QUERY so it now sends all parameters at once, allowing to check all the configuration space.
4. Minor documentation cleanup (added missed "reserved" fields)

Changes since v1:

1. Changed protocol version definition from string to integer, so it can easily be used in comparisons.
Konrad, I have removed your r-b tag for the reason of this change.

2. In order to provide explicit stream parameter negotiation between backend and frontend the following changes are introduced in the protocol:
add XENSND_OP_HW_PARAM_QUERY request to read/update configuration space for the parameter given: request passes desired parameter interval (mask) and the response to this request returns min/max interval (mask) for the parameter to be used.

Quoted 6 lines

Parameters supported by this request/response:
- format mask
- sample rate interval
- number of channels interval
- buffer size, interval, frames
- period size, interval, frames

Quoted 3 lines

I can't judge exactly about the protocol without the actual FE/BE implementations, but the change looks good to me, especially if you've already tested something.

Thank you, I have tested the changes and need them to start upstreaming the frontend driver used to test the protocol.
Do you mind if I put your Acked-by (or you prefer Reviewed-by?) tag to these patches:

[PATCH v3 4/5] sndif: Add explicit back and front synchronization [PATCH v3 5/5] sndif: Add explicit back and front parameter negotiation

Please note, that the changes first to be merged into Xen and then I'll prepare the same, but for the kernel

Quoted 2 lines

If other people have no concern, let's go ahead with FE/BE stuff.

Konrad, are you ok with the changes?

Quoted 4 lines

thanks,

Takashi

Thank you,
Oleksandr

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#28 lore raw
In reply to Oleksandr Andrushchenko
Quoted 40 lines · Oleksandr Andrushchenko

From: Oleksandr Andrushchenko <[email protected]>

Hello, all!

In order to provide explicit synchronization between backend and frontend the following changes are introduced in the protocol:
- bump protocol version to 2
- add new ring buffer for sending asynchronous events from backend to frontend to report number of bytes played by the frontend (XENSND_EVT_CUR_POS)
- introduce trigger events for playback control: start/stop/pause/resume
- add "req-" prefix to event-channel and ring-ref to unify naming of the Xen event channels for requests and events
- add XENSND_OP_HW_PARAM_QUERY request to read/update
stream configuration space: request passes desired intervals/formats for the stream parameters and the response returns allowed intervals and formats mask that can be used.

Changes since v2:
1. Konrad's r-b tag for version patch
2. MAJOR: changed req/resp/evt packet sizes from 32 to 64 octets
3. Reworked XENSND_OP_HW_PARAM_QUERY so it now sends all parameters at once, allowing to check all the configuration space.
4. Minor documentation cleanup (added missed "reserved" fields)

Changes since v1:

1. Changed protocol version definition from string to integer, so it can easily be used in comparisons.
Konrad, I have removed your r-b tag for the reason of this change.

2. In order to provide explicit stream parameter negotiation between backend and frontend the following changes are introduced in the protocol:
add XENSND_OP_HW_PARAM_QUERY request to read/update configuration space for the parameter given: request passes desired parameter interval (mask) and the response to this request returns min/max interval (mask) for the parameter to be used.

Quoted 6 lines

Parameters supported by this request/response:
- format mask
- sample rate interval
- number of channels interval
- buffer size, interval, frames
- period size, interval, frames

I can't judge exactly about the protocol without the actual FE/BE implementations, but the change looks good to me, especially if you've already tested something.

If other people have no concern, let's go ahead with FE/BE stuff.

thanks,

Takashi

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#29 lore raw
In reply to Oleksandr Andrushchenko
Quoted 53 lines · Oleksandr Andrushchenko

From: Oleksandr Andrushchenko <[email protected]>

Hello, all!

In order to provide explicit synchronization between backend and frontend the following changes are introduced in the protocol:
- bump protocol version to 2
- add new ring buffer for sending asynchronous events from backend to frontend to report number of bytes played by the frontend (XENSND_EVT_CUR_POS)
- introduce trigger events for playback control: start/stop/pause/resume
- add "req-" prefix to event-channel and ring-ref to unify naming of the Xen event channels for requests and events
- add XENSND_OP_HW_PARAM_QUERY request to read/update
stream configuration space: request passes desired intervals/formats for the stream parameters and the response returns allowed intervals and formats mask that can be used.

Changes since v2:
1. Konrad's r-b tag for version patch
2. MAJOR: changed req/resp/evt packet sizes from 32 to 64 octets
3. Reworked XENSND_OP_HW_PARAM_QUERY so it now sends all parameters at once, allowing to check all the configuration space.
4. Minor documentation cleanup (added missed "reserved" fields)

Changes since v1:

1. Changed protocol version definition from string to integer, so it can easily be used in comparisons.
Konrad, I have removed your r-b tag for the reason of this change.

2. In order to provide explicit stream parameter negotiation between backend and frontend the following changes are introduced in the protocol:
add XENSND_OP_HW_PARAM_QUERY request to read/update configuration space for the parameter given: request passes desired parameter interval (mask) and the response to this request returns min/max interval (mask) for the parameter to be used.

Parameters supported by this request/response:
- format mask
- sample rate interval
- number of channels interval
- buffer size, interval, frames
- period size, interval, frames

Oleksandr Andrushchenko (5):
sndif: Introduce protocol version
sndif: Fix missed "reserved" fields in comments
sndif: Make requests and responses 64 octets long
sndif: Add explicit back and front synchronization
sndif: Add explicit back and front parameter negotiation

Quoted 3 lines
 xen/include/public/io/sndif.h | 322 +++++++++++++++++++++++++++++++++++++++---
 1 file changed, 306 insertions(+), 16 deletions(-)

With Konrad's ack you can have my:

even if the commit can't be done before the freeze. The header isn't used inside Xen so the risk for the release is zero.

Juergen

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#30 lore raw
Quoted 54 lines · Juergen Gross
Quoted 53 lines · Oleksandr Andrushchenko

From: Oleksandr Andrushchenko <[email protected]>

Hello, all!

In order to provide explicit synchronization between backend and frontend the following changes are introduced in the protocol:
- bump protocol version to 2
- add new ring buffer for sending asynchronous events from backend to frontend to report number of bytes played by the frontend (XENSND_EVT_CUR_POS)
- introduce trigger events for playback control: start/stop/pause/resume
- add "req-" prefix to event-channel and ring-ref to unify naming of the Xen event channels for requests and events
- add XENSND_OP_HW_PARAM_QUERY request to read/update
stream configuration space: request passes desired intervals/formats for the stream parameters and the response returns allowed intervals and formats mask that can be used.

Changes since v2:
1. Konrad's r-b tag for version patch
2. MAJOR: changed req/resp/evt packet sizes from 32 to 64 octets
3. Reworked XENSND_OP_HW_PARAM_QUERY so it now sends all parameters at once, allowing to check all the configuration space.
4. Minor documentation cleanup (added missed "reserved" fields)

Changes since v1:

1. Changed protocol version definition from string to integer, so it can easily be used in comparisons.
Konrad, I have removed your r-b tag for the reason of this change.

2. In order to provide explicit stream parameter negotiation between backend and frontend the following changes are introduced in the protocol:
add XENSND_OP_HW_PARAM_QUERY request to read/update configuration space for the parameter given: request passes desired parameter interval (mask) and the response to this request returns min/max interval (mask) for the parameter to be used.

Parameters supported by this request/response:
- format mask
- sample rate interval
- number of channels interval
- buffer size, interval, frames
- period size, interval, frames

Oleksandr Andrushchenko (5):
sndif: Introduce protocol version
sndif: Fix missed "reserved" fields in comments
sndif: Make requests and responses 64 octets long
sndif: Add explicit back and front synchronization
sndif: Add explicit back and front parameter negotiation

Quoted 6 lines
Quoted 3 lines
  xen/include/public/io/sndif.h | 322 +++++++++++++++++++++++++++++++++++++++---
  1 file changed, 306 insertions(+), 16 deletions(-)

With Konrad's ack you can have my:

Thank you

Quoted 3 lines

even if the commit can't be done before the freeze. The header isn't used inside Xen so the risk for the release is zero.

This is true

Quoted 2 lines

Juergen

Thank you,
Oleksandr

#31 lore raw
In reply to Juergen Gross
Quoted 54 lines · Juergen Gross
Quoted 53 lines · Oleksandr Andrushchenko

From: Oleksandr Andrushchenko <[email protected]>

Hello, all!

In order to provide explicit synchronization between backend and frontend the following changes are introduced in the protocol:
- bump protocol version to 2
- add new ring buffer for sending asynchronous events from backend to frontend to report number of bytes played by the frontend (XENSND_EVT_CUR_POS)
- introduce trigger events for playback control: start/stop/pause/resume
- add "req-" prefix to event-channel and ring-ref to unify naming of the Xen event channels for requests and events
- add XENSND_OP_HW_PARAM_QUERY request to read/update
stream configuration space: request passes desired intervals/formats for the stream parameters and the response returns allowed intervals and formats mask that can be used.

Changes since v2:
1. Konrad's r-b tag for version patch
2. MAJOR: changed req/resp/evt packet sizes from 32 to 64 octets
3. Reworked XENSND_OP_HW_PARAM_QUERY so it now sends all parameters at once, allowing to check all the configuration space.
4. Minor documentation cleanup (added missed "reserved" fields)

Changes since v1:

1. Changed protocol version definition from string to integer, so it can easily be used in comparisons.
Konrad, I have removed your r-b tag for the reason of this change.

2. In order to provide explicit stream parameter negotiation between backend and frontend the following changes are introduced in the protocol:
add XENSND_OP_HW_PARAM_QUERY request to read/update configuration space for the parameter given: request passes desired parameter interval (mask) and the response to this request returns min/max interval (mask) for the parameter to be used.

Parameters supported by this request/response:
- format mask
- sample rate interval
- number of channels interval
- buffer size, interval, frames
- period size, interval, frames

Oleksandr Andrushchenko (5):
sndif: Introduce protocol version
sndif: Fix missed "reserved" fields in comments
sndif: Make requests and responses 64 octets long
sndif: Add explicit back and front synchronization
sndif: Add explicit back and front parameter negotiation

Quoted 6 lines
Quoted 3 lines
  xen/include/public/io/sndif.h | 322 +++++++++++++++++++++++++++++++++++++++---
  1 file changed, 306 insertions(+), 16 deletions(-)

With Konrad's ack you can have my:

Thank you

Quoted 3 lines

even if the commit can't be done before the freeze. The header isn't used inside Xen so the risk for the release is zero.

This is true

Quoted 2 lines

Juergen

Thank you,
Oleksandr

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel