From 1cee559351a7cb57b405554bac10a6f33c28ed09 Mon Sep 17 00:00:00 2001 From: Oleksandr Andrushchenko Date: Mon, 14 May 2018 09:27:41 +0300 Subject: ALSA: xen-front: Implement ALSA virtual sound driver Implement essential initialization of the sound driver: - introduce required data structures - handle driver registration - handle sound card registration - register sound driver on backend connection - remove sound driver on backend disconnect Initialize virtual sound card with streams according to the Xen store configuration. Implement ALSA driver operations including: - manage frontend/backend shared buffers - manage Xen bus event channel states Implement requests from front to back for ALSA PCM operations. - report ALSA period elapsed event: handle XENSND_EVT_CUR_POS notifications from the backend when stream position advances during playback/capture. The event carries a value of how many octets were played/captured at the time of the event. - implement explicit stream parameter negotiation between backend and frontend: handle XENSND_OP_HW_PARAM_QUERY request to read/update configuration space for the parameter given: request passes desired parameter interval and the response to this request returns min/max interval for the parameter to be used. Signed-off-by: Oleksandr Andrushchenko Signed-off-by: Takashi Iwai --- sound/xen/xen_snd_front_evtchnl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sound/xen/xen_snd_front_evtchnl.c') diff --git a/sound/xen/xen_snd_front_evtchnl.c b/sound/xen/xen_snd_front_evtchnl.c index 1faafff08807..d70a62e7f910 100644 --- a/sound/xen/xen_snd_front_evtchnl.c +++ b/sound/xen/xen_snd_front_evtchnl.c @@ -14,6 +14,7 @@ #include #include "xen_snd_front.h" +#include "xen_snd_front_alsa.h" #include "xen_snd_front_cfg.h" #include "xen_snd_front_evtchnl.h" @@ -118,7 +119,8 @@ static irqreturn_t evtchnl_interrupt_evt(int irq, void *dev_id) switch (event->type) { case XENSND_EVT_CUR_POS: - /* Do nothing at the moment. */ + xen_snd_front_alsa_handle_cur_pos(channel, + event->op.cur_pos.position); break; } } -- cgit