HiFiBerry Digi+ / I2S SYNC error

Hello,
I tried to install Pi Musicbox on my B+ with the HiFiBerry Digi+ module for some weeks now. I always get the same error and no sound over spdif or toslink:

bcm2708-i2s bcm2708-i2s.0: I2S SYNC error!

Here is what I did:

I tried the latest stable Image of Pi Musicbox and also the Prerelease versions (last one was musicbox0.5.1rc2.img). After installation I get sound over HDMI. I checked the Digi+ module with the test image from HiFiBerry - it also works and prodcues the test tone over spdif and toslink. So basically Pi Musicbox installation and the Digi+ module seem to be okay.

I updated /etc/modules:

snd_bcm2835
snd_soc_bcm2708_i2s
bcm2708_dmaengine
snd_soc_hifiberry_digi
ipv6
bcm2708_wdog

and changed the settings.ini of the Pi Musicbox:

output = hifiberry_digi

The Pi Musicbox still automatically selects the HDMI output and ignores the Digi+ although it recognizes the presence of the Hifiberry digi. So I checked /opt/musicbox/setsound.sh – the script looks for the device
identification snd-rpi-hifiberry-digi:

elif [[ ${dev[1]} == "snd-rpi-hifiberry-digi" ]]; then

but the id supplied is simply snd-hifiberry-digi, so I changed it to:

elif [[ ${dev[1]} == "snd-hifiberry-digi" ]]; then

After rebooting the right output is selected but the SYNC error is shown and no sound at all.

bcm2708-i2s bcm2708-i2s.0: I2S SYNC error!

I posted this topic on the HiFiBerry support forum before but Daniel from the forum asked me to investigate in this forum. You can find more informations in my post there

Any help would be appreciated.
Thanks in advance, Uwe

Uwe, checkout this thread. Maybe this can help you: Will it run out-of-the-box on a RPI B+?

Aside from Mopidy, shairport is the other process possibly using the soundcard. You’d maybe need to comment out the bottom part of /etc/monit/monitrc to prevent monit from automatically restarting it once you kill it.

Rene, thank you for the hint. I read your post before (and a lot other posts, too) and I think I did it all the same way, you did. Except that I use the Digi+ instead of the Dac plus. So I set output = hifiberry_digi instead of hifiberry_dacplus. The strange thing is that the Digi+ was still ignored so I had to change setsound.h as shown in my first post.

Shairport is disabled by default but I also removed it from the monitrc. Still no difference. Maybe there is some problem with my configuration:

root@MusicBox:~# lsmod
Module                  Size  Used by
iptable_filter          1485  1 
xt_REDIRECT             1968  1 
xt_tcpudp               2110  2 
iptable_nat             2607  1 
nf_conntrack_ipv4      12965  1 
nf_defrag_ipv4          1491  1 nf_conntrack_ipv4
nf_nat_ipv4             3630  1 iptable_nat
nf_nat                 15166  3 nf_nat_ipv4,xt_REDIRECT,iptable_nat
nf_conntrack           87622  4 nf_nat,nf_nat_ipv4,iptable_nat,nf_conntrack_ipv4
ip_tables              11694  2 iptable_filter,iptable_nat
x_tables               17030  4 ip_tables,xt_tcpudp,iptable_filter,xt_REDIRECT
bcm2708_wdog            3545  1 
ipv6                  316254  20 
snd_soc_hifiberry_digi     2572  0 
snd_soc_wm8804          7932  1 
snd_soc_pcm512x         9034  0 
snd_soc_bcm2708_i2s     6210  2 
regmap_mmio             2818  1 snd_soc_bcm2708_i2s
snd_soc_core          127849  4 snd_soc_pcm512x,snd_soc_wm8804,snd_soc_hifiberry_digi,snd_soc_bcm2708_i2s
snd_compress            8259  1 snd_soc_core
regmap_i2c              1661  3 snd_soc_pcm512x,snd_soc_wm8804,snd_soc_core
snd_pcm_dmaengine       5505  1 snd_soc_core
regmap_spi              1913  3 snd_soc_pcm512x,snd_soc_wm8804,snd_soc_core
snd_pcm                83845  3 snd_soc_core,snd_pcm_dmaengine
snd_page_alloc          5132  1 snd_pcm
snd_seq                55484  0 
snd_seq_device          6469  1 snd_seq
snd_timer              20998  2 snd_pcm,snd_seq
leds_gpio               2079  0 
led_class               4118  1 leds_gpio
snd                    62252  7 snd_soc_core,snd_timer,snd_pcm,snd_seq,snd_seq_device,snd_compress
i2c_bcm2708             4943  0 
root@MusicBox:~# cat /sys/class/sound/card*/device/modalias
platform:snd-hifiberry-digi
root@MusicBox:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: sndrpihifiberry [snd_rpi_hifiberry_digi], device 0: HifiBerry Digi HiFi wm8804-spdif-0 []
  Subdevices: 0/1
  Subdevice #0: subdevice #0
root@MusicBox:~# cat /etc/asound.conf
pcm.!default {
    type hw
    card 0
}
ctl.!default {
    type hw
    card 0
}
root@MusicBox:~# cat /etc/modules
# /etc/modules: kernel modules to load at boot time.

#snd_bcm2835
snd_soc_bcm2708_i2s
bcm2708_dmaengine
snd_soc_hifiberry_digi

ipv6
bcm2708_wdog

#8188eu
#8192cu
root@MusicBox:~# cat /etc/modprobe.d/raspi-blacklist.conf 
# blacklist spi and i2c by default (many users don't need them)

blacklist spi-bcm2708
#blacklist i2c-bcm2708
blacklist snd_soc_tas5713

I have same issue. I previously used version 0.5 and with help of this thread I was able to listen through SPDIF. Can somebody to guide me how can I fix this in version 0.5.1rc2?

cannot test this, don’t have a Digi+…

Hi Wouter,

the configuration of the Digi and Digi+ is the same. Both boards are based on the same hardware, only the form factor is different. Do you have a Digi? I can also provide a Digi+ to you if you want to test this.

Best regards
Daniel

I have this same issue as well.

I noticed that as well as the sync error message, I was also getting ‘DMA transfer could not be terminated’ which would also prevent alsa force-reload from working once I had attempted to play any sound.

The same error would crop up again during shutdown - I don’t really understand these things, but I think something to do with the bcm2708_dmaengine driver is locking the digi somehow and not releasing.

I’ve hit the limit of my understanding/googling, so have given up and gone back to volumio (which is nowhere near as good - but I can get it to play music) :frowning:

Hey this is how i got my Pi Musicbox on my B+ with the HiFiBerry Digi+ to work.

  1. Chose sound card HiFiBerry Digi
  2. restart it it won’t work directly.
  3. ssh into it
    ssh root@ip
  4. aplay -l check the card number of HiFiBerry Digi+
  5. change asound.conf with the above card nummber
    nano /etc/asound.conf
    pcm.!default {
    type hw
    card 1
    }
    ctl.!default {
    type hw
    card 1
    }
  6. Stop mopidy
    service mopidy stop
    7 reload alsa
    alsa force-reload
  7. Start mopidy
    service mopidy start

Now it works:)

You have to do it every time you restart but after some time you get very fast at it :smile:

Hi,
This works!
Changing the asound.conf did the trick.
Is there someone who can make this work after a reboot?
Or tell me the how to fix it.
Maybe Wouter van Wijk himself?
Please help!
Musicbox is fantastic, but i need this digital output!

Regards, Peter

Someone with a digi+ needs to provide the output of ‘aplay -l’

Hi,

I have to manualy type this…

**** List of PLAYBACK Hardware Devices *****
Card 0: ALSA [bcm2835 ALSA] device 0: bcm2835 ALSA [bcm2835 ALSA]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #0: subdevice #1
Subdevice #0: subdevice #2
Subdevice #0: subdevice #3
Subdevice #0: subdevice #4
Subdevice #0: subdevice #5
Subdevice #0: subdevice #6
Subdevice #0: subdevice #7
card 0: ALSA [bcm2835 ALSA], device 1 bcm2835 ALSA [bcm2835 IEC958/HDMI]
Subdevices: 1/1
Subdivice #0: subdevice #0
card 1: sndrpihifiberry [sbd_rpi_hifiberry_digi], device 0; HifiBerry Digi HiFi wm8804-spdif-0 []
Subdevices: 1/1
Subdivice #0: subdevice #0

this is for the HiFi Digital DAC PiCobbe from Geekroo

And you are saying the very latest version of setsound.sh (from github)
doesn’t detect it when you specify hifiberry_digi in the settings?

Hi kingosticks,
I am not sure if i use the latest version setsound.sh
I installed a fresh image from musicbox0.5.3 so i think i have the latest version.
Linux is new for me… but i am trying…

it keeps playing over my HDMI port
but if i use the sollution from Daniel Swenson (post of 12feb) it works ok, but after a reboot musicbox plays over HDMI again.

I would like to have the setting fixed.

Hi,
i managed to find your setsound.sh
https://raw.githubusercontent.com/woutervanwijk/Pi-MusicBox/master/filechanges/opt/musicbox/setsound.sh

i will try again.

Thats the one. dont forget to make the new version executable with chmod +x /opt/musicbox/setsound.sh

fresh image installed
set output to hifiberry-digi

root@MusicBox:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7
card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: sndrpihifiberry [snd_rpi_hifiberry_digi], device 0: HifiBerry Digi HiFi wm8804-spdif-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
root@MusicBox:~#

copy-pasted this via ssh into setsound.sh with nano (did not know how to copy via putty)
https://raw.githubusercontent.com/woutervanwijk/Pi-musicBox/master/filechanges/opt/musicbox/setsound.sh

reboot

Start a stream:

On the HDMI monitor: [ 188.801121] bcm2708-i2s bmc2708-i2s.0: I2S SYNC error!

Oh… just saw your post… chmod +x /opt/musicbox/setsound.sh
no response like ok or something just a command prompt.

lets try…

Reboot…
wait…
start a stream
nope… again: bcm2708-i2s bmc2708-i2s.0: I2S SYNC error!

root@MusicBox:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7
card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: sndrpihifiberry [snd_rpi_hifiberry_digi], device 0: HifiBerry Digi HiFi wm8804-spdif-0 []
Subdevices: 0/1
Subdevice #0: subdevice #0
root@MusicBox:~#

Just so we are 100% clear. You need to completely replace the old version
of setsound.sh with the one from github. You then need to make the file
executable. You then need to set hifiberry_digi (underscore, I think, not
hyphen) in settings.ini and reboot.

Yes, but i did the setting to hifiberry-digi first.

First tried with original setsound.sh, and setting audio output to hifiberry-digi. update and reboot…
this didn’t work. (i checked its setting in settings.ini)
I did edit the file setsound.sh . Removed all lines and then pasted your setsound.sh lines into the old file.
saved it (ctrl-o)
chmod +x setsound.sh
did a reboot.
Tried to play a stream and then i got the i2s sync error.

info:
Raspberry pi model B
DAC: Geekroo Digital DAC HiFi Picobber Using WM8804G