summaryrefslogtreecommitdiff
path: root/sound/firewire/digi00x/digi00x.h
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2015-10-11 12:30:15 +0900
committerTakashi Iwai <tiwai@suse.de>2015-10-11 18:25:57 +0200
commit9dc5d31cdceb5f1ee65edc8a41a5bc7c92d85dd5 (patch)
treedaa3bd5ce5641d40cd1139ca6414a290fd3675a9 /sound/firewire/digi00x/digi00x.h
parent17385a386ccae1b5a9a135c43493652b4dd82f61 (diff)
ALSA: firewire-digi00x: handle MIDI messages in isochronous packets
In Digi 002/003 protocol, MIDI messages are transferred in the last data channel of data blocks. Although this data channel has a label of 0x80, it's not fully MIDI conformant data channel especially because the Counter field always zero independently of included MIDI bytes. The 4th byte of the data channel in LSB tells the number of included MIDI bytes. This byte also includes the number of MIDI port. Therefore, the data format in this data channel is: * 1st: 0x80 as label * 2nd: MIDI bytes * 3rd: 0 or MIDI bytes * 4th: the number of MIDI byte and the number of MIDI port This commit adds support of MIDI messages in data block processing layer. Like AM824 data format, this data channel has a capability to transfer more MIDI messages than the capability of phisical MIDI bus. Therefore, a throttle for data rate is required to prevent devices' internal buffer to overflow. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire/digi00x/digi00x.h')
-rw-r--r--sound/firewire/digi00x/digi00x.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/sound/firewire/digi00x/digi00x.h b/sound/firewire/digi00x/digi00x.h
index b960c868b59b..88df67be5477 100644
--- a/sound/firewire/digi00x/digi00x.h
+++ b/sound/firewire/digi00x/digi00x.h
@@ -24,6 +24,7 @@
#include <sound/pcm_params.h>
#include <sound/firewire.h>
#include <sound/hwdep.h>
+#include <sound/rawmidi.h>
#include "../lib.h"
#include "../iso-resources.h"
@@ -103,15 +104,19 @@ enum snd_dg00x_optical_mode {
SND_DG00X_OPT_IFACE_MODE_COUNT,
};
+#define DOT_MIDI_IN_PORTS 1
+#define DOT_MIDI_OUT_PORTS 2
+
int amdtp_dot_init(struct amdtp_stream *s, struct fw_unit *unit,
enum amdtp_stream_direction dir);
int amdtp_dot_set_parameters(struct amdtp_stream *s, unsigned int rate,
- unsigned int pcm_channels,
- unsigned int midi_ports);
+ unsigned int pcm_channels);
void amdtp_dot_reset(struct amdtp_stream *s);
int amdtp_dot_add_pcm_hw_constraints(struct amdtp_stream *s,
struct snd_pcm_runtime *runtime);
void amdtp_dot_set_pcm_format(struct amdtp_stream *s, snd_pcm_format_t format);
+void amdtp_dot_midi_trigger(struct amdtp_stream *s, unsigned int port,
+ struct snd_rawmidi_substream *midi);
int snd_dg00x_transaction_register(struct snd_dg00x *dg00x);
int snd_dg00x_transaction_reregister(struct snd_dg00x *dg00x);