alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Cc: vinod.koul@intel.com, alsa-devel@alsa-project.org,
	broonie@linaro.org, clemens@ladisch.de,
	omair.m.abdullah@intel.com
Subject: Re: [PATCH 1/4] ALSA: control: return payload length for TLV operation
Date: Tue, 30 Aug 2016 08:59:35 +0200	[thread overview]
Message-ID: <s5hr3963foo.wl-tiwai@suse.de> (raw)
In-Reply-To: <1b8df791-0c18-50f7-6a64-ee1bccc30c8f@sakamocchi.jp>

On Tue, 30 Aug 2016 08:19:46 +0200,
Takashi Sakamoto wrote:
> 
> On Aug 30 2016 14:29, Takashi Iwai wrote:
> > On Tue, 30 Aug 2016 01:44:42 +0200,
> > Takashi Sakamoto wrote:
> >>
> >> TLV feature of control interface is originally introduced at
> >> commit 42750b04c5ba ("[ALSA] Control API - TLV implementation for
> >> additional information like dB scale") and commit 8aa9b586e420 ("[ALSA]
> >> Control API - more robust TLV implementation"). In this time,
> >> snd_kcontrol_tlv_rw_t is for generating and transferring information about
> >> threshold level for applications.
> >>
> >> This feature can transfer arbitrary data in a shape of an array with
> >> members of unsigned int type, therefore it can be used to deliver quite
> >> large arbitrary data from user space to in-kernel drivers via ALSA control
> >> character device. Focusing on this nature, commit 7523a271682f ("ASoC:
> >> core: add a helper for extended byte controls using TLV") introduced
> >> snd_soc_bytes_tlv_callback() just for I/O operations.
> >>
> >> In this case, typically, APIs return operated length, while TLV feature
> >> can't. This is inconvenient to applications.
> >
> > The ASoC TLV (ab)usage still takes / receives the length field of
> > TLV.  What's missing there?
> 
> I don't get exactly what you mean.
> 
> The issue in which I'm interested is that applications cannot get to
> know length of actual processed bytes. Nothing others.
> 
> When pure threshold level information is transferred, applications can
> get its length of TLV packet payload, because we have a loose protocol
> to store the length of data in second element of the payload. The size
> of 2 elements plus the length equals to the length of TLV packet
> payload.
> 
> When using TLV feature just for I/O, this protocol is not kept, as we
> can see implementation of 'soc_bytes_ext' operation. Thus, the number
> of processed bytes should be returned to applications, by any
> ways. This patchset uses 'length' field in TLV packet header.

The current way of ASoC ext ctl is intended to be a workaround to pass
a large data via ctl API.  Nothing more than that.  If it's used for
receiving arbitrary size of data from the driver, it's a buggy usage.


Takashi

  reply	other threads:[~2016-08-30  6:59 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 [this message]
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
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=s5hr3963foo.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@linaro.org \
    --cc=clemens@ladisch.de \
    --cc=o-takashi@sakamocchi.jp \
    --cc=omair.m.abdullah@intel.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).