All of lore.kernel.org
 help / color / mirror / Atom feed
From: Scott Bahling <sbahling@suse.com>
To: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Cc: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	ffado-devel@lists.sf.net
Subject: Re: Controlling the Tascam FW-1884
Date: Mon, 22 Oct 2018 13:47:53 +0200	[thread overview]
Message-ID: <4a971bd3716ddf43662b637904209f5230ccbf02.camel@suse.com> (raw)
In-Reply-To: <58ef33b1fffec178217044e0f0d5f2b6aecfc31d.camel@suse.com>

Hi Takashi,

On Sun, 2018-10-14 at 21:09 +0200, Scott Bahling wrote:
> On Sat, 2018-10-13 at 19:40 +0900, Takashi Sakamoto wrote:
> 
> > For FW-1082 these quadlets includes value of movable fader as well,
> > however unlike FW-1884 they have fluctuate quirk. So I think it
> > reasonable for us to program this module to ignore them.
> 
> Ah, understood.
> 
> > Instead, let us program applications so that they call
> > 'hinawa_snd_tscm_get_status()' periodically to get current value of
> > these faders between touch and untouch event on quadlet 05? This
> > take applications to consume CPU time more efficiently than handling
> > many events.
> 
> That should work.

I have tried this, but the endianness of the status bits passed via this
method seems to be wrong.

I noticed in your latest kernel code[1], that you don't convert the firewire
data to local CPU endian when storing in the "after" variable which ends up
getting pushed into the status structure as big endian:


    after = buffer[s->data_block_quadlets - 1];
...
...
...
    tscm->status[index] = after;


Shouldn't that be:

    after = be32_to_cpu(buffer[s->data_block_quadlets - 1]);

which also would remove the need for later conversions in that block of
code?

I have a tested patch which I will send as a pull request once github is
functioning again.

> ...
> > Well, as a result, ALSA firewire-tascam driver handles 'edge-trigge'
> > events except for jog wheel and knobs. For this kind of event, it's
> > useful to notify before/after value when emitting notification. So I'd
> > like to change structure passed to UAPI so that:
> > 
> >   struct snd_firewire_tascam_control {
> >          unsigned int index;
> > -       __u32 flags;
> > +       __u32 before;
> > +       __u32 after;
> >   };
> > 
> > Would I request your opinion? You can see patches here:
> >   - 
> > https://github.com/takaswie/snd-firewire-improve/tree/topic/tascam-userspace-take3
> >   - https://github.com/takaswie/libhinawa/tree/topic/tascam-userspace-take3
> > 
> > You can receive 'control' event of 'HinawaSndTscm' GObject with these
> > two values:
> > 
> 
> ...
> 
> Sounds reasonable. For state change detection, I currently store the
> "before" state of each control in my application. Your new driver
> implementation will mean not needing to maintain my own state
> structures for that purpose.
> 
> I will try it out in the next few days.

I have only done a small amount of testing, but so far the control event
setup is working fine.

-Scott


[1] https://github.com/takaswie/snd-firewire-improve/blob/topic/tascam-userspace-take3/sound/firewire/tascam/amdtp-tascam.c#L132

  reply	other threads:[~2018-10-22 11:47 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <9cec059e1ff1a558f21a3f0729c5a69a3d506573.camel@suse.com>
2018-09-08  2:53 ` Controlling the Tascam FW-1884 Takashi Sakamoto
2018-09-08 11:21   ` Scott Bahling
2018-09-10  7:59     ` Takashi Sakamoto
2018-09-12  7:18       ` Scott Bahling
2018-09-17 14:36         ` Takashi Sakamoto
2018-09-24  9:32           ` Scott Bahling
2018-09-28  3:44             ` Takashi Sakamoto
2018-09-28 15:28               ` Scott Bahling
2018-10-02  3:16                 ` Takashi Sakamoto
2018-10-03 20:37                   ` Scott Bahling
2018-10-06  9:07                     ` Takashi Sakamoto
2018-10-07 11:32                       ` Scott Bahling
2018-10-07 14:11                   ` Takashi Sakamoto
2018-10-12  8:12                     ` Scott Bahling
2018-10-13 10:40                       ` Takashi Sakamoto
2018-10-14 19:09                         ` Scott Bahling
2018-10-22 11:47                           ` Scott Bahling [this message]
2018-10-30  9:34                             ` Takashi Sakamoto
2018-11-02  9:26                               ` Scott Bahling
2018-11-02 12:05                                 ` Takashi Sakamoto
2018-11-16 17:37                                   ` Scott Bahling
2018-10-03 19:31               ` Scott Bahling

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=4a971bd3716ddf43662b637904209f5230ccbf02.camel@suse.com \
    --to=sbahling@suse.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=ffado-devel@lists.sf.net \
    --cc=o-takashi@sakamocchi.jp \
    /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.