Home > Arduino, Code > New Code for Buffalo II DAC

New Code for Buffalo II DAC


Put a new version of the code (v07d) in the CODE section

  • Tracks DPLL setting separately for I2S and SPDIF allowing fine tuning of the DPLL setting depending on the input format
  • The DPLL settings still default to “best” for I2S and “lowest” for SPDIF at power-on. These have shown to be the best stable settings especially when the DAC is cold


Added Selection of quantizer and other improvements:

  • 6-bit True differential
  • 7-bit Pseudo differential
  • 7-bit True differential
  • 8-bit Pseudo differential
  • 8-bit True differential
  • 9-bit Pseudo differential

What does changing this setting do?

  • Decreases out of band noise as explained by the chip designer at diyaudio [link]. This allows the design of the analog section (the analog output stage such as Legato) to “run with a less aggressive filter [which] has some nice benefits (better slew rate etc) to the final audio” [link]
  • Shuts off certain digital sections of the DAC. In 8-bit mode, for example, the digital sections of 4 DACs (half of the eight DACs) are merged and the unused half is shut off. I will speculate here that this reduces internal noise and interference.

Where is the code?

Visit the CODE tab

I can’t hear differences between the different settings, but some of you may hear differences. Please post your experiences…

NOTE: update your Arduino s/w to version 0022 (or later)

  1. wktk_smile
    June 4, 2011 at 10:13

    Hi, after brief testing, I had noticed that the larger bit quantizer reduces unlocks
    caused by lower DPLL BANDWIDTH settings. I feel this is because reduced (merged) internal dacs – thus less chance to unlock, but I can’t surely say so with my limited
    understanding with the DAC :p

    and, I feel my DAC tend to get longer stable locking state with b07c.

    Of course all above is what I feel after BRIEF listening, I might need play with b07c some more…

    Thanks for sharing your great effort.

  2. wktk_smile
    June 4, 2011 at 13:15

    >I feel my DAC tend to get longer stable locking state with b07c.

    I have found this is because I happend to switch i2s to spdif, then back to i2s after DPLL_BANDWIDTH setting to Lowest, so actually BEST_DEFAULT at that time although LCD indicates “<L" , lol

  3. BlogGeanDo
    June 4, 2011 at 15:21

    Hello wktk_smile,
    Thanks for sharing your experience. Right now the code will force the dpll setting to “lowest” if you switch to spdif and force the dpll setting to “best” if you switch to i2s. This is done regardless of what setting you have at the moment.

    This gives me an idea: I should track changes to dpll setting depending on whether you are in spdif or I2S because each interface behaves differently depending on the interface.

    I will add that feature in the next couple of days.

  4. BlogGeanDo
    June 5, 2011 at 05:07

    Hello WS again,
    Yes, there is a bug in the code where the dpll setting is not updated when you switch between spdif and i2s… Will fix it in the next release shortly….

  5. Chang LH
    June 5, 2011 at 05:56

    I installed this latest b07c s/w and found the following (btw I only make minor changes like to the SR calculation formula – 100Mhz clock instead of 80Mhz & for IR only):-
    1) the s/w “hangs” after sometime of inactivity (the ‘hearbeat’ stops) and turning or pressing the encoder has no effect – but the music continues, only it freezes at that setting
    2) However, using the IR remote will bring it back to life again – after ‘waking up’ the encoder can control it normally again, but after some 30minutes it ‘freezes’ again
    3) Turning “on” the DAC (and Arduino) with the SPDIF input connected to say, CD transport which is (a)already “on” and streaming digital or (b) “off” at first then on after the DAC, produced different results. In case (a) after optimizing, it will lock on and play normally and when the CD is stopped or paused, it automatically goes into “mute” mode and the “mute” goes off when ‘play’ (which is good thing) – for this I have a LED showing mute status connected to Buffalo II. In the case of (b), it never mutes when in pause or stop modes.
    Thanks and best regards,

    • BlogGeanDo
      June 5, 2011 at 06:38

      Chang LH, Thanks sharing your experience. I am going to let it play for a while without touching the controls and see if it freezes. That is a very strange behavior though.

      The remote is detected through polling the pin (meaning the program is still running. The encoder and the heartbeat are controlled by interrupts. That means somehow that the interrupts got blocked after 30 minutes, but the program kept running.

      I’ll test it out and check the code again. I’m posting a newer version of the s/w to fix the dpll display problem and to enable separate tracking of dpll between spdif and i2s

      Thanks again for your report.

      PS: I left the controller running for 45 minutes and it does not hang (I’m using v07d which I just posted)
      Today I left the controller running for 5 hrs without making any adjustments and experienced no hanging…

  6. Chang LH
    June 5, 2011 at 23:58

    Thanks for your explanation, but my unit still ‘hangs’ after using v07d-100. I have only changed s/w to default input as SPDIF & Qtz as 8bit true. At first I thought it will happen only if I turn up volume to 0dB, but no it happens when:
    1) Happens every time I use the remote to turn up volume to “over” 0dB (but the display stays at 0 of course) – it will ‘hang’ immediately and the encoder has no control whatsoever but using the remote to volume down below 0dB (eg -1dB) everything is normal again.
    2) Sometimes within minutes it will hang if the remote is the last used device to change the volume to a value other than zero.
    3) It occasionally also happen if the encoder is the last used device to change the volume to zero dB (remote never used).

    Could it be some loose connections or spikes in PSU? I will roll back to b06e to check again as there was no such issues before. The only changes to the H/w is the addition of the ADUM 1250 to isolate the connections to BII. But running the Arduino using USB power (of notebook) and no i2c connections will also hang – what could be the cause – faulty Arduino/Atmega?
    Thanks and regards

  7. BlogGeanDo
    June 6, 2011 at 00:15

    Hmmm, that is very strange. I just replicated your description and experienced no hangs. I used the remote to change volume from -99 to 0 and back to -99 several times and used the control to do adjustment too.

    Does the heartbeat stop when it hangs everytime? If you can revert to 06e and test it, that might bring out some light to the situation…

    If it hangs and then “recover”, it sounds like a problem with Arduino. It could be s/w, but can’t reproduce it on my end.

    Thanks for the test report…

  8. Chang LH
    June 7, 2011 at 00:30

    I tested v07d-100 again with the DAC powered down and only the Arduino & display on and powered by notebook USB. I only changed the IR codes to case 10 & 12 instead of 11 and 13 thats all. In the short test, the encoder works as no problem at all volume settings, but using the remote pushing the volume up to exactly -0dB is ok, but “beyond” that the heartbeat stops and s/w ‘hangs’ and this happens every time. By beyond 0dB, I mean you continue to press Vol Up after reaching 0dB (even one time). This case easily happens if you ‘hold’ volume up to increase volume. By ‘hang’ I only mean the encoder could no longer control it and the SR display ‘freezes’ and no longer show real SR. However all problems disappear if you use remote to ‘vol down’ to exactly 0dB or lower.

    I then revert to v06e s/w and all above strange things don’t occur – performs perfectly. So I guess my Arduino and H/w are ok – probably bugs the loop on IR remote or related. Thanks

  9. BlogGeanDo
    June 7, 2011 at 04:25

    Chang LH, thanks again for the report. I will test your scenario some more…. stay tuned…

    Hi again, Q: are you using version 0022 or the Arduino IDE? you behavior is consistent with NOT using 0022 with the pulseIn() function. The old version b06e will work with 0021 because I rewrote the pulseIn() function to take into account a deficiency in that function. But the Arduino people fixed that deficiency in Arduino 0022, so I just used the regular pulseIn() function.

  10. Chang LH
    June 7, 2011 at 13:34

    YES, mine was 0021! Downloaded version 0022 IDE and your v07d codes works fine – NO PROBLEMS of the kind mentioned earlier is encountered now. My sincere apologies for any inconvenience / anxiety caused. Now its time to enjoy the music …

  11. BlogGeanDo
    June 7, 2011 at 15:01

    Yes… enjoy the music; and, no problem🙂
    The freezing you reported earlier were also caused by the pulsIn() function because sometimes you can get spurious signals through the IR receiver.

  12. September 14, 2016 at 14:54

    Demir Info

  13. September 14, 2016 at 15:47

    son of god movie free

  14. September 14, 2016 at 16:43

    lydia ivory

  15. September 14, 2016 at 17:00

    convert pdf to excel

  16. September 14, 2016 at 17:58

    click here link

  17. September 14, 2016 at 18:07

    chapter 7 and 13 bankruptcy

  18. September 14, 2016 at 19:07

    best car trend

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s