Received: by 10.192.165.156 with SMTP id m28csp296155imm; Sun, 15 Apr 2018 23:32:44 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/F1ZSrD47fXxDq61QDnx+jeMzvYrvwuXzVIZZcKnKNt/7A8U3WmcgiG5CdaX9eF30a8gmR X-Received: by 10.99.103.67 with SMTP id b64mr12096822pgc.14.1523860364324; Sun, 15 Apr 2018 23:32:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523860364; cv=none; d=google.com; s=arc-20160816; b=WwFk9h8JvxJudRAQ8DSzN03tLBUdHJVt+TmSZFWu/aIFdaZrOL7vc3jea1sLt4UBWS hcsW9IMqZcj8ZtyidvwLTbkmgCPxVpWGqV7wn2vHx9W81BNPaw/xVVbGfC3n0VerOC7R hlk12+xAFB+x6P/l7eclZBTB7wmDtVkwMQjfGOhOl3a41FfZnmjNMWQVr7xzKlV0rbBn Gn5Ge31nRAB7hbssbaMZw5hVeCVFr1uHJjjlLHE3yQXdCC+ySqILYhkwUvkZAVDnwuP1 7UZajQIC6BYvD7jLwb1OpvV5GIzOUeVJk2FRynwDp+3Eq9sDAKG9gvcT8qN4t80Bksmt uCfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=rW5+91JHSh1/1qmqdFiZs0f5LRFp9kh1A28Ifi6vegM=; b=EKtky3coVS+05AohyxX7gU7EdI6dZWiZf9VD0hG0EmkxrgsCcTwoPENZUDehNTlTKa XqYOWjtHt9o7se0uh0bgBHFNXEyFZSUS/b2nX69vN4Q188h5rBDQdt904WMjK/BbVFRf 4+NPcVYvwhlFQaQ/VmwEIMjM+SAkWgRVDx94+ItAJ4mAahMpcANRgk8JkREnQnoJXwCO CXO11QPM94dH/+RGpsI3vfh9bBU1JQNIFjWbkuPieOUExUby4uCxP5XsHbk5FTqP74Vv rwlFrDG1NkZcfduSHBoLOfvaK4nr+LyP2MN9sVk3pnEw+c244mcdoHJ/ovE2zMF1WnrG fwNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JjRJUmhC; 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=QUARANTINE 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 n7si9076334pga.199.2018.04.15.23.32.30; Sun, 15 Apr 2018 23:32:44 -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=JjRJUmhC; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753435AbeDPGZH (ORCPT + 99 others); Mon, 16 Apr 2018 02:25:07 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:37038 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751341AbeDPGZG (ORCPT ); Mon, 16 Apr 2018 02:25:06 -0400 Received: by mail-lf0-f67.google.com with SMTP id b23-v6so1380972lfg.4 for ; Sun, 15 Apr 2018 23:25:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=rW5+91JHSh1/1qmqdFiZs0f5LRFp9kh1A28Ifi6vegM=; b=JjRJUmhCQO4i1WJFDYqE/hl0/XdQDlJhTxZ+ho1S7eHMoqvaq7iieacY2E7lzTyhcO fJiG5pV2hVE3s+8FokFrTXUIwBQljXNe+V29RyITcTbToX7YCX8mp6LNiGTDLrQfgG3n Vx5mXMSAJQHI/XMWGdEp1yzy7ORGEvcaw2lsR279ywAjs8i4fEwu+at6q1UlTNiqn7iq nJG+uHo/CZVtQ5GSYNqneL/Ku/3v90bzbCDy46eUeoeL69CePl81ahXfWL6IkFeoBxX/ HExFe9xYcR+LhgjKlx5xIPNKYyPYKSTB66YMDVOdsIwQ5K49XCPOZNnwGGvjuit3hiRn o0sQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=rW5+91JHSh1/1qmqdFiZs0f5LRFp9kh1A28Ifi6vegM=; b=jpYgNVZ+rqtqx38vGK8ES1IgP8gf2PHlgvuzPLyC7oKgmmikOn1UaGVzkkc2iSv12s ek8p7W8ESkGnH4bi8m0J/NkMWa3Cbm4K3S5wi016TruUla3Gw7D6cG6kZaYcVJiUcOa8 GFf3mcpAJX5u/TRZm4OXwh9YgJJwZSHGc4LvRJdccbGM9F7naO3oHJxTRmpcoruF8M5s crE1bjtSf5KbI/ZhLAphbQ7+8wE2p5gtt2+3BBnadwHrF8S5Ojtr5YEX3sHG6XWxLavg fUDuCytiVRKzHmrTlXp8kekInBNalMMq0+wb8psRn4qY9tX61QKhq4UOykwFFPBhNl1S FbGw== X-Gm-Message-State: ALQs6tCu+/Ph6buykwL7ju544gdOfkfH4UV1YmnPC1z7o4GQRbjm1+iN 2ZAA+QqxHYMNsZiRgLVVCNs= X-Received: by 10.46.154.9 with SMTP id o9mr8872438lji.98.1523859904545; Sun, 15 Apr 2018 23:25:04 -0700 (PDT) Received: from a2k-HP-ProDesk-600-G2-SFF.kyiv.epam.com (ll-74.141.223.85.sovam.net.ua. [85.223.141.74]) by smtp.gmail.com with ESMTPSA id x18sm2060357ljc.22.2018.04.15.23.25.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 15 Apr 2018 23:25:03 -0700 (PDT) From: Oleksandr Andrushchenko To: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, jgross@suse.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com, perex@perex.cz, tiwai@suse.com Cc: andr2000@gmail.com, Oleksandr Andrushchenko Subject: [PATCH v2 0/5] ALSA: xen-front: Add Xen para-virtualized frontend driver Date: Mon, 16 Apr 2018 09:24:48 +0300 Message-Id: <20180416062453.24743-1-andr2000@gmail.com> X-Mailer: git-send-email 2.16.2 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Oleksandr Andrushchenko Please note: this patch series depends on [3]. This patch series adds support for Xen [1] para-virtualized sound frontend driver. It implements the protocol from include/xen/interface/io/sndif.h 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 scenarious where unprivileged OS (e.g. Android, AGL etc) use software mixers. Both capture and playback are supported. Corresponding backend, implemented as a user-space application, can be found at [2]. Thank you, Oleksandr Changes since v1: ***************** 1. Moved driver from sound/drivers to sound/xen 2. Coding style changes to better meet Linux Kernel 3. Added explicit back and front synchronization 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 4. Added explicit back and front parameter negotiation 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 parameters given: request passes desired parameter's intervals/masks and the response to this request returns allowed min/max intervals/masks to be used. [1] https://xenproject.org/ [2] https://github.com/xen-troops/snd_be [3] https://lkml.org/lkml/2018/4/12/522 Oleksandr Andrushchenko (5): ALSA: xen-front: Introduce Xen para-virtualized sound frontend driver ALSA: xen-front: Read sound driver configuration from Xen store ALSA: xen-front: Implement Xen event channel handling ALSA: xen-front: Implement handling of shared buffers ALSA: xen-front: Implement ALSA virtual sound driver sound/Kconfig | 2 + sound/Makefile | 2 +- sound/xen/Kconfig | 10 + sound/xen/Makefile | 9 + sound/xen/xen_snd_front.c | 410 +++++++++++++++++++ sound/xen/xen_snd_front.h | 57 +++ sound/xen/xen_snd_front_alsa.c | 830 ++++++++++++++++++++++++++++++++++++++ sound/xen/xen_snd_front_alsa.h | 23 ++ sound/xen/xen_snd_front_cfg.c | 517 ++++++++++++++++++++++++ sound/xen/xen_snd_front_cfg.h | 46 +++ sound/xen/xen_snd_front_evtchnl.c | 478 ++++++++++++++++++++++ sound/xen/xen_snd_front_evtchnl.h | 92 +++++ sound/xen/xen_snd_front_shbuf.c | 193 +++++++++ sound/xen/xen_snd_front_shbuf.h | 36 ++ 14 files changed, 2704 insertions(+), 1 deletion(-) create mode 100644 sound/xen/Kconfig create mode 100644 sound/xen/Makefile create mode 100644 sound/xen/xen_snd_front.c create mode 100644 sound/xen/xen_snd_front.h create mode 100644 sound/xen/xen_snd_front_alsa.c create mode 100644 sound/xen/xen_snd_front_alsa.h create mode 100644 sound/xen/xen_snd_front_cfg.c create mode 100644 sound/xen/xen_snd_front_cfg.h create mode 100644 sound/xen/xen_snd_front_evtchnl.c create mode 100644 sound/xen/xen_snd_front_evtchnl.h create mode 100644 sound/xen/xen_snd_front_shbuf.c create mode 100644 sound/xen/xen_snd_front_shbuf.h -- 2.16.2