[alsa-devel] [PATCH 0/3] ALSA: oxfw: add support for TASCAM FireOne
Hi,
This parchset adds support for TASCAM FireOne to ALSA OXFW driver. PCM and MIDI functionalities become available including physical controls. The first and second patches are preparation for it.
This model supports some extra commands. So as the other ALSA drivers for sound and music units on IEEE 1394 bus, they should be implemented in userspace applications. For your information, I note them:
(Jog/Shuttle display mode) ./firewire-request /dev/fw1 fcp 0x01ff0000022e46493110ffff response: 000: 0c ff 00 00 02 2e 46 49 31 10 06 * The last byte is: * 0x00: always off * 0x01: always on * 0x02: breathe * 0x03: metronome * 0x04: MIDI clock rotate * 0x05: MIDI clock flash * 0x06: jog slow rotate * 0x07: Jog track
(Control surface mode) ./firewire-request /dev/fw1 fcp 0x01ff0000022e46493111ffff response: 000: 0c ff 00 00 02 2e 46 49 31 11 00 * The last bytes is: * 0x00: FireOne native * 0x01: Mackie Human User Interface emulation
(Input monitor monaural) ./firewire-request /dev/fw1 fcp 0x01ff0000022e46493112ffff response: 000: 0c ff 00 00 02 2e 46 49 31 12 00 * The last byte is: * 0x00: off * 0x01: on
(Firmware version, read-only) ./firewire-request /dev/fw1 fcp 0x01ff0000022e46493113ffff response: 000: 0c ff 00 00 02 2e 46 49 31 13 02 * The last byte is: * 0x02: version 2
I can see additional commands from Windows driver. They seem to be used to retrieve the name of data channels.
./firewire-request /dev/fw1 fcp 0x01ff0000022e48535460ff0000000040 response: 000: 0c ff 00 00 02 2e 48 53 54 60 ff 00 00 00 12 0c ......HST`...... response: 010: 41 75 64 69 6f 20 4f 75 74 20 4c 00 Audio Out L.
./firewire-request /dev/fw1 fcp 0x01ff0000022e48535460ff0000010040 response: 000: 0c ff 00 00 02 2e 48 53 54 60 ff 00 00 01 12 0c ......HST`...... response: 010: 41 75 64 69 6f 20 4f 75 74 20 52 00 Audio Out R.
./firewire-request /dev/fw1 fcp 0x01ff0000022e48535460ff0000020040 response: 000: 0c ff 00 00 02 2e 48 53 54 60 ff 00 00 02 12 09 ......HST`...... response: 010: 4d 69 64 69 20 4f 75 74 20 Midi Out
./firewire-request /dev/fw1 fcp 0x01ff0000022e48535460ff0001000040 response: 000: 0c ff 00 00 02 2e 48 53 54 60 ff 00 01 00 12 0b ......HST`...... response: 010: 41 75 64 69 6f 20 49 6e 20 41 00 Audio In A.
./firewire-request /dev/fw1 fcp 0x01ff0000022e48535460ff0001010040 response: 000: 0c ff 00 00 02 2e 48 53 54 60 ff 00 01 01 12 0b ......HST`...... response: 010: 41 75 64 69 6f 20 49 6e 20 42 00 Audio In B.
./firewire-request /dev/fw1 fcp 0x01ff0000022e48535460ff0001020040 response: 000: 0c ff 00 00 02 2e 48 53 54 60 ff 00 01 02 12 08 ......HST`...... response: 010: 4d 69 64 69 20 49 6e 20 Midi In
./firewire-request /dev/fw1 fcp 0x01ff0000022e48535470ff0000000040 response: 000: 0c ff 00 00 02 2e 48 53 54 70 ff 00 00 00 12 06 ......HSTp...... response: 010: 41 75 64 69 6f 20 Audio
./firewire-request /dev/fw1 fcp 0x01ff0000022e48535470ff0000010040 response: 000: 0c ff 00 00 02 2e 48 53 54 70 ff 00 00 01 12 00 ......HSTp......
./firewire-request /dev/fw1 fcp 0x01ff0000022e48535470ff0000020040 response: 000: 0a ff 00 00 02 2e 48 53 54 70 ff 00 00 02 00 40 ......HSTp.....@
./firewire-request /dev/fw1 fcp 0x01ff0000022e48535470ff0001000040 response: 000: 0c ff 00 00 02 2e 48 53 54 70 ff 00 01 00 12 06 ......HSTp...... response: 010: 41 75 64 69 6f 20 Audio
./firewire-request /dev/fw1 fcp 0x01ff0000022e48535470ff0001010040 response: 000: 0c ff 00 00 02 2e 48 53 54 70 ff 00 01 01 12 00 ......HSTp......
./firewire-request /dev/fw1 fcp 0x01ff0000022e48535470ff0001020040 response: 000: 0a ff 00 00 02 2e 48 53 54 70 ff 00 01 02 00 40 ......HSTp.....@
./firewire-request /dev/fw1 fcp 0x01ff0000022e48535460ff8100000040 response: 000: 0c ff 00 00 02 2e 48 53 54 60 ff 81 00 00 12 0c ......HST`...... response: 010: 4d 69 64 69 20 49 6e 20 4f 6e 65 00 Midi In One.
./firewire-request /dev/fw1 fcp 0x01ff0000022e48535460ff8101000040 response: 000: 0c ff 00 00 02 2e 48 53 54 60 ff 81 01 00 12 0d ......HST`...... response: 010: 4d 69 64 69 20 4f 75 74 20 4f 6e 65 00 Midi Out One.
./firewire-request /dev/fw1 fcp 0x01ff0000022e48535460ff8200000040 response: 000: 0c ff 00 00 02 2e 48 53 54 60 ff 82 00 00 12 0c ......HST`...... response: 010: 4d 69 64 69 20 49 6e 20 54 77 6f 00 Midi In Two.
./firewire-request /dev/fw1 fcp 0x01ff0000022e48535460ff8201000040 response: 000: 0c ff 00 00 02 2e 48 53 54 60 ff 82 01 00 12 0d ......HST`...... response: 010: 4d 69 64 69 20 4f 75 74 20 54 77 6f 00 Midi Out Two.
Takashi Sakamoto (3): ALSA: oxfw: calculating MIDI ports in stream discover ALSA: oxfw: support more MIDI ports ALSA: oxfw: add an entry for TASCAM FireOne
sound/firewire/oxfw/oxfw-midi.c | 24 +++--------------------- sound/firewire/oxfw/oxfw-stream.c | 37 +++++++++++++++++++++++++++++++++++-- sound/firewire/oxfw/oxfw.c | 17 +++++++++++++++++ 3 files changed, 55 insertions(+), 23 deletions(-)
Current OXFW driver calculates the number of MIDI ports just before adding ALSA MIDI ports. It's convenient for some devices with quirks to move these codes before handling quirks.
This commit implements this idea.
Signed-off-by: Takashi Sakamoto o-takashi@sakamocchi.jp --- sound/firewire/oxfw/oxfw-midi.c | 24 +++--------------------- sound/firewire/oxfw/oxfw-stream.c | 35 ++++++++++++++++++++++++++++++++++- 2 files changed, 37 insertions(+), 22 deletions(-)
diff --git a/sound/firewire/oxfw/oxfw-midi.c b/sound/firewire/oxfw/oxfw-midi.c index 37a86cf..8665e10 100644 --- a/sound/firewire/oxfw/oxfw-midi.c +++ b/sound/firewire/oxfw/oxfw-midi.c @@ -142,29 +142,11 @@ static void set_midi_substream_names(struct snd_oxfw *oxfw,
int snd_oxfw_create_midi(struct snd_oxfw *oxfw) { - struct snd_oxfw_stream_formation formation; struct snd_rawmidi *rmidi; struct snd_rawmidi_str *str; - u8 *format; - int i, err; - - /* If its stream has MIDI conformant data channel, add one MIDI port */ - for (i = 0; i < SND_OXFW_STREAM_FORMAT_ENTRIES; i++) { - format = oxfw->tx_stream_formats[i]; - if (format != NULL) { - err = snd_oxfw_stream_parse_format(format, &formation); - if (err >= 0 && formation.midi > 0) - oxfw->midi_input_ports = 1; - } - - format = oxfw->rx_stream_formats[i]; - if (format != NULL) { - err = snd_oxfw_stream_parse_format(format, &formation); - if (err >= 0 && formation.midi > 0) - oxfw->midi_output_ports = 1; - } - } - if ((oxfw->midi_input_ports == 0) && (oxfw->midi_output_ports == 0)) + int err; + + if (oxfw->midi_input_ports == 0 && oxfw->midi_output_ports == 0) return 0;
/* create midi ports */ diff --git a/sound/firewire/oxfw/oxfw-stream.c b/sound/firewire/oxfw/oxfw-stream.c index 2c63058..4879808 100644 --- a/sound/firewire/oxfw/oxfw-stream.c +++ b/sound/firewire/oxfw/oxfw-stream.c @@ -629,6 +629,9 @@ end: int snd_oxfw_stream_discover(struct snd_oxfw *oxfw) { u8 plugs[AVC_PLUG_INFO_BUF_BYTES]; + struct snd_oxfw_stream_formation formation; + u8 *format; + unsigned int i; int err;
/* the number of plugs for isoc in/out, ext in/out */ @@ -648,12 +651,42 @@ int snd_oxfw_stream_discover(struct snd_oxfw *oxfw) err = fill_stream_formats(oxfw, AVC_GENERAL_PLUG_DIR_OUT, 0); if (err < 0) goto end; + + for (i = 0; i < SND_OXFW_STREAM_FORMAT_ENTRIES; i++) { + format = oxfw->tx_stream_formats[i]; + if (format == NULL) + continue; + err = snd_oxfw_stream_parse_format(format, &formation); + if (err < 0) + continue; + + /* Add one MIDI port. */ + if (formation.midi > 0) + oxfw->midi_input_ports = 1; + } + oxfw->has_output = true; }
/* use iPCR[0] if exists */ - if (plugs[0] > 0) + if (plugs[0] > 0) { err = fill_stream_formats(oxfw, AVC_GENERAL_PLUG_DIR_IN, 0); + if (err < 0) + goto end; + + for (i = 0; i < SND_OXFW_STREAM_FORMAT_ENTRIES; i++) { + format = oxfw->rx_stream_formats[i]; + if (format == NULL) + continue; + err = snd_oxfw_stream_parse_format(format, &formation); + if (err < 0) + continue; + + /* Add one MIDI port. */ + if (formation.midi > 0) + oxfw->midi_output_ports = 1; + } + } end: return err; }
In IEC 61883-6, sequence multiplexing is applied to MIDI conformant data channel. As a result, eight MIDI data streams are included in the channel. Although ALSA AM824 data block processing layer implements this multiplexing, current OXFW driver doesn't utilize it due to wrong calculation of MIDI ports.
This commit fixes this bug to add proper calculation. Although this commit allows to use 8 MIDI data streams, the number of available MIDI ports is limited by the number of ALSA MIDI ports added by the driver.
Fixes: df075feefbd3('ALSA: firewire-lib: complete AM824 data block processing layer') Signed-off-by: Takashi Sakamoto o-takashi@sakamocchi.jp --- sound/firewire/oxfw/oxfw-stream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/firewire/oxfw/oxfw-stream.c b/sound/firewire/oxfw/oxfw-stream.c index 4879808..7cb5743 100644 --- a/sound/firewire/oxfw/oxfw-stream.c +++ b/sound/firewire/oxfw/oxfw-stream.c @@ -148,7 +148,7 @@ static int start_stream(struct snd_oxfw *oxfw, struct amdtp_stream *stream, }
pcm_channels = formation.pcm; - midi_ports = DIV_ROUND_UP(formation.midi, 8); + midi_ports = formation.midi * 8;
/* The stream should have one pcm channels at least */ if (pcm_channels == 0) {
TASCAM FireOne is based on OXFW971 and ALSA OXFW driver can support it. These are values of identical registers.
$ ./firewire-request /dev/fw1 read 0xfffff0050000 result: 97100105
$ ./firewire-request /dev/fw1 read 0xfffff0090020 result: 39373100
This commit adds an entry for this model. This model has physical controls and its MIDI control messages are transferred to second MIDI data stream multiplexed in one MIDI conformant data channel.
Signed-off-by: Takashi Sakamoto o-takashi@sakamocchi.jp --- sound/firewire/oxfw/oxfw.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
diff --git a/sound/firewire/oxfw/oxfw.c b/sound/firewire/oxfw/oxfw.c index d606e3a..588b93f 100644 --- a/sound/firewire/oxfw/oxfw.c +++ b/sound/firewire/oxfw/oxfw.c @@ -18,6 +18,7 @@ #define VENDOR_GRIFFIN 0x001292 #define VENDOR_BEHRINGER 0x001564 #define VENDOR_LACIE 0x00d04b +#define VENDOR_TASCAM 0x00022e
#define MODEL_SATELLITE 0x00200f
@@ -154,6 +155,15 @@ static void detect_quirks(struct snd_oxfw *oxfw) */ if (vendor == VENDOR_LOUD && model == MODEL_SATELLITE) oxfw->wrong_dbs = true; + + /* + * TASCAM FireOne has physical control and requires a pair of additional + * MIDI ports. + */ + if (vendor == VENDOR_TASCAM) { + oxfw->midi_input_ports++; + oxfw->midi_output_ports++; + } }
static int oxfw_probe(struct fw_unit *unit, @@ -323,6 +333,13 @@ static const struct ieee1394_device_id oxfw_id_table[] = { .specifier_id = SPECIFIER_1394TA, .version = VERSION_AVC, }, + /* TASCAM, FireOne */ + { + .match_flags = IEEE1394_MATCH_VENDOR_ID | + IEEE1394_MATCH_MODEL_ID, + .vendor_id = VENDOR_TASCAM, + .model_id = 0x800007, + }, { } }; MODULE_DEVICE_TABLE(ieee1394, oxfw_id_table);
On Sun, 18 Oct 2015 10:09:37 +0200, Takashi Sakamoto wrote:
Hi,
This parchset adds support for TASCAM FireOne to ALSA OXFW driver. PCM and MIDI functionalities become available including physical controls. The first and second patches are preparation for it.
This model supports some extra commands. So as the other ALSA drivers for sound and music units on IEEE 1394 bus, they should be implemented in userspace applications. For your information, I note them:
(Jog/Shuttle display mode) ./firewire-request /dev/fw1 fcp 0x01ff0000022e46493110ffff response: 000: 0c ff 00 00 02 2e 46 49 31 10 06
- The last byte is:
- 0x00: always off
- 0x01: always on
- 0x02: breathe
- 0x03: metronome
- 0x04: MIDI clock rotate
- 0x05: MIDI clock flash
- 0x06: jog slow rotate
- 0x07: Jog track
(Control surface mode) ./firewire-request /dev/fw1 fcp 0x01ff0000022e46493111ffff response: 000: 0c ff 00 00 02 2e 46 49 31 11 00
- The last bytes is:
- 0x00: FireOne native
- 0x01: Mackie Human User Interface emulation
(Input monitor monaural) ./firewire-request /dev/fw1 fcp 0x01ff0000022e46493112ffff response: 000: 0c ff 00 00 02 2e 46 49 31 12 00
- The last byte is:
- 0x00: off
- 0x01: on
(Firmware version, read-only) ./firewire-request /dev/fw1 fcp 0x01ff0000022e46493113ffff response: 000: 0c ff 00 00 02 2e 46 49 31 13 02
- The last byte is:
- 0x02: version 2
I can see additional commands from Windows driver. They seem to be used to retrieve the name of data channels.
./firewire-request /dev/fw1 fcp 0x01ff0000022e48535460ff0000000040 response: 000: 0c ff 00 00 02 2e 48 53 54 60 ff 00 00 00 12 0c ......HST`...... response: 010: 41 75 64 69 6f 20 4f 75 74 20 4c 00 Audio Out L.
./firewire-request /dev/fw1 fcp 0x01ff0000022e48535460ff0000010040 response: 000: 0c ff 00 00 02 2e 48 53 54 60 ff 00 00 01 12 0c ......HST`...... response: 010: 41 75 64 69 6f 20 4f 75 74 20 52 00 Audio Out R.
./firewire-request /dev/fw1 fcp 0x01ff0000022e48535460ff0000020040 response: 000: 0c ff 00 00 02 2e 48 53 54 60 ff 00 00 02 12 09 ......HST`...... response: 010: 4d 69 64 69 20 4f 75 74 20 Midi Out
./firewire-request /dev/fw1 fcp 0x01ff0000022e48535460ff0001000040 response: 000: 0c ff 00 00 02 2e 48 53 54 60 ff 00 01 00 12 0b ......HST`...... response: 010: 41 75 64 69 6f 20 49 6e 20 41 00 Audio In A.
./firewire-request /dev/fw1 fcp 0x01ff0000022e48535460ff0001010040 response: 000: 0c ff 00 00 02 2e 48 53 54 60 ff 00 01 01 12 0b ......HST`...... response: 010: 41 75 64 69 6f 20 49 6e 20 42 00 Audio In B.
./firewire-request /dev/fw1 fcp 0x01ff0000022e48535460ff0001020040 response: 000: 0c ff 00 00 02 2e 48 53 54 60 ff 00 01 02 12 08 ......HST`...... response: 010: 4d 69 64 69 20 49 6e 20 Midi In
./firewire-request /dev/fw1 fcp 0x01ff0000022e48535470ff0000000040 response: 000: 0c ff 00 00 02 2e 48 53 54 70 ff 00 00 00 12 06 ......HSTp...... response: 010: 41 75 64 69 6f 20 Audio
./firewire-request /dev/fw1 fcp 0x01ff0000022e48535470ff0000010040 response: 000: 0c ff 00 00 02 2e 48 53 54 70 ff 00 00 01 12 00 ......HSTp......
./firewire-request /dev/fw1 fcp 0x01ff0000022e48535470ff0000020040 response: 000: 0a ff 00 00 02 2e 48 53 54 70 ff 00 00 02 00 40 ......HSTp.....@
./firewire-request /dev/fw1 fcp 0x01ff0000022e48535470ff0001000040 response: 000: 0c ff 00 00 02 2e 48 53 54 70 ff 00 01 00 12 06 ......HSTp...... response: 010: 41 75 64 69 6f 20 Audio
./firewire-request /dev/fw1 fcp 0x01ff0000022e48535470ff0001010040 response: 000: 0c ff 00 00 02 2e 48 53 54 70 ff 00 01 01 12 00 ......HSTp......
./firewire-request /dev/fw1 fcp 0x01ff0000022e48535470ff0001020040 response: 000: 0a ff 00 00 02 2e 48 53 54 70 ff 00 01 02 00 40 ......HSTp.....@
./firewire-request /dev/fw1 fcp 0x01ff0000022e48535460ff8100000040 response: 000: 0c ff 00 00 02 2e 48 53 54 60 ff 81 00 00 12 0c ......HST`...... response: 010: 4d 69 64 69 20 49 6e 20 4f 6e 65 00 Midi In One.
./firewire-request /dev/fw1 fcp 0x01ff0000022e48535460ff8101000040 response: 000: 0c ff 00 00 02 2e 48 53 54 60 ff 81 01 00 12 0d ......HST`...... response: 010: 4d 69 64 69 20 4f 75 74 20 4f 6e 65 00 Midi Out One.
./firewire-request /dev/fw1 fcp 0x01ff0000022e48535460ff8200000040 response: 000: 0c ff 00 00 02 2e 48 53 54 60 ff 82 00 00 12 0c ......HST`...... response: 010: 4d 69 64 69 20 49 6e 20 54 77 6f 00 Midi In Two.
./firewire-request /dev/fw1 fcp 0x01ff0000022e48535460ff8201000040 response: 000: 0c ff 00 00 02 2e 48 53 54 60 ff 82 01 00 12 0d ......HST`...... response: 010: 4d 69 64 69 20 4f 75 74 20 54 77 6f 00 Midi Out Two.
Takashi Sakamoto (3): ALSA: oxfw: calculating MIDI ports in stream discover ALSA: oxfw: support more MIDI ports ALSA: oxfw: add an entry for TASCAM FireOne
Applied all three patches now. Thanks.
Takashi
sound/firewire/oxfw/oxfw-midi.c | 24 +++--------------------- sound/firewire/oxfw/oxfw-stream.c | 37 +++++++++++++++++++++++++++++++++++-- sound/firewire/oxfw/oxfw.c | 17 +++++++++++++++++ 3 files changed, 55 insertions(+), 23 deletions(-)
-- 2.1.4
Hi,
On Oct 19 2015 19:02, Takashi Iwai wrote:
This parchset adds support for TASCAM FireOne to ALSA OXFW driver. PCM and MIDI functionalities become available including physical controls. The first and second patches are preparation for it.
This model supports some extra commands. So as the other ALSA drivers for sound and music units on IEEE 1394 bus, they should be implemented in userspace applications. For your information, I note them:
(snip)
Takashi Sakamoto (3): ALSA: oxfw: calculating MIDI ports in stream discover ALSA: oxfw: support more MIDI ports ALSA: oxfw: add an entry for TASCAM FireOne
Applied all three patches now. Thanks.
Thanks to applying them.
For ALSA OXFW driver, I have an additional issue. SCS.1m/SCS.1d also use this chipset for its communication functionality. Currently, snd-scs1x is applied to these models with MIDI functionality, while we can merge it to snd-oxfw with MIDI/PCM functionality.
I've already written the patchset but it's a bit intrusive to snd-scs1x users. To avoid regressions, I'll contact to a developer who posted about this model in this mailing list (then, Clemens wrote the driver): http://mailman.alsa-project.org/pipermail/alsa-devel/2012-May/052264.html
On the other hand, it's two weeks rest till next merge window. I think it better to postpone them to next period...
Regards
Takashi Sakamoto
participants (2)
-
Takashi Iwai
-
Takashi Sakamoto