• WANTED: Happy members who like to discuss audio and other topics related to our interest. Desire to learn and share knowledge of science required. There are many reviews of audio hardware and expert members to help answer your questions. Click here to have your audio equipment measured for free!

Raspberry Pi as USB to I2S adapter

Krunok

Major Contributor
Joined
Mar 25, 2018
Messages
4,600
Likes
3,067
Location
Zg, Cro
I suspected as much. Though I was hoping that two identical usb dacs would run in sync if the source is one RPi. I got the idea from miniDSP SHD, since it has two spdif output ports for 4 channels, but I guess they paid attention in keeping them in sync. Any facts available on how this would look like with RPi and it's usb? I also guess based on a quick-Google that multichannel GPIO I2S is not easy/possible. Maybe we need to persuade Ivan to make a 4 channel version.. ;)

Even if 2 SPDIFs are in sync they again have to go through DA conversion in different DACs.

Who is Ivan?
 
OP
S

somebodyelse

Major Contributor
Joined
Dec 5, 2018
Messages
3,754
Likes
3,054
The beaglebone black I2S can do TDM if you can find a suitable multichannel DAC, but it doesn't have much CPU to play with for doing DSP. The HifiBerry DAC+ DSP can do TDM output, and its toslink output may be capable of ADAT.
if you need multichannel DAC with balanced outputs I recommend MOTU UltraLite-mk4.
Is it reliable with linux? The Ultralite AVB and the 8A aren't according to the threads on linuxmusicians.com.
 

Krunok

Major Contributor
Joined
Mar 25, 2018
Messages
4,600
Likes
3,067
Location
Zg, Cro
The beaglebone black I2S can do TDM if you can find a suitable multichannel DAC, but it doesn't have much CPU to play with for doing DSP. The HifiBerry DAC+ DSP can do TDM output, and its toslink output may be capable of ADAT.

Is it reliable with linux? The Ultralite AVB and the 8A aren't according to the threads on linuxmusicians.com.

Reliable?
 
OP
S

somebodyelse

Major Contributor
Joined
Dec 5, 2018
Messages
3,754
Likes
3,054
Reliable?
Lacking in pops clicks, channel changes etc. that seem to happen with the Ultralite AVB and 8A in UAC2 mode in varying degrees depending on motherboard and motu firmware version - see for example the Ultralite AVB thread. There are suggestions about kicking it into the mode it uses with Windows which is slightly different and works more reliably for some users, and a preliminary linux AVB implementation.
 

Krunok

Major Contributor
Joined
Mar 25, 2018
Messages
4,600
Likes
3,067
Location
Zg, Cro
Lacking in pops clicks, channel changes etc. that seem to happen with the Ultralite AVB and 8A in UAC2 mode in varying degrees depending on motherboard and motu firmware version - see for example the Ultralite AVB thread. There are suggestions about kicking it into the mode it uses with Windows which is slightly different and works more reliably for some users, and a preliminary linux AVB implementation.

Aha. Unfortunately I don't have any experience how it works with linux.
 

JonR

New Member
Joined
Oct 28, 2020
Messages
3
Likes
0
Perhaps of interest: I've been using a teensy 4 with a toslink module to provide a USB to toslink convolution engine. Seems to work well (with linux) although I haven't done anything more than casual listening tests. It can just as easily do i2s in or out.

Brutefir and an alsa loopback had a sample rate mismatch issue that was getting too complicated.
 

m_g_s_g

Active Member
Forum Donor
Joined
Feb 26, 2020
Messages
192
Likes
229
Location
Europe. Living in MD, USA.
[Apologies for necroposting]

I found that some patches for the g_audio gadget were posted a couple of months ago to solve the Windows 10 issue. They still haven't made it to the stable kernel.

So I decided yesterday to compile a kernel for a Rpi4 including those patches, and after some fiddling, Windows 10 was able to recognize the Rpi as a Sound Controller indeed. But I still have not been able to produce a sound out of it. For now I'm just trying to make the default Raspberry soundcard (Headphones) work with alsaloop.

I'll maybe play with it some more time, but the configuration seems to be tricky. If anybody is interested in making it work, let me know, several tweaks had to be made!
 
OP
S

somebodyelse

Major Contributor
Joined
Dec 5, 2018
Messages
3,754
Likes
3,054
Necroposting's fine by me - easier to keep track of a single thread than several, and it's not like this is one's too long to read the whole of.

The comments to that patch set include one about possibly adding support for implicit feedback. I gather implicit feedback support was headed for kernel 5.11 via this patchset so it might be worth checking whether the gadget changes have made it in too.
 

Jukka

Active Member
Joined
Apr 24, 2019
Messages
248
Likes
169
Nice to see some progress. I might test it out some time in the future.
FWIW, I got miniDSP SHD for the original intented use. It's expensive compared to an RPi, but it worked by plugging in the mains. Also the Dirac time domain processing is something I could not have done myself.
 
OP
S

somebodyelse

Major Contributor
Joined
Dec 5, 2018
Messages
3,754
Likes
3,054
About a week ago Ruslan posted an update to address (among other things) the issues raised in response to the previous patch set @m_g_s_g linked - note that that earlier link now lists the new patches too. It also adds some volume control, but an outstanding issue in the Pi4's USB driver stops that working for now. It seems like progress, but I've not tried it myself yet. If we're _really_ lucky it might make its way into 5.13.
 
OP
S

somebodyelse

Major Contributor
Joined
Dec 5, 2018
Messages
3,754
Likes
3,054
I think a derivative of the feedback endpoint patches just made it into the mainline 5.14 release, but not the volume controls.
 

zeroloopback

New Member
Joined
Sep 4, 2021
Messages
3
Likes
1
I think a derivative of the feedback endpoint patches just made it into the mainline 5.14 release, but not the volume controls.
That sounds very interesting.

I'm now looking for a way to build a virtual USB class compliant audio device with 8 input and 8 output channels for the sole purpose of providing audio loopback (Ch1 in is directly connected to Ch1 out, Ch2 in to Ch2 out etc.).
This might not make much sense using with a modern desktop DAW but it would make a huge difference when used with iPhones and iPads for music production because iOS lacks virtual audio ports and the sandboxed architecture won't allow 3rd party developers to build something like that.
I have a class compliant 8in, 8out USB audio interface here if that helps in any way (tracing USB communication maybe?) but I have no idea how to start with my Pi Zero W, which would be my device of choice because it's small and efficient.

Ideally, the Pi Zero W would plug into the USB port or Camera Connection Kit of the iPhone/iPad and show up as a class compliant audio interface with 8 ins and 8 outs so these can be used to route audio between different audio apps (synths, DAWs, effects...)

Any hints would be very welcome!
I've been searching for a solution like this for quite a while but I haven't found anything promising so far.

Thank you.
 
OP
S

somebodyelse

Major Contributor
Joined
Dec 5, 2018
Messages
3,754
Likes
3,054
I don't think iOS needs the feedback, so you probably don't need to wait for the new kernel. I've not tried different channel counts than the default (or tried it at all recently for that matter), but I think you would need to supply the c_chmask and p_chmask parameters when you modprobe the g_audio driver. I've not seen docs on those parameters but I'd guess setting them to 255 would give you 8 channels. If that works you can try using alsaloop to connect the capture and playback sides.

I think @phofman was involved in getting those patches into the kernel, so might be able to give you some better pointers than my speculation.
 
OP
S

somebodyelse

Major Contributor
Joined
Dec 5, 2018
Messages
3,754
Likes
3,054
If you try it please let us know whether or not it works!
 
Top Bottom