Tascam US-428 4-in/2-out with Jack [Solved partially]

Talk about your MIDI interfaces, microphones, keyboards...

Moderators: MattKingUSA, khz

Post Reply
Gwyndaf
Established Member
Posts: 26
Joined: Mon Dec 02, 2013 12:15 pm
Location: London, UK

Tascam US-428 4-in/2-out with Jack [Solved partially]

Post by Gwyndaf »

Anyone recently succeeded in fully setting up a Tascam US-428?
So far I've got it working nicely enough as a 2-in 2-out audio device in both ALSA and JACK, but still failing to get inputs C/D working. Although I've found plenty of old giudance on this, I'm still getting problems.

Currently:
- Works ok (and all channels working) when tested with Windows
- Kernel module snd-usb-usx2y, firmware and us428control all loaded automatically by udev (seems I have to connect it a second time, but that's a minor glitch I can live with)
- I can use it fine as hw:3,0 for 2-channel ALSA and JACK usage
- I'm using the latest Liquorix kernel and 'performance' CPU clock speed (which serves other audio hardware nicely)

But, if I try to run JACK on the raw USB / hwdep device hw:n,2 (which I understand is the way to get all 4 inputs) I get a message that it's already in use:

Code: Select all

$ jackd -dalsa -dhw:3,2
jackdmp 1.9.10
...
no message buffer overruns
no message buffer overruns
no message buffer overruns
JACK server starting in realtime mode with priority 10
self-connect-mode is "Don't restrict self connect requests"
audio_reservation_init
Acquire audio card Audio3
creating alsa driver ... hw:3,2|hw:3,2|1024|2|48000|0|0|nomon|swmeter|-|32bit
Using ALSA driver USB US-X2Y running on card 3 - TASCAM US-X2Y (1604:8001 if 0 at 003/006)


ATTENTION: The playback device "hw:3,2" is already in use. Please stop the application using it and run JACK again
Cannot initialize driver
JackServer::Open failed with -1
Failed to open server
So, any suggestion what might be 'already using' this device, or whether that's a phantom message that signifies something else? This comes from a fresh start, with pulseaudio disabled, so I know of nothing that should be using it.

Looking ahead, I'm hoping to use this as a control surface for Ardour, so any tips on using this (full interactivity, LEDs etc working) also much appreciated.
Last edited by Gwyndaf on Wed Nov 19, 2014 11:03 pm, edited 1 time in total.
Pablo
Established Member
Posts: 1274
Joined: Thu Apr 17, 2008 9:57 pm
Been thanked: 3 times

Re: Tascam US-428

Post by Pablo »

Just some ideas:

In order to see what is using the sound card, I suggest you do something like:

lsof /dev | grep snd

You will see what opened the file /dev/snd/pcmC3D2p (just guessing)

The command "aplay -l" will show the playback devices and "arecord -l" will show the capture devices. Devices that appear in both lists are, obviously, duplex devices. The problem seems to be that some channels are in other device(s) that the default. So you can try something like alsa_out, or alsa_in, or, better, the zita a2j and/or j2a bridges to tell jack to take other devices into account, after starting jack on the default device (which I guess is hw:3,0).

Or you can try to make a virtual device in ~/.asoundrc that integrates the two (or three?) devices.
Gwyndaf
Established Member
Posts: 26
Joined: Mon Dec 02, 2013 12:15 pm
Location: London, UK

Re: Tascam US-428

Post by Gwyndaf »

Thanks for the suggestions. I tried lsof /dev already and it shows nothing, which is why I wondered whether it was maybe a phantom message triggered by something else.

Great idea trying zita-a2j to add the additional ports on top of a basic 2-in/2-out Jack setup on the working ALSA ports. But sadly a similar response, and comes back with:
Can't open ALSA capture device 'hw:3,1' (same for hw:3,2)
hw:3,0 is duplex 2-in/2-out
hw:3,1 is 2-in only
hw:3,2 is supposedly a special device that 'merges' these into a 4-in/2-out duplex.
Apparently it's a hwdep or rawusb mode device, but I don't know what further Jack options can help access it.

So, next step looks like tinkering with ALSA. I don't know .asoundrc setup that well, but happy to dive into understanding that. I've seen some references to a usb_stream ALSA module so maybe that's my next step to test out:
http://www.linuxmusicians.com/viewtopic.php?f=27&t=7679
Gwyndaf
Established Member
Posts: 26
Joined: Mon Dec 02, 2013 12:15 pm
Location: London, UK

Re: Tascam US-428

Post by Gwyndaf »

Success!

I tried using Jack1 instead of Jack2 and it works. In particular, seems to find the ALSA/USX2Y rawusb driver that's needed for 4-in/2-out operation. Seems to work equally well from command line or Qjackctrl:

Code: Select all

22:50:57.195 /usr/bin/jackd -dalsa -dhw:3,2 -r48000 -p256 -n3 -S -i4 -o2
connect(2) call to /dev/shm/jack-1027/default/jack_0 failed (err=No such file or directory)
attempt to connect to server failed
jackd 0.124.2
Copyright 2001-2009 Paul Davis, Stephane Letz, Jack O'Quinn, Torben Hohn and others.
jackd comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it
under certain conditions; see the file COPYING for details
JACK compiled with System V SHM support.
loading driver ..
22:50:57.469 JACK was started with PID=4870.
apparent rate = 48000
creating alsa driver ... hw:3,2|hw:3,2|256|3|48000|4|2|nomon|swmeter|-|16bit
ALSA/USX2Y: EXPERIMENTAL hwdep pcm device hw:3,2 (aka "rawusb")
configuring for 48000Hz, period = 256 frames (5.3 ms), buffer = 3 periods
ALSA: final selected sample format for capture: 16bit little-endian
ALSA: use 3 periods for capture
ALSA: final selected sample format for playback: 16bit little-endian
ALSA: use 3 periods for playback
22:50:59.502 JACK connection change.
22:50:59.508 Server configuration saved to "/home/alun/.jackdrc".
22:50:59.513 Statistics reset.
22:50:59.577 Client activated.
22:50:59.636 Buffer size change (256).
A few stability/performance issues, but basically seems to imply that ALSA/USX2Y support is missing or not working in Jack2, rather than being a problem of my ALSA setup.

For now I'll treat this a partially solved as I still can't fully use KXstudio tools without Jack2/Dbus. But it's a major step forward.
Gwyndaf
Established Member
Posts: 26
Joined: Mon Dec 02, 2013 12:15 pm
Location: London, UK

Re: Tascam US-428 4-in/2-out with Jack [Solved partially]

Post by Gwyndaf »

So now I've got this working with jackdbus, which means being able to use LADISH and Claudia. This is with the KXstudio build of Jack1, which I think includes dbus compatibility.

The key seems to be referencing the card number directly (e.g. hw:3,2). Using hw:USX2Y,2 for some reason reports the device as already in use and fails (though seems ok when starting jackd directly). With Cadence, the Jack config lists only the ALSA alias (USX2Y), so just means the card details have to be entered manually.

Still seems a bit unstable, but at least it's going broadly in the right direction!
Gwyndaf
Established Member
Posts: 26
Joined: Mon Dec 02, 2013 12:15 pm
Location: London, UK

Re: Tascam US-428 4-in/2-out with Jack [Solved partially]

Post by Gwyndaf »

Some possible advance on the stability front. After switching to a 64bit setup (LMDE2, KXstudio, Thinkpad R61i), things initially seemed to go worse than before, with solid white-ish noise when starting jack with the hwdep ALSA port (hw:n,2), but no jack messages to help troubleshoot. OK when using hw:n,0 but that doesn't get all four US428 inputs.

What seemed to solve it was this: although I'd got rtirq set up, with USB prioritised, these devices (including now a US224) are USB1, and weren't getting a big enough bite of the bandwidth. That's as best I can describe it with my limited knowledge of Linux USB handling: I think each physical port manifests in Linux as two devices, for regular (uhci_hcd) and high speed (ehci_hcd) connections.

So, I explicitly added the regular speed devices to rtirq ahead of generic USB:

Code: Select all

RTIRQ_NAME_LIST="rtc uhci_hcd usb snd i8042"
This seems to help achieve noise-free running: not consistently, but at least makes it possible and stable once running. Right now, it still seems a bit random, and I'll update this if I can work out more specifically what's going on.
dannybender
Established Member
Posts: 9
Joined: Wed Mar 28, 2018 3:27 am

Re: Tascam US-428 4-in/2-out with Jack [Solved partially]

Post by dannybender »

Hey, I'm a novice in Linux; I'm currently using Mint Cinnamon 18.3, & can't even C that the computer recognizes my US 428. What did U do 2 begin with 2 even make it work?
dannybender
Established Member
Posts: 9
Joined: Wed Mar 28, 2018 3:27 am

Re: Tascam US-428 4-in/2-out with Jack [Solved partially]

Post by dannybender »

Hey, that's great that you got the US 428 even partially working! I'd greatly appreciate you giving me an explanation of how you did it, for I'm yearning to get mine going in Mint Cinnamon 18.3.
Gwyndaf
Established Member
Posts: 26
Joined: Mon Dec 02, 2013 12:15 pm
Location: London, UK

Re: Tascam US-428 4-in/2-out with Jack [Solved partially]

Post by Gwyndaf »

Hi Danny,
Really sorry I failed to respond to this at the time, but better late than never! I've not touched this for ages but was just recently looking at it again.

I've yet to get this running totally reliably, and have some things that were working got knocked back with distro/kernel updates. Sometimes the crashes are so bad they lock up the whole computer when I try to restart jack, and I've generally tended to go with a simpler interface, but still occasionally come back to see if I can get more life out of this.

All my experience has been on Debian-based distros (LMDE), so should be close to your own experience.
Broadly, this is what's involved (as at last time I gave this serious attention):

1. Make sure the interface is being seen by ALSA
  • Use 'aplay -l' in a terminal to monitor the sound devices that ALSA recognises
  • Plug in interface, and keep monitoring with 'aplay -l' (it might take a while)
  • Eventually, the interface should be listed, as two devices (0 and 2)
  • If it's still not listed after a minute or two, unplug and replug; keep retesting with 'aplay -l'
RATIONALE: to get full functionality, the card needs to be detected, firmware for the card loaded, and the 'modified' device (with firmware) detected again (device 2), and the device kernel module (snd-usb-usx2y) loaded. This should all be done by udev, but my past experience has been that is doesn't (didn't) do it all automatically.
To avoid the double-plugging, I make the driver (snd-usb-usx2y) load manually, by including it in /etc/modules.
NOTE: you can also try adding 'options snd-usb-usx2y nrpacks=1' in a conf file in /etc/modprobe.d (I don't know exactly what this does, but general advice has been that it's necessary to help the kernel module best handle the data throughput).

2. Make sure control software (us428control) is running
  • Once card has been detected, in terminal, use 'ps -A | grep us428control' to check if software process is running
  • If not, run 'us428control &' (the & makes it a background process so you can exit the terminal and it keeps running)
  • Response to the successful command should be something like 'US-X2Y-compatible card found on hwdep hw:2'
RATIONALE: this is mainly to enable communication between knobs and buttons on the interface, but also including the main volume control, so I find it still needs to be running to get audio functionality, even if I'm not using all the controls.

I found lots of sources on the web that describe how to do these two steps manually, but found it's mostly taken care of automatically by udev and should't need much more effort, apart from the double-plugging.

3. Run jack
  • Use jack1 (not jack2).
  • My main discovery was that I need to use jack1 (not jack2), as that contains elements to support the USX2Y interface, but jack2 doesn't (didn't).
  • I think falkTX is now developing jack2, but have heard nothing about adding in USX2Y functionality.
  • The kxstudio build of jack1 includes dbus functionality, so you can control jack with Cadence, or you can just use qjackctl or command line with other builds
  • Specific jack parameters might depend on your system, but the ones I found most significant (IIRC):
    • Set/force 16-bit
    • Reference card as hw:n,2 with n as card number and 2 as device number (2 for full functionality, 0 for basic). This is (was) more reliable that using the system-assigned hw:USX2Y,2 (on a US-428 you need device :2 for the full 4 inputs)
    • Sample rate, buffer size, periods/buffer you can tweak for best performance on your system, but I think I found 3 periods/buffer better than the default of 2.
Things I don't really know/understand
Some of what I discovered ran up against the limits of my knowledge, or time/patience to find out more fully. These include:
  • These are USB1 devices, and I suspect some of the unreliability comes from playing badly with USB2. I've not tried USB3, but that may have similar problems. Although I've tried things like running it through various hubs, I can't give a definitive 'best approach'
  • Sometimes, if it was working ok without the us428control software running, things went bad (heavy digital noise/distortion instead of clean sound) when I ran us428control. That made me suspect it was messing with the data throughput, and I made a stab at rewriting it, but I'm not much of a programmer, so didn't get too far beyond getting more control over button mappings.
  • I'm currently running a US-224 (smaller version of US-428), just as device 0, and with jack2. This wouldn't give 4 full inputs on a US-428 but seems to work ok for a reasonable while. But, when it crashes it totally locks up the computer. That makes me think there's some problem at a low level, like hardware or kernel module.
  • It's possible to use rtirq to prioritise how the computer handles different devices, e.g. to prioritise these USB1 cards, but I've never managed to find a totally reliable solution.
Lots of this knowledge/experience is a few years old, so I think the broad principles should still hold true, but the specifics might have changed with newer software versions. I still like these machines as handy and inexpensive so, if I even find a reliable solution, will post again, maybe in another few years!
Post Reply