• These commercial threads are for private transactions. diyAudio.com provides these forums for the convenience of our members, but makes no warranty nor assumes any responsibility. We do not vet any members, use of this facility is at your own risk. Customers can post any issues in those threads as long as it is done in a civil manner. All diyAudio rules about conduct apply and will be enforced.

symphonic-mpd

I'm thinking about the first stage of measurements, that would be to measure the bit clock without any dac connected.

The thing to compare would be symphonic-mpd vs a standard distro running mpd.
This only makes sense if I can run the standard distro without mash messing up the clock.

So then my question is, is there any sample rate where it will generate the right frequency without using mash?

Hi HenrikEnquist,

The BCLK of the DAC slave is generated from the PLLD multiplied to 500 MHz, so any sample rate will be affected by MASH.

I shouldn't dictate the measurement conditions, but I will make a personal request.

I am personally interested in seeing if it makes any difference to the I2S signal of the DAC master.
This is because the DAC master is superior in terms of sound quality, and my listening environment is also a DAC master, and the DAC master is my main target for development.
As for the DAC slave, I am just checking that it works properly.

I presented an oscilloscope image of the DAC slave because it was the only case where I could measure the changes in the I2S signal.
 
IMO there is no reason to use standard audio samplerate (48kHz, etc) for the test, should it have to involve the inherently flawed MASH. If the RPI's master frequency is 500MHz, an integer divider ratio will generate 50kHz which is a perfectly acceptable samplerate in linux. SoX/aplay can generate/play any samplerate. I have tested 19.2MHz with snd-aloop and jaaa analyzer https://www.diyaudio.com/forums/equ...ort-samplerates-sw-analyzers.html#post6133979
 
Last edited:
IMO there is no reason to use standard audio samplerate (48kHz, etc) for the test, should it have to involve the inherently flawed MASH. If the RPI's master frequency is 500MHz, an integer divider ratio will generate 50kHz which is a perfectly acceptable samplerate in linux. SoX/aplay can generate/play any samplerate. I have tested 19.2MHz with snd-aloop and jaaa analyzer https://www.diyaudio.com/forums/equ...ort-samplerates-sw-analyzers.html#post6133979


So we need a bitclock that is 64 * fs. The integer sample rates I found quickly are:
62500 = 500e6/125/64
78125 = 500e6/100/64

31250 = 500e6/250/64
There are probably more, but one is enough.



Does it use MASH to generate the 500MHz as well? Then it's hopeless..
 
Right, again my fault, you need bclk, not lrclk.

gpio - What are the different clock sources for the general-purpose clocks? - Raspberry Pi Stack Exchange with the difference that RPi4 uses 54MHz oscillator instead of 19.2MHz one in the older models. 500MHz is generated with PLL, no mixing frequencies.

But IMO you should be able to reconfigure device tree to use the (hopefully) clean 54MHz master. Plus it should be possible to reconfigure GPIOs to output the oscillator (clock 1) signal GPCLK at Raspberry Pi GPIO Pinout Generating 2.4Mhz Clock on GPCLK - Raspberry Pi Forums

That way you can check quality of the master 54MHz signal first, and then check quality of the bclk under different software conditions. Quite a long measurement :)

Henrik, if you were doing this setup and measurement, please could you check a few higher bclk frequencies to see what the limit and what quality of I2S is? 384kHz is confirmed by the i2s driver, but I am interested in higher limit :) Thanks in advance.

STICKY: The I2S sound thread. [I2S works] - Page 39 - Raspberry Pi Forums
 
Sure once I get things working I can measure all kinds of things. Exploring the limits of the i2s interface would be fun. And measuring with the raspberry slaved to a dac would also be easy if I can borrow a dac that can be master, I don't have one and don't feel like buying one just to measure this :)


But let's start with a much simpler "measurement". I need to go check what instruments we have, and what they can do. I can do that next week. Then I need to ask somebody to show me how to use the stuff. This step could take some time while the whole covid mess is going on, with people working from home and such.
 
Thanks a lot.

Meanwhile I should learn how to re-configure device tree to use the 54MHz signal with integer divider for the bit clock. I think the RPi I2S driver author will know :) STICKY: The I2S sound thread. [I2S works] - Page 40 - Raspberry Pi Forums

54MHz clock can generate these integer samplerates/dividers for 2x32bit I2S:

Code:
samplerate  divider
---------------------
    31250       27
    33750       25
    46875       18
    56250       15
    84375       10
    93750        9
   140625        6
   168750        5
   281250        3
   421875        2
   843750        1
I would be specifically interested in the samplerate 843.750 or at least the 421.875 :)
 
Last edited:
Hi papalius,

since the current theoretical discussion here has driftet to the aspects
of slave/master mode, i have a question i wanted to ask you for the last two weeks:

i want to try out running the rpi in slave mode:

the problem is, i don´t have a DAC-hat with master-mode, i have the FifoPi from iancanada insted.
i know that master-dac-hats and fifo-reclockers are somehow opposing concepts and when you synchronise
the dac with the rpi, you can´t put a fifo-reclocker between them, but my intend is to synchronise the reclocker
with the rpi (my dac is a diy TDA1543, which doesn´t even need a MCLK). and i know that the whole purpose
of the fifo-buffer is to eliminate the need for clock-synchronisation, but i think it should still be possible and
beneficial, even if the data gets buffered for half a second inbetween. and the real benefit of running the PLL
in slave mode is not clock-synchronisation, it´s giving the PLL a much better clock-signal.

but how to do it ??

i was intrigued by the idea since the hype around the Allo BOSS dac (yeah, the dac-driver sets the PLL in
slave mode and the MCLK from the dac gets injected back into the Pi, its easy..)
but i was never able to find any info about how it works exactly.

so, on the software side:
your dt-blob.bin in the /boot of smpd does not set the PLL to slave, it just optimises the whole process, right?
can i just use any dt-overlay for a master-dac, can i modify the generic i2s dt-overlay, or is there a switch
somewhere else?

and for the hardware:
i assume the MCLK gets connected via the gpio, but which pin ? and what frequencies must i use ?
is the MCLK-signal from he FifoPi suitable for the PLL ?

so, Papalius, since it seems that you know a lot about the innards of the raspberry, i´m hoping that
maybe you could help me out with this, it would be really awesome...


cheerio,
Mirko
 
Hi M_Balou,

The I2S signals generated by RPi are BCLK, LRCK, and DATA.
MCLK is not used.

The DAC master/DAC slave switching can be controlled by the registers in the SoC.
That's the driver's job.

When the sample rate is switched between songs, the 44.1 KHz system and the 48 KHz system on the DAC side. The oscillator needs to be switched.
To do this, the DAC has an I2C interface that switches the oscillator used for the BCLK according to instructions from the RPi.
This I2C control is also the job of the driver.

If the DAC does not have an I2C interface, then what driver in dtoverlay will not allow you to run on a DAC master (=RPi slave). This is because the driver will not be able to communicate with I2C and the initialization process will fail.

If your FifoPi has an interface that can accept oscillator switching instructions, it may be possible to write a device driver for the FifoPi that will allow it to run on a FifoPi master (=RPi slave).
 
Hi M_Balou,

Let me describe my listening environment.

The DAC chip is the ES9018S, which does not require an MCLK.

The HAT I'm using is called Innomaker HiFi DAC Hat, with dtoverlay=allo-boss-dac-pcm512x-audio and running on a DAC master (=RPi slave).

Rpi HiFi DAC Hat – InnoMaker

A unique feature of this HAT is that the GPIO pins extend to the back of the device.
The BCLK, LRCK and DATA are taken from the GPIO pins extending to the rear and connected to the ES9018S DAC.
(You can also pull the MCLK from the HAT, although I don't use it.
If you're using AKM chips, you'll need the MCLK as well.)

As a result, the DAC and RPi are asynchronous.
The advantage is that the HAT's two oscillators can be used for BCLK. (Inexpensive and easy.)

I think this method is close to how you would expect it to work.
(But not at the level you'd expect for isolation.)


Any HAT that supports DAC masters can be used for this method.
We have members in the club that pull BCLK, LRCK, and DATA from the HiFiBerry Digi + Pro and other HATs and connect them to the DAC through an isolation/HDMI conversion (LVDS) board.
 
Hi M_Balou,

Didn't FifoPi automatically detect BCLK?

If the FifoPi side automatically detects the BCLK, there is no need to tell the I2C to switch the sample rate.

You might be able to connect the 44,1 KHz and 48 KHz oscillators to different GPIO pins, and then switch the GPIO pins to be referenced by the driver.
(I'm worried that connecting the oscillator to the Pi's GPIO will break the isolation and induce noise, though.)


I'll get some advice from the HAT driver developers.
Please wait a while. (About a week or two.)
 
Last edited:
Hi Papalius, I'm trying to configure dac hat es9038q2m, using v0.96. I've checked at smpd forum, and it seems that you do not support es9038q2m, aren't you?

I also have pcm5122 dac hat. I will give it a try (slave mode), swapping dac hat a little bit weird because of housing.

I also followed your instruction to configure external usb hdd, I can see the hdd, but do not know how to show its content in library.

I set the wifi, but it hang at reboot while it is still connected to wire, do not know why (not connect to the screen). I suspect the sd card issue.

still cannot hear smpd. :). hungry to try it.
 
Hi vucv,

Does your DAC HAT support DAC masters?
The manufacturer of the DAC HAT should have specified the drivers that should be set for dtoverlay.
What is the name of that driver?
I can build the driver and incorporate it into the SD image.

If your DAC HAT doesn't support DAC masters, then the driver should specify rpi-dac.
The symphonic-mpd rpi-dac driver supports 384KHz/32bit.

To scan the library on the USB HDD, use the UPDATE LIBRARY in the web UI Open it, specify "USB" in the Scan music directory and press the OK button.

The problem of not booting normally when Wifi is enabled is most likely a power supply issue.

Does it boot normally when Wifi is disabled and the USB HDD is removed?
If it's booted, open the DASHBOARD in the web UI and see if you get a low voltage alert.
Also, check the ARM and CORE frequencies.

If you are getting a low voltage alert at this point, you need to have your power supply reviewed.

If you are not getting a low voltage alert at this point, then you can move on.

Enable Wifi and remove the USB HDD.
Let me know if it boots up normally.
If it does boot up, check your DASHBOARD to see if you get a low voltage alert.

If you don't get a low voltage alert at this point, then let's go to the next step.

Boot up with the USB HDD disconnected and connect the USB HDD after boot up.
At this point, make sure there is no low voltage alert in DASHBOARD.

Based on the results of the checks so far, we will try to come up with a compromise.
 
Thank you, Papalius.
My Dac es9038qm2 has master clock similar to dac boss. (cloned one from China). I'm using normally with Moodeaudio.

I feed pi 3 by board lt1964 (max 1.5A), my external hdd in orico box has its own walwart ps. So I do not think the issue is ps.

I was suspected the micro sd card, because I flashed it by balenaEtcher, once finished flashing, at the last step, verification, my Windows got BSOD. anyway I was still able to boot with it. Let me try again. Screenshot_20200602-001042_Chrome.jpg
 
Hi vucv,

Thank you for contacting me.

After configuring I2S in moode, check the dtoverlay in config.txt
We will try to support that driver.


If you have trouble booting, try these two things

1) Rename the file /boot/dt-blob.bin
For example, dt-blob.bin.bak

2) Comment out force_turbo=1 in /boot/config.txt

Please try these changes to see if they make a difference.


I have received reports of an error in checking the balenaEtcher.
(I've also heard that it works fine.)

I also use balenaEtcher, but I'm not sure how to reproduce it.