All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Sakamoto <o-takashi@sakamocchi.jp>
To: Scott Bahling <sbahling@suse.com>
Cc: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	ffado-devel@lists.sf.net
Subject: Re: Controlling the Tascam FW-1884
Date: Sat, 6 Oct 2018 18:07:10 +0900	[thread overview]
Message-ID: <bc5df36b-f9ed-f39d-381f-13fc6bc85f16@sakamocchi.jp> (raw)
In-Reply-To: <4e0b4dc88db65ddd3055f3266af509fd439472c5.camel@suse.com>

Hi Scott,

On Oct 4 2018 05:37, Scott Bahling wrote:
> On Tue, 2018-10-02 at 12:16 +0900, Takashi Sakamoto wrote:
>> I have an idea to invervene them:
>>
>> 1. For control events, in kernel land, driver module detects
>> changes of set of bitflags for physical controls, then queue
>> events to tell the change to userspace applications
>> (e.g. poll(2)). The queued events include information about
>> changed bitflags (e.g. a shape of u32 data). Userspace
>> applications execute read(2) then get the bitflags, then parse
>> it and emit userspace event by ports in ALSA sequencer
>> subsystem.
>> The driver and userspace application should pay enough
>> attention to share the queue. The driver can drop the oldest
>> queued events if the queue is full.
>>
>> 2. For level meter, in kernel land, driver module caches the
>> recent value. Userspace applications execute ioctl(2) with
>> unique command (You can see this kind of commands in
>> 'include/uapi/sound/firwire.h').
>>
>> However, as long as I note[2], the purpose of some quadlets in the
>> image are not still identified:
>>
>> "Quadlet 00-15 show control messages. Quadlet 16-23 show analog input
>> level. Quadlet 24-31 shows digital ADAT input level. Quadlet 32-33
>> shows digital S/PDIF input level. Quadlet 34-35 is unknown.
> 
> On my FW-1884 34/35 is analog level of output 1/2. The "Monitor" level
> pot (as well as the master fader if enabled) control the level so if
> they are set at 0, then you will not see any signal on the 34/35.
> 
>> Quadlet
>> 36-43 shows analog output level.
> 
> 36-41 = analog outputs 3-8
> 
>> The other quadlets are unknown."
> 
> 52: shows the current sample rate setting
>      010101xx = 44.1k
>      020102xx = 48k
>      810181xx = 88.2k
>      820182xx = 96k
> 
> 52: Byte 1 shows the current clock source
>      0x01 = Internal
>      0x02 = Word Clock
>      0x03 = Digital In
>      0x04 = ADAT
> 
> 54-55 appears to be the level of the internal "Monitor Mix".
> 57-58 appears to be the level of the stereo mix of the analog inputs
> 
> 59: Byte 1 indicates what is routed to the Monitor Mix
>      0x01 = PCM Stream from computer
>      0x02 = Analog Inputs
>      0x03 = Both
> 
>> We need further investigation to clear the unknown fields as much as
>> possible to add more codes in ALSA kernel land.
> 
> Above is as far as I have gotten with the unknown fields.
> 
> On the asynchronous side, I have mapped out the LED codes to the LEDs
> on the FW-1884 and discovered the registers for controlling the faders.

Thanks for your report. I have additional information from today
investigation. In detail, please read the end of this message.

I think it reasonable to take kernel-land driver emits events for
quadlet 05-15 to userspace applications, then let SndTscm object in
libhinawa. (Extra care is required for the value of monitor-knob).
Additionally, SndTscm object produces API to retrieve current value
of fader, knob and so on.

Anyway, initial value should be reported to userspace, mmm...

======== 8< --------

00: fader2 fader1
01: fader4 fader3
02: fader6 fader5
03: fader8 fader7
04: solo-knob fader9(=master)

The value of fader is between 0x0000 and 0x03ff (2byte).
The value of solo-knob (FW-1884 only) is between 0x0000 and
0x03ff (2byte).

05: op-mode+fader-sense monitor-knob

op-mode is 7 bits in MSB side.
  - 0x00: computer mode
  - 0xfe: midi-ctl/mon-mix modes

The value of fader-sense consists of bitflags in which
a bit becomes zero during user touches corresponding fader.
This is next 9 bits in MSB side.
  - 0x0100: for fader 9 (=master)
  - 0x0080: for fader 8
    ...
  - 0x0001: for fader 1

The value of monitor-knob is between 0x0000 and 0x03ff.
But the lowest bits becomes frequently without handy operation.

06: bitflags
07: bitflags
08: bitflags
09: bitflags

These bitflags consists two states:
  - During corresponding button is pressed, bit becomes zero.
  - some sets of 2 bits represent current value of corresponding
    knob.
The position is largely different depending on FW-1884/FW-1082.

10: unknown unknown
11: unknown unknown
12: unknown unknown
13: unknown unknown
14: unknown unknown

15: dial-value unknown

The value of dial is between 0x0000 and 0xffff, accumulated clockwise.
At overflow it resets to 0x0000.

16: analog-in-1
17: analog-in-2
18: analog-in-3
19: analog-in-4
20: analog-in-5
21: analog-in-6
22: analog-in-7
23: analog-in-8
24: adat-in-1
25: adat-in-2
26: adat-in-3
27: adat-in-4
28: adat-in-5
29: adat-in-6
30: adat-in-7
31: adat-in-8
32: s/pdif-in-1
33: s/pdif-in-2
34: analog-out-1
35: analog-out-2
36: analog-out-3
37: analog-out-4
38: analog-out-5
39: analog-out-6
40: analog-out-7
41: analog-out-8
42: adat-out-1
43: adat-out-2
44: adat-out-3
45: adat-out-4
46: adat-out-5
47: adat-out-6
48: adat-out-7
49: adat-out-8

The value of level is between 0x00000000 and 0x7fffff00.

50: (unknown)
51: (unknown)

I expect them for spdif-out-1/2 but actually they're not.

52: clock-status clock-config

As Scott investigated, but configuration of clock source
is not necessarily effective in bits of clock-status.

53: (unknown)
54: monitor-mix-1 (enabled at INPUT/BOTH modes)
55: monitor-mix-2 (enabled at INPUT/BOTH modes)
56: (unknown)
57: analog-in-mix-1
58: analog-in-mix-2

59: 0:COMPUTER, 1:INPUTS, 2:BOTH

At monitor mix mode, the above selections are available.

60: (unknown)
61: (unknown)
62: (unknown)
63: (unknown)

======== 8< --------

Thanks

Takashi Sakamoto

  reply	other threads:[~2018-10-06  9:07 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 [this message]
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
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=bc5df36b-f9ed-f39d-381f-13fc6bc85f16@sakamocchi.jp \
    --to=o-takashi@sakamocchi.jp \
    --cc=alsa-devel@alsa-project.org \
    --cc=ffado-devel@lists.sf.net \
    --cc=sbahling@suse.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.