Raspberry Pi I2S to SPDIF Hat

Discussion in 'Digital: DACs, USB converters, decrapifiers' started by Michael Kelly, Apr 30, 2016.

  1. Michael Kelly

    Michael Kelly MOT: Pi 2 Design

    Joined:
    Apr 22, 2016
    Likes Received:
    1,015
    Dislikes Received:
    0
    Trophy Points:
    93
    Location:
    Rhode Island, USA
    Home Page:
    Guys,
    In my tube/hybrid amp thread one of you (Vastx) asked about making a Pi hat with I2S to SPDIF. Sounds like a Digi+ right? But they wanted a couple of items done differently. First it had to have transformer coupled coax. Second was the ability to supply 3.3V and 5V from an external linear supply, thus decoupling from the Pi supply. Third, high quality clocks were mentioned. Finally someone else mentioned it would be great to run the digi+ software "out of the box".

    I took that as a mission and have designed a hat that has the following features:

    1) WM8804 with GPIO selectable 24.5476Mhz/22.5792Mhz Clock input
    2) Clock are very low noise using NDK2520SD series. Not as low as Crytek's best, but not $20 each either!
    3) WM8804 runs in Master Mode, Pi in Slave mode so BCLK and LRCLK are very low jitter
    4) Transformer coupled Coax and Optical SPDIF output
    5) LT3042 Ultra-Low Noise, High PSRR LDO for SPDIF PLL and Crystal supply
    6) Jumper to isolate PI 5V from Hat 5V with 2.5mm barrel jack for external 5V input
    7) 4-Layer PCB with filtered ground from Pi

    That's all the good stuff. I don't provide for external 3V since I have the LT3042 there. The one downside is that in order to switch the clock input between the two frequencies, we need to add SW to the various audio platforms. It's actually easy to do, but it means we'll have to provide the modified platforms to our users until it can be integrated into the next releases. We could make version that has a single 27Mhz clock so the Digi+ code could run without change. The main issue with that is the increased jitter from using the WM8804 internal PLL to create the proper frequencies.

    If anyone is interested I will be sending the design for fabrication next week. Any input would be great. I can also share the schematic if anyone wants to better understand this.

    Cheers,
    Michael
     
    Last edited: Apr 30, 2016
    Grattle, ultrabike, Priidik and 17 others like this.
  2. philipmorgan

    philipmorgan Member of the month

    Friend BWC
    Joined:
    Sep 28, 2015
    Likes Received:
    2,667
    Dislikes Received:
    1
    Trophy Points:
    93
    Location:
    In the wind, so to speak
    Home Page:
    I'm interested. I'm finding my Digi+ to offer some of the same sonic benefits as a $500 USB --> SPDIF converter.
     
    Michael Kelly likes this.
  3. Jun

    Jun Friend

    Friend
    Joined:
    Feb 28, 2016
    Likes Received:
    170
    Dislikes Received:
    1
    Trophy Points:
    43
    Why not just use RPI i2s to an i2s dac that has a reclocker and bypass the s/pdif conversions. Should be better than going i2s to S/PDIF -> S/PDIF to i2s.

    I know the s/pdif conversion can be great for some people who want it.

    Just a question, your tube dac/amp for rpi does it reclock the i2s signal?
     
  4. Merrick

    Merrick A lidless ear

    Friend
    Joined:
    Jan 6, 2016
    Likes Received:
    5,262
    Dislikes Received:
    5
    Trophy Points:
    113
    Location:
    Portland, OR
    Some of us want to use our existing DAC that doesn't offer and i2s option. I think this sounds great! I currently have a Digi+ but would upgrade if this provides better sound.
     
  5. Xen

    Xen Friend

    Friend
    Joined:
    Sep 30, 2015
    Likes Received:
    198
    Dislikes Received:
    1
    Trophy Points:
    43
    Location:
    Houston, TX
    Hankering to learn some electronics and was planning on picking up a Pi3 for tinkering. Would be interested in this in place of DIGI+
     
  6. fraggler

    fraggler A Happy & Busy Life

    Friend
    Joined:
    Oct 1, 2015
    Likes Received:
    2,482
    Dislikes Received:
    5
    Trophy Points:
    113
    Location:
    Chicago, IL
    Would definitely get this over the Digi+
     
    Michael Kelly likes this.
  7. Michael Kelly

    Michael Kelly MOT: Pi 2 Design

    Joined:
    Apr 22, 2016
    Likes Received:
    1,015
    Dislikes Received:
    0
    Trophy Points:
    93
    Location:
    Rhode Island, USA
    Home Page:
    As the others have mentioned, this is useful when you have another piece of equipment that cannot accept I2S directly. Which would be most equipment as there is no standard connector or cabling for I2S.

    As for the tube amp, we use the PCM5102A which uses the bit clock to create an internal master clock using a PLL. This adds more jitter to what is present from the PI, resulting in a fair amount of total jitter. This is partly the reason that part does not have the best specifications for noise or distortion. So no, it does not re-clock the I2S signals.

    Cheers,
    Michael
     
  8. hauntology

    hauntology Rando

    Joined:
    Oct 21, 2015
    Likes Received:
    0
    Dislikes Received:
    0
    Trophy Points:
    1
    I'd be interested in trying this out. I've been using a Digi+ and I've been happy with it, but this design sounds great.
     
  9. uncola

    uncola Friend

    Friend
    Joined:
    Sep 27, 2015
    Likes Received:
    458
    Dislikes Received:
    1
    Trophy Points:
    63
    Location:
    Oahu, Hawaii
    so to use this we also need an external 5v lps? heh sorry I'm asking such basic questions. I mean.. an external power supply other than the one we're using for the raspberry pi
     
  10. Xen

    Xen Friend

    Friend
    Joined:
    Sep 30, 2015
    Likes Received:
    198
    Dislikes Received:
    1
    Trophy Points:
    43
    Location:
    Houston, TX
    I thought the same the thing, but then re-read the OP (Point 6). It lists a jumper that will be used to switch from Pi3 powering the hat to an external PS
     
    FlySweep likes this.
  11. uncola

    uncola Friend

    Friend
    Joined:
    Sep 27, 2015
    Likes Received:
    458
    Dislikes Received:
    1
    Trophy Points:
    63
    Location:
    Oahu, Hawaii
    in that case, put me down for one! tired of all these uber expensive arm based network streamers like microrendu and aries. just give me a rpi3 and this thing and I'd be happy running archvile. or archphile.
     
    Xecuter, Wfojas, Vastx and 1 other person like this.
  12. Vastx

    Vastx Almost "Made"

    Joined:
    Feb 4, 2016
    Likes Received:
    255
    Dislikes Received:
    0
    Trophy Points:
    43
    Location:
    Italy
    This is great Micheal!
    I was going to say in the other thread that external 5V as the only powering way for the hat could have been a deal breaker for someone but you made a very smart move putting a jumper there.

    As for the double clock... So many people would of course be happier with the liberty to try other platforms without waiting for you to provide the software. Thus the single clock looks like the better option for compatibility.
    I say screw this. If we want compatibility many of us already have or can buy the digi or his chinese copy the digipi. I say go for performance with the double clock and be sure to cover the main platforms in the beginning (Rune, Moode, Volumio) and then reach out for wider software integration.

    Of course if you want to make a single clock version as well to differentiate your offer, that would be good too.

    I'd be glad to take a peek at the schematic and I'm definitively looking forward to try the hat.
     
  13. Michael Kelly

    Michael Kelly MOT: Pi 2 Design

    Joined:
    Apr 22, 2016
    Likes Received:
    1,015
    Dislikes Received:
    0
    Trophy Points:
    93
    Location:
    Rhode Island, USA
    Home Page:
    The single clock option will install a single 27Mhz instead of the pair of audio clocks. The Digi+ software expects this. You will still gets you the isolated coax and the very low noise 3V LDO (LT3042 thanks to you Vastx!). I expect that even running form the Pi 5V the performance will be very good.

    You know, the more I think about it, the double clock is something everyone should be able to try, even if they want start with the 27Mhz in order to run the stock drivers. Heck, it's not like another crystal is all that expensive! So, new feature, three clocks: 27Mhz digi+ clone, plus dual 24.5476/22.5792 for no PLL operation, but with a new driver.

    You guys are great, please keep the ideas coming! :)

    Cheers,
    Michael
     
  14. Michael Kelly

    Michael Kelly MOT: Pi 2 Design

    Joined:
    Apr 22, 2016
    Likes Received:
    1,015
    Dislikes Received:
    0
    Trophy Points:
    93
    Location:
    Rhode Island, USA
    Home Page:
    Here's a 3D rendering of the PCB for the 503SPD1:

    [​IMG]
     
  15. Vastx

    Vastx Almost "Made"

    Joined:
    Feb 4, 2016
    Likes Received:
    255
    Dislikes Received:
    0
    Trophy Points:
    43
    Location:
    Italy
    Wonderful!
    Ok... Triple clocks (single + double)....you just turn a deal breaker problem into a killer option. Nice one!
    LT3042 was my choice to power the Pi and the and the digi... One of the highest PSRR affordable new generation LDO. Still waiting to receive my PSU kit though.

    [WARNING: BS mode ON]
    Another cool option would be considering clock upgrade for this board. Maybe tomorrow some hands could get itchy to try new and better clocks and we can provide that with a simple and inexpensive modification of the PCB Layout. I see some unused space in there.
    Edit: Or you can offer better clocks as an option yourself with a mark up on them too.
    [​IMG]
    Please stop me if you think I'm overdoing with this board :D

    Edit - This hat deserves a cool project codename! My vote is for "DIGIKiller" |{
     
    Last edited: May 1, 2016
    mori39, FlySweep and uncola like this.
  16. Michael Kelly

    Michael Kelly MOT: Pi 2 Design

    Joined:
    Apr 22, 2016
    Likes Received:
    1,015
    Dislikes Received:
    0
    Trophy Points:
    93
    Location:
    Rhode Island, USA
    Home Page:

    Vastx - I must give you full credit for the LT3042. I saw you mention it in your Digi+ thread. I have a couple of TI parts I've used when I need high PSRR and I've used the ADP150 for low noise. But the LT3042 combines the best of both. Thanks for that!

    As for the clocking, let me think about it. I am pretty confident that as is, it's going to be very solid, but I also understand the opportunity it might represent.

    Thanks,
    Michael

    P.S. "DIGIKiller, I love it, but... I am a bit hesitant to say anything bad about the Hifberry products. I wouldn't want to start a war!
     
    Wfojas likes this.
  17. Michael Kelly

    Michael Kelly MOT: Pi 2 Design

    Joined:
    Apr 22, 2016
    Likes Received:
    1,015
    Dislikes Received:
    0
    Trophy Points:
    93
    Location:
    Rhode Island, USA
    Home Page:
    Link to schematics for the brave of you who know how to read schematics. ;)

    http://www.pi2design.com/uploads/4/8/5/3/48531975/503spd1_sch_p1.pdf

    It's pretty straightforward. The pullup and pulldown resistors on CKSEL0-3 select the 27Mhz by default. One we make the patches for RUNE and Volumio we'll have the ability to switch the right clock on the fly. The code to change the Wolfson WM8804 PLL is already there, so we just stick our changes in that code to select the actual clock instead of changing the PLL multiply/divide constants. Easy, right?
     
    Vastx and philipmorgan like this.
  18. Vastx

    Vastx Almost "Made"

    Joined:
    Feb 4, 2016
    Likes Received:
    255
    Dislikes Received:
    0
    Trophy Points:
    43
    Location:
    Italy
    Of course, piece of cake! LOL

    Seriously, I'm glad you could use the lt3042. Thank you for that. About the name, it was just a joke. I don't want to start a war either with hifiberry, Daniel is a nice and supportive guy. Though I still think you can come up with something a little more catchy than 503SPD1 if you want people to easily communicate about it ;) but I can live with every name as long as it delivers superior audio quality.
    People in this forum love Schiit stuff. Thinking about it... 503SPD1 is not that bad as a name.

    Could you please include MoodeAudio in the shortlist of audio platforms? It has his fair share of followers, including me.
     
  19. Michael Kelly

    Michael Kelly MOT: Pi 2 Design

    Joined:
    Apr 22, 2016
    Likes Received:
    1,015
    Dislikes Received:
    0
    Trophy Points:
    93
    Location:
    Rhode Island, USA
    Home Page:
    How familiar are you with installing and configuring MoodeAudio? My SW guy has done a bit with Rune audio and a lot with Volumio. Our typical customer on the embedded side is fairly comfortable with building images and installing patches. Obviously this arena may not be so excited about that! If you can help us along then we'd be happy to send you a unit or two and test it out. If the Digi+ stuff just works with the 27Mhz clock, then great. But would you be willing to work with us on the upgraded clock option? It would probably only require installing the version we send you then running it through it's paces with different files and formats to make sure it all works solid. That would be a great help, if you were OK with it. I am not trying to push our job on anyone else!

    Speaking of Schiit, at first I though it was just some unlucky guys name and he/she decided to embrace it. But since one of their products is called "fulla" I am not sure it wasn't a very clever marketing ploy. Maybe the guys who started it are really named Smith and Jones!

    Cheers,
    Michael
     
  20. Vastx

    Vastx Almost "Made"

    Joined:
    Feb 4, 2016
    Likes Received:
    255
    Dislikes Received:
    0
    Trophy Points:
    43
    Location:
    Italy
    I use moodeaudio regularly and I have also installed it and configured it in my friends setups a couple of times. I've also tested rune and volumio. I've never made images or installed patches.

    I'd be very glad to test it and contribute, no problem at all. If this "only require installing the version we send you then running it through it's paces with different files and formats to make sure it all works solid" then I can do that easily. If I am required to perform other operations you could guide me through the process.

    If you think you need someone more experienced than me with linux I'm sure you'll find someone up to the task in this nice forum, otherwise count me in.
     

Share This Page