summaryrefslogtreecommitdiff
path: root/sound/firewire/fireface/ff.h
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2017-03-31 16:06:09 +0300
committerTakashi Iwai <tiwai@suse.de>2017-04-05 22:31:44 +0300
commit75d6d898977830d6d789083bf0a63ea6826124c8 (patch)
tree88dfec144484d3ce0eb0ca7291f065aec0138e18 /sound/firewire/fireface/ff.h
parent6fb7db902bbe6358b39f359b917f10e3c923058c (diff)
downloadlinux-75d6d898977830d6d789083bf0a63ea6826124c8.tar.xz
ALSA: fireface: add stream management functionality
This commit adds management functionality for packet streaming. As long as investigating Fireface 400, there're three modes depending on sampling transmission frequency. The number of data channels in each data block is different depending on the mode. The set of available data channels for each mode might be different for each protocol and model. The length of registers for the number of isochronous channel is just three bits, therefore 0-7ch are available. When bus reset occurs on IEEE 1394 bus, the device discontinues to transmit packets. This commit aborts PCM substreams at bus reset handler. As I described in followed commits, The device manages its sampling clock independently of sampling transmission frequency against IEC 61883-6. Thus, it's a lower cost to change the sampling transmission frequency, while data fetch between streaming layer and DSP require larger buffer for resampling. As a result, device latency might tend to be larger than ASICs for IEC 61883-1/6 such as DM1000/DM1100/DM1500 (BeBoB), DiceII/TCD2210/TCD2220/TCD3070 and OXFW970/971. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire/fireface/ff.h')
-rw-r--r--sound/firewire/fireface/ff.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/sound/firewire/fireface/ff.h b/sound/firewire/fireface/ff.h
index fa7242fd9b8c..6599c11744ae 100644
--- a/sound/firewire/fireface/ff.h
+++ b/sound/firewire/fireface/ff.h
@@ -24,6 +24,7 @@
#include "../lib.h"
#include "../amdtp-stream.h"
+#include "../iso-resources.h"
#define SND_FF_STREAM_MODES 3
@@ -68,6 +69,12 @@ struct snd_ff {
ktime_t next_ktime[SND_FF_OUT_MIDI_PORTS];
bool rx_midi_error[SND_FF_OUT_MIDI_PORTS];
unsigned int rx_bytes[SND_FF_OUT_MIDI_PORTS];
+
+ unsigned int substreams_counter;
+ struct amdtp_stream tx_stream;
+ struct amdtp_stream rx_stream;
+ struct fw_iso_resources tx_resources;
+ struct fw_iso_resources rx_resources;
};
enum snd_ff_clock_src {
@@ -107,6 +114,12 @@ int amdtp_ff_add_pcm_hw_constraints(struct amdtp_stream *s,
int amdtp_ff_init(struct amdtp_stream *s, struct fw_unit *unit,
enum amdtp_stream_direction dir);
+int snd_ff_stream_init_duplex(struct snd_ff *ff);
+void snd_ff_stream_destroy_duplex(struct snd_ff *ff);
+int snd_ff_stream_start_duplex(struct snd_ff *ff, unsigned int rate);
+void snd_ff_stream_stop_duplex(struct snd_ff *ff);
+void snd_ff_stream_update_duplex(struct snd_ff *ff);
+
void snd_ff_proc_init(struct snd_ff *ff);
int snd_ff_create_midi_devices(struct snd_ff *ff);