Raspberry Pi I2S to SPDIF Hat

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

  1. rott

    rott Secretly hates other millenials - Friend

    Pyrate
    Joined:
    Oct 23, 2015
    Likes Received:
    1,211
    Trophy Points:
    93
    Location:
    Nation's Capital of failure
    Is there any way (i.e. software package or OS image) for video content to be sent out from the Pi's HDMI and stereo audio to be sent via Digi+ or any such similar SPDIF hat?
     
  2. Michael Kelly

    Michael Kelly MOT: Pi 2 Design

    Pyrate
    Joined:
    Apr 22, 2016
    Likes Received:
    4,134
    Trophy Points:
    113
    Location:
    Rhode Island, USA
    Home Page:
    Oops my bad. Yes RCA in/out! TOSLINK is there because it's still used by a lot of folks, especially in low cost combo speaker/amp setups. And the optical transmitter cost $2!

    Cheers,
    Michael
     
  3. bixby

    bixby Friend

    Pyrate
    Joined:
    Sep 26, 2015
    Likes Received:
    4,043
    Trophy Points:
    113
    Location:
    Northern Colorado
    I am reading all I can to catch up to you guys re: the pi. Seems the USB port is DOA for USB bus powered dacs, something like 140 milliamps. Ethernet and USB on same controller pose issues for USB audio if you are pulling files from a shared drive over ethernet. Spdif sounds like a good idea to get the audio to a dac, but you are correct Ethernet can be noisy.

    The 25-30 feet of it in my main mac system has a fair negative effect on the sound, so I transfer files to an SD card and yank the Ethernet cable before listening. I have run it a few turns through a ferrite but that did not cure all of the difference in sound.

    So is the best way to get files to the player on the Pi to go wireless? And/or is it best to run it as a upnp device as a renderer? and do you use the same player software or something else on a mac or win machine? Sorry for the noob questions.
     
  4. tboooe

    tboooe Acquaintance

    Joined:
    May 2, 2016
    Likes Received:
    71
    Trophy Points:
    28
    Location:
    The OC!
    Another way is to use Fiber. You can get 2 FMCs and run 25-30 ft of fiber. This would eliminate any electrical noise.

    I also wouldnt discount USB unless you think it sounds inferior. Given the size of music files I believe there is plenty of bandwidth to receive data via ethernet and send it out via USB.

    Right now, I use the Pi as a renderer attached via ethernet to a wireless bridge. As I mentioned, I think I prefer the sound when I use a usb3 to ethernet adapter feeding my Pi3 versus its onboard ethernet port.
     
  5. tboooe

    tboooe Acquaintance

    Joined:
    May 2, 2016
    Likes Received:
    71
    Trophy Points:
    28
    Location:
    The OC!
    Thanks Michael. I understand Toslink as I was one of the supporters of it when it was being discussed here. However, I dont understand having a digital input as well. How would someone use that feature with the SPD01?
     
  6. Michael Kelly

    Michael Kelly MOT: Pi 2 Design

    Pyrate
    Joined:
    Apr 22, 2016
    Likes Received:
    4,134
    Trophy Points:
    113
    Location:
    Rhode Island, USA
    Home Page:
    The big, big, big issue with noise and Ethernet on the Pi is that the Ethernet transformer center taps are tied to the Raspberry Pi 3.3V plane. It has a ferrite, but that is to keep out noise in the MHz range and up, not in the audio range. In fact, the purpose of the center tap is to shunt common mode noise to the power plane! Although a solution is to use wireless, a better solution is to use a hat that does not use the Raspberry Pi 3.3V rail. The DIGI+ and DAC+ both use the Pi 3.3V for their digital side. On the 503SPD1 and 503SPD2 all 3.3V is generated on the hat using low noise LDO's with high PSRR (power supply rejection ratio) above 80db up to 100Khz. And we use separate LDO's for the digital interface and one for the PLL and Transmitter. Testing will tell for sure, but I am confident Ethernet will not have issues.

    In fact, we posted a quick video of our tube hat playing and it is streaming over Ethernet and the noise floor is below 90db. And that's a basic PCM5102A with Analog Devices ADP150 LDO's with 60db PSRR. The SPD1 and SPD2 have the even superior LT3042 with 80db+.

    Cheers,
    Michael
     
  7. Vastx

    Vastx Facebook Friend

    Joined:
    Feb 4, 2016
    Likes Received:
    255
    Trophy Points:
    43
    Location:
    Italy
    Bad move, after this post @tboooe is gonna try to throw more money at you :D

    [​IMG]
     
  8. tboooe

    tboooe Acquaintance

    Joined:
    May 2, 2016
    Likes Received:
    71
    Trophy Points:
    28
    Location:
    The OC!
    Michael, if I use a USB3.0 to Gigabit ethernet adapter will this eliminate the noise you are referring to here? Perhaps this is why I think I prefer music using this adapter getting music from my wireless AC bridge versus connecting the Pi3 directly to my bridge with ethernet cable?
     
  9. tboooe

    tboooe Acquaintance

    Joined:
    May 2, 2016
    Likes Received:
    71
    Trophy Points:
    28
    Location:
    The OC!
    [​IMG]

     
  10. bixby

    bixby Friend

    Pyrate
    Joined:
    Sep 26, 2015
    Likes Received:
    4,043
    Trophy Points:
    113
    Location:
    Northern Colorado
    @tboooe
    Can you help this noob understand the layout of usb 3 to ethernet adapter feeding the pi3? I thought you were doing wireless file share from another computer to the pi via wifi>wireless access point / bridge>ethernet out > pi?

    And Michael, I let the droolers and first adopters have their say on the new boards, but it all makes sense. :confused: No, really, I am following most of this.

    Ouch, isn't common mode noise supposed to be shunted to a ground plane?
     
  11. Michael Kelly

    Michael Kelly MOT: Pi 2 Design

    Pyrate
    Joined:
    Apr 22, 2016
    Likes Received:
    4,134
    Trophy Points:
    113
    Location:
    Rhode Island, USA
    Home Page:
    Yes. In that case the Ethernet is powered from the USB 5V via a 5V to 3.3V LDO and is no where near the Pi 3.3V.

    Cheers,
    Michael
     
  12. Michael Kelly

    Michael Kelly MOT: Pi 2 Design

    Pyrate
    Joined:
    Apr 22, 2016
    Likes Received:
    4,134
    Trophy Points:
    113
    Location:
    Rhode Island, USA
    Home Page:
    For frequencies above a few Mhz or so, the 3.3V plane appears the same as the ground plane. High frequency signals/noise are shunted to the ground plane through the bypass caps. But below 1Mhz or so, and especially at audio frequency, the impedance from 3.3V to ground is very high, so the noise stays on that plane.

    In fact we use a bypass technique for high speed digital routing. When a signal goes from one side of a 4-layer board to the other, it often switches the plane it is near from 3.3V to ground. To create proper return path we simply add a small cap connected from 3.3V to ground. At those frequencies it's a short. The designers of the Raspberry Pi were digital guys, and somewhat novices at that.

    Cheers,
    Michael
     
  13. tboooe

    tboooe Acquaintance

    Joined:
    May 2, 2016
    Likes Received:
    71
    Trophy Points:
    28
    Location:
    The OC!
    Sorry for not being more clear. In my setup, I have a dlink DAP-1650 wireless AC bridge that is connected to my music server running Minimserver and pi3 via ethernet. The pi3 is acting as a renderer. My NAS is upstairs connected to my wireless router via ethernet. For the pi3 I am using a Cable Matters USB3.0 to Gigabit ethernet adapter. I plug this into the USB port of the pi3. On the other end of the adapter I plug my ethernet cable which is also plugged into my DAP-1650. I cant do wireless from the pi3 to the bridge because I am using 5ghz band for max performance. The pi3 and the various dongles only does 2.4ghz.

    Music server >> ethernet >> wireless bridge
    Renderer (pi3) >> usb3.0 to Gigabit adapter >> ethernet >> wireless bridge
    Wireless bridge >> wireless AC >> wireless router >> ethernet >> NAS

    Does that make sense?
     
  14. tboooe

    tboooe Acquaintance

    Joined:
    May 2, 2016
    Likes Received:
    71
    Trophy Points:
    28
    Location:
    The OC!
    ahhh..so maybe I am not nuts after all for preferring music through the pi3 usb via the usb to ethernet adapter. Maybe I am not an audiophool afterall!
     
  15. bixby

    bixby Friend

    Pyrate
    Joined:
    Sep 26, 2015
    Likes Received:
    4,043
    Trophy Points:
    113
    Location:
    Northern Colorado

    Got it and the reason you are not using the ethernet port on the pi is because it sounds better through the gig e to usb link?

    It makes perfect sense. No doubt you are doing lots of things to mitigate the pitfalls of other connect methods, it just cost a bit more.
     
  16. Scott Kramer

    Scott Kramer Friend

    Pyrate
    Joined:
    May 3, 2016
    Likes Received:
    1,456
    Trophy Points:
    93
    This is really interesting, Thanks for letting us see how you are designing this... it's just so slick! You are having way too much fun :D
     
  17. tboooe

    tboooe Acquaintance

    Joined:
    May 2, 2016
    Likes Received:
    71
    Trophy Points:
    28
    Location:
    The OC!
    Yes, at least to my ears the music sounds getting gong through the usb to ethernet adapter versus through the ethernet port.
     
  18. tboooe

    tboooe Acquaintance

    Joined:
    May 2, 2016
    Likes Received:
    71
    Trophy Points:
    28
    Location:
    The OC!
    Hi guys, just a follow up on the thread on RuneAudio regarding the THD of the Pi...

    Here is a portion of his latest findings (direct link to the post here). I am not sure what to make of his findings. The idea of lowering the volume and losing resolution does not sound like a good solution.

    When I connect the Pi to the DAC (with software volume control disabled) over either USB, or Coaxial from my Digi+, an issue occurs whereby the digital signal appears to be peak limited. This results in the THD and IMD test signal being truncated, thus causing the 15% THD results. If the Pi were rendering the digital information correctly, the DAC would give the same output as with any other digital renderer. The only reason why the DAC's output would change is if there were a change in the digital data it receives. I have shown that this issue occurs independently of the HiFi Berry product. I have also replicated the exact same results with: my USB drive unplugged from the Pi, using ethernet, wifi with ethernet unplugged, with wifi and bluetooth disabled, different power supply, various bit depths and sample rates, and with Volumio as well as RuneAudio. The issue must surely reside at the Pi's i2s stage or earlier.

    I have found that, by enabling software volume control and setting the Pi's volume to 89%, the issue with the altered test signal goes away and the results in RMAA look normal for my DAC. However, by doing this you are essentially removing 2 bits of resolution from the signal. Using the RMAA 16/44 test with the Pi at 87% (the sweet-spot, see results up-thread) gives a dynamic range output of 85 dB which is the equivalent of 14 bits. Disable the volume mixer (so output is 100%) and you get ~16 bits of resolution, but 15% THD.

    So, my question is: Is the Pi doing something at the i2s (or earlier) rendering stage that results in a clipped signal? I would be inclined at this point to say 'yes' as, to repeat what I wrote earlier, the analogue output of a single file from a single DAC should be exactly the same - regardless of the device used to render the digital information to it - so long as that rendering device is operating in a bit-perfect fashion.
     
    Last edited: May 12, 2016
  19. bixby

    bixby Friend

    Pyrate
    Joined:
    Sep 26, 2015
    Likes Received:
    4,043
    Trophy Points:
    113
    Location:
    Northern Colorado
  20. Michael Kelly

    Michael Kelly MOT: Pi 2 Design

    Pyrate
    Joined:
    Apr 22, 2016
    Likes Received:
    4,134
    Trophy Points:
    113
    Location:
    Rhode Island, USA
    Home Page:
    Guys,

    We currently have a board with the PCM5102A DAC and the WM8804. It only does SPDIF and RCA, and runs in slave I2S mode with the 27Mhz PLL, but it does use low noise LDO's and does not use the Pi 3.3V. Anyone willing to test it against the DIGI+? It's called the 503DAC1 and we also have a PI-Zero version, the 504DAC1. I know, I know, super awesome naming as usual! ;)

    It might be a good way to see where we stand in regards to the DIGI+ and DAC+. Who has the most experience with the DIGI+, Vastx?

    Cheers,
    Michael
     

Share This Page