From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965203AbdKQII4 (ORCPT ); Fri, 17 Nov 2017 03:08:56 -0500 Received: from mail-lf0-f54.google.com ([209.85.215.54]:34562 "EHLO mail-lf0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965031AbdKQIIr (ORCPT ); Fri, 17 Nov 2017 03:08:47 -0500 X-Google-Smtp-Source: AGs4zMbIOSkCVXPAm1Nby1vC+eh8eUZyxxZREXf5vFz/lXPbz/PtpRf04c7LhmyTNDfE7joHKV/6qw== Subject: Re: [Xen-devel] [RFC v1] ALSA: xen-front: Add Xen para-virtualized frontend driver To: Oleksandr Andrushchenko , tiwai@suse.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, xen-devel , Clemens Ladisch , Takashi Sakamoto , Konrad Rzeszutek Wilk References: From: Oleksandr Andrushchenko Message-ID: <172d2f40-937d-5455-1b4e-576ac7b0da45@gmail.com> Date: Fri, 17 Nov 2017 10:08:43 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ping On 11/02/2017 03:11 PM, Oleksandr Andrushchenko wrote: > Hi, all! > > Foreword > ======== > > This RFC is aimed to introduce support of para-virtualized sound frontend > driver for Xen [1] and gather opinions from the relevant communities > (ALSA, Xen). It implements the protocol from [2] with the > following limitations: >   - mute/unmute is not supported >   - get/set volume is not supported > Volume control is not supported for the reason that most of the use-cases > (at the moment) are based on scenarios where unprivileged OS > (e.g. Android, AGL etc) uses software mixers. > Both capture and playback are supported. > > 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). > > Discussion > ========== > > During the first attempt to upstream the 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 [8] 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. > > Along with these changes other comments on the driver were addressed, > e.g. split into smaller chunks, moved the driver from misc to xen etc. > > > Hope, this helps to get the full picture of what was discussed and > makes it > possible to move forward. > > 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 > [8] > https://github.com/andr2000/linux/commit/095d7feae00bf00c852c67c4f1044de5601678ed > > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > https://lists.xen.org/xen-devel