All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Sakamoto <o-takashi@sakamocchi.jp>
To: Takashi Iwai <tiwai@suse.de>
Cc: Yoshifuji Hideaki <yoshfuji@linux-ipv6.org>,
	alsa-devel@alsa-project.org, clemens@ladisch.de,
	ffado-devel@lists.sf.net
Subject: Re: [RFC][PATCH 26/37] ALSA: firewire-tascam: add MMAP	support to show status and control message
Date: Wed, 22 Jul 2015 23:53:37 +0900	[thread overview]
Message-ID: <55AFAE71.7070809@sakamocchi.jp> (raw)
In-Reply-To: <s5hzj2qj4b7.wl-tiwai@suse.de>

On Jul 20 2015 23:23, Takashi Iwai wrote:
> On Sat, 11 Jul 2015 16:12:37 +0200,
> Takashi Sakamoto wrote:
>>
>> TASCAM FireWire series transfers status and control messages in
>> isochronous packets. One packet includes one message, and the
>> message is periodic every 64 packets. As a result, the messages
>> construct image with 64 quadlets. For example:
>>
>> 00 00000000, 32 00000000
>> 01 00000000, 33 00000000
>> 02 00000000, 34 00000000
>> 03 00020000, 35 00000000
>> 04 00000000, 36 25ea0000
>> 05 ffff0000, 37 27dfff00
>> 06 ffffffff, 38 1d9d0000
>> 07 ffffffff, 39 00000000
>> 08 ffffffff, 40 25ea0000
>> 09 ffffffff, 41 27dfff00
>> 10 00000000, 42 00000000
>> 11 00000000, 43 00000000
>> 12 00000000, 44 00000000
>> 13 00000000, 45 00000000
>> 14 00000000, 46 00000000
>> 15 00010000, 47 00000000
>> 16 00012e00, 48 00000000
>> 17 00010400, 49 00000000
>> 18 00011e00, 50 00000000
>> 19 00011200, 51 00000000
>> 20 00014900, 52 01010101
>> 21 00011e00, 53 00000000
>> 22 00010c00, 54 25ea0000
>> 23 00013000, 55 27dfff00
>> 24 00000000, 56 00000000
>> 25 00000000, 57 00000000
>> 26 00000000, 58 00000000
>> 27 00000000, 59 00000001
>> 28 00000000, 60 00000000
>> 29 00000000, 61 00000000
>> 30 00000000, 62 00000000
>> 31 00000000, 63 00000000
>>
>> 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. Quadlet
>> 36-43 shows analog output level. The other quadlets are unknown.
>>
>> This image is updated every 1 msec or less, depending on current
>> sampling transfer frequency.
>>
>> This commit adds MMAP support to show this image via hwdep interface.
>> An userspace application can map a page frame to its virtual address
>> space with read-only flag. This driver write every control and status
>> messages into the page frame, and the userspace application can parse
>> them.
>>
>> The control messages are both of edge-triggered/level-trigerred,
>> according to physical implementation. For example, the control message
>> corresponding to toggle switch acts as edge-trigger, while the control
>> message corresponding to level fader acts as level-trigger. These control
>> messages are updated every 1 msec or less, alghough the scheduling
>> granuality in Linux operating system is not always so small. This may
>> cause the userspace parser misses some messages when many tasks are
>> running without voluntary programs.
>>
>> Typically, such messages should be converted to MIDI control change
>> messages for userspace applications. Thus, this driver should have
>> a converter with appropriate MIDI map. Currently I have no good idea
>> for the map and it is not implemented yet. Developers helps are
>> required.
>>
>> Cc: Yoshifuji Hideaki <yoshfuji@linux-ipv6.org>
>> Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
> 
> Using mmap for accessing this kind of message isn't good for various
> reasons.  First off, it's volatile, and your implementation keeps only
> a single record, thus it will be overridden at each input.
> 
> Second, the access is racy.
> 
> Third, the mmap implementation can be complex if a cache coherency
> plays a role.  It's easy on x86, but for others...

Indeed. Now I investigate about the converter between the bitmap and
MIDI messages.

But anyway, input/output level should be exposed to userspace because it
doesn't matter to miss reading the information sometimes.

> And the rest... there must be something else I overlooked obviously
> (I don't count a bug here, e.g. the lack of offset value check in vm
>  fault handler :)


Thanks

Takashi Sakamoto

  reply	other threads:[~2015-07-22 14:53 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-11 14:12 [RFC][PATCH 00/37] ALSA: firewire: support AMDTP variants Takashi Sakamoto
2015-07-11 14:12 ` [RFC][PATCH 01/37] ALSA: firewire-lib: rename 'amdtp' to 'amdtp-stream' for functional separation Takashi Sakamoto
2015-07-11 14:12 ` [RFC][PATCH 02/37] ALSA: firewire-lib: functional separation between packet stream and data block format Takashi Sakamoto
2015-07-11 14:12 ` [RFC][PATCH 03/37] ALSA: firewire-lib: add helper functions for asynchronous MIDI port Takashi Sakamoto
2015-07-11 14:12 ` [RFC][PATCH 04/37] ALSA: firewire-lib: serialize request transaction and response transaction Takashi Sakamoto
2015-07-11 14:12 ` [RFC][PATCH 05/37] ALSA: firewire-lib: schedule tasklet again when MIDI substream has rest of MIDI messages Takashi Sakamoto
2015-07-11 14:12 ` [RFC][PATCH 06/37] ALSA: firewire-lib: add throttle for MIDI data rate Takashi Sakamoto
2015-07-12  8:31   ` [FFADO-devel] " Jonathan Woithe
2015-07-11 14:12 ` [RFC][PATCH 07/37] ALSA: firewire-lib: avoid endless loop to transfer MIDI messages at fatal error Takashi Sakamoto
2015-07-11 14:12 ` [RFC][PATCH 08/37] ALSA: firewire-digi00x: add skelton for Digi 002/003 family Takashi Sakamoto
2015-07-11 14:12 ` [RFC][PATCH 09/37] ALSA: firewire-digi00x: add protocol layer Takashi Sakamoto
2015-07-11 14:12 ` [RFC][PATCH 10/37] ALSA: firewire-digi00x: add stream functionality Takashi Sakamoto
2015-07-11 14:12 ` [RFC][PATCH 11/37] ALSA: firewire-digi00x: add proc node to show clock status Takashi Sakamoto
2015-07-11 14:12 ` [RFC][PATCH 12/37] ALSA: firewire-digi00x: add PCM functionality Takashi Sakamoto
2015-07-11 14:12 ` [RFC][PATCH 13/37] ALSA: firewire-digi00x: add MIDI functionality Takashi Sakamoto
2015-07-11 14:12 ` [RFC][PATCH 14/37] ALSA: firewire-digi00x: add hwdep interface Takashi Sakamoto
2015-07-11 14:12 ` [RFC][PATCH 15/37] ALSA: firewire-digi00x: add support for asynchronous messaging Takashi Sakamoto
2015-07-11 14:12 ` [RFC][PATCH 16/37] ALSA: firewire-digi00x: add support for MIDI ports for machine control Takashi Sakamoto
2015-07-11 14:12 ` [RFC][PATCH 17/37] ALSA: firewire-tascam: add skeleton for TASCAM FireWire series Takashi Sakamoto
2015-07-11 14:12 ` [RFC][PATCH 18/37] ALSA: firewire-tascam: add a structure for model-dependent parameters Takashi Sakamoto
2015-07-11 14:12 ` [RFC][PATCH 19/37] ALSA: firewire-tascam: add proc node to show firmware information Takashi Sakamoto
2015-07-11 14:12 ` [RFC][PATCH 20/37] ALSA: firewire-tascam: add specific protocol layer Takashi Sakamoto
2015-07-11 14:12 ` [RFC][PATCH 21/37] ALSA: firewire-tascam: add streaming functionality Takashi Sakamoto
2015-07-11 14:12 ` [RFC][PATCH 22/37] ALSA: firewire-tascam: add PCM functionality Takashi Sakamoto
2015-07-11 14:12 ` [RFC][PATCH 23/37] ALSA: firewire-tascam: add transaction functionality Takashi Sakamoto
2015-07-11 14:12 ` [RFC][PATCH 24/37] ALSA: firewire-tascam: add MIDI functionality Takashi Sakamoto
2015-07-11 14:12 ` [RFC][PATCH 25/37] ALSA: firewire-tascam: add hwdep interface Takashi Sakamoto
2015-07-11 14:12 ` [RFC][PATCH 26/37] ALSA: firewire-tascam: add MMAP support to show status and control message Takashi Sakamoto
2015-07-20 14:23   ` Takashi Iwai
2015-07-22 14:53     ` Takashi Sakamoto [this message]
2015-07-21 14:06   ` Clemens Ladisch
2015-07-22 15:19     ` Takashi Sakamoto
2015-07-11 14:12 ` [RFC][PATCH 27/37] ALSA: firewire-lib: add support for source packet header field in CIP header Takashi Sakamoto
2015-07-11 14:12 ` [RFC][PATCH 28/37] ALSA: firewire-lib: enable protocol layer to handle current cycle count Takashi Sakamoto
2015-07-11 14:12 ` [RFC][PATCH 29/37] ALSA: firewire-motu: add skeleton for Mark of the unicorn (MOTU) FireWire series Takashi Sakamoto
2015-07-11 14:12 ` [RFC][PATCH 30/37] ALSA: firewire-motu: add a structure for model-dependent parameters Takashi Sakamoto
2015-07-11 14:12 ` [RFC][PATCH 31/37] ALSA: firewire-motu: add MOTU specific protocol layer Takashi Sakamoto
2015-07-12  1:05   ` [FFADO-devel] " Jonathan Woithe
2015-07-15 16:10     ` Takashi Sakamoto
2015-07-11 14:12 ` [RFC][PATCH 32/37] ALSA: firewire-motu: add stream functionality Takashi Sakamoto
2015-07-13 11:09   ` [FFADO-devel] " Jonathan Woithe
2015-07-13 11:23   ` Jonathan Woithe
2015-07-11 14:12 ` [RFC][PATCH 33/37] ALSA: firewire-motu: add transaction functionality Takashi Sakamoto
2015-07-11 14:12 ` [RFC][PATCH 34/37] ALSA: firewire-motu: add proc node to show the status of internal clock Takashi Sakamoto
2015-07-13 11:28   ` [FFADO-devel] " Jonathan Woithe
2015-07-11 14:12 ` [RFC][PATCH 35/37] ALSA: firewire-motu: add PCM functionality Takashi Sakamoto
2015-07-11 14:12 ` [RFC][PATCH 36/37] ALSA: firewire-motu: add MIDI functionality Takashi Sakamoto
2015-07-11 14:12 ` [RFC][PATCH 37/37] ALSA: firewire-motu: add hwdep interface Takashi Sakamoto
2015-07-13 10:58   ` [FFADO-devel] " Jonathan Woithe
2015-07-11 14:33 ` [RFC][PATCH 00/37] ALSA: firewire: support AMDTP variants Takashi Sakamoto
2015-07-12  8:46 ` [FFADO-devel] " Jonathan Woithe

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=55AFAE71.7070809@sakamocchi.jp \
    --to=o-takashi@sakamocchi.jp \
    --cc=alsa-devel@alsa-project.org \
    --cc=clemens@ladisch.de \
    --cc=ffado-devel@lists.sf.net \
    --cc=tiwai@suse.de \
    --cc=yoshfuji@linux-ipv6.org \
    /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.