Author Topic: Ethernet to digital audio conversion  (Read 14187 times)

0 Members and 1 Guest are viewing this topic.

Offline gmichael225Topic starter

  • Contributor
  • Posts: 27
  • Country: au
    • www.gmichael225.com
Ethernet to digital audio conversion
« on: December 10, 2014, 11:20:40 pm »
Apologies if I'm posting this in the wrong place / format!

In the spirit of don't turn it on, take it apart don't buy it if you can build it for less, I'm trying to build a converter circuit for a live sound application.

The source is 24 raw Ethernet streams (of 24-bit 48kHz PCM) (no IP layer, it's just Ethernet data bytes sent to a broadcast MAC address), and I'm hoping to output three 8-channel ADAT Lightpipe lines. From memory (it's been a little while since I looked at it), they're integer-compatible with some slightly different bit arrangements.

I'm trying to decide what the best approach is to building this device - I've created a software implementation that will play the Ethernet stream to local speakers, but I really need latency as low as possible as it's for live sound. The software version ended up a couple seconds behind over time (but then it was a bit of a kludge - "cut" and "grep" really shouldn't be in an audio pipeline).

At the moment I'm tossing up between doing something software-based (with a less kludgey implementation) on something like a RasPi, or something FPGA-based. (Or are both overkill?)

Any and all comments welcome!
 

Offline ehughes

  • Frequent Contributor
  • **
  • Posts: 409
  • Country: us
Re: Ethernet to digital audio conversion
« Reply #1 on: December 11, 2014, 12:13:37 am »
This can be a difficult topic but here are some things to think about:

 Ethernet is not well suited for low latency, real time audio for sound performance/reproduction.  You got a good start by staying at layer 2 but every attempt at using ethernet for sound reproduction in a live setting hasn't been optimal for this reason.  There is no good way to encode the audio clock in the signal.   Differences in playback rate are a pain to deal with and you cannot  add buffer to solve it.   Moving to a hardware solution such as an FPGA won't fundamental solve problem if you use ethernet. 

Checkout Gibson "Magic".    It was ultimately a market failure.

If you are trying to send gobs of audio channels over CAT6,  consider some other transport.   Why not just use the ADAT protocol over copper?

Also,   There are other implementations of real time digital audio transport such as AES10.

http://en.wikipedia.org/wiki/MADI


Not to say you can't do it,   it is just that you have to match up the transport protocol to the data type.   Ethernet simply cannot be low latency and there is no good way of transmitting data synchronously. Just for reference  I define low latency as 1 to 2 audio samples for real time.       The best I have seen is about 800uS to 1mS over Ethernet.     The problem isn't the 1mS.  The problem is that there are many other things in the chain that add latency!

Just some food for thought.

 

Offline macboy

  • Super Contributor
  • ***
  • Posts: 2252
  • Country: ca
Re: Ethernet to digital audio conversion
« Reply #2 on: December 11, 2014, 02:58:34 pm »
I think this is a bad idea. Ethernet is not fundamentally robust, and it does not care one bit if frames are delivered late or not at all. How will you deal with dropped Ethernet frames? You also can't guarantee the receive order or latency of frames. If you se TCP, then you have built-in robustness, but you will need to add buffering give the protocol time to deal with retransmission of late/dropped packets. Using raw Ethernet gains you basically nothing since you just shift that burden onto your software, instead of the TCP stack. You still need to buffer for some time to reassemble out-of-order frames and to handle dropped frames, both of which will happen.

If you just need to be able to send audio over Ethernet cable. then forget about Ethernet and put some other protocol over the cable. You have four high bandwidth differential pairs to utilize. If it is an existing cable that you can't just take over, then maybe you can live with 100Base-TX instead of gigabit, leaving two pair free to use. I like the idea of ADAT or even some other TDM protocol over the twisted pair. TI and others make ICs that can accept multiple serial streams, mux them up into a single higher rate TDM stream, and demux them at the other end into the separate streams again.
 

Offline gmichael225Topic starter

  • Contributor
  • Posts: 27
  • Country: au
    • www.gmichael225.com
Re: Ethernet to digital audio conversion
« Reply #3 on: December 11, 2014, 03:00:53 pm »
Thanks for your response!

Sorry, I should clarify - the source already exists in the form of three ProCo Momentum mi8's. (There are other systems out there, but this is what I have.) I'm not inventing the protocol - I need to decode & ADATify it...
 

Offline gmichael225Topic starter

  • Contributor
  • Posts: 27
  • Country: au
    • www.gmichael225.com
Re: Ethernet to digital audio conversion
« Reply #4 on: December 11, 2014, 03:09:42 pm »
For clarification:

I'm trying to build the pink box. The other components already exist and have existing, defined formats. I'm just trying to work out what the best hardware approach will be to building it.

 

Offline gmichael225Topic starter

  • Contributor
  • Posts: 27
  • Country: au
    • www.gmichael225.com
Re: Ethernet to digital audio conversion
« Reply #5 on: December 11, 2014, 03:12:34 pm »
are you going to make it open source? and destroy every known cobranet, yamaha-net, etc whatever else xyznets in the known audio-verse lol ... please say yes ... it will make many small-mid sized PA outfit and installers very happy

I keep hearing that AVB will do that. At the moment things seem to be heading in the direction of Cobra + Dante.
 

Online Marco

  • Super Contributor
  • ***
  • Posts: 6694
  • Country: nl
Re: Ethernet to digital audio conversion
« Reply #6 on: December 11, 2014, 04:06:53 pm »
The ethernet support on Raspberry Pi isn't native right? 25 Mbps might be pushing it, there's cheap SBCs with gigabit ethernet as well.

You will have to dick around with preempt_rt for linux to get <1 ms latency, still I'd definitely use a SBC ... just throwing a wildly overpowered CPU and a couple million LOC generic OS at it might not be elegant, but it's definitely easier than the alternative.
 

Offline gmichael225Topic starter

  • Contributor
  • Posts: 27
  • Country: au
    • www.gmichael225.com
Re: Ethernet to digital audio conversion
« Reply #7 on: December 11, 2014, 04:30:07 pm »
...cheap SBCs with gigabit ethernet ... preempt_rt...

Cheers, I'll investigate both! :)
 

Offline gmichael225Topic starter

  • Contributor
  • Posts: 27
  • Country: au
    • www.gmichael225.com
Re: Ethernet to digital audio conversion
« Reply #8 on: December 11, 2014, 04:33:40 pm »
The question then becomes - how to generate 3x 12.288 Mbit/s bitstreams from an SBC...
 

Offline Rigby

  • Super Contributor
  • ***
  • Posts: 1476
  • Country: us
  • Learning, very new at this. Righteous Asshole, too
Re: Ethernet to digital audio conversion
« Reply #9 on: December 11, 2014, 04:44:24 pm »
You guys seem to be confusing "Ethernet" with "TCP/IP" in a lot of ways.  Some of the things said here are just plain wrong.

He's using "Ethernet" as a layer 2 transport only, there's not any guaranteed delivery to slow things down, there's not going to be much in the way of smarts between endpoints to interfere.  You can definitely be within 1 audio sample and synchronous.  Anyone familiar with VoIP will eviscerate many of the stuff said in this thread.

Besides, you're all attacking something that is already built; he has an audio over ethernet device and wants to get the audio out.  So drop all of the "this shouldn't be done over ethernet" stances - it's well beyond that point already.

Hackaday.com (I think) recently featured someone doing what the thread starter is looking to do: tap into the digital audio stream that goes over CAT5 rather than analog audio cables.  Yeah, here it is.
 

Offline gmichael225Topic starter

  • Contributor
  • Posts: 27
  • Country: au
    • www.gmichael225.com
Re: Ethernet to digital audio conversion
« Reply #10 on: December 11, 2014, 04:46:43 pm »
Hackaday.com (I think) recently featured someone doing what the thread starter is looking to do: tap into the digital audio stream that goes over CAT5 rather than analog audio cables.  Yeah, here it is.

That's me. :P
I'm now trying to build a show-ready protocol converter based on what I learnt in that exercise.
 

Offline Rigby

  • Super Contributor
  • ***
  • Posts: 1476
  • Country: us
  • Learning, very new at this. Righteous Asshole, too
Re: Ethernet to digital audio conversion
« Reply #11 on: December 11, 2014, 05:01:26 pm »
I would employ the use of an FPGA if I were you.  You can definitely keep latency pretty damned low if you can use an FPGA.
 

Offline gmichael225Topic starter

  • Contributor
  • Posts: 27
  • Country: au
    • www.gmichael225.com
Re: Ethernet to digital audio conversion
« Reply #12 on: December 11, 2014, 05:11:32 pm »
That was my thinking, but I'm still just getting started with FPGA's really. Always keen to learn new things though!
 

Offline jeremy

  • Super Contributor
  • ***
  • Posts: 1079
  • Country: au
Re: Ethernet to digital audio conversion
« Reply #13 on: December 11, 2014, 05:26:12 pm »
Beaglebone Black might be worth a look. I think it is only 100M ethernet, but it has on chip Real Time Units (RTU) which you can delegate tasks to. You could also use a real-time operating system/bare metal on a Cortex A series board.

Is this a one-off ?
 

Offline magetoo

  • Frequent Contributor
  • **
  • Posts: 284
  • Country: se
Re: Ethernet to digital audio conversion
« Reply #14 on: December 11, 2014, 05:32:46 pm »
I remember that there were some people posting on comp.arch.fpga about this sort of thing - using raw Ethernet to transfer data between an FPGA-based system and a workstation with low latency.

It might be useful to take a look there, probably something can be learned about both ends of the pipe (i.e. both the FPGA implementation and on the desktop).  I think there is a searchable archive at fpgarelated.com if you aren't already set up to do newsgroups.
 

Offline gmichael225Topic starter

  • Contributor
  • Posts: 27
  • Country: au
    • www.gmichael225.com
Re: Ethernet to digital audio conversion
« Reply #15 on: December 11, 2014, 05:50:21 pm »
Beaglebone Black might be worth a look. I think it is only 100M ethernet, but it has on chip Real Time Units (RTU) which you can delegate tasks to. You could also use a real-time operating system/bare metal on a Cortex A series board.
I'll look into that. Bearing in mind though that it does need the ADAT out, which could be tricky on an SBC.

Is this a one-off ?
Yes, but I do want to build it to a high standard for production use.

mmm im definately getting too old for these and out of touch (too deep in the mountain) ... what is ... "AVB" ?

AVB: http://en.wikipedia.org/wiki/Audio_Video_Bridging

and sorry i have to noob this ... what is "big-endian integers" ?

Endianness: http://www.cs.umd.edu/class/sum2003/cmsc311/Notes/Data/endian.html

my guess is with some luck in hooking up with techs from rental companies, you could borrow their AD/DA gear for a few days and you could prolly figure out what all the protocols are. very likely they are all the same (i guess) ... because when it comes to specifications, all the cables specified are always in the same ballpark

I've borrowed some equipment, both the Ethernet transmit and the ADAT Lightpipe receive gear, and have details on the protocols for both. I'm just struggling to pick between SBC/SoC and FPGA, given the device has to have both Ethernet and high-speed (~13Mbit/s) GPIO.

It might be useful to take a look there, probably something can be learned about both ends of the pipe (i.e. both the FPGA implementation and on the desktop).  I think there is a searchable archive at fpgarelated.com if you aren't already set up to do newsgroups.

Cool, I'll check that out! Cheers :)
 

Offline jeremy

  • Super Contributor
  • ***
  • Posts: 1079
  • Country: au
Re: Ethernet to digital audio conversion
« Reply #16 on: December 11, 2014, 06:33:24 pm »
Beaglebone Black might be worth a look. I think it is only 100M ethernet, but it has on chip Real Time Units (RTU) which you can delegate tasks to. You could also use a real-time operating system/bare metal on a Cortex A series board.
I'll look into that. Bearing in mind though that it does need the ADAT out, which could be tricky on an SBC.

Take a look at this: http://elinux.org/BeagleBone_PRU_Notes

With assembly, I believe you can get a GPIO to toggle at 200MHz.
 

Offline Jeroen3

  • Super Contributor
  • ***
  • Posts: 4067
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Re: Ethernet to digital audio conversion
« Reply #17 on: December 11, 2014, 07:35:31 pm »
With assembly, I believe you can get a GPIO to toggle at 200MHz.
No way 200 MHz is coming out of an non-clockout gpio.

You will need a SPI peripheral to do the NRZI encoding of the ADAT line. 3 of them.

Its a long time ago and don't remember the hard limits of the chip, but what about a LPC43xx's SGPIO and some additional gates for the NRZI encoding?
I used that chip to control multiple ( 8 ) RGB LED driver IC's really fast.
 


Offline gmichael225Topic starter

  • Contributor
  • Posts: 27
  • Country: au
    • www.gmichael225.com
Re: Ethernet to digital audio conversion
« Reply #19 on: December 12, 2014, 02:47:39 pm »
Looks like I might need to get a Beaglebone Black to play with! Even if it doesn't work out for this, I'm sure it'll come in handy somewhere.
 

Offline Rigby

  • Super Contributor
  • ***
  • Posts: 1476
  • Country: us
  • Learning, very new at this. Righteous Asshole, too
Re: Ethernet to digital audio conversion
« Reply #20 on: December 12, 2014, 03:03:06 pm »
They're amazing little machines; far more punch to a BBB than a Raspberry Pi.
 

Online Marco

  • Super Contributor
  • ***
  • Posts: 6694
  • Country: nl
Re: Ethernet to digital audio conversion
« Reply #21 on: December 12, 2014, 03:31:16 pm »
The i.MX6 boards should be able to output at a fair clip as well using the DMA controller (basically an extra processor).
 

Offline Richard Crowley

  • Super Contributor
  • ***
  • Posts: 4317
  • Country: us
  • KJ7YLK
Re: Ethernet to digital audio conversion
« Reply #22 on: December 12, 2014, 03:36:34 pm »
The ADAT protocol is was typically implemented by using the Wavefront Semiconductor chips. It is just another particular serial format, not significantly different than any other serial protocol, but I'm not sure it is published so that you can "reverse-engineer" it.  But if we had the definition, any digital circuit of sufficient speed and power should be able to generate it

http://www.wavefrontsemi.com/index.php?products

Unfortunately, as you can see, all the ADAT format chips are EOL and no longer available.  Dunno how people are implementing ADAT now?
 

Offline manzini

  • Regular Contributor
  • *
  • Posts: 54
  • Country: es
Re: Ethernet to digital audio conversion
« Reply #23 on: December 12, 2014, 11:45:18 pm »
Dunno how people are implementing ADAT now?

Also interested, just curiosity, wavefront second hand are very overpriced,  but in any case, extinct IC with manage a very simple protocol, obsolescence because the niche is addressed to better solutions (MADI/AVB) but I still enjoy my "old" RayDAT and want for many years to interconnect my adat gear.

Maybe looking into a new Behringer item as adat 8200, but I guess that use custom ic's paying Alesis royalties.

It is more likely that a recent Motu, with AVB that means new platform&dev.board, unveil a generic ic programmed to ADAT trans/decode.


About AVB.

I took a few months looking AVB solutions, I am interested in soft. development. Now some pro-solutions AVB (also have Adat) come from Motu.

But in terms of development, check Xmos platform, a good AVB platform.

#Richard -> Xmos had ADAT in their roadmap for some time, maybe they have it now.
 

Offline gmichael225Topic starter

  • Contributor
  • Posts: 27
  • Country: au
    • www.gmichael225.com
Re: Ethernet to digital audio conversion
« Reply #24 on: December 13, 2014, 12:32:47 pm »
Unfortunately, as you can see, all the ADAT format chips are EOL and no longer available.  Dunno how people are implementing ADAT now?

There are FPGA implementations out there. https://ackspace.nl/wiki/ADAT_project.

The problem for me is, with FPGA's I'm not so sure of the Ethernet side, and with SBC's I'm not so sure of the ADAT / latency side.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf