Motu M2 USB Interface on Linux

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

Moderators: khz, MattKingUSA

knillenhower
Posts: 2
Joined: Sun Jan 19, 2020 10:08 pm

Motu M2 USB Interface on Linux

Postby knillenhower » Sun Jan 19, 2020 11:48 pm

recently i was looking for an USB audio interface for stereo output and mic input. the Motu M2 attracted my attention. on (non-linux) tests low latency and high quality preamps are reported and it possesses a LCD level meter (which is quite unique for this device class). a popular competitor in this class is the focusrite scarlett 2i2, but i heard on linux there are issues with the latest 2i2 generation (gen 3).

on the web i could not find any info at all using the Motu M2 on linux and of course it is not officially supported. but as the specifications say "USB audio class compliant" i decided to just order it, test it and report. and it looks like it runs pretty well.

my specs are:

intel x86_64
archlinux, kernel 5.4.12
systemd
Xorg+lightdm+cinnamon
pulseaudio

plug-and-play works, at the beginning there were two issues: the first one was a little annoying. sometimes when switching or starting an audio stream the the sound output did not start right away but 2-5 s late (but not asynchronously). the second issue rarely appeared. sometimes the sound output was distorted like on a low sample rate. both issues were fixed when putting

Code: Select all

default-sample-rate = 48000

into /etc/pulse/daemon.conf. i also tried

Code: Select all

avoid-resampling = yes

but that led to regular crashes of the device (LCD meter froze and no sound at all).

so now the device almost runs perfectly, the only thing left is minor cracking on sound output when moving the volume slider on some applications (happens only on some files, really strange). but this is a minor issue for me.

i did not test midi in/out, high-z-in and line-in. for recording i used audacity 2.3.3, a dynamic microphone and 48 kHz and 96 kHz sampling rates. no issues there and sound quality sounds very good to me. as i do not use jack i cannot say anything about xruns, on my recordings i did not notice any issues. the recording latency with pulseaudio is very high and not suitable for recording along a track (which i do not need so far. maybe audacity uses alsa directly and shows lower latency but i did not investigate).

very quickly i tested the Motu M2 on an old debian machine (debian 9/stretch+linux 4.9+xfce) without success.
maybe i install jack in the future and take a deeper look on latency. if so i can give an update here.

puleglot
Established Member
Posts: 9
Joined: Thu Jan 23, 2020 3:14 pm

Re: Motu M2 USB Interface on Linux

Postby puleglot » Thu Jan 23, 2020 3:26 pm

knillenhower wrote:i also tried

Code: Select all

avoid-resampling = yes

but that led to regular crashes of the device (LCD meter froze and no sound at all).

The device reinitializes every time the sample rate is changed. This results in a 2-5 seconds lag. So it is better to set some fixed rate (default-sample-rate = alternate-sample-rate) and disable avoid-resampling.


knillenhower wrote:so now the device almost runs perfectly, the only thing left is minor cracking on sound output when moving the volume slider on some applications (happens only on some files, really strange). but this is a minor issue for me.

This device needs implicit feedback which is currently not automatically detected by alsa.
https://git.kernel.org/pub/scm/linux/ke ... aaa94339dc

robjordan
Established Member
Posts: 5
Joined: Thu Jan 30, 2020 3:44 pm

Re: Motu M2 USB Interface on Linux

Postby robjordan » Thu Jan 30, 2020 4:36 pm

knillenhower wrote:recently i was looking for an USB audio interface for stereo output and mic input. the Motu M2 attracted my attention. on (non-linux) tests low latency and high quality preamps are reported and it possesses a LCD level meter (which is quite unique for this device class). a popular competitor in this class is the focusrite scarlett 2i2, but i heard on linux there are issues with the latest 2i2 generation (gen 3).

very quickly i tested the Motu M2 on an old debian machine (debian 9/stretch+linux 4.9+xfce) without success.
maybe i install jack in the future and take a deeper look on latency. if so i can give an update here.


Thank you for posting this. I also bought an M2 with intention to use it with Linux, mainly for playback from a Raspberry Pi streamer, but also for some recording projects, digitising old LPs and cassettes. As you say, there is little information anywhere on how to make this work, so perhaps this forum could be a place to share experiences.

My standard desktop is Linux Mint 19.3, so Debian-Buster/Sid based.
Kernel: 5.0.0-37-generic x86_64
alsa-base 1.0.25+dfsg-0ubuntu5
alsa-utils 1.1.3-1ubuntu1

Plugged in the M2 and a new card appears as expected.

Code: Select all

$ aplay -l
...
card 2: M2 [M2], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0


and lots of new PCMs:

Code: Select all

$ aplay -L
...
sysdefault:CARD=M2
    M2, USB Audio
    Default Audio Device
front:CARD=M2,DEV=0
    M2, USB Audio
    Front speakers
surround21:CARD=M2,DEV=0
    M2, USB Audio
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=M2,DEV=0
    M2, USB Audio
    4.0 Surround output to Front and Rear speakers
surround41:CARD=M2,DEV=0
    M2, USB Audio
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=M2,DEV=0
    M2, USB Audio
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=M2,DEV=0
    M2, USB Audio
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=M2,DEV=0
    M2, USB Audio
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=M2,DEV=0
    M2, USB Audio
    IEC958 (S/PDIF) Digital Audio Output
dmix:CARD=M2,DEV=0
    M2, USB Audio
    Direct sample mixing device
dsnoop:CARD=M2,DEV=0
    M2, USB Audio
    Direct sample snooping device
hw:CARD=M2,DEV=0
    M2, USB Audio
    Direct hardware device without any conversions
plughw:CARD=M2,DEV=0
    M2, USB Audio
    Hardware device with all software conversions


With VLC audio output module set to Pulseaudio, and Audio Device set to M2 Analogue Stereo I can see the volume meters waggling up and down in pavucontrol, but nothing can be heard. Seems like it's muted. I read that ALSA devices often come up muted, and I should use an amixer command to un-mute. Problem is, there isn't a mixer listed on the M2:

Code: Select all

jordan@ximinez /var/log $ amixer -c 2
jordan@ximinez /var/log $


This is perhaps a fundamental reason for the failure to playback. I'll spare you all the other fiddling around I did with alsa. I'm far from an expert, though willing to learn.

So I followed your lead and installed a fresh Arch Linux setup (no small feat, since I've never installed Arch!). Things are a lot more successful there, playback works right away. I haven't spent enough time to get to grips with sample rate and such, but it's a huge step forward. Not sure if it's to do with later versions (not looking at the box now, but it seems like it has kernel 5.4.6 and arch-utils 1.2.1, so well in advance of my Mint/Debian system). My plan is to learn enough about how it's working on Arch to understand what config might be needed to get it running on Debian. Grateful for any hints if anyone has insight.

Rob

puleglot
Established Member
Posts: 9
Joined: Thu Jan 23, 2020 3:14 pm

Re: Motu M2 USB Interface on Linux

Postby puleglot » Thu Jan 30, 2020 6:29 pm

robjordan wrote:
knillenhower wrote:With VLC audio output module set to Pulseaudio, and Audio Device set to M2 Analogue Stereo I can see the volume meters waggling up and down in pavucontrol, but nothing can be heard. Seems like it's muted.

My MOTU M4 hangs when connected to machine where Linux is already running. You might have the same problem. The following patch fixes this issue, it will be included into upcoming 5.6:
https://git.kernel.org/pub/scm/linux/ke ... 71f7ec0d22

robjordan
Established Member
Posts: 5
Joined: Thu Jan 30, 2020 3:44 pm

Re: Motu M2 USB Interface on Linux

Postby robjordan » Sat Feb 01, 2020 11:56 pm

puleglot wrote:
robjordan wrote:
knillenhower wrote:My MOTU M4 hangs when connected to machine where Linux is already running. You might have the same problem. The following patch fixes this issue, it will be included into upcoming 5.6:
https://git.kernel.org/pub/scm/linux/ke ... 71f7ec0d22


Thanks I will try that patch. The funny thing though is how it works on Arch, with a 5.4 kernel.

knillenhower
Posts: 2
Joined: Sun Jan 19, 2020 10:08 pm

Re: Motu M2 USB Interface on Linux

Postby knillenhower » Fri Feb 07, 2020 10:51 pm

@robjordan: wow, you installed arch linux for testing the Motu. i hope it was not too much of a hassle. there are also distributions like manjaro that are based on arch but easy to install.
the linux mint issue is just a kernel thing i guess, probably the Motu only runs on newer kernels . i know there were a lot of sound changes in kernel 5.1 with some changes for Motu devices in it:

https://lkml.org/lkml/2019/3/2/31

in linux mint you can check the update manager for later kernels. there is a special kernel selection tool in the update manger. but maybe newer kernels are (not yet) served. and of course there are other ways to get the latest kernel on ubuntu/mint probably through ppa. there are also debian based distros with newer kernels than 5.0: like debian testing (kernel 5.4) and ubuntu 19.10 (kernel 5.3).

@puleglot: thx for the hint about two kernel patches specifically for the Motu M series. as you already mentioned they will be implemented in the next kernel version 5.6 which will be released in ~2 months.

robjordan
Established Member
Posts: 5
Joined: Thu Jan 30, 2020 3:44 pm

Re: Motu M2 USB Interface on Linux

Postby robjordan » Sat Feb 08, 2020 9:23 am

knillenhower wrote:I know there were a lot of sound changes in kernel 5.1 with some changes for Motu devices in it:

https://lkml.org/lkml/2019/3/2/31

Good info thanks! I haven't had chance to get back to this, so nothing new to report from me for the time being.

robjordan
Established Member
Posts: 5
Joined: Thu Jan 30, 2020 3:44 pm

Re: Motu M2 USB Interface on Linux

Postby robjordan » Sun Feb 09, 2020 3:25 pm

knillenhower wrote:I know there were a lot of sound changes in kernel 5.1 with some changes for Motu devices in it:

https://lkml.org/lkml/2019/3/2/31


Quick update: Linux Mint 19.3 had updated to a 5.3.0.28 kernel without me noticing. However playback via M2 still wasn't working.

Then I downloaded the latest Ubuntu kernel, which is 5.5.2, using the ukuu utility (https://mintguide.org/tools/691-ukuu-ubuntu-kernel-upgrade-utility.html) and it works right away. I haven't tested exhaustively; for sure I'm going to need those patches that will go into 5.6, but it's a big step forward.

puleglot
Established Member
Posts: 9
Joined: Thu Jan 23, 2020 3:14 pm

Re: Motu M2 USB Interface on Linux

Postby puleglot » Wed Feb 12, 2020 6:30 pm

Well, my M4 hangs with linux 5.4.x without the patch, and there are very few changes in snd-usb-audio driver in 5.5.x.

BTW, I checked the latest Windows driver from 2020-02-06, because "Improved audio startup timing" caught my eye in the changelog. Turned out, MOTU increased startup delay from ~2 seconds to ~3.5-3.7 seconds. I wonder if they ever planning to release a firmware that fixes hangs instead of applying workarounds in software. %)

robjordan
Established Member
Posts: 5
Joined: Thu Jan 30, 2020 3:44 pm

Re: Motu M2 USB Interface on Linux

Postby robjordan » Thu Feb 13, 2020 12:45 am

Another data point. I connected M2 to a Raspberry Pi 2, running Ubuntu Server 19.10, kernel 5.3.0-1014-raspi2 (32-bit) and it is playing back fine.
Curious because it didn't work at all with Mint kernel 5.3.0.28 on an Intel laptop.

@puleglot perhaps we also have to consider that M2 and M4 behave differently.

puleglot
Established Member
Posts: 9
Joined: Thu Jan 23, 2020 3:14 pm

Re: Motu M2 USB Interface on Linux

Postby puleglot » Thu Feb 13, 2020 12:49 am

robjordan wrote:Another data point. I connected M2 to a Raspberry Pi 2, running Ubuntu Server 19.10, kernel 5.3.0-1014-raspi2 (32-bit) and it is playing back fine.
Curious because it didn't work at all with Mint kernel 5.3.0.28 on an Intel laptop.

I think it's pulseaudio that tries to interact with device before it becomes ready. And you likely don't have pulseaudio on your RPi 2.


Return to “Computer Related Hardware”

Who is online

Users browsing this forum: Google [Bot] and 1 guest