Motu M2 USB Interface on Linux

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

Moderators: MattKingUSA, khz

knillenhower
Established Member
Posts: 9
Joined: Sun Jan 19, 2020 10:08 pm

Motu M2 USB Interface on Linux

Post by knillenhower »

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: 135
Joined: Thu Jan 23, 2020 3:14 pm
Has thanked: 3 times
Been thanked: 13 times

Re: Motu M2 USB Interface on Linux

Post by puleglot »

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

Post by robjordan »

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: 135
Joined: Thu Jan 23, 2020 3:14 pm
Has thanked: 3 times
Been thanked: 13 times

Re: Motu M2 USB Interface on Linux

Post by puleglot »

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

Post by robjordan »

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
Established Member
Posts: 9
Joined: Sun Jan 19, 2020 10:08 pm

Re: Motu M2 USB Interface on Linux

Post by knillenhower »

@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

Post by robjordan »

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

Post by robjordan »

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-ub ... ility.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: 135
Joined: Thu Jan 23, 2020 3:14 pm
Has thanked: 3 times
Been thanked: 13 times

Re: Motu M2 USB Interface on Linux

Post by puleglot »

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

Post by robjordan »

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: 135
Joined: Thu Jan 23, 2020 3:14 pm
Has thanked: 3 times
Been thanked: 13 times

Re: Motu M2 USB Interface on Linux

Post by puleglot »

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.
Beiri22
Posts: 1
Joined: Sat Mar 28, 2020 10:29 am

Re: Motu M2 USB Interface on Linux

Post by Beiri22 »

Hi,

I also try to use a Motu M2 in Linux (Manjaro, Kernel 5.5.x, 5.6.Rc) and experience strange behaviour. I cannot use playback and recording at the same time. When I select the Motu-Input-Device, the Motu Output is deselected and vice versa. There are a few messages in dmesg, like (not in order):

Unable to change format on ep #81: already in use ---> multiple times in a row
Not enough bandwidth for new device state.
usb 1-1: Not enough bandwidth for altsetting 0
Not enough bandwidth for altsetting 1
2:1: cannot set interface (-28)
usb 1-1: Unable to submit urb #0: -2 (urb 00000000c0c7cb05)
usb 1-1: Unable to submit urb #1: -2 (urb 000000005ff27e52)
usb 1-1: Unable to submit urb #2: -2 (urb 00000000553098ae)
usb 1-1: Unable to submit urb #3: -2 (urb 00000000b86a4073)
usb 1-1: Unable to submit urb #4: -2 (urb 0000000061db7269)
usb 1-1: Unable to submit urb #5: -2 (urb 000000003fb09f67)
usb 1-1: Unable to submit urb #6: -2 (urb 0000000036d0dc90)
usb 1-1: Unable to submit urb #7: -2 (urb 0000000029c4d079)

Also I wonder, because the Motu is recognized as USB-2.0 device, see lsusb -tv: Class=Audio, Driver=snd-usb-audio, 480M

Has anyone similar problems?
puleglot
Established Member
Posts: 135
Joined: Thu Jan 23, 2020 3:14 pm
Has thanked: 3 times
Been thanked: 13 times

Re: Motu M2 USB Interface on Linux

Post by puleglot »

Beiri22 wrote: Sat Mar 28, 2020 10:37 am I cannot use playback and recording at the same time. When I select the Motu-Input-Device, the Motu Output is deselected and vice versa. There are a few messages in dmesg, like (not in order):
This problem is common to all usb audio interfaces with implicit feedback. The only workaround I know is to use jack.
knillenhower
Established Member
Posts: 9
Joined: Sun Jan 19, 2020 10:08 pm

Re: Motu M2 USB Interface on Linux

Post by knillenhower »

@Beiri22: on my system dmesg does not contain as many warnings:

Code: Select all

[ 7785.479044] usb 2-11: new high-speed USB device number 8 using xhci_hcd
[ 7785.496359] usb 2-11: New USB device found, idVendor=07fd, idProduct=0008, bcdDevice= 1.01
[ 7785.496361] usb 2-11: New USB device strings: Mfr=1, Product=3, SerialNumber=2
[ 7785.496363] usb 2-11: Product: M2
[ 7785.496364] usb 2-11: Manufacturer: MOTU
[ 7785.496365] usb 2-11: SerialNumber: XXX
[ 7788.643474] usb 2-11: Unable to change format on ep #81: already in use
[ 7788.643671] usb 2-11: Unable to change format on ep #81: already in use
[ 7788.643889] usb 2-11: Unable to change format on ep #81: already in use
[ 7788.644300] usb 2-11: Unable to change format on ep #81: already in use
[ 7788.644700] usb 2-11: Unable to change format on ep #81: already in use
[ 7788.645962] usb 2-11: Unable to change format on ep #81: already in use
[ 7788.646159] usb 2-11: Unable to change format on ep #81: already in use
[ 7788.646352] usb 2-11: Unable to change format on ep #81: already in use
[ 7788.646727] usb 2-11: Unable to change format on ep #81: already in use
...
the M2 is a USB2.0 device. it's a little bit hidden in the specifications:
https://motu.com/en-us/products/m-series/m2/specs/

i can confirm that there are no duplex profiles anymore for the device in pavucontrol. this is quite annoying, only a input or output profile can be selected. so no recording and listening at the same time. i'm pretty sure there were duplex profiles before but i did not notice when they disappeared.

@puleglot: do i understand you correctly that we cannot have duplex profiles with our devices on pulse audio?

any help with the duplex profile issue would be greatly appreciated.

i also use the device on a windows machine. the windows driver might have updated the firmware, but i don't think so as the firmware update procedure from the manufacturer involves pressing a button while powering on. the windows driver app tells me i have firmware version 1.01. there is also a newer version 1.02 available. did not risk to install yet.

also today on arch kernel 5.6 came out. no changes of the audio behavior noticed so far.
puleglot
Established Member
Posts: 135
Joined: Thu Jan 23, 2020 3:14 pm
Has thanked: 3 times
Been thanked: 13 times

Re: Motu M2 USB Interface on Linux

Post by puleglot »

knillenhower wrote: Tue Apr 07, 2020 9:53 pm any help with the duplex profile issue would be greatly appreciated.
I can only suggest you to follow the bug report below:
https://bugzilla.kernel.org/show_bug.cgi?id=207023
Post Reply