All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleksandr Andrushchenko <andr2000@gmail.com>
To: alsa-devel@alsa-project.org, xen-devel@lists.xenproject.org
Cc: andr2000@gmail.com,
	Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Subject: [PATCH 0/2] sndif: add explicit back and front synchronization
Date: Mon,  5 Feb 2018 10:24:58 +0200	[thread overview]
Message-ID: <1517819100-1029-1-git-send-email-andr2000@gmail.com> (raw)

From: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>

Hi, all!

Foreword
========

This change is aimed to add support for explicit back and front
synchronization during playback and capture in response to comments
raised during upstream attempt of the para-virtualized sound frontend
driver for Xen [1], [2] and gather opinions from the relevant communities
(ALSA, Xen) on the change.

The relevant backend is implemented as a user-space application [3]
and uses accompanying helper library [4].

Both frontend driver and backend were tested on real HW running Xen hypervisor
(Renesas R-Car ARM based H3/M3 boards, x86) to make sure the proposed
solution does work.

Rationale
=========

During the first attempt to upstream the Linux front driver [5] number
of comments and concerns were raised, one of the biggest flaws in the
design were questioned by both Clemens Ladisch [6] and
Takashi Sakamoto [7]: the absence of synchronization between frontend
and backend during capture/playback. Two options were discussed:

“In design of ALSA PCM core, drivers are expected to synchronize to
actual hardwares for semi-realtime data transmission. The
synchronization is done by two points:
1) Interrupts to respond events from actual hardwares.
2) Positions of actual data transmission in any serial sound interfaces
    of actual hardwares.
“

and finally a change to the existing protocol was suggested:

“In 'include/xen/interface/io/sndif.h', there's no functionalities I
described the above:
1. notifications from DomU to Dom0 about the size of period for
    interrupts from actual hardwares. Or no way from Dom0 to DomU about
    the configured size of the period.
2. notifications of the interrupts from actual hardwares to DomU.”

This is implemented as a change to the sndif protocol and allows removing
period emulation:
1. Introduced a new event channel from back to front
2. New event with number of bytes played/captured (XENSND_EVT_CUR_POS,
   to be used for sending snd_pcm_period_elapsed at frontend (in Linux
   implementation). Sent in bytes, not frames to make the protocol
   generic and consistent)
3. New request for playback/capture control (XENSND_OP_TRIGGER) with
   start/pause/stop/resume sub-ops
4. Playback/capture buffer size is set on the backend side via
   XENSND_FIELD_BUFFER_SIZE XenStore entry

Waiting for your valuable comments,

Thank you,
Oleksandr

[1] https://github.com/andr2000/linux/commits/snd_upstream_v1
[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/xen/interface/io/sndif.h
[3] https://github.com/xen-troops/snd_be
[4] https://github.com/xen-troops/libxenbe
[5] https://lkml.org/lkml/2017/8/7/363
[6] http://mailman.alsa-project.org/pipermail/alsa-devel/2017-August/123617.html
[7] http://mailman.alsa-project.org/pipermail/alsa-devel/2017-August/123744.html


Oleksandr Andrushchenko (2):
  sndif: introduce protocol version
  sndif: add explicit back and front synchronization

 xen/include/public/io/sndif.h | 173 +++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 170 insertions(+), 3 deletions(-)

-- 
2.7.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

             reply	other threads:[~2018-02-05  8:24 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-05  8:24 Oleksandr Andrushchenko [this message]
2018-02-05  8:24 ` [PATCH 1/2] sndif: introduce protocol version Oleksandr Andrushchenko
2018-03-01 22:12   ` Konrad Rzeszutek Wilk
2018-03-01 22:12   ` [Xen-devel] " Konrad Rzeszutek Wilk
2018-02-05  8:25 ` [PATCH 2/2] sndif: add explicit back and front synchronization Oleksandr Andrushchenko
2018-03-01 22:11   ` Konrad Rzeszutek Wilk
2018-03-01 22:11   ` [Xen-devel][PATCH " Konrad Rzeszutek Wilk
2018-03-02  6:30     ` [PATCH " Oleksandr Andrushchenko
2018-03-02  6:30     ` [Xen-devel][PATCH " Oleksandr Andrushchenko
2018-02-19  6:31 ` [Xen-devel][PATCH 0/2] " Oleksandr Andrushchenko
2018-02-19  6:31 ` [PATCH " Oleksandr Andrushchenko
2018-03-01  6:29 ` Oleksandr Andrushchenko
2018-03-01  6:29 ` [Xen-devel][PATCH " Oleksandr Andrushchenko
2018-03-02 16:52 ` Oleksandr Andrushchenko
2018-03-02 16:52 ` [PATCH " Oleksandr Andrushchenko
2018-03-06 10:52 ` [alsa-devel] " Takashi Iwai
2018-03-06 10:52 ` [Xen-devel][PATCH " Takashi Iwai
2018-03-06 11:25   ` Oleksandr Andrushchenko
2018-03-06 11:32     ` [alsa-devel] [PATCH " Takashi Iwai
2018-03-06 11:32     ` [Xen-devel][PATCH " Takashi Iwai
2018-03-06 12:05       ` Oleksandr Andrushchenko
2018-03-06 12:52         ` [alsa-devel] [PATCH " Takashi Iwai
2018-03-06 12:52         ` [Xen-devel][PATCH " Takashi Iwai
2018-03-06 13:30           ` [alsa-devel] [PATCH " Oleksandr Andrushchenko
2018-03-06 13:30           ` [Xen-devel][PATCH " Oleksandr Andrushchenko
2018-03-06 13:48             ` [alsa-devel] [PATCH " Takashi Iwai
2018-03-06 13:48             ` [Xen-devel][PATCH " Takashi Iwai
2018-03-06 14:13               ` Oleksandr Andrushchenko
2018-03-06 14:27                 ` Takashi Iwai
2018-03-06 14:48                   ` [alsa-devel] [PATCH " Oleksandr Andrushchenko
2018-03-06 14:48                   ` [Xen-devel][PATCH " Oleksandr Andrushchenko
2018-03-06 15:06                     ` [alsa-devel] [PATCH " Takashi Iwai
2018-03-06 15:06                     ` [Xen-devel][PATCH " Takashi Iwai
2018-03-06 16:04                       ` Oleksandr Andrushchenko
2018-03-06 16:30                         ` [alsa-devel] [PATCH " Takashi Iwai
2018-03-06 16:30                         ` [Xen-devel][PATCH " Takashi Iwai
2018-03-07  8:49                           ` Oleksandr Andrushchenko
2018-03-11  8:15                             ` Takashi Iwai
2018-03-12  6:26                               ` Oleksandr Andrushchenko
2018-03-13 11:49                                 ` Oleksandr Andrushchenko
2018-03-13 16:31                                   ` [alsa-devel] [PATCH " Takashi Iwai
2018-03-13 16:31                                   ` [Xen-devel][PATCH " Takashi Iwai
2018-03-13 17:31                                     ` [alsa-devel] [PATCH " Oleksandr Andrushchenko
2018-03-13 17:31                                     ` [Xen-devel][PATCH " Oleksandr Andrushchenko
2018-03-13 18:48                                       ` Takashi Iwai
2018-03-14  7:32                                         ` Oleksandr Andrushchenko
2018-03-14  7:32                                         ` [alsa-devel] [PATCH " Oleksandr Andrushchenko
2018-03-13 18:48                                       ` Takashi Iwai
2018-03-13 11:49                                 ` Oleksandr Andrushchenko
2018-03-12  6:26                               ` Oleksandr Andrushchenko
2018-03-11  8:15                             ` Takashi Iwai
2018-03-07  8:49                           ` Oleksandr Andrushchenko
2018-03-06 16:04                       ` Oleksandr Andrushchenko
2018-03-06 14:27                 ` Takashi Iwai
2018-03-06 14:13               ` Oleksandr Andrushchenko
2018-03-06 12:05       ` Oleksandr Andrushchenko
2018-03-06 11:25   ` Oleksandr Andrushchenko

Reply instructions:

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

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

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

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

  git send-email \
    --in-reply-to=1517819100-1029-1-git-send-email-andr2000@gmail.com \
    --to=andr2000@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=oleksandr_andrushchenko@epam.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

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

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