mirror of
https://github.com/alsa-project/alsa-tools.git
synced 2026-02-21 01:40:16 -05:00
us428control 0.4.5
- A new command line option indicates which interface model is actually present (-m us428|us224|mixxx) -- nb. the mixxx mode is actually orthogonal to the us428 and us224 ones, which are in turn both mutually exclusive, so that more than one -m option can be specified in the same command line, for compatibility sake; default to us428 mode, of course. - New BANK switching allows for mapping to a maximum of 32 (!) logical channel-tracks. This introduces effective BANK L/R button functionality. Under the default us428 mode it now offers a total of 4 switchable banks (or layers) for the available 8 fader-channels; while in the new us224 mode, one can switch across 8 banks of 4 fader-channels each. Each fader-channel maps sequentially (0-31) to a logical track in your DAW, when connected in a MMC closed-loop. This only applies when not in INPUT MONITOR mode. - SELECT, REC, MUTE and SOLO state LEDs/buttons/channel functionality are now split into INPUT MONITOR and BANK modes, so that each bank (layer) has its own state. INPUT MONITOR mode gets its own independent state, which is the only that affects the audio interface channel signal volume (via respective faders) through the internal hardware mixer -- nb. this special mode deals exclusively to channel/faders 0 and 1 (A/B) and eventually to 2 and 3 (C/D) which are only available on the US-428 and made accessible through modprobe'ing snd-usb-usx2y with nrpacks=1 and thus made usable via the special hwdep "rawusb" interface mode (ie. hw:N,2). - The new track-channel mapping gets effectively signaled through correspondent but rather experimental MMC MASKED WRITE sub-commands for RECORD, MUTE and SOLO arming. It is important to note that this late SOLO sub-command is just some MMC implementation mockup of mine, as I believe there's no support whatsoever for just that from the official MIDI MMC RP-013 document (which I don't even have access to date:) However, I've been prototyping around with this, to my own amusement and home-brew audio/MIDI sequencer, qtractor: http://qtractor.sourceforge.net - NULL fader switch LED is now switchable on/off, but not actually of any usefulness at this time ;) I have tried to maintain all previous functionality as it were. Of course I only tested this new stuff over my own US-224, for which it surely needs the '-m us224' command-line option. This is also proposedto be specified in a correspondent udev rule, for all this to work correctly OOTB for the US-224 at least. US-428 owners don't need to bother ;) From: Rui Nuno Capela <rncbc@rncbc.org>
This commit is contained in:
parent
ca6a8bac3c
commit
711d2aec15
6 changed files with 383 additions and 74 deletions
|
|
@ -3,6 +3,7 @@
|
|||
* Controller for Tascam US-X2Y
|
||||
*
|
||||
* Copyright (c) 2003 by Karsten Wiese <annabellesgarden@yahoo.de>
|
||||
* Copyright (c) 2004-2007 by Rui Nuno Capela <rncbc@rncbc.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -63,7 +64,7 @@ static void usage(void)
|
|||
printf("Tascam US-428 Control\n");
|
||||
printf("version %s\n", VERSION);
|
||||
printf("usage: "PROGNAME" [-v verbosity_level 0..2] [-c card] [-D device] [-u usb-device] [-m mode]\n");
|
||||
printf("mode is one of (native, mixxx)\n");
|
||||
printf("mode is one of (us224, us428, mixxx)\n");
|
||||
}
|
||||
/*
|
||||
* check the name id of the given hwdep handle
|
||||
|
|
@ -85,7 +86,7 @@ static int check_hwinfo(snd_hwdep_t *hw, const char *id, const char* usb_dev_nam
|
|||
return 0; /* ok */
|
||||
}
|
||||
|
||||
int US428Control(const char* DevName, int mode)
|
||||
int US428Control(const char* DevName, int mode, int y)
|
||||
{
|
||||
snd_hwdep_t *hw;
|
||||
int err;
|
||||
|
|
@ -95,7 +96,8 @@ int US428Control(const char* DevName, int mode)
|
|||
int npfd, pollrc;
|
||||
|
||||
if ((err = snd_hwdep_open(&hw, DevName, O_RDWR)) < 0) {
|
||||
error("cannot open hwdep %s\n", DevName);
|
||||
if (verbose > 1)
|
||||
error("cannot open hwdep %s\n", DevName);
|
||||
return err;
|
||||
}
|
||||
|
||||
|
|
@ -105,6 +107,9 @@ int US428Control(const char* DevName, int mode)
|
|||
return -ENODEV;
|
||||
}
|
||||
|
||||
if (verbose > 0)
|
||||
fprintf(stderr, PROGNAME ": US-X2Y-compatible card found on hwdep %s\n", DevName);
|
||||
|
||||
Midi.CreatePorts();
|
||||
|
||||
npfd = snd_seq_poll_descriptors_count(Midi.Seq, POLLIN) + 1;
|
||||
|
|
@ -118,11 +123,12 @@ int US428Control(const char* DevName, int mode)
|
|||
snd_hwdep_close(hw);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
us428ctls_sharedmem->CtlSnapShotRed = us428ctls_sharedmem->CtlSnapShotLast;
|
||||
if (mode == 1)
|
||||
OneState = new Cus428StateMixxx(us428ctls_sharedmem);
|
||||
OneState = new Cus428StateMixxx(us428ctls_sharedmem, y);
|
||||
else
|
||||
OneState = new Cus428State(us428ctls_sharedmem);
|
||||
OneState = new Cus428State(us428ctls_sharedmem, y);
|
||||
|
||||
OneState->InitDevice();
|
||||
|
||||
|
|
@ -131,7 +137,7 @@ int US428Control(const char* DevName, int mode)
|
|||
if (verbose > 1 || pfds[0].revents & (POLLERR|POLLHUP))
|
||||
printf("poll returned 0x%X\n", pfds[0].revents);
|
||||
if (pfds[0].revents & (POLLERR|POLLHUP))
|
||||
return -ENXIO;
|
||||
return 0; /* -ENXIO; */
|
||||
int Last = us428ctls_sharedmem->CtlSnapShotLast;
|
||||
if (verbose > 1)
|
||||
printf("Last is %i\n", Last);
|
||||
|
|
@ -158,6 +164,7 @@ int US428Control(const char* DevName, int mode)
|
|||
int main (int argc, char *argv[])
|
||||
{
|
||||
int c;
|
||||
int y = 8;
|
||||
int mode = 0;
|
||||
int card = -1;
|
||||
char *device_name = NULL,
|
||||
|
|
@ -179,6 +186,12 @@ int main (int argc, char *argv[])
|
|||
verbose = atoi(optarg);
|
||||
break;
|
||||
case 'm':
|
||||
if (!strcmp(optarg, "us224"))
|
||||
y = 4;
|
||||
else
|
||||
if (!strcmp(optarg, "us428"))
|
||||
y = 8;
|
||||
else
|
||||
if (!strcmp(optarg, "mixxx"))
|
||||
mode = 1;
|
||||
break;
|
||||
|
|
@ -201,24 +214,28 @@ int main (int argc, char *argv[])
|
|||
}
|
||||
}
|
||||
if (device_name) {
|
||||
return US428Control(device_name, mode) != 0;
|
||||
return US428Control(device_name, mode, y) != 0;
|
||||
}
|
||||
if (card >= 0) {
|
||||
sprintf(name, "hw:%d", card);
|
||||
return US428Control(name, mode) != 0;
|
||||
return US428Control(name, mode, y) != 0;
|
||||
}
|
||||
|
||||
/* probe the all cards */
|
||||
for (c = 0; c < SND_CARDS; c++) {
|
||||
// verbose--;
|
||||
sprintf(name, "hw:%d", c);
|
||||
if (!US428Control(name, mode))
|
||||
if (US428Control(name, mode, y) == 0) {
|
||||
card = c;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (card < 0) {
|
||||
fprintf(stderr, PROGNAME ": no US-X2Y-compatible cards found\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue