From: Scott Bahling Subject: Re: Controlling the Tascam FW-1884 Date: Mon, 22 Oct 2018 13:47:53 +0200 Message-ID: <4a971bd3716ddf43662b637904209f5230ccbf02.camel@suse.com> References: <9cec059e1ff1a558f21a3f0729c5a69a3d506573.camel@suse.com> <0e469670-0520-5953-230b-8d2da5e4c357@sakamocchi.jp> <985b1f6dc5b0af2aae049e0b6fcf976ab400d34d.camel@suse.com> <55afba82-ad24-fe70-b784-d28a38e291c9@sakamocchi.jp> <7a0f35eea26ce475bc3f6953db97f83205ad0a58.camel@suse.com> <10a99ea9c672ac6d0c9d5536e9d85a15f5a32d95.camel@suse.com> <47f66c7d-4337-52da-72da-cdb3f0638dc4@sakamocchi.jp> <246b8baaa3c415a0accdb76d3b524dec5e0429f9.camel@suse.com> <97e54edf-1e47-d422-e438-a2c859083fd3@sakamocchi.jp> <58ef33b1fffec178217044e0f0d5f2b6aecfc31d.camel@suse.com> Reply-To: sbahling@suse.com Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id B443D2677D0 for ; Mon, 22 Oct 2018 13:47:55 +0200 (CEST) In-Reply-To: <58ef33b1fffec178217044e0f0d5f2b6aecfc31d.camel@suse.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Takashi Sakamoto Cc: "alsa-devel@alsa-project.org" , ffado-devel@lists.sf.net List-Id: alsa-devel@alsa-project.org 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