Posts: 24
Threads: 4
Joined: May 2019
Reputation:
1
I'm not sure about the root cause.
I now tested also with moode 5.3 instead of 5.3.1 with the same result (5.4 beta I can't test, because my only avaliable spare SDcard is only 4GB and too small for 5.4).
Test-Environment:
- RPi Zero W/H + Justboom Amp
- Moode installation "out of the box"
- only configuration change: WiFi settings to connect to my WiFI, SSH enabled and Justboom enabled
- Pi is running in a completely headless configuration random init is done.
I can push play as soon as the Webinterface comes up but no audio comes out of the speaker. As soon as "random init is done", I see "pcm512x 1-004d: No SCLK, using BCLK: -" and audio starts.
I think, we should not waste time finding the root cause. For me using havegred fixes the issue, so it's fine for me.
Anyway, I'm pretty sure, that in the beginning, my moode installation was running without any issue but I can't remember which with version I started...
Posts: 6,030
Threads: 177
Joined: Apr 2018
Reputation:
235
@ ghoeher
The important thing is you get to "enjoy the music" if I may steal Tim's tagline.
I was the kid who was still nagging my teacher with "why" at the end of class when everybody else had left for lunch
Guess what happens when I nag Ma Google about "pcm512x 1-004d: No SCLK, using BCLK:"? I get hits from a number of sites stretching back years, including a post...ahem...from me...to our old diyaudio.com forum dated May 2016! This was back in the days of moOde 2.x. Still tracing thru all the hits looking for root causes.
As an aside, I also found posts to the same forum in the same time period concerning a Bluetooth multi-media remote, the same topic I'm pursuing now.
What goes around, comes around, I guess, but it's depressing to see evidence of how much I've forgotten over the years <heavy sigh>.
Regards,
Kent
Posts: 6,030
Threads: 177
Joined: Apr 2018
Reputation:
235
@ ghoeher
It's starting to come back to me now.
When the HiFiBerry DAC+ Pro was released they fielded a driver which could work with either the existing DAC+ or the new DAC+ Pro. AIUI, the driver determines which board is present by sensing for a functioning onboard master-clock system (which generates SCLK). If found, it assumes the DAC+ Pro and sets up for master-clock mode. If not found, it assumes the DAC+ and defaults to slave-clock mode (which uses BCLK). Their driver seems to be used with a lot of other vendors' boards containing the same DAC chipsets.
This would explain why I'm not seeing this message with the same driver; I'm using a DAC+ Pro. I'll have to dig out an old DAC+ HAT and see if I can repro your issue.
In any case, all this message is telling us is that the driver is defaulting to slave-mode. Seeing it just means the driver is finishing initialization (hence it can begin playing). It seems to me this process shouldn't need to block while waiting for random/crng to initialize, but I'm not a driver writer. Can't say more.
Regards,
Kent
Posts: 6,030
Threads: 177
Joined: Apr 2018
Reputation:
235
@ ghoeher
The forensics on this are murky. It looks like a bug was introduced in kernel 4.16 work which can cause blocking. Since moOde 5.3.1 is already at kernel 4.19.49+ I should have thought subsequent kernel patches have taken care of the problem, but perhaps not. In any case, it's not clear which sources contribute enough data to the entropy generator to avoid the delay issue on some moOde 5.3.1 installations (like mine).
Your solution of adding haveged is one way to speed up the entropy generation. An alternative is to install rng-tools. Neither is installed in a default Raspbian Stretch installation which is the basis for moOde 5.3.1.
It should be noted in moOde 5.4beta2 which is based on Raspbian Buster and kernel 4.19.57+ that rng-tools is already installed (one of the running processes is /usr/sbin/rngd). I would not expect moOde 5.4beta2 (soon to be released as moOde 6.0) users to experience the same delay.
Regards,
Kent
Posts: 24
Threads: 4
Joined: May 2019
Reputation:
1
Hi Kent,
I was aware that also rng-tools could help, but as I was not aware that the PI has a hardware random number generator (which is required for rng-tools afaik) I've chosen haveged.
As I now learned that the Pi really has a hardware integrated random generator, I also would prefer the rng-tools.
Even if it's not really important as we know solutions/workarounds for this issue, I'm also puzzling regarding the question what generates enough entropy on your system, whereas mine don't. Which additional hardware do you have attached to the Pi?
In my case, it's completely headless with only SDCard, Justboom Amp Zero and a rotary switch. With this combination I can reproduce the issue on a Pi Zero and a Pi 3a+.
Posts: 6,030
Threads: 177
Joined: Apr 2018
Reputation:
235
(07-22-2019, 05:09 PM)ghoeher Wrote: Hi Kent,
I was aware that also rng-tools could help, but as I was not aware that the PI has a hardware random number generator (which is required for rng-tools afaik) I've chosen haveged.
As I now learned that the Pi really has a hardware integrated random generator, I also would prefer the rng-tools.
Even if it's not really important as we know solutions/workarounds for this issue, I'm also puzzling regarding the question what generates enough entropy on your system, whereas mine don't. Which additional hardware do you have attached to the Pi?
In my case, it's completely headless with only SDCard, Justboom Amp Zero and a rotary switch. With this combination I can reproduce the issue on a Pi Zero and a Pi 3a+.
I checked just now with moOde 5.3.1 on an RPi3B+, headless, WiFi client mode, I2S HiFiBerry DAC+ Pro. No haveged, no rng-tools. The moodeutl -i output below shows what's enabled and what's not.
Rebooted. Took about a minute for the system to respond to an ssh login request and for the UI to appear. Then I could immediately start playing a radio stream.
Code: pi@moodeLR:~ $ dmesg|grep rng
[ 0.000000] random: get_random_bytes called from start_kernel+0xac/0x4b4 with crng_init=0
[ 0.251875] bcm2835-rng 3f104000.rng: hwrng registered
[ 4.304939] random: crng init done
(sorry, the forum software won't let me attach the following information as a text file!?!):
Code: pi@moodeLR:~ $ moodeutl -i
Generating system info...
S Y S T E M P A R A M E T E R S
Date and time = 2019-07-22 16:03:42
System uptime = up 16 minutes
Timezone = America/New_York
Release = moOde 5.3.1 2019-06-12
Update = None
Host name = moodeLR
ETH0 IP = unassigned
ETH0 MAC = b8:27:eb:eb:9f:65
WLAN0 IP = 192.168.1.184
WLAN0 MAC = b8:27:eb:be:ca:30
WiFi country = US
HDWR REV = Pi-3B+ 1GB v1.3
SoC = BCM2835
CORES = 4
ARCH = armv7l
RASPBIAN = 9.6
KERNEL = 4.19.49-v7+
KTIMER FREQ = 100 Hz
USB BOOT = enabled
Warranty = OK
ROOT size = 15G
ROOT used = 15%
ROOT avail = 12G
FS expand = expanded
MEM free = 655 MB
MEM used = 79 MB
Temperature = 49.4°C
CPU GOV = performance
P3-WIFI = On
P3-BT = On
HDMI = Off
ETH0 CHECK = Off
MAX USB CUR = Off
UAC2 FIX = Off
ETHPORT FIX = Off
SSH server = On
LED0 = on
LED1 = on
SD CARD = 50 MHz
C O R E S E R V I C E S
PHP-FPM = 7.0.30
NGINX = 1.10.3
SQLite = 3.16.2
HOSTAPD = 2.7
WIRINGPI = 2.50
A P P E A R A N C E S E T T I N G S
Theme = Default
Accent color = Emerald
Alpha blend = 1.00
Adaptive background = No
Background image = No
Cover backdrop = No
Cover blur = 20px
Cover scale = 1.25
CoverView auto-display = Never
CoverView style = Animated
Auto-shuffle filter = None
Extra metadata = Yes
Playback history = No
L I B R A R Y S E T T I N G S
Artist list order = Artist
Ignore articles = a,and,the
Compilation rollup = No
Compilation excludes = greatest hits
UTF8 character filter = No
Cover search pri = Embedded cover
Hi-res covers = Auto
Pixel ratio = 1
A U D I O P A R A M E T E R S
Audio device = HiFiBerry DAC+ Pro
Interface = I2S
Hardware volume = Controller detected
Mixer name = Digital
Audio source = Local
Output device = Local
Resume MPD aft src chg = No
Volume knob = 31
Volume mute = Unmuted
Saved MPD vol = 0
Preamp volume = 0
ALSA version = 1.1.3-5+rpi3
SoX version = 0.1.2-2
Bluetooth controller = On
Bluetooth pairing agent = Off
Airplay receiver = On
Spotify receiver = On
Squeezelite = Off
UPnP client = On
DLNA server = Off
GPIO button handler = Off
Rotary encoder = Off
Encoder params = 100 2 3 4 5
Crossfeed = Off
Parametric EQ = Off
Graphic EQ = Off
Polarity inversion = Off
Auto-shuffle = Off
Autoplay = Off
MPD crossfade = Off
MPD httpd = Off
M P D S E T T I N G S
Version = 0.20.23
Volume control = software
ALSA device = hw:0
SoX resampling = disabled
SoX quality = very high
SoX multithreading = off
DSD over PCM (DoP) = no
Replaygain = off
Replaygain preamp = 0
Volume normalization = No
Audio buffer (kb) = 4096
Output buffer size (kb) = 131072
B L U E T O O T H S E T T I N G S
Bluetooth ver = 5.50
Bluealsa ver = 1.3.1
Speaker sharing = No
Resume MPD = No
A I R P L A Y S E T T I N G S
Version = 3.3.1
Friendly name = MoodeLR Airplay
ALSA device = hw:0
Interpolation = soxr
Output bit depth = S16
Output sample rate = 44100
Session interruption = no
Session timeout (ms) = 120
Audio buffer (secs) = 0.0
Resume MPD = Yes
S P O T I F Y S E T T I N G S
Friendly name = MoodeLR Spotify
ALSA device = plughw:0
Bit rate = 160
Initial volume = 0
Volume curve = Logarithmic
Volume normalization = No
Normalization pregain = 0
Resume MPD = Yes
S Q U E E Z E L I T E S E T T I N G S
Version = 1.8.7-1052 "DSD/SRC enabled"
Friendly name = Moode
ALSA device = hw:0
ALSA params = 80:4::1
Output buffers = 40000:100000
Task priority = 45
Codec list = flac,pcm,mp3,ogg,aac,alac,dsd
Other options = -W -D 500 -R E -S /var/loca
Resume MPD = No
M O O D E L O G
20190722 154723 worker: - Start
20190722 154723 worker: Successfully daemonized
20190722 154723 worker: Integrity check (warning: playerlib.php)
20190722 154723 worker: Integrity check (passed with warnings)
20190722 154723 worker: ALSA volume set to (0%)
20190722 154723 worker: Session loaded
20190722 154723 worker: Debug logging (off)
20190722 154723 worker: - Platform
20190722 154724 worker: Rel (Moode 5.3.1 2019-06-12)
20190722 154724 worker: Upd (None)
20190722 154724 worker: Rasp (9.6)
20190722 154724 worker: Kern (4.19.49-v7+)
20190722 154724 worker: MPD (0.20.23)
20190722 154724 worker: Host (moodeLR)
20190722 154724 worker: Hdwr (Pi-3B+ 1GB v1.3)
20190722 154724 worker: Arch (armv7l)
20190722 154724 worker: Gov (performance)
20190722 154724 worker: USB boot enabled
20190722 154724 worker: File system expanded
20190722 154725 worker: HDMI port off
20190722 154725 worker: File check ok
20190722 154725 worker: - Network
20190722 154725 worker: eth0 exists
20190722 154725 worker: eth0 address not assigned
20190722 154725 worker: wlan0 exists
20190722 154725 worker: wifi country (US)
20190722 154725 worker: wlan0 trying SSID (phyllis)
20190722 154725 worker: wlan0 wait 0 for IP address
20190722 154728 worker: wlan0 wait 1 for IP address
20190722 154731 worker: wlan0 wait 2 for IP address
20190722 154734 worker: wlan0 wait 3 for IP address
20190722 154737 worker: wlan0 wait 4 for IP address
20190722 154740 worker: wlan0 (192.168.1.184)
20190722 154740 worker: - Audio
20190722 154740 worker: ALSA outputs unmuted
20190722 154740 worker: ALSA card number (0)
20190722 154740 worker: Audio output (I2S audio device)
20190722 154740 worker: Audio device (HiFiBerry DAC+ Pro)
20190722 154740 worker: ALSA mixer name (Digital)
20190722 154740 worker: MPD volume control (software)
20190722 154741 worker: Hdwr volume controller exists
20190722 154741 worker: Chip options (Burr Brown PCM5122)
20190722 154741 worker: - Services
20190722 154741 worker: Reset renderer active state
20190722 154741 worker: MPD conf updated
20190722 154741 worker: MPD started
20190722 154741 worker: MPD accepting connections
20190722 154741 worker: Configure MPD outputs
20190722 154741 worker: MPD output 1 ALSA default (on)
20190722 154741 worker: MPD output 2 ALSA crossfeed (off)
20190722 154741 worker: MPD output 3 ALSA parametric eq (off)
20190722 154741 worker: MPD output 4 ALSA graphic eq (off)
20190722 154741 worker: MPD output 5 ALSA polarity inversion (off)
20190722 154741 worker: MPD output 6 ALSA bluetooth (off)
20190722 154741 worker: MPD output 7 HTTP stream (off)
20190722 154741 worker: MPD crossfade (off)
20190722 154741 worker: Audio source (Local)
20190722 154741 worker: Output device (Local)
20190722 154742 worker: Airplay receiver started
20190722 154742 worker: Spotify receiver started
20190722 154742 worker: UPnP renderer started
20190722 154742 worker: Shellinabox SSH started
20190722 154742 worker: Bluetooth controller started
20190722 154749 worker: Bluetooth controller initialized
20190722 154749 worker: - Music sources
20190722 154749 worker: USB sources (none attached)
20190722 154749 worker: NAS sources (mountall initiated)
20190722 154749 worker: - Miscellaneous
20190722 154749 worker: Saved MPD vol level (0)
20190722 154749 worker: Preamp volume level (0)
20190722 154749 worker: MPD volume level (31) restored
20190722 154749 worker: ALSA volume level (100%)
20190722 154749 worker: Auto-play is off
20190722 154749 worker: Maintenance interval (21600)
20190722 154749 worker: Screen saver activation (Never)
20190722 154749 worker: Watchdog started
20190722 154749 worker: Ready
pi@moodeLR:~ $
|