Raspberry Pi I2S to SPDIF Hat

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

  1. earnmyturns

    earnmyturns Friend

    Friend
    Joined:
    Sep 25, 2016
    Likes Received:
    975
    Dislikes Received:
    0
    Trophy Points:
    93
    Location:
    Palo Alto
    Home Page:
    I've been using a 502DAC with a Pi2, RuneAudio, Pi touchscreen, and an external USB SSD containing my music as a S/PDIF source for various DACs. It works well from a sound point of view, but the RuneAudio touchscreen interface is atrocious for scanning and selecting from my 1300 album collection. What other distros have people used for playing locally-stored music? Positives/negatives?
     
    Michael Kelly likes this.
  2. hifiandrun

    hifiandrun Acquaintance

    Contributor
    Joined:
    Nov 2, 2016
    Likes Received:
    99
    Dislikes Received:
    0
    Trophy Points:
    18
    Location:
    Boston
    I have been using the piCorePlayer on the Pi touchscreen. One installed the pCP jivelite package, the screen looks like a Logitech Squeezebox Touch with a higher resolution. You may also use iPeng, a iPhone app to control the music.
     
  3. earnmyturns

    earnmyturns Friend

    Friend
    Joined:
    Sep 25, 2016
    Likes Received:
    975
    Dislikes Received:
    0
    Trophy Points:
    93
    Location:
    Palo Alto
    Home Page:
    Thanks! I started reading the piCorePlayer docs but it all refers to needed Squeeze stuff, which I don't have (or use for). Did I miss something?
     
  4. Biodegraded

    Biodegraded Friend

    Friend
    Joined:
    May 28, 2017
    Likes Received:
    816
    Dislikes Received:
    0
    Trophy Points:
    93
    Location:
    Calgary AB, Canada
    See @gixxerwimp 's posts at the end of the Raspberry Pi thread for step-by-steps for PiCore-Squeeze-etc.
     
    hifiandrun and Michael Kelly like this.
  5. hifiandrun

    hifiandrun Acquaintance

    Contributor
    Joined:
    Nov 2, 2016
    Likes Received:
    99
    Dislikes Received:
    0
    Trophy Points:
    18
    Location:
    Boston
    Yeah, you need a server, which is included in the piCorePlayer. You could install the server on the same pi or a separated pi running piCorePlayer. I prefer separating the LMS (Logitech media service), now free open source, on a display-free Raspberry Pi3 connecting to a USB hard drive of your music, from the Pi3 + Pi DAC. piCorePlayer has all those functionalities ready for us - when you click "install" the program will download and install it for you. All we need is to click the LMS tab on the web interface, and choose to install the program/functions which you needed. You could also set up the LMS, e.g. the music service on a windows computer. The beauty of the LMS is that it is an eco system - you could have several players around your house with only one LMS. You could sync all you players in different rooms, so that when you walk around your house, you got seamless music playback. Isn't this cool? ;)
     
    Michael Kelly likes this.
  6. earnmyturns

    earnmyturns Friend

    Friend
    Joined:
    Sep 25, 2016
    Likes Received:
    975
    Dislikes Received:
    0
    Trophy Points:
    93
    Location:
    Palo Alto
    Home Page:
    Thanks, that helps. My Pi+502DAC is has to be stand-alone, for security reasons at work. I run a networked system at home, but with other gear and software.
     
    Michael Kelly likes this.
  7. lehmanhill

    lehmanhill Acquaintance

    Contributor
    Joined:
    May 3, 2018
    Likes Received:
    32
    Dislikes Received:
    0
    Trophy Points:
    18
    Location:
    Michigan US
    I agree with hifiandrun regarding picoreplayer. It's nice that it is small and runs in RAM. The Squeeze stuff is very well done, if hard to manage for non-Linux types (ME!). That's why a user interface program like picoreplayer makes things easier. That said, I have found setting up picoreplayer to be difficult. If you find setting up picoreplayer to be an issue, I can recommend Max2Play as an alternative. Their free download will do almost anything you need and it has all the Squeezebox capability. I have been using it for more than 2 years quite reliably.

    My other favorite thing about Squeezelite is the access to internet radio without paying for a streaming service. Lots of cool stations on the web.

    One other comment. Scanning a USB drive works most of the time, but is a occasionally a problem. This is a LMS/Squeezelite issue with any Squeeze based system. The trick is to make sure you give the program plenty of time to complete its work. It may look like it's done scanning, but it may still be cataloging and if you interrupt it, you get start over.

    Good luck.

    PS Just read your website bio. You have the computer chops to crush any of this, so the easy path is most likely irrelevant.
     
  8. lehmanhill

    lehmanhill Acquaintance

    Contributor
    Joined:
    May 3, 2018
    Likes Received:
    32
    Dislikes Received:
    0
    Trophy Points:
    18
    Location:
    Michigan US
    I'm late to the party again. Michael was kind enough to let me know the approximate timing of the next batch of 502DAC. So while I am waiting, I read through all 83 pages. It's a lot to digest, but it is an excellent example of a supplier listening to his customers. Michael, you are to be congratulated.

    The main reason for this post is that I am trying to understand the noise issues with the RPi and their interaction with the 502DAC. In other words, how does it work and where are the last few percent of improvement. So, I will write what I think is going on and ask that you guys correct me where wrong.

    As I understand it, the RPi is noisy from two perspectives, PSU noise from the switcher and switching noise from computer operations that are generated within the RPi and transmitted through shared data paths, power path, and ground path. Using I2S through GPIO pins is better than USB or Ethernet because those two systems share data paths.

    Michael has provided high PSSR voltage regulators that are very good at cleaning up the power paths. Furthermore, pulling the jumper fully isolates the 502DAC power from the RPi power, so the positive power should not be bothered by RPi noise.

    As I understand it, the ground path is common between RPi and 502DAC. In the case where the jumper is pulled, the RPi is power by the switcher, and the 502DAC is powered by a quiet linear PSU, then the noise on the RPi ground due to the switcher + computer noise sees a very high impedance looking into the 502DAC power traces. That said, there are still paths through GPIO pins that carry data and use the common ground as a return path. Is it possible that some small amount of noise from the PRi gets into the 502DAC by way of the ground?

    I am rather curious how Ian's isolator board works. As I understand it, galvanic isolators typically prevent low frequency, low amplitude noise, while passing high frequency digital signals. Is that how the isolator board is designed? I would have thought that a low pass filter to a very low impedance ground would be the way to further clean up noise getting to the 502DAC.

    Sidebar - I took a look at several transformer isolator datasheets, including the Murata that Schiit uses. The Pulse transformer isolators are really nicely spec'd. Nice choice, Micheal !! And since transformer isolators provide both galvanic and electro-magnetic isolation to the output, those transformers may be a good part of the reason that the 502DAC sounds better than the Digione.

    If my understanding of RPi noise is correct, then I think I will have to experiment with a Salas Shunt power supply once I get my 502DAC and get it going. The Salas Shunt has two characteristics that might help bleed off the last little bit of noise. It has very low output impedance over a wide bandwidth, so it reacts quickly to variations in voltage. Also, it uses Kelvin voltage sensing at the load which, as I understand it, further lowers the apparent impedance at the load. It should be an interesting experiment.

    Anyway, I am looking forward to at least one of the 502DAC, whether I understand everything or not.
     
  9. Michael Kelly

    Michael Kelly MOT: Pi 2 Design

    Joined:
    Apr 22, 2016
    Likes Received:
    766
    Dislikes Received:
    0
    Trophy Points:
    93
    Location:
    Rhode Island, USA
    Home Page:
    Wow, this amount of dedication surely deserves something! Send an email to [email protected] and I will see about getting a unit out this week. We had some initial test failures and once they are re-worked (usually just a simple solder joint or lifted resistor) I am sure I will have another 2-3. If I put them in the store they'll go so I will earmark one for you.

    Michael
     
    HumanFly and ofilippov like this.
  10. Michael Kelly

    Michael Kelly MOT: Pi 2 Design

    Joined:
    Apr 22, 2016
    Likes Received:
    766
    Dislikes Received:
    0
    Trophy Points:
    93
    Location:
    Rhode Island, USA
    Home Page:
    We just put another 20 units in the store for pre-order. These will ship Mid-July. As always, thanks to all for the great input as well as the business!

    Michael
     
    dastereo.ru likes this.
  11. earnmyturns

    earnmyturns Friend

    Friend
    Joined:
    Sep 25, 2016
    Likes Received:
    975
    Dislikes Received:
    0
    Trophy Points:
    93
    Location:
    Palo Alto
    Home Page:
    Thanks for all the help, to @lehmanhill as well, this has actually been less complicated than I feared given the somewhat disorganized docs. I'e got piCorePlayer basically going with Squeezelite, LMS and jivelite on the same Pi 2 + 502DAC, but I'm not sure yet if I have set up the USB drive and 502DAC correctly. It looks like LMS is scanning the USB drive (I've checked it is mounted correctly), showing "Server now rescanning..." but the LMS scanner logs do not show much happening. It looks like the scanner can't find any music on the USB drive. Update: Created a mysqueezebox account that was required to log into the LMS Web interface (my_server:9000), messed around with that, and finally I'm seeing a real scan of my USB drive library.
    Update 2: Everything scanned, music playing! A couple of open issues: 1) what's are the right I2S DAC setting for a 502DAC that is being used just for S/PDIF out to my DAC? I set "No Volume Adjustment" but I'm wondering if anything else is needed to get ALSA bit-twiddling out of the digital audio path; 2) will this work disconnected from the net? It was a bit ominous that I needed a mysqueezebox account to get LMS to index my local music.
     
    Last edited: Jun 17, 2018
  12. earnmyturns

    earnmyturns Friend

    Friend
    Joined:
    Sep 25, 2016
    Likes Received:
    975
    Dislikes Received:
    0
    Trophy Points:
    93
    Location:
    Palo Alto
    Home Page:
    :( piCorePlayer works beautifully with my pi 2 + 502DAC -- except that it needs a network for LMS to work even if LMS and its library are local. This is really sad, I much prefer its interface -- clean, fast -- to RuneAudio's sluggish mess or unusable Volumio. I assumed that LMS and Squeezelite would be happy with the loopback network interface, but obviously not. I'll do some more research to see if there's some magic flag that solves this, but I'm not hopeful. I just wanted a quiet little box with a touchscreen to feed my work DAC, where I cannot connect random gear to the network. Bummer, stuck with RuneAudio.
     
    Michael Kelly likes this.
  13. lehmanhill

    lehmanhill Acquaintance

    Contributor
    Joined:
    May 3, 2018
    Likes Received:
    32
    Dislikes Received:
    0
    Trophy Points:
    18
    Location:
    Michigan US
    @earnmyturns ,

    I assume that, because you got music playing well, that you set up the picoreplayer with the 502DAC as either itself or as a HiFiBerrry Pro +. That setting is helpful for using the good clocks on the 502DAC properly.

    You might PM @hifiandrun about a local touch screen control. If I remember correctly, he is controlling his this way.

    I'm not sure if this is helpful, but I found a n LMS plugin written by Triode (the guy who made Squeezelite possible). The plugin is called "Local Player" and I found it in the LMS 3rd party plugins list under 'Server Settings/Plugins'.

    I have never used it, but it sounds like what you are looking for. I guess I don't know how to post photos, so the image I tried to insert doesn't look like it's working.

    The description for the plugin is as follows:

    Local playback from your server computer using Squeezelite software emulator.... The player can be controlled through the server's web interface or other Squeezebox controller interface. Note: the plugin will only support servers or NAS devices with Intel or ARM processors.

    I found this in the LMS web interface on my LMS server RPi. I am still using Max2Play, but I think the LMS server software is common with picoreplayer.

    [​IMG]
     
    Last edited: Jun 18, 2018
    earnmyturns likes this.
  14. earnmyturns

    earnmyturns Friend

    Friend
    Joined:
    Sep 25, 2016
    Likes Received:
    975
    Dislikes Received:
    0
    Trophy Points:
    93
    Location:
    Palo Alto
    Home Page:
    Thanks, I'll try that "Local Player" plugin, hadn't found it when I searched. I use the touchscreen without problem to control play locally, the issue is that the unit needs to be connected to the net for LMS to start.

    Regarding Max2Play: is it worth it? fast enough? does it play disconnected? The documentation on their site is very limited and I wasn't going to pay them before knowing if would serve my purpose at all.
     
  15. lehmanhill

    lehmanhill Acquaintance

    Contributor
    Joined:
    May 3, 2018
    Likes Received:
    32
    Dislikes Received:
    0
    Trophy Points:
    18
    Location:
    Michigan US
    Good luck on the local player.

    First, Max2Play is free for the basic player and interface. You only have to pay them for some of their specialized plugins, which I don't use. Even if you wanted to use one of their plugins, you could buy it for a single period, back it up on your system, and let the premium membership lapse. Basically, none of the guys using Squeezelite and LMS can charge you for that part because Triode/Slim Devices created it and it's open source.

    I think picoreplayer is a little faster, but Max2Play is fine for me. Basic functions are the same with Max2Play having a little more friendly interface, but I wouldn't change from picoreplayer if you have working.

    As for playing disconnected, I don't know. I know it doesn't need internet, but I have always controlled the players with my phone over wi-fi, so I've never tried it disconnected from any network. No touch screen here.
     
    earnmyturns likes this.
  16. hifiandrun

    hifiandrun Acquaintance

    Contributor
    Joined:
    Nov 2, 2016
    Likes Received:
    99
    Dislikes Received:
    0
    Trophy Points:
    18
    Location:
    Boston
    @earnmyturns . Glad you figured out.
    Here are some thoughts based on my experience with the piCoreplayer.
    1. When set up the LMS, you could hit the "skip" on the registration page to "skip" mysqueeze account (an option with tiny font) when first time setting up the LMS. After that, everything will be just local. This is LMS software related, not piCorePlayer related.
    2. If you have the jivelite installed on a touch screen Pi 7'LCD or using HDMI output and a mouse, you could perform basic management of the music database such as rescan the music files without web. The Jivelite interface can locate your local USB drive, find music files and scan them. For more advanced options, you could temperately connect your computer and the Pi with a small wired hub (those palm size box, quite cheap), so that you could setup the LMS. Once being set up, the Pi + 502DAC + Jivelite + LMS would work stand-alone.
    3. My understanding is that the 502DAC will output the music signals to all its output, including the BNC, SPDIF, onboard DAC analog signal, etc.
    4. I would not try the local player plug-in. It is there to keep legacy compatibility. If I were setup a new piCorePlayer stand alone environment, here is what I would do:
    - a. Install and run the piCorePlayer on the Pi, use a wired hub and a computer. Use the piCorePlayer web interface, install NTFS-3 plug in (optional, in case your USB drive is formatted as NTFS on a Windows PC), find and add your usb drive in the piCorePlayer.
    - b. Install the LMS in the piCorePlayer. This is the newest LMS (version 7.9), a very stable and a lot faster than the Logitech official supported version 7.7. Run the LMS webinterface by http:/192.168.1.xx/9000 on the computer, and set up all functions (such as decoding)
    - c. Install Jivelite. At this point, you could disconnect your Pi from your hub and computer and just bring your Pi stand alone system to your office.
    5. piCorePlayer has two versions. If the "audio" version did not work, try the non-audio version instead.
    Hope this helps. Cheers.
     
  17. earnmyturns

    earnmyturns Friend

    Friend
    Joined:
    Sep 25, 2016
    Likes Received:
    975
    Dislikes Received:
    0
    Trophy Points:
    93
    Location:
    Palo Alto
    Home Page:
    Update: Got it! Following a thread in the SlimDevices forum, got to the solution: set a fixed IP, disable DHCP, which is possible to do from the piCorePlayer main page (I had missed that option, it's under the Beta tab). I set those to my my home network configuration so that I can bring the box home and connect it, but disconnected it works perfectly. Thank you all for your help, this is so much faster and easier to navigate to music than RuneAudio.
     
    Last edited: Jun 19, 2018
  18. lehmanhill

    lehmanhill Acquaintance

    Contributor
    Joined:
    May 3, 2018
    Likes Received:
    32
    Dislikes Received:
    0
    Trophy Points:
    18
    Location:
    Michigan US
    I apologize in advance for this longish, geeky post.

    I am trying to understand the digital side of the 502DAC. I'm sure some of you with better understanding will jump in and correct me where I am wrong.

    To get the best sound, we need to minimize jitter and keep noise low on the signal and ground. Michael seems to have done a very good job on the jitter side. He has also given us low noise, high PSRR voltage regulators so that noise coming through the power supply shouldn't be a problem. It is still possible to have some reflected or crosstalk noise on the data path and on the ground. That is the noise that I have been trying to better understand.

    From reading the datasheet, it looks like the WM8004 connects the signal to digital ground when the signal is “low”. When the signal is “high”, we have the choice of 0.6V or 1.0V, thanks to Michael's design.

    Our friends at Schiit have been very nice and specified the chips they are using in each of their products, so we can better understand what is happening at the receiving end. All of the Schiit DACs use the AKM AK4113 SPDIF receiver. From the AK4113 datasheet, the threshold voltage is 350 mV with a hysteresis of 185 mV. Usually, the hysteresis is symmetrical about the threshold, so we get a “high” reading anytime the voltage is above 442 mV and a “low” anytime the voltage is below 258 mV. The difference between the nominal signal (0.6V) and the “high” threshold is 158 mV. If we had noise on the signal that subtracted more than 158 mV from the signal, we would miss turning on the to “high”. That got me thinking. If the SPDIF receiver can accept a higher voltage, using the higher 1.0V output of the 502DAC would make the data stream more robust for noise because the difference between the threshold and the nominal signal voltage would be larger (high threshold 442 mV, signal 1000 mV).

    Back to the AK4113 datasheet. The max input voltage is the TVDD+0.3 where TVDD is the input buffer voltage and has a listed max of 5.5V. So the max input voltage is 5.8V and we can clearly use a 1.0V input signal.

    Is this going to make an audible difference? Probably not. As Michael said, his testing shows that the output is bit perfect. But if it doesn't negatively affect the DAC, it should give a bit more noise immunity to use the 1.0V signal level.

    On the ground side, there is a similar noise story, but the difference between the threshold and ground is 258 mV, plus there isn't much we can do to keep noise down on the ground. Or rather, this may be the best reason to use a good linear supply because the linear supply likely has less noise itself, plus lower impedance that allows it to drain noise on both signal and ground away from the circuit.

    Of course, this only applies to Schiit DACs because they gave us the chip info and that allowed us to get more detail. Some of the smaller DAC makers may be willing to answer the question. I have asked Cee on the Metrum forum about this subject, so it will be interesting to see what kind of answer I get. Yes, I'm excitied to have a Metrum Flint on pre-order. I've never heard a good NOS dac.

    In the meantime, I will try the higher voltage with my Gungnir Multibit, expecting no audible difference, but also no problems.

    P { margin-bottom: 0.08in; }
     
    HumanFly and Michael Kelly like this.
  19. astromo

    astromo Rando

    Joined:
    Oct 16, 2017
    Likes Received:
    7
    Dislikes Received:
    0
    Trophy Points:
    3
    Location:
    Australia
    OK ... My 502DAC P6 landed yesterday (big thanks to Mike and Greg for that) and it's together and operational ...

    ... well, not quite.

    The 502DAC P6 is connected to an RPi 3B+ (the underside of the RPi board reads, FCC ID: 2ABCB-RPI3BP).

    Power is being fed to the HAT and the RPi via the 2.5 mm / 5.5 mm DC jack from a PSU rated to 3.5 A and is delivering 5.2 V of alleged linear power.

    I haven't got a DAC with balanced inputs, so the checks I've done are limited to unbalanced digital and SE analogue for the following line ups:
    1. SE Analogue -> Schiit Freya - OK
    2. USB -> Schiit Modi Multibit -> Schiit Freya - OK
    3. Coax S/PDIF -> Schiit Modi Multibit -> Schiit Freya - OK
    4. Optical S/PDIF (with Coax S/PDIF Connected conincidentally) -> Schiit Modi Multibit -> Schiit Freya - NO Sound
    5. Optical S/PDIF (with Coax S/PDIF disconnected) -> Schiit Modi Multibit -> Schiit Freya - Intermittent Sound
    Sound is being streamed from JRiver MC24 (24.0.36 Win10_x64) as 16/44.1 flac PCM to a Volumio instance running the following system info:
    The relevant detail at the ALSA controller page reads:
    So, two key questions:
    1. Is getting no sound from "Line Up 4" expected?
    2. With "Line Up 5", at least I get playback but the signal drops in and out. The optical interconnect used is a simple swap from a different source that plays back fine. Based on this premise, I doubt that the I/C is the issue.
    Any constructive thoughts or troubleshooting tips would be appreciated. Nothing majorly obvious jumps out at me from the manual http://www.pi2design.com/uploads/4/8/5/3/48531975/502dac_hw_ref_manual_p4_2.pdf and search of this thread revealed that some versions of the HAT would respond to restarts and changing the selected DAC Model.

    I've SSH'd the Volumio and the file at /boot/config.txt reads:
    Code:
    initramfs volumio.initrd
    gpu_mem=16
    max_usb_current=1
    dtparam=audio=on
    audio_pwm_mode=2
    dtparam=i2c_arm=on
    disable_splash=1
    hdmi_force_hotplug=1
    
    #### Volumio i2s setting below: do not alter ####
    dtoverlay=hifiberry-dacplus
    So, looks fine to me (other than to comment that Volumio appears to translate selection of 502DAC to HiFiBerry DAC Plus) and as I'm getting playback via multiple paths, I doubt that's the reason for the S/PDIF optical issues but I'll defer to those with better knowledge.

    Cheers and thanks .. ;)
     
    Last edited: Jun 21, 2018
    Michael Kelly likes this.
  20. Michael Kelly

    Michael Kelly MOT: Pi 2 Design

    Joined:
    Apr 22, 2016
    Likes Received:
    766
    Dislikes Received:
    0
    Trophy Points:
    93
    Location:
    Rhode Island, USA
    Home Page:
    Please look at the underside of the 502DAC where the coax connector is. If the pins are not trimmed it can short to the USB shield on the Pi. We trijm this here by hand, but it is possible we missed one.

    Michael
     

Share This Page