Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751940AbdHGNLw (ORCPT ); Mon, 7 Aug 2017 09:11:52 -0400 Received: from webclient5.webclient5.de ([136.243.32.179]:35291 "EHLO webclient5.webclient5.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751247AbdHGNLv (ORCPT ); Mon, 7 Aug 2017 09:11:51 -0400 Subject: Re: [alsa-devel] [PATCH 08/11] ALSA: vsnd: Add timer for period interrupt emulation To: Oleksandr Andrushchenko Cc: alsa-devel@alsa-project.org, xen-devel@lists.xen.org, linux-kernel@vger.kernel.org, Oleksandr Andrushchenko , tiwai@suse.com References: <1502091796-14413-1-git-send-email-andr2000@gmail.com> <1502091796-14413-9-git-send-email-andr2000@gmail.com> From: Clemens Ladisch Message-ID: <4ce45eec-8657-66c4-c8c7-b851250da46a@ladisch.de> Date: Mon, 7 Aug 2017 15:11:49 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=us-ascii Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 846 Lines: 25 Oleksandr Andrushchenko wrote: > On 08/07/2017 01:27 PM, Clemens Ladisch wrote: >> You have to implement period interrupts (and the .pointer callback) >> based on when the samples are actually moved from/to the backend. > > Do you think I can implement this in a slightly different way, > without a timer at all, by updating > substream->runtime->hw_ptr_base explicitly in the frontend driver? As far as I am aware, hw_ptr_base is an internal field that drivers are not supposed to change. Just use your own variable, and return it from the .pointer callback. > So, that way, whenever I get an ack/response from the backend that it has > successfully played the buffer That response should come after every period. How does that interface work? Is it possible to change the period size, or at least to detect what it is? Regards, Clemens