• The Vendor's Bazaar forum is for commercial offers and transactions. Only unmoderated members can post here.

    diyAudio provides this forum 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

Hi vucv,

Didn't it work on i-sabre-k2m?

In that case, you have no choice but to use it as rpi-dac (DAC slave).

In case of DAC slave, /boot/dt-blob.bin plays an important role in setting up the PLL.
If you have renamed it, please revert it back to its original state.

Also, force_turbo=1 in /boot/config.txt is a big part of the performance design.
Make sure that force_turbo=1 is enabled as the default setting.


In the case of DAC slaves, the mpd volume control can only be set to a software volume.
By default, the volume control is set to "none" and the volume is always at 100% (-0db).
In the web UI, the volume is always displayed as "0".

Open the MPD screen in the Web UI and change the "mixer_type" to "software". Press the OK button.
 
Last edited:
Hi vucv,

Didn't it work on i-sabre-k2m?

In that case, you have no choice but to use it as rpi-dac (DAC slave).

In case of DAC slave, /boot/dt-blob.bin plays an important role in setting up the PLL.
If you have renamed it, please revert it back to its original state.

Also, force_turbo=1 in /boot/config.txt is a big part of the performance design.
Make sure that force_turbo=1 is enabled as the default setting.


In the case of DAC slaves, the mpd volume control can only be set to a software volume.
By default, the volume control is set to "none" and the volume is always at 100% (-0db).
In the web UI, the volume is always displayed as "0".

Open the MPD screen in the Web UI and change the "mixer_type" to "software". Press the OK button.
I tried rpi-dac before see your post which suggested to try i-sabre-k2m, so I did not try k2m.

I used master file from the beginning (only renamed master to bin).

I will uncomment turbo setting, only dsd128 has some laggy, I guest because of buffer 640kb is small?

Update: Oh, I set turbo and cannot boot. not enough ampere? I have to unplug the sd card and edit config.txt in windows.

some pictures of my setting. Screenshot_20200613-210957_Chrome.jpgScreenshot_20200613-210934_Chrome.jpgScreenshot_20200613-205107_Chrome.jpg
 
Last edited:
Hi Papalius,

wow, 3 posts in a row...!

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).

so, you can´t just use any existing master-dac overlay, because it needs to communicate with the dac.
thats unfortunate, but i allready suspected that...

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.

That´s a cool idea, using a cheap dac-hat just for the clock setup (somewhat janky and lavish at the same time)
and it´s easy to implement and works right away.
i´m sure this would also work in my case, but i will certainly not do that !! because the FifoPi already has a excellent
clock-circuit and it would be a waste, not to use it.

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.)

yes, the FifoPi detects the incoming BCLK, you don´t need any external controls, a design goal of Ians fifo-reclocker
was to have it work as a standalone unit.
and AFAIK it outputs the clock-frequencies (45.1584/49.1520 Mhz, or any other pair you use) as the MCLK
but it has only one output, that switches frequencies accordingly.

my main concern was, if these frequencies are usable as a reference for PLL of the RPI4,
but when you think it should be doable, thats great !!

here´s a link to the manual for further reference:
DocumentDownload/FifoPiUltimateManualV1.0.pdf at master * iancanada/DocumentDownload * GitHub

and lastly, many thanks for your effords, i really appreciate it !!


cheers,
Mirko
 
Hi vucv,

I'm glad to hear that the i-sabre-k2m seems to be working.

Please make sure that the BCLK column on the dashboard is labeled DAC Master.

Sorry for the inconvenience about the lag in the dsd128.

We measure the bandwidth by changing the RSIZE when setting up the NAS to estimate a reasonable RSIZE.
On rare occasions, there may be an environment where the measurement does not work and the RSIZE is not set to the correct value.

Enabling the USB port is deprecated and we have not tested playback from USB HDDs.
It may be possible to improve this by having the MPD in the web UI change the buffer size to a larger value, but few members are using USB HDDs and I don't have the know-how to improve this.
 
Hi vucv,

I'm glad to hear that the i-sabre-k2m seems to be working.

Please make sure that the BCLK column on the dashboard is labeled DAC Master.

Sorry for the inconvenience about the lag in the dsd128.

We measure the bandwidth by changing the RSIZE when setting up the NAS to estimate a reasonable RSIZE.
On rare occasions, there may be an environment where the measurement does not work and the RSIZE is not set to the correct value.

Enabling the USB port is deprecated and we have not tested playback from USB HDDs.
It may be possible to improve this by having the MPD in the web UI change the buffer size to a larger value, but few members are using USB HDDs and I don't have the know-how to improve this.
sorry I have 3 posts in a row...
Thanks Papalius,

This morning I stuck at Timeout, resource temporarily unavailable. Cannot play any file. restart or shutdown button do not work. I have to hard reset, 2 times, but it still come up with the same.Screenshot_20200614-064309_Chrome.jpg
 
Hi vucv,

Use the df command to check the free space on the SD card.

In v0.9.6 (RPi3), the expansion of the partition must be performed manually.

Code:
sudo raspi-config noint --expand-rootfs
sudo reboot
not full but I expanded anyway.

pi@smpd:~ $ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/root 1.3G 819M 375M 69% /
devtmpfs 490M 0 490M 0% /dev
tmpfs 491M 0 491M 0% /dev/shm
tmpfs 491M 6.5M 484M 2% /run
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 491M 0 491M 0% /sys/fs/cgroup
tmpfs 650M 0 650M 0% /var/lib/mpd/music/RAM
tmpfs 32M 4.0K 32M 1% /var/log
/dev/mmcblk0p1 42M 4.7M 37M 12% /boot
/dev/sda2 932G 574G 359G 62% /var/lib/mpd/music/USB/sda2
tmpfs 99M 0 99M 0% /run/user/1000
pi@smpd:~ $ sudo raspi-config noint --expand-rootfs

Welcome to fdisk (util-linux 2.25.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): Disk /dev/mmcblk0: 14.9 GiB, 15931539456 bytes, 31116288 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
 
Hi vucv,

I'll try to find out what caused the "resource temporarily unavailable".

After you have tried to play it for a while, open the SUPPORT web UI.
You will see a link called support_log.tar.gz, download it and save it to your PC.
This is a compressed version of the journal logs and other major logs.

Send it to symphonic.mpd@gmail.com and we'll see if you get any errors.
 
Hi vucv,

I'll try to find out what caused the "resource temporarily unavailable".

After you have tried to play it for a while, open the SUPPORT web UI.
You will see a link called support_log.tar.gz, download it and save it to your PC.
This is a compressed version of the journal logs and other major logs.

Send it to symphonic.mpd@gmail.com and we'll see if you get any errors.

Thank you for your prompt support.
I expanded the card and can play haft of a file then get the error again.
I collected log and sent. Please investigate...
 
Hi vucv,

It's not easy to solve the problem.
Sorry I can't help you.


I checked the log and it seems to be running in DAC slave mode.
I checked the source of the driver for v0.9.6, and i-sabre-k2m is not seem to support the DAC master mode.
I also checked the source of the v1.0.3 driver (i-sabre-q2m). It still does not support DAC master mode.

This should be the same for volumio and moode, but, did moode work with DAC master?

In any case, when using i-sabre-k2m with v0.9.6 (RPi3), It works with the DAC slave.
Please revert /boot/dt-blob.bin to the original file.


Are the files that fail to play are mp3?
Could you also try playing wav and flac?
 
Last edited:
Hi vucv,

Open the MPD screen in the Web UI and set the audio_output_format to "*:32:*" .


Alsa-based playback software performs an implicit format conversion to match the format supported by the sound card.
Note that the symphonic-mpd playback software (aplay-rt) does not perform such format implicit conversions.
I'm told that the ES9038 only accepts 16-bit or 32-bit.
Therefore, I think it may not be able to play back 24-bit sound sources.
 
If I changed the output format to *:32:*, then I get the strange sound (noisy) with dsd128 file only. Other files are ok to play.

Normally I'm prefered pi not convert any data before sending data to DAC.

Image is dsd128 played by moode, ouput rate is 32bit even I set similar to *:*:*Screenshot_20200602-001042_Chrome.jpg
 
Hi vucv,

v0.9.6 (RPi3) does not work well with PCM conversion playback of DSD.
You can change the audio_output_format to "192000:32:*".
Fix the rate and convert to PCM on the SoX for playback.


If you want to play both PCM and DSD, v1.0.3 (RPi4) is recommended.

You can specify the normal PCM conversion format and DSD PCM conversion format separately.

For example, normal PCM can be converted as "*:32:*" and
DSD can be set to convert to "1920000:32:2".
(Of course, you can also specify DoP.)
 
Normally I'm prefered pi not convert any data before sending data to DAC.

The player must do all conversions necessary to align the source format to the format accepted by the playback device. 32bit format is very popular because it is easy to handle in HW. Only 24bits are used anyway, the data are just padded with zeros.

DoP is by definition 24bits - 16 bits of DSD and 8 bits of the DSD/DoP marker. If a DAC accepts only 32bits format, 8 extra bits of zeros are appended. No change in the actual information.
 
It's not so clear how the master and slave modes work, so I made a diagram to try to explain it.


rpi_masterslave.png


Upper diagram, Dac is master.
The Dac generates all clock signals. The picture as drawn would be for a pcm5122. There are two crystals on the dac board for the master clock (MCLK), one for the 44.1kHz group and one for the 48kHz. The driver in the raspberry controls which one is active via some GPIO pin. It also configures the dac chip to run at the desired sample rate. The dac chip then divides the master clock by suitable amounts to generate bit clock (BCLK) and sample clock (LRCLK). The Raspberry i2s interface runs as a slave, and outputs the next bit on the DATA line when triggered by BCLK. The i2s fifo is filled up as needed by the dma controller. The Pi PLL isn't used at all.


Lower diagram, Pi is master
The Pi uses it's PLL to generate a bit clock (BCLK) and sample clock (LRCLK = BCLK/64 in most cases). This BCLK triggers the i2s interface to output the next bit, same as above, and the dma controller also fills the fifo the same way.
On the Dac side, the dac senses what format and sample rate are being sent by checking the signals (the diagram is drawn with a PCM5102 in mind). If there is no MCLK supplied (which is the case for the RPi) it uses a PLL (built into the dac, not a separate device as drawn) to generate a matching master clock.


I believe it's correct, but please let me know if you find anything wrong!
 
It's not so clear how the master and slave modes work, so I made a diagram to try to explain it.

Upper diagram, Dac is master.
The Dac generates all clock signals. The picture as drawn would be for a pcm5122. There are two crystals on the dac board for the master clock (MCLK), one for the 44.1kHz group and one for the 48kHz. The driver in the raspberry controls which one is active via some GPIO pin. It also configures the dac chip to run at the desired sample rate. The dac chip then divides the master clock by suitable amounts to generate bit clock (BCLK) and sample clock (LRCLK). The Raspberry i2s interface runs as a slave, and outputs the next bit on the DATA line when triggered by BCLK. The i2s fifo is filled up as needed by the dma controller. The Pi PLL isn't used at all.

Lower diagram, Pi is master
The Pi uses it's PLL to generate a bit clock (BCLK) and sample clock (LRCLK = BCLK/64 in most cases). This BCLK triggers the i2s interface to output the next bit, same as above, and the dma controller also fills the fifo the same way.
On the Dac side, the dac senses what format and sample rate are being sent by checking the signals (the diagram is drawn with a PCM5102 in mind). If there is no MCLK supplied (which is the case for the RPi) it uses a PLL (built into the dac, not a separate device as drawn) to generate a matching master clock.

I believe it's correct, but please let me know if you find anything wrong!

Thank alot for your effords, Henrik.
that´s a really indepth explanation.
so, there´s actually no MCLK involved in the rpi´s slave mode, hmm...
is this a special feature of the PCM5122? Because it seems very unusual that BCLK and LRCK
switch from inputs to outputs.

and it´s quite disapointing, because i won´t be able to replicate this modus with the Fifopi.