All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Oleksandr Andrushchenko <andr2000@gmail.com>
Cc: xen-devel@lists.xenproject.org, alsa-devel@alsa-project.org,
	Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Subject: Re: [alsa-devel] [PATCH 0/2] sndif: add explicit back and front synchronization
Date: Tue, 13 Mar 2018 17:31:14 +0100	[thread overview]
Message-ID: <s5hvae09bu5.wl-tiwai__17871.58546872$1520958605$gmane$org@suse.de> (raw)
In-Reply-To: <e3f39c7f-721f-ace9-82b3-d270c6bf0137@gmail.com>

On Tue, 13 Mar 2018 12:49:00 +0100,
Oleksandr Andrushchenko wrote:
> 
> So, I tried to make a POC to stress the protocol changes and see
> what implementation of the HW parameter negotiation would look like.
> 
> Please find protocol changes at [1]:
> - add 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.
>    Parameters supported by this request:
>      - frame rate
>      - sample rate
>      - number of channels
>      - buffer size
>      - period size
>  - add minimum buffer size to XenStore configuration
> 
> From the previous changes to the protocol which I posted earlier I see
> that XENSND_OP_HW_PARAM_SET is not really needed - removed.
> 
> The implementation in the PV frontend driver is at [2].
> 
> Takashi, could you please take a look at the above if it meets your
> expectations
> so I can move forward?

This looks almost good through a quick glance.
But the mixture of SNDRV_PCM_HW_PARAM_PERIOD_SIZE and
SNDRV_PCM_HW_PARAM_BUFFER_BYTES are likely confusing.
The *_SIZE means in frames unit while *_BYTES means in bytes.
You should align both PERIOD_ and BUFFER_ to the same units,
i.e. either use SNDRV_PCM_HW_PARAM_PERIOD_BYTES and *_BUFFER_BYTES,
or SNDRV_PCM_HW_PARAM_PERIOD_SIZE and *_BUFFER_SIZE.

Also, a slightly remaining concern is the use-case where hw_params is
called multiple times.  An application may call hw_free and hw_params
freely, or even hw_params calls multiple times, in order to change the
parameter.

If the backend needs to resolve some dependency between parameters
(e.g. the available period size depends on the sample rate), the
backend has to remember the previously passed parameters.

So, instead of passing a single parameter, you may extend the protocol
always to pass the full (five) parameters, too.

OTOH, this can be considered to be a minor case, and the backend
(e.g. PA) can likely support every possible combinations, so maybe a
simpler code may be a better solution in the end.


thanks,

Takashi

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

  reply	other threads:[~2018-03-13 16:31 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-05  8:24 [PATCH 0/2] sndif: add explicit back and front synchronization Oleksandr Andrushchenko
2018-02-05  8:24 ` [PATCH 1/2] sndif: introduce protocol version Oleksandr Andrushchenko
2018-03-01 22:12   ` Konrad Rzeszutek Wilk
2018-03-01 22:12   ` [Xen-devel] " Konrad Rzeszutek Wilk
2018-02-05  8:25 ` [PATCH 2/2] sndif: add explicit back and front synchronization Oleksandr Andrushchenko
2018-03-01 22:11   ` Konrad Rzeszutek Wilk
2018-03-01 22:11   ` [Xen-devel][PATCH " Konrad Rzeszutek Wilk
2018-03-02  6:30     ` [PATCH " Oleksandr Andrushchenko
2018-03-02  6:30     ` [Xen-devel][PATCH " Oleksandr Andrushchenko
2018-02-19  6:31 ` [Xen-devel][PATCH 0/2] " Oleksandr Andrushchenko
2018-02-19  6:31 ` [PATCH " Oleksandr Andrushchenko
2018-03-01  6:29 ` Oleksandr Andrushchenko
2018-03-01  6:29 ` [Xen-devel][PATCH " Oleksandr Andrushchenko
2018-03-02 16:52 ` Oleksandr Andrushchenko
2018-03-02 16:52 ` [PATCH " Oleksandr Andrushchenko
2018-03-06 10:52 ` [alsa-devel] " Takashi Iwai
2018-03-06 10:52 ` [Xen-devel][PATCH " Takashi Iwai
2018-03-06 11:25   ` Oleksandr Andrushchenko
2018-03-06 11:32     ` [alsa-devel] [PATCH " Takashi Iwai
2018-03-06 11:32     ` [Xen-devel][PATCH " Takashi Iwai
2018-03-06 12:05       ` Oleksandr Andrushchenko
2018-03-06 12:52         ` [alsa-devel] [PATCH " Takashi Iwai
2018-03-06 12:52         ` [Xen-devel][PATCH " Takashi Iwai
2018-03-06 13:30           ` [alsa-devel] [PATCH " Oleksandr Andrushchenko
2018-03-06 13:30           ` [Xen-devel][PATCH " Oleksandr Andrushchenko
2018-03-06 13:48             ` [alsa-devel] [PATCH " Takashi Iwai
2018-03-06 13:48             ` [Xen-devel][PATCH " Takashi Iwai
2018-03-06 14:13               ` Oleksandr Andrushchenko
2018-03-06 14:27                 ` Takashi Iwai
2018-03-06 14:48                   ` [alsa-devel] [PATCH " Oleksandr Andrushchenko
2018-03-06 14:48                   ` [Xen-devel][PATCH " Oleksandr Andrushchenko
2018-03-06 15:06                     ` [alsa-devel] [PATCH " Takashi Iwai
2018-03-06 15:06                     ` [Xen-devel][PATCH " Takashi Iwai
2018-03-06 16:04                       ` Oleksandr Andrushchenko
2018-03-06 16:30                         ` [alsa-devel] [PATCH " Takashi Iwai
2018-03-06 16:30                         ` [Xen-devel][PATCH " Takashi Iwai
2018-03-07  8:49                           ` Oleksandr Andrushchenko
2018-03-11  8:15                             ` Takashi Iwai
2018-03-12  6:26                               ` Oleksandr Andrushchenko
2018-03-13 11:49                                 ` Oleksandr Andrushchenko
2018-03-13 16:31                                   ` Takashi Iwai [this message]
2018-03-13 16:31                                   ` Takashi Iwai
2018-03-13 17:31                                     ` [alsa-devel] [PATCH " Oleksandr Andrushchenko
2018-03-13 17:31                                     ` [Xen-devel][PATCH " Oleksandr Andrushchenko
2018-03-13 18:48                                       ` Takashi Iwai
2018-03-14  7:32                                         ` Oleksandr Andrushchenko
2018-03-14  7:32                                         ` [alsa-devel] [PATCH " Oleksandr Andrushchenko
2018-03-13 18:48                                       ` Takashi Iwai
2018-03-13 11:49                                 ` Oleksandr Andrushchenko
2018-03-12  6:26                               ` Oleksandr Andrushchenko
2018-03-11  8:15                             ` Takashi Iwai
2018-03-07  8:49                           ` Oleksandr Andrushchenko
2018-03-06 16:04                       ` Oleksandr Andrushchenko
2018-03-06 14:27                 ` Takashi Iwai
2018-03-06 14:13               ` Oleksandr Andrushchenko
2018-03-06 12:05       ` Oleksandr Andrushchenko
2018-03-06 11:25   ` Oleksandr Andrushchenko

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='s5hvae09bu5.wl-tiwai__17871.58546872$1520958605$gmane$org@suse.de' \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=andr2000@gmail.com \
    --cc=oleksandr_andrushchenko@epam.com \
    --cc=xen-devel@lists.xenproject.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.