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:

7 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!

2 Likes

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:

Hello, Iā€™d like to know the status of this. I have a Duo X and run ā€˜not windowsā€™ so Iā€™ll just give it a shot BUT are you still working on this? The idea of attaching an iPad to the Duo with MIDI and Audio access is tantalizing.

it is not working at the moment. mostly it is not a focus for us now, until there are other features out of the way first anyway.

but we are working a bit on it behind the scenes, resolving the case for Windows.

Thank you for the update.
Would really love that ā€œreverseā€ USB MIDI!

hi, i did the ssh command but now the mod duo dosnt recognize via windows, i know u mentiond it before. i wanted to try the midi stuff because i want to use the modduo with my mpc one over usb- midi.

anyway. i tried to restore the firmware but the ssh command is still there. i cant connect via ssh to go back.

windows dos not find a driver for usb ethernet/rndis gadget (code10) i also tried the driver on wiki,.

what should i do now :wink:
thanks

edit: usb midi mod duox <ā€“> mpc one works now. so in that case i can use the bluetooth connection for the gui, or are they other ways to get both working on windows?

you need to get some SSH again in order to revert this (some linux VM should do it). worst case install a factory reset image from https://wiki.moddevices.com/wiki/Factory_Reset_Images

thanks for fast reply. if i disable the usb-multi-gadget mode, midi in out via usb port is also disabled?
i dont need the midi host, just a midi port to use the mod duo as an instrument over usb.

thanks

edit: i did a hard rest like u mentioned, no usb midi :wink:

just be patient on this because it is a feature promised for the dwarf. so once we get to it, we will try to make it work on the other devices too.

if all you need is to send MIDI from the PC, consider a small USB-DIN-MIDI converter cable for now.

1 Like

yes sir, i just use the DIN cable for now, i wanted to get all the gear with usb midi but its not that important for me :smiley: thanks for help

I was wondering about this, if thereā€™s no hardware reason etc why it couldnā€™t work on the Duo X and people will be trying to make it happen then I will probably buy a Duo X and keep my fingers Xā€™d

I tried on my Duo X, and I canā€™t access to the web manager, so obviously I didnā€™t bother checking if it works or notā€¦ Removed the file, rebooted and everything back to normal.

Is this happening to everybody? Iā€™m with the latest software.