Audio Through USB

From MOD Wiki
Jump to navigation Jump to search

Using USB Audio Gadget

NOTE: For best results, please use v1.14 or later

NOTE: This is EXPERIMENTAL

First ssh into the unit, and run:

touch /data/enable-usb-multi-gadget
touch /data/enable-usb-audio-gadget

If using Windows, also run:

touch /data/enable-usb-windows-compat

Now we reboot:

sync && hmi-reset && reboot

Some caveats and known issues:

  • Only 48000 Hz sample rate is supported (this is intentional, matches the internal sample rate of the unit)
  • USB audio requires very precise timings, loading big resources on the web interface over USB can lead to audio dropouts (best results are achieved with the web interface over WiFi, leaving USB for audio and MIDI)
  • MOD Duo X "limited edition" only works in capture mode
  • For use in Windows, an up-to-date Windows 10 or later is required

Forum Threads:

Windows-specific tweaks

When picking an audio driver/mode, look for "WASAPI" or "Windows Audio".
If there is an option for "exclusive mode", try that first; it won't allow other applications to use the USB audio device at the same time, but it reduces the latency.

Using this WASAPI/Windows-Audio mode with a 512 buffer size, we have measured round-trip latencies of around 80ms in normal/shared mode, and 60ms in exclusive mode.
When exclusive mode is selected, we were able to reducethe buffer size to 256, giving a round-trip latency of around 38ms.

Note that latency decreases if you use the MOD device analog IO, as the analog IO has a full round-trip latency of 8ms.
There is extra buffering for handling the USB audio card in software, which is needed in order to keep everything in sync between the MOD device's main audio interface and the USB audio side.

ASIO4ALL

Using ASIO4ALL has been confirmed to work, but needs some tweaks:

  • Set buffer size to 128 or higher
  • In advanced settings, set buffer offset to 16ms
  • Turn off all other options in advanced settings

This should result in around 60ms total round-trip latency, which will be less if you use the MOD unit analog IO.

FL Studio ASIO

The FL Studio ASIO driver has also been confirmed to work, no special tweaks needed.
Its minimum buffer size of 256 should work fine as-is.

In our measurements, it gives a total round-trip latency of around 75ms, which will be less if you use the MOD unit analog IO.

Using netJACK2

NOTE: This requires the use of JACK as sound server in your PC.

See Audio Through NetJack2