Raspberry Pi I2S output as Asynchronous USB-to-I2S - diyAudio
Go Back   Home > Forums > Source & Line > Digital Line Level

Digital Line Level DACs, Digital Crossovers, Equalizers, etc.

Please consider donating to help us continue to serve you.

Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
Reply
 
Thread Tools Search this Thread
Old 1st April 2013, 03:52 PM   #1
Tinco is offline Tinco  Netherlands
diyAudio Member
 
Join Date: Feb 2013
Location: Enschede
Default Raspberry Pi I2S output as Asynchronous USB-to-I2S

Hi,

I am building a USB dac (dddac), and one of the components is an asynchronous USB-to-I2S board. I discovered that the Raspberry Pi actually has a direct I2S output with an option for an external clock.

In my imagination that would have less jitter than any other solution because you have 256MB worth of memory to buffer stuff in and a high speed cpu for putting stuff on the line.

I posted this on the dddac thread and supersurfer had this to say about it:

Quote:
Originally Posted by Supersurfer View Post
...
I also wonder how it would sound using the I2S on the GPIO pins, the advantage of waveIO is it's galvanic separation of the PC and DAC. There is a lot of noise on the PI ground connection that would pollute the signal. If you test the analog output you will understand what I mean.

...
I wondered if the clock could not be on a separate power supply to reduce noise, to which he replied:

Quote:
Originally Posted by Supersurfer View Post
...
The clock ground needs to be connected to the pc ground because the clock signal needs to be referenced to something. Also the I2S data signals will be referenced to the pc ground.

There is another way to overcome the ground pollution; put an isolator on the GPIO output signal, on the waveIO a GMR isolator (IL715 from NVE) is used for this purpose. However I expect the ground pollution will still raise jitter.
...
It was established that this could be used for any dac, not just the dddac so Doede suggested I start a fresh thread on this.

So what do you guys think, is it possible to use the Pi as a low jitter I2S source or is the noise generated by the CPU too big of an obstacle?

(for the sake of the discussion, please assume that I will be able to get the software side of this use the electronics to their best extent)

Kind regards,
Tinco

Last edited by Tinco; 2nd April 2013 at 12:04 AM.
  Reply With Quote
Old 3rd April 2013, 08:35 PM   #2
Turbon is offline Turbon  Sweden
diyAudio Member
 
Turbon's Avatar
 
Join Date: Aug 2011
Location: South
Nice, I have just been thinking about the RPI as an SD (or an general) reader producing UAC-2 output... But, taking the data straight to a DAC of yer choise - neat.

I haven't started my rpi yet sorry to say but one of these days (time given) it will happen ;-).
__________________
These are my principles, and if you don't like them... well, I have others.

Last edited by Turbon; 3rd April 2013 at 08:38 PM.
  Reply With Quote
Old 3rd April 2013, 09:37 PM   #3
Tinco is offline Tinco  Netherlands
diyAudio Member
 
Join Date: Feb 2013
Location: Enschede
Hey, that could work, but note that you would have to add an SD card reader as you can not remove the OS SD card while it is running.
  Reply With Quote
Old 4th April 2013, 01:02 AM   #4
diyAudio Member
 
Join Date: Jun 2011
I think the problem is that you still need some mechanism to ensure the absence of buffer over- or underruns.

If the data being delivered by the USB is arriving at a slower clock rate than the I2S is clocking it out, then you must accumulate data before starting to clock it out, and no matter how big the buffer, it will eventually empty. You need prior knowledge of the duration of the track, sound, music, whatever to know how much buffer space you need to fill.

The case where data is being delivered faster than it is being clocked out is simpler to deal with in some terms, but eventually the buffer will fill. The question will still remain, how do you intend to guarantee the delivery rate is greater than the output rate?

Of course a very big buffer does give some leeway, but music playback is only one aspect. Synchronisation with video may also be required and most people would prefer that this should be automatic.

There is only really one way to deal with this problem, that is to have a master clock at the DAC and to have the data delivered on demand by the PC over the USB in the same way that printers or other devices used to control the data sent to them. Currently available generic USB drivers in Windows simply do not permit such an arrangement for devices that the drivers recognize as DACs.
__________________
Now I am Become Death, the Destroyer of Words
  Reply With Quote
Old 4th April 2013, 01:11 AM   #5
Tinco is offline Tinco  Netherlands
diyAudio Member
 
Join Date: Feb 2013
Location: Enschede
While what you say is true, this holds for all USB dacs. And it has been shown that with some buffering they work fine. The Pi has a relatively large amount of memory available for buffering. Synchronisation with video is not required.

What I am asking is wether it would be possible to use the Pi to build a I2S source that is competitive with for example the luckit WaveIO USB to I2S card.

The answer to this lies in wether the Pi can produce a clean enough signal.
  Reply With Quote
Old 4th April 2013, 02:36 AM   #6
diyAudio Member
 
Join Date: Jun 2011
Quote:
Originally Posted by Tinco View Post
While what you say is true, this holds for all USB dacs.
Yes, this is why the very large majority of DACs have a clock derived from the incoming data, not an external, asynchronous clock.

Thinking about it, the RPi USB functions as a host, master, or controller device, DACs are normally slave devices.

You cannot make the RPi do what you want.
__________________
Now I am Become Death, the Destroyer of Words
  Reply With Quote
Old 4th April 2013, 08:05 AM   #7
Tinco is offline Tinco  Netherlands
diyAudio Member
 
Join Date: Feb 2013
Location: Enschede
Yes, but for USB deriving the clock from the incoming data would be very jitter prone. That is why high-end DACS have elaborate buffering schemes accompanying their reclocking circuits.

It is true that the model B Raspberry Pi can only be used as a master device, but the recently introduced Model A has had the usb hub removed and can now also be used as a slave.

Anyway I would be just as happy if it did ethernet to i2s instead.

I think the best way to find out if I can reduce the jitter is to measure it. I tried googling for how to measure jitter but all I got was highlevel overviews. Does anyone here maybe know how I could generate jitter graphs? (either the eye diagrams or those bar charts?) What sort of device would I need?
  Reply With Quote
Old 4th April 2013, 08:52 AM   #8
dddac is offline dddac  Germany
diyAudio Member
 
Join Date: Jul 2003
Location: Wiesbaden
audio precision and equivalents .. hope you have some 30k$ in the drawer
__________________
www.dddac.com
Happy listening and building
  Reply With Quote
Old 4th April 2013, 11:32 AM   #9
Turbon is offline Turbon  Sweden
diyAudio Member
 
Turbon's Avatar
 
Join Date: Aug 2011
Location: South
Hmmm, what about dynamically (maybe stepwise) control the cpu clock? I would be most interessted in taking the data from the gpio pins rather than messing with USB... But of course, if we can get the USB to play as we wan't I maybe choose that direction instead - but KISS as always...
__________________
These are my principles, and if you don't like them... well, I have others.

Last edited by Turbon; 4th April 2013 at 11:50 AM.
  Reply With Quote
Old 4th April 2013, 12:44 PM   #10
Tinco is offline Tinco  Netherlands
diyAudio Member
 
Join Date: Feb 2013
Location: Enschede
Haha Doede, I am enrolled in university so there's a good chance we have the device, what is the device called that can do it? I love using 30k$ devices I know nothing about
  Reply With Quote

Reply


Hide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
XMOS-based Asynchronous USB to I2S interface Lorien Digital Source 2111 12th July 2014 05:21 AM
exaU2I - Multi-Channel Asynchronous USB to I2S Interface exa065 exaDevices 1357 3rd March 2014 08:51 PM
LPC3130 for asynchronous USB to I2S jonsmirl Digital Line Level 16 11th November 2012 01:12 AM


New To Site? Need Help?

All times are GMT. The time now is 01:46 PM.


vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2014 DragonByte Technologies Ltd.
Copyright 1999-2014 diyAudio

Content Relevant URLs by vBSEO 3.3.2