Duo X as USB Audio input and MIDI device | EXPERIMENTAL

Warning: This is EXPERIMENTAL, and also DOES NOT WORK ON WINDOWS.
Also going to be quite technical, purposefully, so that if things go wrong you need to know how to roll back.

If you are a tech-savvy person using macOS or Linux, we have a gift for you :slight_smile:
The Duo X working as a class-compliant UAC2 Audio* and MIDI device.

*Audio is input only for now, with fixed 48kHz sample rate (same as used inside the unit).


WIth that said, let me give you the details…

With the Duo X we are now running Linux 4.9 kernel. This is past 3.10 where composite devices were introduced. (for comparison, the Duo runs 3.4)
This is quite important, as composite devices allow us to have many USB configurations all at once - could be ethernet, mass storage, serial, audio, midi, printer, etc etc
During Duo X development we researched this a little and discovered it is actually possible to make it work, but with some caveats…

The Duo X USB driver has issues sending out data in a way that makes USB audio output work.
I tried a couple different things, backported some fixes from more recent kernels, but still could not make USB audio output to work. Since it is not a feature that was planned for Duo X launch, USB audio input seemed good enough for a start.
Current plan is to update the kernel version to mainline at a later point, where this issue is likely to be fixed in there already. There are more important things for us to be focused on at the moment, so we revisit this when we update kernel.

So what we are able to enable and get working is USB audio input and USB MIDI device modes (MIDI being both input and output).
Saying “USB audio input” can be a bit confusing, so to clear it up: We can have the Duo X act as a USB soundcard that provides 2 playback channels. You can send audio from your DAW or music application into the Duo X, but you cannot retrieve audio from it (for now).
You can though send and receive MIDI from the Duo X. :grinning:

In the future we will leverage this mode to provide a mass storage device, so you can quickly upload your own samples, soundfonts and other things. But some work on our side needs to be done first before this is possible, so please be patient.
For now we can enjoy audio and MIDI through USB, without resorting to netjack tricks.

So, how to enable this?
Very simple, with the Duo X connected to your system, you just need this:

ssh root@192.168.51.1 "touch /data/enable-usb-multi-gadget && reboot"

If you are confused or don’t understand what that does, PLEASE DO NOT TRY IT.
When we say it is EXPERIMENTAL, we mean it.

The usual Duo X Ethernet gadget will change to a composite device that has ethernet, audio and MIDI all at once.
Depending on the operating system, it might or might not work well.
Windows gets quite confused by this, and the USB audio driver does not start under Windows, so it is quite pointless to even try this there.
It does work quite nicely on macOS and Linux though, and I guess other BSDs will handle it too.

After this is enabled, 2 more audio inputs will appear in the web gui.
These will be the USB audio inputs, which now you can put some FX or connect directly to the outputs.
Since Duo X starts with “aggregated” MIDI mode by default, no new MIDI ports will appear, the DIN MIDI and USB MIDI just get combined.

In case you need to get back to the old behaviour, you do:

ssh root@192.168.51.1 "rm /data/enable-usb-multi-gadget && reboot"

That is assuming you can still connect to the unit.

To the brave souls out there that feel like trying this, please let us know how it goes.
There is a backup in case things get really wrong (like you not being able to connect to it anymore), but it involves deleting all user data…

PS: You might need to enter “mod” as password somewhere… :wink:

6 Likes

Oh yes! Can’t wait to give it a try

beautiful! :smiling_face_with_three_hearts:

okay gave this a try:
seeing all midi in/outs and a pair of modx outputs, nice!
but could not get any audio out via macos default audio and also not in ableton

on mac its also grayed out somehow:

audio:


midi:

btw for the geeks: never seen that kind of top version, must be the latest source^^ :wink:

Will it be possible in the future to do this on the Mod Duo ? Or on a “hardware-upgraded” Mod Duo ?

It is technically possible, but requires quite more work than the Duo X.
In my opinion the work needed for it is just in the border of being worth it. We are too busy right now with other things.

1 Like

okay gave it a restart and now its all working.
still greyed out but having a signal coming through, cool!

1 Like

What are the blockers that may hinder moving both the Duo and the Duo X to using the mainline kernel ?

On the Duo X side, yes, as the company that makes the SoC does not support mainline.
It is a community effort to get their patches in there. I have been keeping track of it, 5.2 had quite a few things merged, even more coming in 5.3
Things are a bit easier for the Duo, but the flash storage makes things quite tricky… something to evaluate at a later time.

by the way, the RT kernel patchset might be making its way to mainline kernel very soon :slight_smile: