Received: by 10.223.164.221 with SMTP id h29csp3365516wrb; Tue, 3 Oct 2017 23:52:33 -0700 (PDT) X-Received: by 10.98.16.80 with SMTP id y77mr19300567pfi.261.1507099953367; Tue, 03 Oct 2017 23:52:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507099953; cv=none; d=google.com; s=arc-20160816; b=TxEiu4dBcbIB0Ip+STDYaAVcpPENOSoCLFUgLvwATcLy6pHHCv+taln4xGf3KgELlm z+n/0oEyP8mQ1KPY65n6LtEre/QDx4E5LvLJwkHNQvyRXOa9N2L/dLvdO0Q9vSSv4Ucn aubcJ4SVjGp7z6JEnOtFvu1G4M/lG98GrpDC03/r9Mbens5ieacUMx9RhbqGKIzRXfJ9 bT97xrldXFNdkrsGLxeIgspjPwne59TEN//bV6xPXItxPZ12NyjyFCGAvsjBJ/J7ymId hvri3rZaJwiOy6KyL6+0nvycGBj4N/jWiPEkXjXIh0T3pKOzU2UGBQCTNv4ZJqLPrzrx 5beQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:from:subject:dkim-signature :arc-authentication-results; bh=5weNvyw/15l7BSFwWmv2hq5OR3WD54SxrdFEpd2HpnI=; b=LbJ8uc5vuOWGAKrIGkCIscXQTeYWe9CSSgESfy+mLc8MhgZi5CxqDylKTK87qKKjLF 7rC/rpjEhQ/bUVKxeEtcvTr9HLbnw5YTI1Kr58omlUPfnXKzlK5OHJyjUEb6u22+3WtD pVY3F9ZEtohZ9hbduIMDqLInnQ2vdqykujo3CWRbXszGMOCSgS++Y9YY0+ahbbqyG6b+ x1TnvH893AfD0eRRvGQAIeS1ufJ7+b4m9fpOIYkxs3H/Z02CFIL9I7v+1RsRiVSJrVvC Y+QpHmSbjCTSQnQboSQThZAyi42hII+jh8GoI5kn8xHcnjhaqKzV3KdFm3ltopbjCdlH snTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mlCYMMrs; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g126si10793793pgc.454.2017.10.03.23.52.19; Tue, 03 Oct 2017 23:52:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mlCYMMrs; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751566AbdJDGuU (ORCPT + 99 others); Wed, 4 Oct 2017 02:50:20 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:44814 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750871AbdJDGuR (ORCPT ); Wed, 4 Oct 2017 02:50:17 -0400 Received: by mail-lf0-f67.google.com with SMTP id l196so12258805lfl.1 for ; Tue, 03 Oct 2017 23:50:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=5weNvyw/15l7BSFwWmv2hq5OR3WD54SxrdFEpd2HpnI=; b=mlCYMMrsCFxkHjYzbxcY2XSe/VoOl8Qb0JNO0vUccTAOnxpHuCnNjMEC3LgQKwT2zF GHSQwQrlLbeKY26lGWdYHNpiv+P1KLeKwGPnimoeBN/osavnrz6pmZlxvS19HbziAaiE 1rGHfDa8FsdHAYAOYGZOBtU/VcITIjneocycGpeMdwdu6DvCxJc/vc1h0k2i1GDzZ9PY SM3igm+O3BJZOH7DjYxSjxXrBAqJfPtpTbbkBYlxhjRxt7Y4ho3+61FNhzy9dOlzFbg2 jVMI+Z/bbBBEfoipiWF2X6EkfRlSQvQpRFndQNfe56Ki4sq97r0vf3ehnE366kBnEb57 I+IQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=5weNvyw/15l7BSFwWmv2hq5OR3WD54SxrdFEpd2HpnI=; b=RlknN4+Kzos7Y8uH4eFDEog28ycJpyOHGm6U03hiqrE1svjouuiBp0k8HJW/MtYOnl hbJfBRLsX1ARtWiasR1/8HwAO62afFilOTxwsPnrKAI+cM/Ae6xnCaxTsO67pai7TC7r 8air6gJ4f0IMLZifvJDd66oxouLmj1ugN+B2g7j6DyFYGzekRVI0d1Cz1Jqg5EeAwQYe D4buEwE2crntWN6Tu0fHY2ltWHSI2wTEfvdKjCq0JRRQFNcoxntxFAzi6eoPVdxoGkRS x+5EQbfDRIwhe0NDdLCDpk4xQne7EJRTh9R7gM4kYHMln4LXF6ABbmFtwXZlLmax70Jf 2JGA== X-Gm-Message-State: AMCzsaW+XO1GiPObQUwLQ1sEWf4gbS/EQgUNwr09c+VnAjAZPy4Tkl9c RKCVXOtBIvJSoxopav34BJs= X-Google-Smtp-Source: AOwi7QCudx1lXZwL0yZTJ7X/QuEH4nSn0IuwadUat7EndKeqhWsaTPKArBUGOr94TPI5dWsA2MVEhQ== X-Received: by 10.25.225.133 with SMTP id l5mr1099508lfk.209.1507099815688; Tue, 03 Oct 2017 23:50:15 -0700 (PDT) Received: from [10.17.182.9] (ll-51.209.223.85.sovam.net.ua. [85.223.209.51]) by smtp.gmail.com with ESMTPSA id d21sm2311306lfj.16.2017.10.03.23.50.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Oct 2017 23:50:14 -0700 (PDT) Subject: Re: [alsa-devel] [PATCH RESEND1 00/12] ALSA: vsnd: Add Xen para-virtualized frontend driver From: Oleksandr Andrushchenko To: Oleksandr Grytsov , Clemens Ladisch , Takashi Sakamoto , tiwai@suse.com Cc: alsa-devel@alsa-project.org, Oleksandr Andrushchenko , linux-kernel@vger.kernel.org, xen-devel@lists.xen.org, Oleksandr Grytsov References: <1502108577-8099-1-git-send-email-andr2000@gmail.com> <7e62a406-7dcd-b5c9-b2de-ea52e1d2afd0@sakamocchi.jp> <2a2fd222-fc54-1709-bfc8-a530efc3f307@gmail.com> <3f8e535b-8607-6b15-6e17-da755a06cc1e@sakamocchi.jp> <3fde10f8-4727-e37b-8001-ce2356fffb2b@sakamocchi.jp> <162b7251-4040-c61f-1fcd-c32f65bd3c67@gmail.com> <8542f293-f2d0-9ba3-7082-967b32fcec17@ladisch.de> <5421f97e-cd7a-dd22-7557-b0fc25899c1b@gmail.com> Message-ID: <232329e2-893f-d40a-3543-062098338bc2@gmail.com> Date: Wed, 4 Oct 2017 09:50:12 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <5421f97e-cd7a-dd22-7557-b0fc25899c1b@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org gentle reminder On 09/26/2017 02:35 PM, Oleksandr Andrushchenko wrote: > Clemens, Sakamoto-san, > > could you please review the below if you by chance have a minute? > > Thank you, > Oleksandr > > On 09/19/2017 11:57 AM, Oleksandr Andrushchenko wrote: >> Hi, all! >> >> We did some work on implementing the idea with >> >> feedback events from the backend to the frontend. >> >> Please see attached the changes to the existing sndif protocol [1]: >> >> 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. >> >> 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. >> >> The implementation we have showed that this is sufficient to >> successfully play/capture w/o using emulated interrupts. >> >> Clemens, Sakamoto-san, >> could you please review the changes and confirm that these are ok to >> be upstreamed to the sndif protocol and are enough for the frontend >> driver we want to upstream (we have it implemented, just need to make >> sure the general approach is accepted by the ALSA community). >> >> Thank you very much for your time, >> Oleksandr Andrushchenko >> Oleksandr Grytsov >> >> [1] >> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/xen/interface/io/sndif.h?h=v4.14-rc1 >> >> On 09/12/2017 10:52 AM, Oleksandr Grytsov wrote: >>> On Tue, Sep 5, 2017 at 10:24 AM, Clemens Ladisch >>> wrote: >>>> Oleksandr Andrushchenko wrote: >>>>>>> We understand that emulated interrupt on the frontend side is >>>>>>> completely not >>>>>>> acceptable >>>> Allow me to expand on that:  Proper synchronization requires that the >>>> exact position is communicated, not estimated.  Just because the >>>> nominal >>>> rate of the stream is known does not imply that you know the actual >>>> rate. >>>> Forget for the moment that there even is a nominal rate; assume >>>> that it >>>> works like, e.g., a storage controller, and that you can know that >>>> a DMA >>>> buffer was consumed by the device only after it has told you. >>>> >>>> It's possible and likely that there is a latency when reporting the >>>> stream position, but that is still better than guessing what the DMA >>>> is doing.  (You would never just try to guess when writing data to >>>> disk, would you?) >>>> >>>>>>> and definitely we need to provide some feedback mechanism from >>>>>>> Dom0 to DomU. >>>>>>> >>>>>>> In our case it is technically impossible to provide precise >>>>>>> period interrupt >>>>>>> (mostly because our backend is a user space application). >>>> As far as I can see, all audio APIs (ALSA, PulseAudio, etc.) have >>>> poll() >>>> or callbacks or similar mechanisms to inform you when new data can be >>>> written, and always allow to query the current position. >>>> >>>>> [...] >>>>> ok, so the main concern here is that we cannot properly >>>>> synchronize Dom0-DomU. >>>>> If we put this apart for a second are there any other concerns on >>>>> having ALSA >>>>> frontend driver? If not, can we have the driver with timer >>>>> implementation upstreamed >>>>> as experimental until we have some acceptable synchronization >>>>> solution? >>>>> This will allow broader audience to try and feel the solution and >>>>> probably contribute? >>>> I doubt that the driver architecture will stay completely the same, >>>> so I >>>> do not think that this experimental driver would demonstrate how the >>>> solution would feel. >>>> >>>> As the first step, I would suggest creating a driver with proper >>>> synchronization, even if it has high latency.  Reducing the latency >>>> would then be 'just' an optimization. >>>> >>>> >>>> Regards, >>>> Clemens >>> Definitely feedback from the backend side is required. Currently >>> we are working on synchronized version on the backend >>> and frontend side. We will be back once we have the solution. >>> >>> Thanks. >> > From 1579616178729020255@xxx Tue Sep 26 15:22:59 +0000 2017 X-GM-THRID: 1575057680710293570 X-Gmail-Labels: Inbox,Category Forums