Linux USB driver for the MOTU AVB series interfaces

Overview

motu-avb

Linux USB driver for the MOTU AVB series interfaces

Kernel parameters:

samplerate: set the samplerate (its currently fixed at module load) default: 44100

midi: set 1 for devices that have a midi port, 0 for the ones that don't

vendor: 0 = use class compliant mode (24 channels in/out), 1 = vendor mode (64/32/24)

Build

Install the kernel source of your running kernel.

The makefile expects the kernel source to be in /lib/modules//source.

If that is not the case set the environment variable KDIRS to point to the location of your kernel source.

Then execute

make 
sudo make install

If you want to use vendor mode, make sure you have curl installed, then connect the device through ethernet and execute the curl command

 curl  --data 'json={"value":"USB2"}' <ip address of the device>/datastore/host/mode
Issues
  • Not an issue, but a thank you.

    Not an issue, but a thank you.

    I just wanted to say thank you for your work on this, and for sharing it. I thought I was losing my mind with my MOTU 16A and 8A interfaces drifting and nothing I could do would resolve it. This driver saved them on Linux for me.

    opened by anthroid 0
  • Build error

    Build error

    sudo dkms build motu-avb-usb/1.0

    Kernel preparation unnecessary for this kernel. Skipping...

    Building module: cleaning build area...(bad exit status: 2) make -j16 KERNELRELEASE=5.4.0-122-generic all KVERSION=5.4.0-122-generic...(bad exit status: 2) Error! Bad return status for module build on kernel: 5.4.0-122-generic (x86_64) Consult /var/lib/dkms/motu-avb-usb/1.0/build/make.log for more information.

    also there is no make.log generated

    opened by bstirling2307 1
  • Invalid Capture Endpoint on 828es

    Invalid Capture Endpoint on 828es

    Motu 828es with firmware 1.3.5.+184 Ubuntu 21.10 with kernel 5.13.0-30-lowlatency

    Kernel patches in place, mostly configure correctly (I think). Configured the device using the attached script. Buffer size and safety offset in the web UI are set to 'display: none' for some reason so I thought I'd mention that.

    I'm pretty sure I have the kernel patched correctly but I'll go back and double check everyhing.

    I had audio coming through briefly but it was distorted and coming through on four channels. While I'm messing with all that I see an error I thought I'd share in case it's something important.

    [ 3423.927796] usb 3-3: samplerate = 44100, queue_length = 21, midi = 1, vendor = 1
    [ 3423.927800] usb 3-3: probing interface 1
    [ 3423.927823] usb 3-3: probing interface 2
    [ 3423.927831] usb 3-3: probing interface 5
    [ 3423.927838] usb 3-3: probing interface 4
    [ 3423.927845] usb 3-3: probing interface 6
    [ 3423.927851] usb 3-3: probing interface 7
    [ 3423.927858] usb 3-3: probing interface 3
    [ 3423.927865] usb 3-3: probing interfaces sucessful
    [ 3423.927866] usb 3-3: invalid capture endpoint: 0
    [ 3423.927934] usbcore: registered new interface driver motu
    [ 3423.941632] usbcore: registered new interface driver snd-usb-audio
    

    I added logging to see which endpoint was invalid by adding this line at line 1104 in motu.c

    dev_err(&ua->dev->dev, "invalid capture endpoint: %d\n", usb_endpoint_num(epd)); motu-setup.txt

    opened by johnny2k 3
  • Spurious wakeups reported by PulseAudio

    Spurious wakeups reported by PulseAudio

    Noticed some bits in my system journal:

    Feb 02 02:06:30 skylyn pulseaudio[590]: ALSA woke us up to write new data to the device, but there was actually nothing to write.
    Feb 02 02:06:30 skylyn pulseaudio[590]: Most likely this is a bug in the ALSA driver 'motu'. Please report this issue to the ALSA developers.
    Feb 02 02:06:30 skylyn pulseaudio[590]: We were woken up with POLLOUT set -- however a subsequent snd_pcm_avail() returned 0 or another value < min_avail.
    

    I thought this was related to the interface sometimes starting up weirdly where it wouldn't lock the sample rate properly, but this appeared to also be logged after i rebooted the interface and tried to play something - it took a couple seconds for the audio to kick in.

    opened by hedgehog1029 0
  • Motu 24Ao

    Motu 24Ao

    Hi,

    i've been using the Motu 24Ao for a while now and since the firmware upgrade to 1.3.5+1028 is have distortion and loss of signal when sending audio to the device. I currently use 8 channels from the computer to the device to then mix it to the outputs. It is not clear for me which driver i need and if any of the drivers will work with my device. I've tried the one on the page. It plays audio but only on all channels, i've had an asound.conf to define 4 sources and it used to work with the default linux audio driver. But with this new driver it doesn't seem to work, however it is not clear to me why this doesn't work anymore.

    I can provide extra information if needed, i'm not an expert in kernel modules so i don't really know which way is the best way to solve my issues. I think i have the channel drifting issue, the signal seems to play, than start to distort en disappear to somewhat later reappear.

    pcm_slave.motu {
      pcm "hw:1,0"
      rate 48000
      channels 8
    }
    
    pcm.source1 {
      type plug
      slave.pcm {
        type dmix
        slave motu
        ipc_key 1001
        ipc_perm 0666
        bindings [ 0 1 ]
      }
    }
    
    pcm.source2 {
      type plug
      slave.pcm {
        type dmix
        slave motu
        ipc_key 1001
        ipc_perm 0666
        bindings [ 2 3 ]
      }
    }
    
    pcm.source3 {
      type plug
      slave.pcm {
        type dmix
        slave motu
        ipc_key 1001
        ipc_perm 0666
        bindings [ 4 5 ]
      }
    }
    
    pcm.source4 {
      type plug
      slave.pcm {
        type dmix
        slave motu
        ipc_key 1001
        ipc_perm 0666
        bindings [ 6 7 ]
      }
    }
    
    
    opened by TCke83 12
  • alsa

    alsa "Cannot allocate memory"

    First, thank very much for your work! This is helping me a lot!

    However, I still have a problem.

    I'm running Debian unstable with the 5.15.0-2-amd64 kernel and I'm using a MOTU AVB 1248. I've followed your instructions and successfully installed the module. lsusb -t shows:

    /:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/10p, 5000M
    /:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/16p, 480M
        |__ Port 1: Dev 9, If 5, Class=Vendor Specific Class, Driver=motu, 480M
        |__ Port 1: Dev 9, If 3, Class=Vendor Specific Class, Driver=motu, 480M
        |__ Port 1: Dev 9, If 1, Class=Audio, Driver=motu, 480M
        |__ Port 1: Dev 9, If 4, Class=Vendor Specific Class, Driver=motu, 480M
        |__ Port 1: Dev 9, If 2, Class=Audio, Driver=motu, 480M
        |__ Port 1: Dev 9, If 0, Class=Audio, Driver=motu, 480M
        |__ Port 4: Dev 2, If 1, Class=Human Interface Device, Driver=usbhid, 12M
        |__ Port 4: Dev 2, If 2, Class=Human Interface Device, Driver=usbhid, 12M
        |__ Port 4: Dev 2, If 0, Class=Human Interface Device, Driver=usbhid, 12M
        |__ Port 5: Dev 3, If 1, Class=Human Interface Device, Driver=usbhid, 12M
        |__ Port 5: Dev 3, If 2, Class=Human Interface Device, Driver=usbhid, 12M
        |__ Port 5: Dev 3, If 0, Class=Human Interface Device, Driver=usbhid, 12M
        |__ Port 7: Dev 4, If 0, Class=Video, Driver=uvcvideo, 480M
        |__ Port 7: Dev 4, If 1, Class=Video, Driver=uvcvideo, 480M
        |__ Port 12: Dev 6, If 1, Class=Wireless, Driver=btusb, 12M
        |__ Port 12: Dev 6, If 0, Class=Wireless, Driver=btusb, 12M
    

    so everything seem alright.

    Still, when I try to play something to the MOTU card, using qjackctl to connect some source to it, I get the following error message in syslog:

    spa.alsa: set_hw_params: Cannot allocate memory
    pw.node: (alsa_output.usb-MOTU_1248_0001f2fffe000bff-00.playback.0.0-317) start node error -12: Cannot allocate memory
    

    and I get no sound at all. I get the problem with or without the patched kernel, (so with vendor = 1 or vendor = 0).

    Without your module, so using the standard snd_usb-audio, the card works, but I get the infamous MOTU channel hopping problem which I wanted to solve....

    Any ideas?

    Thank you in advance for your help!

    opened by davidpirro 8
  • Make error

    Make error

    Hi Drumfix,

    Thanks for providing this code! I have a MOTU 24Ao in the lab and am trying to control it from a PC running Ubuntu 20.04. I am also experiencing some issues with it suddenly stopping in the middle of playback and channels switching (especially when using an USB extension cable between sound card and PC) and I was hoping this driver would fix that. However, I have some problems compiling and installing the driver and was hoping you could help. I have only a little programming experience, so sorry if this is a trivial question.

    So, I installed the kernel source code by downloading it from https://github.com/zen-kernel/zen-kernel/tags and extracting them into/lib/modules/uname -r/source as @ozel suggested. But when I try to run make I get the following: _Copying required header files from kernel sources... '/lib/modules/5.11.0-41-generic/source/sound/usb/usbaudio.h' -> '/home/audiologie/Documents/motu-avb-usb-main/usbaudio.h' '/lib/modules/5.11.0-41-generic/source/sound/usb/midi.h' -> '/home/audiologie/Documents/motu-avb-usb-main/midi.h' make -C ""/lib/modules/5.11.0-41-generic/build"" M="/home/audiologie/Documents/motu-avb-usb-main" modules make[1]: Entering directory '/usr/src/linux-headers-5.11.0-41-generic' CC [M] /home/audiologie/Documents/motu-avb-usb-main/motu.o MODPOST /home/audiologie/Documents/motu-avb-usb-main/Module.symvers LD [M] /home/audiologie/Documents/motu-avb-usb-main/motu.ko BTF [M] /home/audiologie/Documents/motu-avb-usb-main/motu.ko Skipping BTF generation for /home/audiologie/Documents/motu-avb-usb-main/motu.ko due to unavailability of vmlinux make[1]: Leaving directory '/usr/src/linux-headers-5.11.0-41-generic' _

    I don't know if this is an error or just a warning that can be ignored, but if I then try to do sudo make install I get the following errors: _make -C ""/lib/modules/5.11.0-41-generic/build"" M="/home/audiologie/Documents/motu-avb-usb-main" modules_install make[1]: Entering directory '/usr/src/linux-headers-5.11.0-41-generic' INSTALL /home/audiologie/Documents/motu-avb-usb-main/motu.ko At main.c:160:

    • SSL error:02001002:system library:fopen:No such file or directory: ../crypto/bio/bss_file.c:69
    • SSL error:2006D080:BIO routines:BIO_new_file:no such file: ../crypto/bio/bss_file.c:76 sign-file: certs/signing_key.pem: No such file or directory DEPMOD 5.11.0-41-generic Warning: modules_install: missing 'System.map' file. Skipping depmod. make[1]: Leaving directory '/usr/src/linux-headers-5.11.0-41-generic' depmod -A _

    I really have no clue how to fix this, could you please help?

    Best, Maartje

    opened by MartyME91 5
Cross-OS library for implementing USB device-mode interfaces

libusbd Cross-OS library for implementing USB device-mode interfaces. WIP. I'm currently working out most of the API details with the programs in exam

Max Thomas 32 Jul 26, 2022
Loads a signed kernel driver which allows you to map any driver to kernel mode without any traces of the signed / mapped driver.

CosMapper Loads a signed kernel driver (signed with leaked cert) which allows you to map any driver to kernel mode without any traces of the signed /

null 118 Jul 26, 2022
Linux Driver for USB WiFi Adapters that are based on the RTL8811AU and RTL8821AU Chipsets

Click for USB WiFi Adapter Information for Linux 8821au ( 8821au.ko ) ?? Linux Driver for USB WiFi Adapters that are based on the RTL8811AU and RTL882

Nick 110 Aug 3, 2022
Linux Driver for USB WiFi Adapters that are based on the RTL8812BU and RTL8822BU Chipsets

Click for USB WiFi Adapter Information for Linux 88x2bu ( 88x2bu.ko ) ?? Linux Driver for USB WiFi Adapters that are based on the RTL8812BU and RTL882

Nick 237 Aug 4, 2022
LoRa Driver for Semtech SX1262 on Linux (PineDio USB Adapter) and BL602 (PineDio Stack BL604)

LoRa Driver for Semtech SX1262 on Linux (PineDio USB Adapter) and BL602 (PineDio Stack BL604) Read the articles... "Build a Linux Driver for PineDio L

Lee Lup Yuen 7 Mar 15, 2022
Linux Driver for USB WiFi Adapters that are based on the RTL8812AU Chipset - v5.13.6

Click for USB WiFi Adapter Information for Linux A FAQ is available at the end of this document. Problem reports go in Issues. Problem reports should

Nick 165 Aug 8, 2022
Linux Driver for USB WiFi Adapters that are based on the RTL8811CU, RTL8821CU and RTL8731AU Chipsets - v5.12.0

Click here for USB WiFi Adapter Information for Linux A FAQ is available at the end of this document. Problem reports go in Issues. Include the inform

Nick 102 Aug 9, 2022
ESP32 software USB host through general IO pins. We can connect up to 4 USB-LS HID (keyboard mouse joystick) devices simultaneously.

esp32_usb_soft_host esp32 USB-LS pure software host thru general IO pins. Up to 4 HID devices simultaneously. board ~$3 :https://www.aliexpress.com/pr

Samsonov Dima 273 Jul 25, 2022
ESP8266 software USB host through general IO pins. We can connect up to 2 USB-LS HID (keyboard mouse joystick) devices simultaneously.

esp8266_usb_soft_host Test for esp8266 usb host . Works with ESP-IDF v3.4 80MHz and 160MHz. WorkInProgress Test run with mouse & combined mouse & keyb

Samsonov Dima 27 Jul 30, 2022
Tiny and portable usb host and device stack for mcu with usb ip

Tiny and portable usb host and device stack for mcu with usb ip

sakumisu 404 Aug 2, 2022
USB-C_PCB_experiments - USB-C ports made from a flex PCB and an ATtiny84A

USB-C PCB Experiments This is part of an ongoing series of projects involving creative interpretations of the USB mechanical standards. You've probabl

Sam Ettinger 22 May 21, 2022
Anotter USB temperature logger that can record up to four channels with thermocouple or NTCs connected via CDC directly or SCPI to USB.

temperature-logger Anotter USB temperature logger that can record up to four channels with thermocouple or NTCs connected via CDC directly or SCPI to

Jana Marie Hemsing 47 Apr 6, 2022
A WMI driver for Lenovo Legion series of laptops

Problem The Legion line of laptops from Lenovo come with the ability to switch power modes between "quiet", "balanced" and "performance." On Windows t

null 9 Jul 7, 2022
Project Etnaviv is an open source user-space driver for the Vivante GCxxx series of embedded GPUs.

Introduction Project Etnaviv is an open source user-space driver for the Vivante GCxxx series of embedded GPUs. This repository contains reverse-engin

null 200 Jul 24, 2022
An unofficial Realtek PCIe/USB-based SD card reader driver for macOS

Realtek Card Reader Driver for macOS Unleash the full potential of your SDXC UHS-I cards Introduction An unofficial macOS kernel extension for Realtek

FireWolf 130 Aug 1, 2022
Windows kernel-mode driver emulating well-known USB game controllers.

Windows kernel-mode driver emulating well-known USB game controllers.

Virtual Gamepad Emulation Framework 1.5k Aug 10, 2022
x64 Windows kernel driver mapper, inject unsigned driver using anycall

anymapper x64 Windows kernel driver mapper, inject unsigned driver using anycall This project is WIP. Todo Fix: Can't make API calls from IAT nor func

Kento Oki 68 Jun 22, 2022
Driver leap - Self-sustainable fork of SteamVR driver for Leap Motion controller with updated vendor libraries

Driver Leap Self-sustainable fork of SteamVR driver for Leap Motion controller with updated vendor libraries Installation (for users) Install Ultralea

null 46 Jul 28, 2022
Hygieia, a vulnerable driver traces scanner written in C++ as an x64 Windows kernel driver.

Hygieia The Greek goddess of health, her name is the source for the word "hygiene". Hygieia is a windows driver that works similarly to how pagewalkr

Deputation 69 Jul 27, 2022