All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Vinod Koul <vinod.koul@intel.com>
Cc: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>,
	broonie@linaro.org, Clemens Ladisch <clemens@ladisch.de>,
	alsa-devel@alsa-project.org,
	Takashi Sakamoto <o-takashi@sakamocchi.jp>
Subject: Re: [PATCH 1/4] ALSA: control: return payload length for TLV operation
Date: Mon, 12 Sep 2016 17:28:58 +0200	[thread overview]
Message-ID: <s5htwdlgmrp.wl-tiwai@suse.de> (raw)
In-Reply-To: <20160912152531.GE9355@localhost>

On Mon, 12 Sep 2016 17:25:31 +0200,
Vinod Koul wrote:
> 
> On Mon, Sep 12, 2016 at 01:37:37PM +0100, Charles Keepax wrote:
> > On Tue, Sep 06, 2016 at 12:30:35PM +0900, Takashi Sakamoto wrote:
> > > On Sep 5 2016 05:45, Takashi Iwai wrote:
> > > >Yeah, there are obviously some issues in the current implementation of
> > > >wm_adsp and ASoC ext ctl.  Although I'll unlikely take Sakamoto-san's
> > > >patchset as is from a few reasons, these issues still should be
> > > >addressed.
> > > 
> > > OK. I welcome to abandon this patchset ;)
> > > 
> > > >First off, passing the binary blob directly via TLV callback is
> > > >incorrect from the ABI perspective.  When Vinod proposed the idea via
> > > >TLV access originally, we thought they the data is encoded in TLV
> > > >format.  Alas, the resulted code didn't do that and it slipped into
> > > >the upstream without consideration.
> > > 
> > > +1
> > > 
> > > >Besides that, the second problem is the count value returned via
> > > >snd_ctl_elem_info, as mentioned in the above.  It's beyond the
> > > >original control API design, and a kind of illegal usage.
> > > 
> > > +1
> > > 
> > > >(Well, it's a philosophical argument: what one would expect for an
> > > > element that has neither read nor write access...?)
> > > 
> > > It's an element with no sense for applications. A waste of codes in kernel
> > > land.
> > > 
> > > >So, at this point, the main question is whether we keep this access
> > > >pattern as is, as a sort of official one, and put some exceptional
> > > >rule.  Charles, how is the situation?  Has it been already deployed to
> > > >real systems?
> > > >
> > > >If we may still change the wm_adsp behavior, we may "fix" the first
> > > >issue by passing the blob properly encoded in TLV format, at least.
> > > >OTOH, if we need to keep the current ABI abuse as is, one idea is to
> > > >add a special flag in SNDRV_CTL_ELEM_ACCESS_* indicating this kind of
> > > >control, and we define more strictly how the code should be
> > > >implemented.  Currently we can judge this element as a one that has no
> > > >read/write access but with tlv r/w.  But it's way too unclear.
> > > 
> > > The 'abuse' is a part of my understanding of ALSA SoC part. I need a bit
> > > time to switch my mind for this issue.
> > 
> > Perhaps we should add this as a topic for discussion at the Audio
> > mini-conference? If the general feeling is that this feature is
> > badly designed we should certainly be looking at what we can do
> > to improve it.
> > 
> > I do very much like the idea of the additional access flag as I
> > said. Wrapping the data in a TLV structure we would have to think
> > about a little more though as the code has shipped in several
> > kernel versions at this point.
> > 
> > We are starting to have a few customers use a 4.4 kernel which
> > does include these controls, all our previous backports had used
> > a system of partitioning the controls up into multiple 512 byte
> > controls as these binary TLV controls were not supported. So
> > there is a little bit of friction to major changes to the ABI,
> > but I don't think its insurmountable as long as the functionality
> > remains the same.
> > 
> > But we need to get Intel involved in that discussion too, as they
> > have used these controls quite widely as well.
> 
> Sorry havent been able to follow this yet :(
> 
> 
> But yes current Skylake Chromebooks ship with this code so we cant break it.
> 
> I am not sure what is the issue with API though. (sorry haven't read the
> thread yet). The tlv was designed to allow people send bytes larger than 512
> down to kernel. The Type cna be anything (implementation specific, though we
> haven't used it yet), length the blob length and then the bytes blob.

Yes, and this part is missing in wm_adsp driver.  It passes the blob
without TLV encoding, i.e. starting from the offset zero without type
and length encoding.

> We provide a tunnel and pass these to DSP. They maybe module coefficients,
> hotwording blobs etc.

So, does Intel driver pass the blob in TLV format?  Then we have two
different implementations.

Also, still another point is to be decided: is passing an arbitrary
size via info callback for an element without read/write access bits
(but with TLV bit) a right behavior?

> Sure, we can this at u-conf :) F2F is always much better ...

Well, the u-conf is still over a month ahead.  I think we should keep
discussing on ML before u-conf.


thanks,

Takashi

  reply	other threads:[~2016-09-12 15:29 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-29 23:44 [RFC][PATCH 0/4] ALSA: control: return payload length of TLV operation Takashi Sakamoto
2016-08-29 23:44 ` [PATCH 1/4] ALSA: control: return payload length for " Takashi Sakamoto
2016-08-30  5:29   ` Takashi Iwai
2016-08-30  6:19     ` Takashi Sakamoto
2016-08-30  6:59       ` Takashi Iwai
2016-08-30  7:13         ` Takashi Sakamoto
2016-08-30  7:39           ` Takashi Iwai
2016-08-30  7:05   ` Clemens Ladisch
2016-08-30  7:09     ` Takashi Sakamoto
2016-08-30  8:04       ` Clemens Ladisch
2016-08-30 12:22         ` Takashi Sakamoto
2016-08-30 14:51       ` Vinod Koul
2016-08-30 22:04         ` Takashi Sakamoto
2016-08-31  4:20           ` Vinod Koul
2016-08-31  4:30             ` Takashi Sakamoto
2016-08-31  9:05               ` Charles Keepax
2016-08-31  9:40                 ` Takashi Iwai
2016-08-31 11:54                   ` Clemens Ladisch
2016-08-31 12:08                     ` Takashi Iwai
2016-08-31 15:26                       ` Takashi Sakamoto
2016-08-31 15:40                         ` Takashi Iwai
2016-09-02 11:30                           ` Takashi Sakamoto
2016-09-02 13:09                             ` Takashi Iwai
2016-09-02 14:50                               ` Takashi Sakamoto
2016-09-02 15:19                                 ` Takashi Iwai
2016-09-02 16:26                                   ` Takashi Iwai
2016-09-03 11:38                             ` Charles Keepax
2016-09-04 11:07                               ` Takashi Sakamoto
2016-09-04 20:45                                 ` Takashi Iwai
2016-09-06  3:30                                   ` Takashi Sakamoto
2016-09-12 12:37                                     ` Charles Keepax
2016-09-12 15:25                                       ` Vinod Koul
2016-09-12 15:28                                         ` Takashi Iwai [this message]
2016-09-12 16:03                                           ` Charles Keepax
2016-09-12 16:28                                             ` Takashi Iwai
2016-09-13  8:39                                               ` Charles Keepax
2016-08-31 12:19                     ` Charles Keepax
2016-08-31 13:24                       ` Clemens Ladisch
2016-08-31 14:18                         ` Charles Keepax
2016-08-31 16:05                           ` Vinod Koul
2016-09-02 11:18                     ` Takashi Sakamoto
2016-09-02 16:05                       ` Takashi Iwai
2016-09-03  3:53                         ` Takashi Sakamoto
2016-09-03 11:32                       ` Charles Keepax
2016-08-29 23:44 ` [PATCH 2/4] ALSA: control: delegate checking the length of data payload to each drivers Takashi Sakamoto
2016-08-30 15:46   ` Vinod Koul
2016-08-29 23:44 ` [PATCH 3/4] ALSA: control: add kerneldoc for snd_kcontrol_tlv_rw_t Takashi Sakamoto
2016-08-29 23:44 ` [PATCH 4/4] ALSA: control: bump up protocol version to 2.0.8 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=s5htwdlgmrp.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@linaro.org \
    --cc=ckeepax@opensource.wolfsonmicro.com \
    --cc=clemens@ladisch.de \
    --cc=o-takashi@sakamocchi.jp \
    --cc=vinod.koul@intel.com \
    /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.