diff options
author | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2018-11-23 13:13:05 +0900 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2018-11-23 15:31:12 +0100 |
commit | d7167422433cdb61e58baee9c25543d0eba95c9d (patch) | |
tree | eeb1851aa855cddd2d70148194eefb02c1b1be5e /sound/firewire/tascam/tascam.h | |
parent | 90e8ac5c9d446124a5b43a6f135bf67e060c0c9d (diff) | |
download | linux-d7167422433cdb61e58baee9c25543d0eba95c9d.tar.bz2 |
ALSA: firewire-tascam: queue events for change of control surface
Units of TASCAM FireWire series transfer image of states of the unit in
tx isochronous packets. Demultiplexing of the states from the packets
is done in software interrupt context regardless of any process context.
In a view of userspace applications, it needs to have notification
mechanism to catch change of the states.
This commit implements a queue to store events for the notification. The
image of states includes fluctuating data such as level of gain/volume
for physical input/output and position of knobs. Therefore the events
are queued corresponding to some control features only.
Furthermore, the queued events are planned to be consumed by userspace
applications via ALSA hwdep interface. This commit suppresses event
queueing when no applications open the hwdep interface.
However, the queue is maintained in an optimistic scenario, thus without
any care against overrrun. This is reasonable because target events are
useless just to handle PCM frames. It starts queueing when an usespace
application opens hwdep interface, thus it's expected to read the queued
events steadily.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire/tascam/tascam.h')
-rw-r--r-- | sound/firewire/tascam/tascam.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sound/firewire/tascam/tascam.h b/sound/firewire/tascam/tascam.h index c710496a99cf..6a411ee0dcf1 100644 --- a/sound/firewire/tascam/tascam.h +++ b/sound/firewire/tascam/tascam.h @@ -62,6 +62,8 @@ struct snd_fw_async_midi_port { int consume_bytes; }; +#define SND_TSCM_QUEUE_COUNT 16 + struct snd_tscm { struct snd_card *card; struct fw_unit *unit; @@ -92,6 +94,10 @@ struct snd_tscm { // A cache of status information in tx isoc packets. __be32 state[SNDRV_FIREWIRE_TASCAM_STATE_COUNT]; + struct snd_hwdep *hwdep; + struct snd_firewire_tascam_change queue[SND_TSCM_QUEUE_COUNT]; + unsigned int pull_pos; + unsigned int push_pos; }; #define TSCM_ADDR_BASE 0xffff00000000ull |