Hifiberry DAC+ Pro - HW mods anybody?

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
FYI. Just compiled the latest 4.4.(22)-simple. It still exhibits the 192kHz issue.


Code:
Oct 03 18:56:36 MamboLSPlus2B1 kernel:  Mamboberry DAC: snd_rpi_es9023_dac_hw_params: frequency=192000, format=S24_LE, sample_bits=24, physical_bits=32, channels=2. Setting bclk_ratio=48.
Oct 03 18:56:36 MamboLSPlus2B1 kernel: bcm2835-i2s 3f203000.i2s: bcm2835_i2s_set_dai_bclk_ratio: ratio=48

Yeah, I see it. Of course, bclk_ratio needs to be 64 for S24_LE, not 48. (24 bit payload in a 32 bit word.) Doh!!! I'll push a fix to simple branch later this evening.
 
Clive,

On my piZero/D+Pro test setup it's refusing to play at 384K, 352K8 does, and all other sample rates are fine... I tried other source file sample rates etc, always refuses to play at 384. What do you think?

Edit: At 384K it's playing, but choppy, and CPU pegged at 100%. cat /proc/asound/card0/pcm0p/sub0/hw_params reports 352K --

When playing at 352K it's only 22% cpu usage on the zero.
 

Attachments

  • Screen Shot 2016-10-03 at 2.34.04 PM.png
    Screen Shot 2016-10-03 at 2.34.04 PM.png
    605.6 KB · Views: 277
  • Screen Shot 2016-10-03 at 2.34.31 PM.png
    Screen Shot 2016-10-03 at 2.34.31 PM.png
    944.6 KB · Views: 282
Last edited:
On my piZero/D+Pro test setup it's refusing to play at 384K, 352K8 does, and all other sample rates are fine... I tried other source file sample rates etc, always refuses to play at 384. What do you think?

mmap commit error..... Never seen that before, that's what I think. LOL.

Let me finish putting this 192/24 booboo to bed and I'll see if I can reproduce your issue.
I've just re-based "simple" branch to 4.4.23 and updated the 9023 card driver to use physical_bits rather than sample_bits for calculating bclk_ratio. Just about to compile and test.....

Remind me, you did have 352k8/384k working with HB DAC+PRO on your other Pi. It's just the Zero that is having problems?
 
mmap commit error..... Never seen that before, that's what I think. LOL.

Let me finish putting this 192/24 booboo to bed and I'll see if I can reproduce your issue.
I've just re-based "simple" branch to 4.4.23 and updated the 9023 card driver to use physical_bits rather than sample_bits for calculating bclk_ratio. Just about to compile and test.....

Remind me, you did have 352k8/384k working with HB DAC+PRO on your other Pi. It's just the Zero that is having problems?

Sounds good.

I think the pi3 can muscle thru it, but it reports 352K also... I'll try it again...
 
SC/Tim, that should resolve the 192/24 playback speed issue, or at least it does for me.

Code:
$ uname -a
Linux MamboLSPlus2B1 4.4.23-501.20161003gitc2a1d97.fc24.armv7hl.bcm2709 #1 SMP Mon Oct 3 19:48:49 BST 2016 armv7l armv7l armv7l GNU/Linux

Oct 03 20:05:47 MamboLSPlus2B1 kernel:  Mamboberry DAC: snd_rpi_es9023_dac_hw_params: frequency=192000, format=S24_LE, sample_bits=24, physical_bits=32, channels=2. Setting bclk_ratio=64.
Oct 03 20:05:47 MamboLSPlus2B1 kernel: bcm2835-i2s 3f203000.i2s: bcm2835_i2s_set_dai_bclk_ratio: ratio=64
Oct 03 20:05:47 MamboLSPlus2B1 kernel: bcm2835-i2s 3f203000.i2s: bcm2835_i2s_hw_params: clk_set_rate: sample_freq=192000, bclk_ratio=64, target_freq=12288000, actual_freq=12287950, parent=plld_per, parent_freq=499599993
 
Don't know. Works fine for me in master mode @ 384k.

Code:
Oct 03 20:29:53 BerryPlusPro2B1 kernel: pcm512x 1-004d: snd_rpi_hifiberry_dacplus_set_sclk: clk_set_rate(24576000) for 384000 sample rate
Oct 03 20:29:53 BerryPlusPro2B1 kernel:  HiFiBerry DAC+ Pro: snd_rpi_hifiberry_dacplus_set_bclk_ratio: frequency=384000, format=S32_LE, sample_bits=32, physical_bits=32, channels=2. Setting bclk_ratio=64
Oct 03 20:29:53 BerryPlusPro2B1 kernel: bcm2835-i2s 3f203000.i2s: bcm2835_i2s_set_dai_bclk_ratio: ratio=64
Oct 03 20:29:53 BerryPlusPro2B1 kernel:  HiFiBerry DAC+ Pro: snd_rpi_hifiberry_dacplus_update_rate_den: updating substream rate_num (384000->384000), rate_den (1->1)
Oct 03 20:29:53 BerryPlusPro2B1 kernel: pcm512x 1-004d: pcm512x_hw_params: 384000 Hz, 2 channels
Oct 03 20:29:53 BerryPlusPro2B1 kernel: pcm512x 1-004d: pcm512x_set_dividers: dac_rate 6144000 sample_rate 384000
Oct 03 20:29:53 BerryPlusPro2B1 kernel: pcm512x 1-004d: pcm512x_set_dividers: DSP divider=1, DAC divider=4, NCP divider=4, OSR divider=1, BCK divider=1, LRCK divider=64, IDAC=64, 1<<FSSP=8
 
Oh sh***t! Looks like the external branch is missing a patch..... I might have to just take this branch down. I cannot publish what I actually use myself, and I'm just trying to pull out the bits that I can publish and make them available in a public branch. But I cannot spend my life supporting this......
This is complicated by the fact that for my actual instances that I listen to, I don't even use the 4.4 kernels anymore. I switched to 4.7 already. But I can't publish a 4.7 branch either.....
 
Latest 4.4.23-simple did the trick on 192kHz.

Good to know.

I'm not running my modified Hifiberry DAC anymore.
I'm enjoying -- and even prefer -- the unmodifed Mamboberry LS.

Took you long enough to figure out that spending time and money on anything even smelling like a TI PCM5 series product, was a waste of both time and money..... ;)

I think the Mambo LS is on a par with the Audiophonics V2, the first version with TXCO, not the later V3 with the transverse layout - jacks above USB/ethernet port..... Either way, both of those boards are a better starting point for mods and upgrades, compared to the usual IQ and HB suspects......
 
Hmmm. I wonder whether the chap/company (Colibri????) behind the Mambo would send me one for testing? I'm loathe to want to buy another ES9023 based HAT, as I already own a few........

I've just ordered one, with no desperate need for it. If you wanted to borrow it for a while to do some testing that would be fine. Let me know.

EDIT. Oops just read further down the thread and Collybia have sent you one.
 
Last edited:
Yep, I'm thinking about this. I fired another patch at RPi github today, specifically to fix the 24bit slow playback in another place, in rpi-4.7.y branch, before someone else reports it there.....

bcm2835-i2s: Calculate bclk_ratio based on physical width

Are you feeding the official PI kernel tree now? Which would mean from 4.7 we can expect your audio related patches (or at least the most crucial ones) in the main RPI tree!?!??


BTW. Just to respond to your "waste of time" comment.

1. You never know where you end up with a tweaking project like this
You might call all hobbies "waste of time".
2. Many folks prefer the 51xx family over Sabre and the HB DAC+ Pro clocking looked
more advanced than other installations, knowing the PI I2S in master mode is crappy.
That's been the starting point. There were no related projects, information or threads
over here at DIYA.
Later I learned from other inmates that the DAC+ Pro clocks have - if at all - a very small impact.
3. The old MamboBerry and the Audiophonics DACs were not in my preferred price range.
That changed with the MamboBerry LS.
4. I (and some other people) made it quite far with numerous modifications.
My modified HB DAC+ Pro can easily compete with the MamboBerry LS.
The Hifiberry folks would just have to introduce some modifications to lift up their DAC.
I guess though, they are not listening.
5. I realized, mentioned and even recommended much earlier in this thread that
the Mamboberry would be my first choice, if I wouldn't have the HB DAC+ Pro at hand.
I mean, I had the original MamboBerryDac at home for testing and returned it.
My modified DAC+ Pro played in the same league.
6. It's a great learning and fun exercise to run such a project. Especially
if you find out that your 50$ solution is being able to compete with much higher
priced and higher rated solutions ( a certain R2R project comes to mind) .
Obviously I would have never gotten into the great kernel discussion with you
without having this project ongoing. ;)

Bottom line. I made some progress and had a lot of fun. And I hope others did too.

And. Just to say it again. I'd never run a "stock" HifiBerry DAC+ Pro in my system.
 
Last edited:
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.