Hacker News new | past | comments | ask | show | jobs | submit login
Ask HN: Does this USB audio device exist?
5 points by dusted 11 months ago | hide | past | favorite | 20 comments
I have two computers, one has speakers attached. I want a low-latency, lossless way of transferring audio from the computer without speakers, to the computer with the speakers.

Ideally, a device which plugs into usb in computer 1 and presents itself as a USB audio class 2 sink.

And plugs into usb in computer 2 and presents itself as a USB audio class 2 source.

Kind of the digital version of "putting a line cable from line-out of pc 1 through an isolation transformer into the line-in in pc 2". But without needless conversion from digital to analog and back.

I've been looking at chips that implement usb audio class and provide i2c or i2c communications, but it seems like such a trivial device that I assume it's simply my google-fu that fails me.




You could use two cheep USB audio interfaces and plug the audio together.

Or if you want to remain in the digital domain use S/PDIF, such as e.g. https://www.amazon.com/Decoder-PCM2704-Module-Analog-Coaxial...

Or use a network audio protocol such as https://en.wikipedia.org/wiki/Livewire_(networking)


The S/PDIF route is interesting, it might be the closest option, I think the card you linked to actually only does spdif output. I'll investigate this further.

I'm probably going to order some USB > i2s chips and optocouplers and build something myself.


I needed pro-audio grade connection like that, and after many experiments with many devices I settled for RME HDSPE AIO devices on PCIexpress of both PCs. My requirements were: low latency, flawless ASIO, bi-directional, many digital and analog inputs and outputs, and 192kHz sampling rate capability. What I unexpectedly gained as a bonus is a SMUX sample rate converter, meaning, one PC can be set at 48kHz, while the other is at 192kHz and they still work flawlessly.

If you need one way only, then, a cheap USB device based on XMOS chip can be your output, while a not-so-cheap RME Digiface USB can be on the input side.

I found out that USB digital optical or S/PDIF output device is easy to find, and can be cheap, while USB digital optical or S/PDIF input devices are rare and not so cheap at all.

If you would like me to explain some more, please feel free to ask.


Yeah, the RME Digiface USB seems like it'd fit the bill, and then just do optical from one computer to this device. However, it's rather expensive for my case where I basically just want to pipe audio from one computer into another without having to lose quality.

If anything, such a device should be cheaper than even the cheapest USB ADC, since it doesn't even have to do any analog stuff, just carry bits between the input of one usb class device and the output of another, I'm going to build this, because it annoys the heck out of me that such a simple device don't exist.

I'm way too principled, which is how I ended up with a USB AES/EBU output device to stay digital right until the speakers does their thing :\ (which is also partly why I'm extra annoyed at having the second computers output going through that extra unneeded DAC/ADC conversion for no damn good reason!) ;)


I'm running my speakers from AES/EBU as well.

RME Digiface USB is unfortunately not class compliant and RME is completely ignoring linux, so drivers for RME devices are a hit and miss affair on GitHub.

If you ever build such a device (USB-to-USB cable with one-way class-compliant lossless audio transport), I would gladly be your first customer.

Good luck!


Give us more context; what's the situation that's lead you to this particular solution?

USB sound cards with a mic and a speaker are all over the place these days, so two of those, and an aux cable, from the speaker on one to the mic on two would get you what you're looking for, assuming I'm understanding your question correctly.

eg https://www.amazon.com/ENVEL-External-Headphone-Microphone-M...


There are issues with the simple "line out -> line in" solution.

First an aesthetic one: You're doing a totally unnecessary step, converting digital audio to analogue in the device on the "sending" computer, and then converting the analogue signal back to digital in the "recenving" computer.

A theoretical one: You're losing quality both at the DAC, electrical interface and at the DAC, along with the two devices not being clocked synchroniously so you get quantization due to clock drift of the DAC/ADC.

A practical one: You're creating a ground loop between the devices which presents itself as a 50 (or 60) hz hum along with whatever noise is picked up.

The practical problem can be solved (as I do in my setup) by using an audio isolation transformer, which solves the ground-loop issue but introduces additional loss and distortion.

I'd prefer the audio not to leave the digital domain before it's doing the final conversion to analogue by my speakers.

So, the situation that lead me to this particular solution is, that it seems the most intuitive and user-friendly way to achieve a universial solution for digitally transporting audio from one computer to another using existing drivers and operating system infrastructure (the usb audio class) with acceptable latencies (while the latency from a USB audio device may not be good enough for professional musicians, it's certainly good enough that I can't perceieve any lag between for example what happens on my display and the sound that goes along with it when watching a movie or playing a game).


Do it with toslink?

https://a.co/d/7Vl7L6t

a ground loop isolator is ancient technology by this point. It's something to be aware of, but if it's giving you distortion, you've got to ground more devices in the chain - it shouldn't be causing you problems.

As far as the theoretical, spidif/toslink will get you that, but also, I'd run recognizable patterns through the system and look at how much distortion you see before rejecting a solution based on some notion of signal purity.

But why is computer 1 restricted to not having speakers and just running a longer wire to them? There are a number of software solutions available in this space that might be better/easier, given some more context.


The audio and usb is pretty irrelevant.

You need something like this:

Computer1 + Special software -> high speed data transfer -> Computer 2 + special software -> Audio out.

Im pretty sure you can do this with ethernet switch/router just network streaming. There is probably a way to setup VLC to just playback network stream music on computer 2, and then set up OBS on computer 1 do the stream.


I think there is a simpler solution to what you are trying to do. Take a look here: https://www.virtualhere.com/

Free Trial if you want to try it out. (Not affiliated with the site)


Have you considered using something like this: https://github.com/bondagit/aes67-linux-daemon


you can just stream the audio over your network, there is software for that that can do it low latency


networking not an option?


I'm doing that atm, using jack on both boxes, but it requires waay more configuration and fiddling to get working well.

a physical usb connection would provide an intuitive, default-supported way to transfer the data, the audio class supports everything we need for making this work.

I've looked at a couple of chips and ordered two usb -> i2s chips along with a pair of high-speed optoisolators, seems I need a bit of firmware to configure the chips via i2c, but that I can do from an arduino. Just seems such an intuitive thing to have I can't imagine I really have to do it myself.


Take a look at AoIP, AES67 and Dante.

While they're IP and not USB, they are very much designed for extremely low latency for professional applications.

https://github.com/bondagit/aes67-linux-daemon


perhaps pipewire is easier, did you check what it can do? (honestly not sure but it looks to try and solve some tediousness of pulse and jack. i remember something also called 'audiod' or audio daemon which can do network fairly easy but im not sure what it was part of / using as subsystem. its been so long ago


Low-latency and USB are incompatible things. When I have a network device connected via USB it is typical to have 1000+ ms pings as a worst case.

> But without needless conversion from digital to analog and back.

AFAIK if you are working with some signal after sound player it is going to be analog. Possible solution lies in implementing a custom sound driver for a tx device and probably a custom microphone driver for a rx device.

Another possible solution is to get an HDMI input card for rx device, probably the HDMI interface will require having some video stream also instead of just sound.


> Low-latency and USB are incompatible things. When I have a network device connected via USB it is typical to have 1000+ ms pings as a worst case.

You won't achieve real-time latencies, but you'll get close enough for any practical purpose, and you'll anyway get better latency than the current solution of doing line-out -> line-in since those device will usually be present on the USB bus anyway + you have to wait for the DAC and ADC sampling.

> AFAIK if you are working with some signal after sound player it is going to be analog. Possible solution lies in implementing a custom sound driver for a tx device and probably a custom microphone driver for a rx device.

I'm not trying to do anything to the signal (I'm literally trying NOT to do anything to the signal), the way these audio devices work is usually by transporting PCM samples between the USB host and the USB device. Anything analog is due to the singnal either entering the audio device from an analog source, or leaving the device for an analog destination.

> Another possible solution is to get an HDMI input card for rx device, probably the HDMI interface will require having some video stream also instead of just sound. That is an option, but HDMI audio input devices are less standard and would probably not just pop up in your OS as an audio source without additional software or driver support.


So... I wonder if you can find a microcontroller with two 'device mode' USB ports.

Then you could (through significant effort, presumably), program port A to appear as a USB audio sink and port B to appear as a USB audio source, buffer a few samples and hope.


> transporting PCM samples between the USB host and the USB device.

Seems like a great and simple idea but it might be not easy to negotiate between available PCM implementations on transmitting and receiving devices, I don't even know about what bus should be between two USBs and how to transmit silence to the receiving side if the transmitter device is unplugged, at least it requires to have a synchronized clock between two devices with fundamentally different ones.

I expected this functional in Bluetooth, because Bluetooth has some established codec solution, but I have not seen a Bluetooth dongle which can transform a PC into Bluetooth-speaker.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: