Ultralite AVB

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

Moderators: MattKingUSA, khz

pemberley
Established Member
Posts: 24
Joined: Sun Jan 13, 2019 11:33 pm

Re: Ultralite AVB

Post by pemberley »

superb, have you tried different versions of the firmware? MOTU has published all historical firmware versions (I think it's upstream here; I can link it if you can't find it) for their various AVB devices.

I went down a similar path as you are: patching the realtime kernel, setting thread priorities, scheduling algorithms, etc etc. At some point, I had been fast and loose enough with this that I needed to go again with the entire os from scratch. Out of curiosity, on my fresh install, I first tried downgrading the MOTU device firmware (the final step that made it work before), and it worked just as well. At least on my machine, simply selecting the right firmware with a stock computer is enough to get it working well. I haven't hit it really hard yet (number of channels, sample rate, etc) but I'm optimistic.
pemberley
Established Member
Posts: 24
Joined: Sun Jan 13, 2019 11:33 pm

Re: Ultralite AVB

Post by pemberley »

ah sorry, I just found the bottom bit about how your device doesn't have the older firmware versions that some others do; that's unfortunate. Hopefully MOTU is working on this.

Could you maybe get an ADAT <-> USB box that plays better with Linux? Never tried it, just a random idea. The conversion will still happen in the MOTU unit, you'd just need a format transcoder that talks nicely with your linux machine, I think.
supereb
Established Member
Posts: 93
Joined: Fri Aug 17, 2018 10:55 pm
Has thanked: 36 times
Been thanked: 5 times

Re: Ultralite AVB

Post by supereb »

Hi pemberly,

Thanks for the reply. I have thought about interfacing with another box, maybe an Ultralite AVB since those seem to work, but also I was trying to go for simplicity. Single interface with mic pres, no mixer or additional boxes. The MOTU AVB line seemed like a dream come true for those of us who want to run Linux, but as you know, class compliant doesn't always mean class compliant. The 8pre-ES would be perfect for my needs otherwise. I've been back on WIndows for the last six months or so that I've had it, but really long to ditch Windows for variety of reasons.

I'd really like to keep this interface,but ultimately I;d swap it out if I had to, to get off Windows.

I've not totally given up, but it's been a long week and I'm tired. I'm a newbie when it comes to Linux, so it's hard for me to know when to throw in the towel.

Hopefully this can get sorted out but regardless, I'm grateful for everyone here (especially Drumfix) for sharing their knowledge.
Drumfix
Established Member
Posts: 299
Joined: Mon Jan 26, 2009 5:15 pm
Been thanked: 11 times

Re: Ultralite AVB

Post by Drumfix »

Don't worry, we will get your device to run.

Based on the jack output i assume your device is set to UAC mode instead of the proprietary mode.

After the device booted up you must run the curl commands to set the device into proprietary mode (with the ip address of your own device).
The value set for MaxUsbToHost in the curl command must match the number of channels of the quirk you selected before compiling the kernel.

The number of in/out channels in the call to jack must match the number of channels in MaxUsbToHost.
supereb
Established Member
Posts: 93
Joined: Fri Aug 17, 2018 10:55 pm
Has thanked: 36 times
Been thanked: 5 times

Re: Ultralite AVB

Post by supereb »

Drumfix wrote:Don't worry, we will get your device to run...
Thanks Drumfix! I did do the curl commands on a previous attempt, but unfortunately did not save any log messages. I nuked the patched 4.19 kernel last night, for some reason it was filling up the hard drive with huge log files.

Recompiling now and will post the jack log after sending the curl commands to the interface.
supereb
Established Member
Posts: 93
Joined: Fri Aug 17, 2018 10:55 pm
Has thanked: 36 times
Been thanked: 5 times

Re: Ultralite AVB

Post by supereb »

Recompiled, documenting every step:

Code: Select all

cd /usr/src
sudo tar xf linux-source-4.19.tar.xz
cd linux-source-4.19
#in root terminal
cd/usr/src/linux-source-4.19
xcat ../linux-patch-4.19-rt.patch.xz
#user terminal
#copy motu-proprietary_pcm.c.patch, pcm.c.patch-2.patch to /usr/src/linux-source-4.19/sound/usb
cd /sound/usb
patch < motu-proprietary_pcm.c.patch
# The first two hunks will be rejected so,
patch < pcm.c.patch-2.patch
#Copy 24 channel quirk from	motu_proprietary_quirk.txt into quirks-table.h in the MOTU quirks section
cd ..
cd ..
# Now in /usr/src/linux-source-4.19
sudo cp /boot/config-$(uname -r) .config
# Open .config in text editor, Comment out line: CONFIG_SYSTEM_TRUSTED_KEYS="debian/certs/benh@debian.org.cert.pem"
sudo make menuconfig
#Go to general settings, select preemption model and set to "Full". Save and exit.
sudo make -j 4
# if .config not found warning on first line, stop, make clean, make menuconfig and re-save configuration, then sudo make -j 4
sudo make modules -j 4
sudo make modules_install -j 4

#The following warnings at end of last step:
# depmod: WARNING: /lib/modules/4.19.5-rt3/updates/vboxvideo.ko needs unknown symbol mutex_lock
% depmod: WARNING: /lib/modules/4.19.5-rt3/updates/vboxvideo.ko needs unknown symbol __mutex_init
$ depmod: WARNING: /lib/modules/4.19.5-rt3/updates/vboxvideo.ko needs unknown symbol mutex_trylock
$ depmod: WARNING: /lib/modules/4.19.5-rt3/updates/vboxvideo.ko needs unknown symbol mutex_unlock

sudo make install -j 4

# 19.4 GB free after install

sudo reboot

curl --data 'json={"value":"USB2"}' 10.0.0.96/datastore/host/mode
curl --data 'json={"value":"64"}' 10.0.0.96/datastore/host/maxUSBToHost


Qjackctrl shows two devices, hw:AVB,0 USB Audio (hw:2,0) and hw:AVB AVB (hw:2). Here is the log for hw:AVB,0 USB Audio (hw:2,0):

Code: Select all

13:50:05.728 Statistics reset.
13:50:05.818 ALSA connection change.
Cannot read socket fd = 24 err = Success
CheckRes error
JackSocketClientChannel read fail
Cannot open qjackctl client
JackShmReadWritePtr1::~JackShmReadWritePtr1 - Init not done for 4294967295, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for 4294967295, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for 4294967295, skipping unlock
13:50:10.961 ALSA connection graph change.
13:50:19.720 JACK is starting...
13:50:19.732 /usr/bin/pasuspender -- jackd -P97 -t50000 -dalsa -r44100 -p512 -n3 -D -Chw:AVB,0 -Phw:AVB,0 -i24 -o24
Cannot read socket fd = 24 err = Success
CheckRes error
JackSocketClientChannel read fail
Cannot open qjackctl client
JackShmReadWritePtr1::~JackShmReadWritePtr1 - Init not done for 4294967295, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for 4294967295, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for 4294967295, skipping unlock
13:50:19.888 JACK was started with PID=5975.
`default' server already active
Failed to open server
jackdmp 1.9.11
Copyright 2001-2005 Paul Davis and others.
Copyright 2004-2014 Grame.
jackdmp 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
13:50:20.054 JACK was stopped
13:50:27.129 Could not connect to JACK server as client. - Overall operation failed. - Server communication error. Please check the messages window for more info.
Cannot read socket fd = 24 err = Success
CheckRes error
JackSocketClientChannel read fail
Cannot open qjackctl client
JackShmReadWritePtr1::~JackShmReadWritePtr1 - Init not done for 4294967295, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for 4294967295, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for 4294967295, skipping unlock
Here is the output when hw:AVB AVB (hw:2) is selected:

Code: Select all

13:57:25.111 Statistics reset.
13:57:25.205 ALSA connection change.
Cannot read socket fd = 24 err = Success
CheckRes error
JackSocketClientChannel read fail
Cannot open qjackctl client
JackShmReadWritePtr1::~JackShmReadWritePtr1 - Init not done for 4294967295, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for 4294967295, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for 4294967295, skipping unlock
13:57:30.262 ALSA connection graph change.
13:57:38.445 JACK is starting...
13:57:38.446 /usr/bin/pasuspender -- jackd -P97 -t50000 -dalsa -r44100 -p512 -n3 -D -Chw:AVB,0 -Phw:AVB,0 -i24 -o24
Cannot read socket fd = 24 err = Success
CheckRes error
JackSocketClientChannel read fail
Cannot open qjackctl client
JackShmReadWritePtr1::~JackShmReadWritePtr1 - Init not done for 4294967295, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for 4294967295, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for 4294967295, skipping unlock
`default' server already active
Failed to open server
jackdmp 1.9.11
Copyright 2001-2005 Paul Davis and others.
Copyright 2004-2014 Grame.
jackdmp 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
13:57:38.546 JACK was started with PID=6854.
13:57:38.612 JACK was stopped
13:57:45.756 Could not connect to JACK server as client. - Overall operation failed. - Server communication error. Please check the messages window for more info.
Cannot read socket fd = 24 err = Success
CheckRes error
JackSocketClientChannel read fail
Cannot open qjackctl client
JackShmReadWritePtr1::~JackShmReadWritePtr1 - Init not done for 4294967295, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for 4294967295, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for 4294967295, skipping unlock
P.S. - Something about this kernel build generates log files that while quickly fill up the remaining space on the hard drive and make it unusable!
Drumfix
Established Member
Posts: 299
Joined: Mon Jan 26, 2009 5:15 pm
Been thanked: 11 times

Re: Ultralite AVB

Post by Drumfix »

Does it work, if you set a samplerate of 192000 ?

If not, try the 64 channel quirk with 44100 and set 64 channels in/out in jack.

Or, if you just want the patched class compliant mode, then do not copy any of the quirks into the quirks-table.c and instead, in the patch file i gave you earlier, change the line

Code: Select all

+		iface = usb_ifnum_to_if(dev, 5); // 2 for UAC, 5 for USB2
to

Code: Select all

+		iface = usb_ifnum_to_if(dev, 2); // 2 for UAC, 5 for USB2
supereb
Established Member
Posts: 93
Joined: Fri Aug 17, 2018 10:55 pm
Has thanked: 36 times
Been thanked: 5 times

8pre-ES working in Linux!

Post by supereb »

SUCCESS!

8pre-ES is now working in Linux! Listened to a whole album played through a pair of inputs on the interface and routed back out using qjackctrl. Left on overnight and in the morning my output channels were still correct - no swapping! I can't tell you how happy I am!

Fresh install of MX 18.2, only qjackctrl installed, no system tweaks. Compiled 4.9-RT with 24, 32, and 64 channel quirks.

Thank you Drumfix for the patch/quirks, and pemberly for suggesting that a fresh install might help.

I did observe some interesting behavior:
  • 64 channel quirk works on 44.1kHz and 48kHz as expected.

    32 channel quirk only works with 88.2kHz and 96kHz, Jack crashes if 44.1 or 48kHz are selected.

    24 channel quirk - Jack crashes at any sample rate. I thought that maybe it would work at 176.4kHz and 192kHz based on the results with the other two quirks but it didn't.
I suspect the Windows driver must be loading alternate drivers depending on the sample rate requested by an application.

Is there a way to have 44.1 - 48 - 88.2 - 96kHz without rebooting into different kernels?
User avatar
bluebell
Established Member
Posts: 1909
Joined: Sat Sep 15, 2012 11:44 am
Location: Saarland, Germany
Has thanked: 111 times
Been thanked: 116 times

Re: Ultralite AVB

Post by bluebell »

Unloading and reloading the module?

modprobe -r ...
modprobe

Linux – MOTU UltraLite AVB – Qtractor – http://suedwestlicht.saar.de/

stanlea
Established Member
Posts: 700
Joined: Wed Apr 25, 2012 9:49 pm
Has thanked: 41 times
Been thanked: 23 times

Re: Ultralite AVB

Post by stanlea »

On my side I have a 828ES (not preES, meaning I have 2 preamps, not 8). Actually I run it as Class Compliant device, with the oldest BIOS I could find, and I have the 2 (not so big) well known issues : channel hoping and "stuttering effect". Generally a reboot of the unit throught the web interface solves the issues.
I'm not at all familiar with patching kernel, so can someone explain what I can expect from the patches provided :
- enhance class compliant mode with more stable channels ?
- change from class compliant to another mode (but which one ? AVB ?) ?

Thanks for you investment here.
supereb
Established Member
Posts: 93
Joined: Fri Aug 17, 2018 10:55 pm
Has thanked: 36 times
Been thanked: 5 times

Re: Ultralite AVB

Post by supereb »

stanlea wrote:I'm not at all familiar with patching kernel, so can someone explain what I can expect from the patches provided :
- enhance class compliant mode with more stable channels ?
- change from class compliant to another mode (but which one ? AVB ?) ?
See Drumfix's two posts on page 12 of this thread. It involves changing the operating mode of the MOTU interface to "USB2" (Windows), applying a patch to the pcm.c file and a quirk entry to quirks-table.h in the kernel source.
supereb
Established Member
Posts: 93
Joined: Fri Aug 17, 2018 10:55 pm
Has thanked: 36 times
Been thanked: 5 times

Re: Ultralite AVB

Post by supereb »

bluebell wrote:Unloading and reloading the module?

modprobe -r ...
modprobe
I understand this conceptually, but am not sure how I would create an 'alternate' module that includes the alternate quirk. At my present level of Linux experience, I'm impressed with myself for even being able to compile a kernel!
stanlea
Established Member
Posts: 700
Joined: Wed Apr 25, 2012 9:49 pm
Has thanked: 41 times
Been thanked: 23 times

Re: Ultralite AVB

Post by stanlea »

supereb wrote:
stanlea wrote:I'm not at all familiar with patching kernel, so can someone explain what I can expect from the patches provided :
- enhance class compliant mode with more stable channels ?
- change from class compliant to another mode (but which one ? AVB ?) ?
See Drumfix's two posts on page 12 of this thread. It involves changing the operating mode of the MOTU interface to "USB2" (Windows), applying a patch to the pcm.c file and a quirk entry to quirks-table.h in the kernel source.
Still I don't understand what will be the driver in this case : if the unit operates in a non-class compliant mode, how can it be seen by alsa and jack ?
supereb
Established Member
Posts: 93
Joined: Fri Aug 17, 2018 10:55 pm
Has thanked: 36 times
Been thanked: 5 times

Re: Ultralite AVB

Post by supereb »

stanlea wrote:
supereb wrote:
stanlea wrote:I'm not at all familiar with patching kernel, so can someone explain what I can expect from the patches provided :
- enhance class compliant mode with more stable channels ?
- change from class compliant to another mode (but which one ? AVB ?) ?
See Drumfix's two posts on page 12 of this thread. It involves changing the operating mode of the MOTU interface to "USB2" (Windows), applying a patch to the pcm.c file and a quirk entry to quirks-table.h in the kernel source.
Still I don't understand what will be the driver in this case : if the unit operates in a non-class compliant mode, how can it be seen by alsa and jack ?
I'm not the best person to try to answer this, but I believe that there is a "driver" involved for class compliant devices, in the above case it was "tweaked" to operate in a different manner. ALSA/Jack doesn't care about the driver as long as it can see the ports and request sample rate and buffer size.
supereb
Established Member
Posts: 93
Joined: Fri Aug 17, 2018 10:55 pm
Has thanked: 36 times
Been thanked: 5 times

Re: Ultralite AVB

Post by supereb »

Drumfix wrote: As for the state of AVB driver... ...Achievable roundtrip latencies...
USB is working great, but I am seeing additional latency because of the need for three buffers. Looks like AVB is only requiring two. I'd love to try to get AVB working, do you have anything ready to share?
Post Reply