0

I've just installed a fresh Raspbian Buster on My Raspi 3B+ together with a JustBoom DAC HAT sound card. With the old Raspbian installation, sound output went well after a couple of experiments, but on the new system, I've run into a very strange issue: All sounds (no matter which type of sound data, even with eSpeak outputs) are played with an enourmously low pitch, supposedly at half the original frequency! Here is my ALSA config:

pi@autoradio:/import/valen/autoradio $ aplay -l
**** Liste der Hardware-Geräte (PLAYBACK) ****
Karte 0: sndrpijustboomd [snd_rpi_justboom_dac], Gerät 0: JustBoom DAC HiFi pcm512x-hifi-0 [JustBoom DAC HiFi pcm512x-hifi-0]
  Sub-Geräte: 1/1
  Sub-Gerät #0: subdevice #0
pi@autoradio:/import/valen/autoradio $ aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
jack
    JACK Audio Connection Kit
pulse
    PulseAudio Sound Server
dmixer
cdplay
dsnooper
duplex
default
sysdefault:CARD=sndrpijustboomd
    snd_rpi_justboom_dac, JustBoom DAC HiFi pcm512x-hifi-0
    Default Audio Device
dmix:CARD=sndrpijustboomd,DEV=0
    snd_rpi_justboom_dac, JustBoom DAC HiFi pcm512x-hifi-0
    Direct sample mixing device
dsnoop:CARD=sndrpijustboomd,DEV=0
    snd_rpi_justboom_dac, JustBoom DAC HiFi pcm512x-hifi-0
    Direct sample snooping device
hw:CARD=sndrpijustboomd,DEV=0
    snd_rpi_justboom_dac, JustBoom DAC HiFi pcm512x-hifi-0
    Direct hardware device without any conversions
plughw:CARD=sndrpijustboomd,DEV=0
    snd_rpi_justboom_dac, JustBoom DAC HiFi pcm512x-hifi-0
    Hardware device with all software conversions
usbstream:CARD=sndrpijustboomd
    snd_rpi_justboom_dac
    USB Stream Output

The on-board mono sount output has been switched off in the boot config. Here is the corresponding /etc/asound.conf:

pcm.dmixer { 
    type dmix
    ipc_key 1024
    ipc_perm 0666 
    slave {
        pcm "hw:0,0"
        period_time 0
        period_size 1024
        buffer_size 4096
        rate 44100
        format S16_LE
        channels 2
    }
    bindings {
        0 0
        1 1
    }
}

pcm.cdplay {
    type dmix
    ipc_key 1024
    ipc_perm 0666
    slave {
        pcm "hw:0,0"
        period_time 0
        period_size 1024
        buffer_size 4096
        rate 44100
        format S16_LE
        channels 2
    }
    bindings {
        0 0
        1 1
    }
}

pcm.dsnooper {
    type dsnoop
    ipc_key 2048
    ipc_perm 0666
    slave
    {
        pcm "hw:0,0"
        period_time 0
        period_size 1024
        buffer_size 4096
        rate 192000
        format S32_LE
        channels 2
    }
    bindings {
        0 0
        1 1
    }
}

pcm.duplex {
    type asym
    playback.pcm "dmixer"
    capture.pcm "dsnooper"
}

pcm.!default {
    type plug
    slave.pcm "duplex"
}
 
ctl.!default {
        type hw
        card 0
}

What I do know is that eSpeak has an output sample rate of 22050 Hz. But: MP3 files are affected, too. What's wrong here? Thank you.

3
  • I am not familiar with your equipment however It sounds like the new clock is slower then the original one at least on the playback side.
    – Gil
    Aug 28, 2021 at 3:45
  • Do you mean the CPU clock speed?
    – Neppomuk
    Aug 28, 2021 at 20:23
  • Hint: prefixing CLI commands with LC_ALL=C forces messages to be printed in English. Useful when you're parsing the output in scripts, or when you're posting them on an English-speaking website. Aug 30, 2021 at 13:16

1 Answer 1

2

I've just found the solution, which has almost nothing to do with ALSA: The culprit was the pigpiod service, which by default generates clock signals by using PCM! Changing this to PWM…

/usr/bin/pigpiod -t 0 -l

…and restarting the service made all sounds sound as expected.

1
  • 1
    Thanks for letting us know.
    – Gil
    Aug 30, 2021 at 1:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.