All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleksandr Andrushchenko <andr2000@gmail.com>
To: Clemens Ladisch <clemens@ladisch.de>
Cc: alsa-devel@alsa-project.org,
	Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
	tiwai@suse.com, linux-kernel@vger.kernel.org,
	xen-devel@lists.xen.org
Subject: Re: [alsa-devel] [PATCH 08/11] ALSA: vsnd: Add timer for period interrupt emulation
Date: Mon, 7 Aug 2017 16:38:06 +0300	[thread overview]
Message-ID: <45738e58-7ed2-8315-8d9c-138c3d3a2ecc__45653.4850098707$1502113170$gmane$org@gmail.com> (raw)
In-Reply-To: <4ce45eec-8657-66c4-c8c7-b851250da46a@ladisch.de>

On 08/07/2017 04:11 PM, Clemens Ladisch wrote:
> 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.
I know that and always considered not a good solution,
this is why I have timer to emulate things
> Just use your own variable, and return it from the .pointer callback.
this can work, but see below
>> 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?
For the buffer received in .copy_user/.copy_kernel we send
a request to the backend and get response back (async) when it has copied
the bytes into HW/mixer/etc, so the buffer at frontend side can be reused.
So, the amount of bytes in this exchange is not necessarily
a multiply of the period. Also, there is no way to synchronize period
sizes in the front driver and backend to make those equal.
There is also no event from the backend in the
protocol to tell that the period has elapsed, so
sending data in period's size buffers will not probably
help because of possible underruns
>   Is it possible to change the period size,
> or at least to detect what it is?

Unfortunately no, this is not in the protocol.

>
>
> Regards,
> Clemens
you can see the protocol at [1]

Thank you,
Oleksandr

[1] 
https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git/tree/include/xen/interface/io/sndif.h?h=for-next

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2017-08-07 13:38 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-07  7:43 [PATCH 00/11] ALSA: vsnd: Add Xen para-virtualized frontend driver Oleksandr Andrushchenko
2017-08-07  7:43 ` [PATCH 01/11] ALSA: vsnd: Implement driver's probe/remove Oleksandr Andrushchenko
2017-08-07  7:43   ` Oleksandr Andrushchenko
2017-08-07  7:43 ` [PATCH 02/11] ALSA: vsnd: Implement Xen bus state handling Oleksandr Andrushchenko
2017-08-07  7:43 ` Oleksandr Andrushchenko
2017-08-07  7:43 ` [PATCH 03/11] ALSA: vsnd: Read sound driver configuration from Xen store Oleksandr Andrushchenko
2017-08-07  7:43   ` Oleksandr Andrushchenko
2017-08-07  7:43 ` [PATCH 04/11] ALSA: vsnd: Implement Xen event channel handling Oleksandr Andrushchenko
2017-08-07  7:43   ` Oleksandr Andrushchenko
2017-08-07  7:43 ` [PATCH 05/11] ALSA: vsnd: Implement handling of shared buffers Oleksandr Andrushchenko
2017-08-07  7:43   ` Oleksandr Andrushchenko
2017-08-07  7:43 ` [PATCH 06/11] ALSA: vsnd: Introduce ALSA virtual sound driver Oleksandr Andrushchenko
2017-08-07  7:43 ` Oleksandr Andrushchenko
2017-08-07  7:43 ` [PATCH 07/11] ALSA: vsnd: Initialize virtul sound card Oleksandr Andrushchenko
2017-08-07  7:43   ` Oleksandr Andrushchenko
2017-08-07  7:43 ` [PATCH 08/11] ALSA: vsnd: Add timer for period interrupt emulation Oleksandr Andrushchenko
2017-08-07  7:43   ` Oleksandr Andrushchenko
2017-08-07 10:27   ` [alsa-devel] " Clemens Ladisch
2017-08-07 10:27   ` Clemens Ladisch
2017-08-07 10:27     ` Clemens Ladisch
2017-08-07 11:30     ` [alsa-devel] " Oleksandr Andrushchenko
2017-08-07 11:30     ` Oleksandr Andrushchenko
2017-08-07 13:11       ` Clemens Ladisch
2017-08-07 13:38         ` Oleksandr Andrushchenko [this message]
2017-08-07 13:38         ` Oleksandr Andrushchenko
2017-08-07 13:55           ` Clemens Ladisch
2017-08-07 13:55           ` Clemens Ladisch
2017-08-07 15:14             ` Oleksandr Andrushchenko
2017-08-08  6:09               ` Oleksandr Andrushchenko
2017-08-08  6:09               ` Oleksandr Andrushchenko
2017-08-07 15:14             ` Oleksandr Andrushchenko
2017-08-07 13:11       ` Clemens Ladisch
2017-08-07  7:43 ` [PATCH 09/11] ALSA: vsnd: Implement ALSA PCM operations Oleksandr Andrushchenko
2017-08-07  7:43 ` Oleksandr Andrushchenko
2017-08-07  7:43 ` [PATCH 10/11] ALSA: vsnd: Implement communication with backend Oleksandr Andrushchenko
2017-08-07  7:43   ` Oleksandr Andrushchenko
2017-08-07  7:43 ` [PATCH 11/11] ALSA: vsnd: Introduce Kconfig option to enable Xen PV sound Oleksandr Andrushchenko
2017-08-07  7:43 ` Oleksandr Andrushchenko
2017-08-07 11:28 ` [PATCH 00/11] ALSA: vsnd: Add Xen para-virtualized frontend driver Takashi Sakamoto
2017-08-07 11:28   ` Takashi Sakamoto
2017-08-07 11:33   ` Oleksandr Andrushchenko
2017-08-07 11:33   ` Oleksandr Andrushchenko
2017-08-07 11:28 ` Takashi Sakamoto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='45738e58-7ed2-8315-8d9c-138c3d3a2ecc__45653.4850098707$1502113170$gmane$org@gmail.com' \
    --to=andr2000@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=clemens@ladisch.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleksandr_andrushchenko@epam.com \
    --cc=tiwai@suse.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.