Ultralite AVB

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

Moderators: MattKingUSA, khz

nandoll
Established Member
Posts: 17
Joined: Mon Jul 29, 2019 10:29 pm

Re: Ultralite AVB

Post by nandoll »

nandoll wrote: Fri Jan 06, 2023 1:37 am
AudioNarwhal wrote: Thu Dec 29, 2022 9:02 pm
stanlea wrote: Thu Dec 29, 2022 7:49 pm

Edit : the first hardware input (microphone 1 on the front side of the 828ES) is still routed to input 17 in Carla or Ardour.

While audio is running can you try this utility (motu-sync-rec) to see if it corrects the input channel mapping? Can you also share the output logs from this tool?
motu-sync-rec

Example:

Code: Select all

$ ./motu-sync-rec 169.254.231.248
USB Channel Count (-1): 23
USB State: 0x11
USB Record Delta: 36
Forcing Record Sync...
USB Record Delta: 36

@AudioNarwhal: holy cow, this is magical!!
...
This alone makes my life much easier in the sense that it looks like I no longer would have to try to start jackd multiple times until the channel order happens to be right. Wow. Thanks!

Would it be possible to share the source to this utility? (I try to never rely on binaries alone if possible, for example this program did not run on an older version of Fedora because of GLIB version incompatibility).

trakuna
Established Member
Posts: 3
Joined: Tue Jan 07, 2020 10:12 pm

Re: Ultralite AVB

Post by trakuna »

nandoll wrote: Fri Jan 06, 2023 2:42 am

Would it be possible to share the source to this utility? (I try to never rely on binaries alone if possible, for example this program did not run on an older version of Fedora because of GLIB version incompatibility).

Seems like it just makes a UDP connection on port 9999, checks if the device is actively streaming via USB and if so sends the following bytes to force the sync:

Code: Select all

0000   4d 4f 54 55 0b 00 00 00 00 00 00 00 55 02 00 00   MOTU........U...
0010   10 00 00 00                                       ....

Should be doable with this (untested):

Code: Select all

echo '4d4f54550b000000000000005502000010000000' | xxd -r -p | nc -u -N 192.168.ccc.ddd 9999
nandoll
Established Member
Posts: 17
Joined: Mon Jul 29, 2019 10:29 pm

Re: Ultralite AVB

Post by nandoll »

trakuna wrote: Fri Jan 06, 2023 11:03 am
nandoll wrote: Fri Jan 06, 2023 2:42 am

Would it be possible to share the source to this utility? (I try to never rely on binaries alone if possible, for example this program did not run on an older version of Fedora because of GLIB version incompatibility).

Should be doable with this (untested):

Code: Select all

echo '4d4f54550b000000000000005502000010000000' | xxd -r -p | nc -u -N 192.168.ccc.ddd 9999

Thanks, confirmed that this incantation works...

Yes, I fired up tcpdump & wireshark yesterday and looked around :-)

shellwalker
Established Member
Posts: 68
Joined: Sun Jan 03, 2021 1:54 pm
Has thanked: 21 times
Been thanked: 11 times

Re: Ultralite AVB

Post by shellwalker »

trakuna wrote: Fri Jan 06, 2023 11:03 am

Seems like it just makes a UDP connection on port 9999, checks if the device is actively streaming via USB and if so sends the following bytes to force the sync:

Code: Select all

0000   4d 4f 54 55 0b 00 00 00 00 00 00 00 55 02 00 00   MOTU........U...
0010   10 00 00 00                                       ....

How does it do the check whether the device is actively streaming via USB?

MOTU 828mk3, MOTU 828ES, Cakewalk by Bandlab, Kubuntu 22.04.1 LTS, https://github.com/shellwalker-coder/motu_patch_testing

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 »

@AudioNarwhal

Running 1.4.5 in my 8pre-ES. It has been rock solid. On the previous firmware it would have acted up at least a couple of times and often more than that during the past 10 days.

Thanks again!

shellwalker
Established Member
Posts: 68
Joined: Sun Jan 03, 2021 1:54 pm
Has thanked: 21 times
Been thanked: 11 times

Re: Ultralite AVB

Post by shellwalker »

supereb wrote: Mon Jan 09, 2023 9:04 pm

@AudioNarwhal

Running 1.4.5 in my 8pre-ES. It has been rock solid. On the previous firmware it would have acted up at least a couple of times and often more than that during the past 10 days.

Thanks again!

Nice to hear that superb
Could you please add whether you are running with or without a kernel driver patch and on which kernel you are running?
Thx.

MOTU 828mk3, MOTU 828ES, Cakewalk by Bandlab, Kubuntu 22.04.1 LTS, https://github.com/shellwalker-coder/motu_patch_testing

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 »

shellwalker wrote: Tue Jan 10, 2023 7:07 am
supereb wrote: Mon Jan 09, 2023 9:04 pm

@AudioNarwhal

Running 1.4.5 in my 8pre-ES. It has been rock solid. On the previous firmware it would have acted up at least a couple of times and often more than that during the past 10 days.

Thanks again!

Nice to hear that superb
Could you please add whether you are running with or without a kernel driver patch and on which kernel you are running?
Thx.

I'm running 6.0.0-13.3-liquorix-amd64 without a kernel driver patch.

KREAM
Established Member
Posts: 6
Joined: Wed Feb 13, 2019 7:03 pm
Has thanked: 4 times

Re: Ultralite AVB

Post by KREAM »

@AudioNarwhal

Thanks for your help here! I also have a 1248 that I would love to get working in Linux again. I posted years ago in here, but since the Touch Mixer firmware update I have the issue of the channel hopping, bitcrushing, etc. Since installing the Drumfix driver and running in class compliant mode things are more stable but I'm stuck with only 24 channels I/O. Please, let me know if there is anything I can do to help with a new firmware for the 1248!

User avatar
AudioNarwhal
Established Member
Posts: 39
Joined: Thu Apr 29, 2021 12:43 pm
Has thanked: 2 times
Been thanked: 35 times

Re: Ultralite AVB

Post by AudioNarwhal »

KREAM wrote: Sun Jan 15, 2023 5:24 pm

Thanks for your help here! I also have a 1248 that I would love to get working in Linux again.

Here is a build for the 8M, 16A, 1248 and 112D devices.

MOTU AVB 1.4.5+92559 for 8M, 16A, 1248 and 112D.update

User avatar
AudioNarwhal
Established Member
Posts: 39
Joined: Thu Apr 29, 2021 12:43 pm
Has thanked: 2 times
Been thanked: 35 times

Re: Ultralite AVB

Post by AudioNarwhal »

Musinux wrote: Sun Jan 01, 2023 5:55 pm

I have a question regarding the buffer settings.
How does one set "Host Buffer Size" ,"Host Safety Offset" and alsa/jack frames/period "right" ?

If you are talking about the "Host Buffer Size" and "Host Safety Offset" options in the web app, these settings don't actually do anything on the hardware, they are there as a user interface to control the MOTU driver on windows. The windows driver reads these settings and configures itself accordingly.

For ALSA/Jack settings, I am unable to provide any guidance right now as I am trying to figure that out myself.

nandoll
Established Member
Posts: 17
Joined: Mon Jul 29, 2019 10:29 pm

Re: Ultralite AVB

Post by nandoll »

AudioNarwhal wrote: Tue Jan 17, 2023 5:27 pm

Here is a build for the 8M, 16A, 1248 and 112D devices.

MOTU AVB 1.4.5+92559 for 8M, 16A, 1248 and 112D.update

Thanks!! Hopefully I will be able to run some tests this coming weekend... ("motu" driver + vendor mode = 1)...

baptiste
Established Member
Posts: 26
Joined: Sat Oct 06, 2018 7:18 am
Has thanked: 10 times
Been thanked: 8 times

Re: Ultralite AVB

Post by baptiste »

Great initiative !

I'm back after upgrading my laptop to a brand new 12th gen Intel laptop from http://frame.work.
I also upgraded my system to Linux Mint 21.1.
Since the latest Intels may be not be fully supported by 5.15 and 5.19 kernels and because the motu patch was made for 6.0.3, i upgraded to the oem kernel line, version 6.1.
The system is brand new, a good place to start a tutorial about patching and building the snd-usb-audio module !

Here we go !
Install the linux-oem kernel :

Code: Select all

sudo apt install linux-oem-22.04c

Reboot.

Install stuff :

Code: Select all

sudo apt install linux-source libssl-dev libelf-dev gcc-12

Download the kernel source in /usr/src :

Code: Select all

cd /usr/src
sudo apt-get source linux-image-unsigned-$(uname -r)
cd linux-oem-6.1-6.1.0/

Clean and prepare. If the final module building fails because you miss some dependency, redo this before trying again :

Code: Select all

sudo make mrproper &&
sudo make olddefconfig &&
sudo make prepare &&
sudo make scripts

Move :

Code: Select all

cd sound/usb

Patch the module (manually, because the 6.0.3 patch won't work on 6.1 endpoint.c) :
see the patched card.h and endpoint.c attached.

(NOTE : the function that is patched in endpoint.c (snd_usb_queue_pending_output_urbs) is not strictly identical to the one in the patch.
Patch looks for

Code: Select all

snd_usb_queue_pending_output_urbs(struct snd_usb_endpoint *ep, int err, i;

While 6.1 endpoint.c reads

Code: Select all

snd_usb_queue_pending_output_urbs(struct snd_usb_endpoint *ep, bool in_stream_lock)

I don't know how and if it will have consequences on your system's behaviour.)

Let's build the module now :

Code: Select all

sudo cp /usr/src/linux-headers-$(uname -r)/Module.symvers .
sudo make -C /lib/modules/`uname -r`/build M=$PWD

Backup of the current module :

Code: Select all

cd /usr/lib/modules/$(uname -r)/kernel/sound/usb
sudo mv snd-usb-audio.ko snd-usb-audio.ko.bkp

Unplug any usb audio device.

Move the new module :

Code: Select all

sudo cp /usr/src/linux-oem-6.1-6.1.0/sound/usb/snd-usb-audio.ko .

Launch tail :

Code: Select all

sudo tail -f /var/log/syslog

Then plug back the usb audio interface and check the module is loaded (should print "MOTU Patch")

Attachments
endpoint.c
(48.3 KiB) Downloaded 126 times
card.h
(8.28 KiB) Downloaded 108 times
User avatar
AudioNarwhal
Established Member
Posts: 39
Joined: Thu Apr 29, 2021 12:43 pm
Has thanked: 2 times
Been thanked: 35 times

Re: Ultralite AVB

Post by AudioNarwhal »

nandoll wrote: Tue Jan 17, 2023 7:18 pm

Thanks!! Hopefully I will be able to run some tests this coming weekend... ("motu" driver + vendor mode = 1)...

Just clarifying since I might be misunderstanding what you mean by vendor mode = 1, but the posted firmwares (1.4.5+92559) will only address issues that occur in 24 channel UAC mode operation.

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 »

@AudioNarwhal

The latest firmware has been working flawlessness until the other night when immediately upon startup audio had a bit crushing sound. I've never had it happen immediately. I restarted jack and it was fine for the rest of the session. It has not happened since. I don't know if it happening on the input or output side.

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 »

@baptiste : is your laptop AVB capable ?

Post Reply