[SOLVED] USB Audio - Jack with Pipewire on Linux - How to? (mod duo)

Continuing the discussion from Using USB Audio Gadget from @dreamer.

https://wiki.moddevices.com/wiki/Audio_Through_USB

I see @dreamer has gotten it working on Pipewire on Linux. I am on Linux with the new Pipewire audio plumbing and the jackd command doesn’t seem to be ported to the pipewire world yet. How were you able to get this working @dreamer? Can you share more details? Thanks

2 Likes

DOH - I see now, the title of the doc is Audio through USB but there are two sections, one the older jackd method, and then scrolling down, the newer Using USB Audio Gadget section. Trying that now.

1 Like

K, I followed the instructions and see it showing up in Zoom as a “Multifunction Composite Gadget Analog Stereo” device now. However, when I do a test recording there is no audio. I’m testing other programs now.

image

1 Like

Sweet, got it. Found this thread here Duo X as USB Audio input and MIDI device | EXPERIMENTAL that said there are two more outputs/inputs on the Mod web interface to route audio to!

THIS IS AMAZING!!!

7 Likes

Is this one of the first mainstream, opensource USB Audio interfaces for Linux? I’ve searched for opensource USB Audio Interfaces before and come up dry in the past.

This is so cool! Now I can play some tunes over Zoom for folks, and also pipe this stuff right into Bitwig now!!!

6 Likes

It even works plugged into my Pixel 3 using the USB-A to USB-C adapter/dongle into the Google Photos app, it shows up as a wired microphone!! It does seem a bit hot though, so I put another Tiny Gain on just those outputs and dropped it a bit and it works great:

This is a game changer for Linux audio interfaces IMO, because none of them are open source other than MOD!!!

7 Likes

We are not doing anything special though, not yet anyway.
The USB Audio implementation is from the Linux kernel, we just need to ensure USB works well.
Since both Duo and Dwarf can run mainline (that is, latest official Linux kernel, instead of vendor locked one) we can enjoy any fixes and new implementations made and added in it super easily now.

One thing you can easily notice with the current test implementation is the high latency, there is basically triple buffering going on which is really not ideal. But it is there as a test to see if things generally work.
Reducing latency mostly involves setting up something custom that talks directly to USB (in so called “push mode”) instead of polling data from it as ALSA/JACK typically does.

I was meant to give that a try late last year, but then got distracted with Cardinal… :roll_eyes:

8 Likes

Thanks for sharing how that works!

Side note: somehow it stopped working after trying to test out Bitwig. I noticed that if I choose jack mode in pipewire or udacity it shows it as “Multifunction Composite Gadget Analog Stereo” but if I choose alsa mode in pipewire it shows as “MOD Duo / USB Audio”.

I was able to get it to work in Udacity earlier and record something with Jack “Multifunction Composite Gadget Analog Stereo” but now I can’t get it working again. Including making sure usbgadget is running on the Duo and restarting my laptop.

[root@modduo ~]# ps axf | grep [u]sbgadget
  413 ?        SLsl   0:00 /usr/bin/jack_load mod-usbgadget_c zita-a2j -w -a -i -d hw:UAC2Gadget -L -p 128 -n 4 -w
  414 ?        SLsl   0:00 /usr/bin/jack_load mod-usbgadget_p zita-j2a -w -a -i -d hw:UAC2Gadget -L -p 128 -n 4 -w

I also was able to record a video w/audio on Zoom with “Multifunction Composite Gadget Analog Stereo”.

I think I’ll go back into my phone as a test next.

1 Like

K, I tested my phone again and it showed up as a wired mic, but recorded no sound in the Google Photos app. And Open Camera didn’t show the mic at all. So I power cycled the Duo and it is working again now, including in Bitwig with Pipewire’s Alsa mode w/“MOD Duo / USB Audio”! It is hard to use that way though because, as noted, you can only use it for input or output right now, not both, so playback has to be switched back to my laptop soundcard.

I’ll work towards reproducing it if it happens again.

2 Likes

K, I read through Duo X as USB Audio input and MIDI device | EXPERIMENTAL a bit more and realized that was for the X, and that Audio Through USB - MOD Wiki suggests capture is supported. So I simply connected the USB Audio Inputs to the regular Hardware Playback 1 & 2 and it works. It is a bit gargley, but this is good progress so far!

4 Likes