Die, SPDIF ! Design of the Ethernet DAC

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
Hello,

Sorry for the rather eye-catchy subject !

As many of you, I've been thinking for a long time about how to build the best music system.
And I've finally decided to get down to doing it. So, let's pool some brains.

I write this post to get your ideas and critics, so please express.
I will ask you to be constructive and refrain from flaming.

So, starting at the source this first post will be about designing a good DAC for a computer. This includes the following questions :

Let's start from the beginning.
*************************************************
0. The Source

The source shall be future proof (able to read current and future formats without replacing). Only a computer fits this definition. It is made of cheap and easy to replace parts ; a HD-DVD or Blu-Ray drive can be added when needed and it can play legal music downloads in 24/96 FLAC from magnatune.com. CD is obsolete as a media for information storage anyway. I want HDD backups and playlists.

*************************************************
1. How to get rid of jitter ? Where is the master clock ?

The master clock should be on the same board carrying the DAC chips, with the shortest path between clock and DAC(s). The source (computer) and everything else should be slaved to it. Better eliminate problems rather than trying to solve them. Of course the implementation must be good enough (see next episode)...

Physically the DAC will be one box. There will probably be several boards inside (digital, analog, etc). Power supply will probably be external to keep noise down.

A computer can play DVDs and will be able to play any future audio/video formats (HD-DVD, Blu-Ray) while being slaved to the master clock in the DAC, so there is no problem for video playback either.

There shall be two clocks, one for 44.1k based sample rates and one for 48k based sample rates, with appropriate selections via software.

*************************************************
2. How many channels ?

A stereo system for 24b/192k needs about 10 Mbps.
If we want to be future proof, let's provision for a craziest multichannel system with active digital XO :
- 3 front channels, 4 way
- 4 subwoofers
- 2 rear channels, 2 way

By putting all channels 24/192 except the woofers and LF channels in each speaker we get about 70 Mbits/s.

Hm, so let's design for between 2 and 20 channels.

I think I'll start with 6 or 8 x 24/192 channels to be able to do digital crossover for 4 way speakers and various other experiments. There should be an expansion connector... also a cheap multichannel codec can be used for the subwoofers while good quality dacs like PCM1704 can be used for the rest.

Calculating the number of channels was to know the required bandwidth. SPDIF/ADAT are, or course, out : not flexible enough, stereo only, too much jitter.

I will also include a stereo ADC for analog sources : tuner, vinyl.

*************************************************
3. Where to do the digital crossovers and filtering / upsampling ? In the PC or in the DAC box ?

Doing them in the PC will allow use of standard, proven software like BruteFIR.
It will be a phenomenal time saving but, due to available bandwidth, will pretty much limit the max sample rate to 192 kHz. I think this is enough. A DSP might be added to the DAC box to oversample to the DAC chips native frequencies if a DSP expert is found or I can learn how to do it. I don't think it is a good idea to do the room correction/crossover in a DSP chip : it already works well with a PC. Don't reinvent the wheel.

*************************************************
4. Connection from the DAC box to the computer.

From our bandwidth requirements, we have :
- Custom PCI FPGA board : Out, PCI is obsolete.
- Firewire
- USB2
- Ethernet

The connection should also allow the computer to tell the DAC which sample clock to use, and the DAC to query audio data from the computer, effectively slaving it to its clock.

I prefer Ethernet because it's the most mature one, the easiest to program and it can be 100m. long so the PC can be in another room. I wish there were boards with Gigabit Ethernet, but, oh well.

USB is too short (5m max) and eats system resources.

Firewire is nice but isn't very mature. Maybe someone can comment on this ? Also, Firewire audio puts the clock in the component which is elected as bus master. I don't fully understand how the protocol works.

Connection includes drivers. The PC will, of course, run Linux, so I will have to write a kernel driver which will masquerade this DAC as a sound card and take care of all communication :
- data transmission
- clock management
- setting volume from the computer
- displaying the song title on the DAC LCD front panel (LOL)
- etc

Linux already has support for ethernet audio (like making the soundcard on a computer virtually appear on another) so I think this should be doable without too much headache.

Also, for Ethernet boards, I think the DAC will act like a TCP server, receiving audio data as a simple TCP stream. These boards have HTTP servers in the firmware (uclinux rules) so the controls (volume, sample rate etc) could be simple HTTP requests.

In this case, the first version of the "driver" can be a simple userspace application, talking to the DAC via ethernet / TCP/IP and offering some Jack ports to the audio player. Hell, it could even be written in Python. No need to hack the kernel, and you get full debugger support with no hassle. And you can test your DAC with a web browser (upload a WAV file... lol.) or even SSH into it...

*************************************************
5. Implementation.

I will design the electronics around the DACs, clock, and analog output stage / volume control. However this needs to be fed data in a format like I2S. I will not design a board carrying a CPU, Ethernet transceiver et al, this is too much work.

So, I'm hunting readymade boards with the following characteristcs :

- Computer connection (Ethernet 100Mbps or better, 1Gbps, real USB2 or Firewire)
- A nice CPU with enough power and DMA to lug aroung the data, or a FPGA which can synthetize a CPU core
- Included communication stack (like a TCP/IP stack)
- Enough RAM and output pins
- Easy to program (Ideally uclinux)
- Bonus if it includes a DSP or a FPGA
- Price should be acceptable (ie. not 1500 euro + tax like the DICEII Firewire dev board)

So, said board will receive the data from the computer, buffer it and send it to the DAC. It will probably output the samples in parallel format with DMA access, so a converter will be needed to make them I2S. This will either be a FPGA or other programmable component.

Examples :

http://www.acmesystems.it/?id=4 (cheap)
http://www.acmesystems.it/?id=120 (cheap)
http://www.cesys.com/index.php?language=en&doc=advanced&docparams=USB2FPGA&menuparams=50 (unknown price)
http://www.traquair.com/products/microline/c6713compact.html (unknown price)


*************************************************

Now, I'm waiting for your comments (and especially suggestions for the CPU board !)

If anyone wants to embark on the project, you're welcome.
 
I figure after all this talk of DAC's and the Squeezebox transporter, the easiest thing to do to ensure the best possible signal is to get a pro computer dac and use balanced output to transport the signal where-ever you need in the house.

I have a friend that did this, he installed softsqueeze on his computer, then is using pda / laptops / cell phone to control the playlists. All the amps are in his basement. You should check out the slimdevices forums, they tolerate a lot of diy type discussion.
 
Isn't this just a Squeezebox?

Not really. Squeezebox goes through the network to grab MP3 and other files on a PC offering a file sharing. My box will be a lot dumber ; it will just wait for the PC to send audio data ; but will be able to do multichannel, active crossover, etc ; it's just a soundcard at the end of a wire.

And I dont want to browse through my music collection using a crummy two button interface.


Yes, I couldn't find real documentation on their site. Any info ?
 
I'd rather have my device as dumb as possible and program all the intelligence in the PC, especially when the PC can use existing software that works, like :
- BruteFIR for crossover and room correction,
- linux infrared remote control,
- amarok media player,
- playing DVDs and video files
- listening to internet radio
- having a decent visual ilterface

Besides, the Tivx looks like it generates the DAC clocks from a cheap oscillator / PLL which is quite a compromise...

Also, I DON'T OWN A TV :D

Hehe, getting closer :

http://www.opalkelly.com/products/xem3001/

Our FrontPanel software fully supports the XEM3001 for basic configuration and incredibly flexible virtual control panel interfacing. And the FrontPanel programmer's interface lets you communicate with the XEM3001 using your own software and our drivers -- after configuration, the USB interface becomes a high-speed bidirectional communications pipe between the PC and your FPGA design allowing you to transfer asynchronous and synchronous data using our HDL modules and API. Since the API is available in C++, Python, and Java programming languages, software/hardware integration has never been so easy.

Python ? They said Python ? :D
 
What about the new version of the Via epia mini-itx boards. They seem to carry gigabit lan and can be had totally fanless (no noise) The boards are small (17*17cm) and there is also a 12*12 cm available. The processor might not be sufficient to do 20 channels of brutefir though. Small cases can be used as (if?) not much ad ons are required.

http://www.via.com.tw/en/products/mainboards/motherboards.jsp?motherboard_id=420

I do not know whether I2s can be derrived from the board. The via VT1618 is, if I remember well, also used by M-Audio for some of it's pro soundcards.

I'm thinking of building something like that (small dedicated pc + external MC soundcard/dac) but for now I have too many projects.
 
Actually, they come rather cheap if you consider what is included on the board. Although the Vt1618 seems to be relatively good I would be in favour of external soundcard/DAC.

I've been playing around lately with laptop and M-audio transit USB soundcard using asio drivers and Foobar2000. The results are very very satisfying. It's not as good as a Rega Apollo CDP (tested in front of a dozen DIY loudspeaker builders) but it is not that far off either.

I used to think that good sound from a computer was only for the megabuck pro machines but I have changed my mind a bit. Don't underestimate the effort. I fiddled around with drivers and Foobar for weeks to get it to the lever where I am now. It sound good withouth upsampling and maybe just a tad better with upsampling. The upsampling is taking all of the P4 2,7Ghz capacity though.
 
I love Open Source.

http://netjack.sourceforge.net/

"Netjack is a Realtime Audio Transport over a generic IP Network. It is fully integrated into JACK.

When you transport Audio Signals over a Network, you will always have the problem, that two Computers are bound to two different Sample Clocks. The other Network Transports face the Problem of compensating for the drift between these Sample Clocks. This is very hard to do.

NetJack works around this problem, by syncing all Clients to one Soundcard."
 
BlackCatSound said:
The easy way around the clock issue is to feed the data faster than required and for the client to say 'stop' when its getting full.

Syncing clocks will never give the same performance as a nice fixed osc.

Yes, that was the idea.

However the computer needs to have a rather precise idea of the DAC clock to synchronize video, for instance.

Here's the plan (this is how netJack works) :

DAC has a master clock which is the only one which matters. It sends UDP packets with timestamps and clock counters to the PC so that the PC can recreate a virtual clock in sync with the DAC clock.

The PC just sends data to the DAC using a simple buffered TCP connection.

Everything is controlled by the DAC clock.
 
Have been playing with these problems, and still do, so I can share some experience.

1. System must be independent from PC and OS. These thing become obsolete in a few months, so I'd avoid micro-atx board and similar.

2. An old dedicated PIII based PC has no cost, but is enough for audio purposes. I have taken one too old from my office and boxed it in a mediacenter case from Thermaltake, whic provides a remote control that I use to command Foobar.

3. Thermaltake provides fan less 300W PS for PC and passive coolers for CPU. Seagate HD are the most silent and is the only noise you hear, less than a CD transport. HD too has a heatsink.

4. My compromise to get out data from an hard disk to feed a DAC is an E-mu 1212M sound card (www.emu.com). This card has two interesting features (other than a great DSP):

a. accepts an input clock and can operate as slave.

b. having a daughter card, the main card has outputs for SDIN SCLK and LRCK. Could these feed directly an external DAC? My Wolfson DAC has pins to receave directly serial data (Wolfson names are DIN BCKIN and LRCIN) and a pin for an external master clock.

Now I use Spdif to connect PC and DAC because I'm not yet enough experienced to handle the signals to connect directly the 1212m and the DAC (I even don't know if it is possible).

Is this a good way to go?

Cheers

Thomas
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.