[GH-ISSUE #528] Loud ticks/clicks when selecting other songs #339

Closed
opened 2026-02-27 19:30:05 +03:00 by kerem · 16 comments
Owner

Originally created by @basmeyer on GitHub (Oct 3, 2020).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/528

Hi, I have been directed to you regarding problems with the moOde player.
It is about very audible ticks of clicks and they appear when one song is playing and another is selected in Spotify.
Equipment: Raspberry Pi 4B with HiFBerry DAC+ Pro XLR add-on board.
Software: moOde Player 6.7.1 2020-07-22, but also in previous 6.4.0 2019-11-24.
The loudness of the ticks follow the volume set in the player and are regardless of hardware or software volume control.
System information below. Please let me know if I could provide more information. Thanks!

`
S Y S T E M P A R A M E T E R S

moOde release = 6.7.1 2020-07-22
RaspiOS = 10.4
Linux kernel = 5.4.51-v8+ #1325
Platform = Pi-4B 4GB v1.1
Architecture = aarch64 (64-bit)
System uptime = up 16 hours, 26 minutes
Timezone = Europe/Amsterdam
Current time = 2020-10-03 18:36:15

Host name = moode
Ethernet address = 192.168.1.13
Ethernet MAC = dc:a6:32:61:3c:2c
WLAN address = unassigned
WLAN MAC = dc:a6:32:61:3c:2e
WLAN country = US

SoC identifier = bcm2711
Core count = 4
Kernel timer freq = 250 Hz
SDCard freq = 50 MHz
USB boot = not available
Warranty = OK

Root size = 3.4G
Root used = 80%
Root available = 674M
Root expand = not expanded
Memory free = 3504 MB
Memory used = 88 MB
SoC temperature = 46.7°C

CPU governor = ondemand
Onboard WiFi = On
Onboard BT = On
HDMI output = Off
LED state = 1,1
Eth addr wait = On
Max USB current = Off
USB (UAC2) fix = Off
Pi-3B+ eth fix = Off
SSH term server = Off

PHP-FPM version = 7.3.14
NGINX version = 1.14.2
SQLite3 version = 3.27.2
Hostapd version = 2.8-devel
WiringPi version = 2.50
RPi.GPIO version = 0.7.0

A U D I O P A R A M E T E R S

Audio device = HiFiBerry DAC+ Pro
Interface = I2S
Mixer name = Digital
Hardware volume = Controller detected
Max ALSA volume = 100
Max MPD volume = 100
Volume step limit = 10
Audio source = Local
Output device = Local
Resume MPD = No
Volume knob = 0
Volume mute = Unmuted
Saved MPD vol = 0
Preamp volume = 0
ALSA version = 1.1.8-1+rpt1
SoX version = 0.1.2-3

Bluetooth controller = Off
Pairing agent = Off
Airplay receiver = Off
Spotify receiver = On
Squeezelite = Off
UPnP client = Off
DLNA server = Off
GPIO button handler = Off
UPnP browser = Off

Auto-shuffle = Off
Autoplay = Off
Rotary encoder = Off
Encoder params = 100 2 3 23 24
USB volume knob = Off
Polarity inversion = Off
Crossfeed = Off
Crossfade = Off
Parametric EQ = Off
Graphic EQ = Off
MPD httpd = Off

A P P E A R A N C E S E T T I N G S

Themes and backgrounds

Theme = Default
Accent color = Emerald
Alpha blend = 1.0
Adaptive background = No
Background image = No
Cover backdrop = No
Cover blur = 20px
Cover scale = 1.25

Library options

Instant play action = Add/Play
Show tagview genres = Yes
Show tagview covers = Yes
Show sample rate = No
Ellipsis limited text = No
Thumbnail columns = 6/2 (Default)
Albumview sort order = by Artist
Tagview sort order = by Artist
Compilation identifier = Various Artists
Recently added = 1 Month
Ignore articles = a,an,the
UTF8 character filter = No
Hi-res thumbs = Auto
Cover search pri = Embedded cover
Pixel ratio = 2

Coverview screen saver

CoverView auto-display = Never
CoverView style = Gradient (Linear)

Other options

Font size = Normal
Auto-shuffle filter = None
Extra metadata = track,disc,date,composer,encoded
Playback history = No
First use help = y,y

M P D S E T T I N G S

Version = 0.21.24
Volume control = hardware
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 = 8192 (kb)
Output buffer size = 131072 (kb)

B L U E T O O T H S E T T I N G S

Bluetooth ver = 5.50
Bluealsa ver = v2.1.0
Speaker sharing = No
Resume MPD = No
PCM buffer time = 500000 (µs)

A I R P L A Y S E T T I N G S

Version = 3.3.6
Friendly name = moOde Airplay
ALSA device = hw:0
Interpolation = soxr
Output bit depth = S16
Output sample rate = 44100
Session interruption = no
Session timeout = 120 (ms)
Latency offset = 0.0 (secs)
Audio buffer = 0.2 (secs)
Resume MPD = No

S P O T I F Y S E T T I N G S

Friendly name = moOde Spotify
ALSA device = plughw:0
Bit rate = 320
Initial volume = 0
Volume curve = Logarithmic
Volume normalization = No
Normalization pregain = 0
Autoplay = No
Resume MPD = No

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/local
Resume MPD = No

L O C A L D I S P L A Y S E T T I N G S

Local UI display = Off
Mouse cursor = On
Screen blank = 600 Secs
Wake display on play = Off
Brightness = 255
Pixel aspect ratio = Default
Rotate screen = 0 Deg

M O O D E S T A R T U P L O G

20201003 020939 worker: -- Start
20201003 020939 worker: Successfully daemonized
20201003 020939 worker: Integrity check (passed)
20201003 020939 worker: Session loaded
20201003 020939 worker: Debug logging (off)
20201003 020939 worker: Device raw: (0:sndrpihifiberry|1:empty|2:empty|3:empty
20201003 020939 worker: Device i2s: (HiFiBerry DAC+ Pro)
20201003 020939 worker: Device mpd: (0:HiFiBerry DAC+ Pro)
20201003 020939 worker: Device ses: (0|HiFiBerry DAC+ Pro|Digital|0%)
20201003 020939 worker: ALSA Digital volume set to (0%)
20201003 020939 worker: -- System
20201003 020940 worker: Host (moode)
20201003 020941 worker: moOde (6.7.1 2020-07-22)
20201003 020941 worker: RaspiOS (10.4)
20201003 020941 worker: Kernel (5.4.51-v8+ #1325)
20201003 020941 worker: Platform (Pi-4B 4GB v1.1)
20201003 020941 worker: ARM arch (aarch64, 64-bit kernel)
20201003 020941 worker: MPD ver (0.21.24)
20201003 020941 worker: CPU gov (ondemand)
20201003 020941 worker: USB boot not available
20201003 020941 worker: File system not expanded yet
20201003 020941 worker: HDMI port off
20201003 020941 worker: File check (OK)
20201003 020941 worker: -- Network
20201003 020941 worker: eth0 exists
20201003 020941 worker: IP addr (192.168.1.13)
20201003 020941 worker: Netmask (255.255.255.0)
20201003 020941 worker: Gateway (192.168.1.1)
20201003 020941 worker: Pri DNS (192.168.1.1)
20201003 020941 worker: Domain (blueeaglevision)
20201003 020941 worker: wlan0 exists
20201003 020941 worker: wifi country (US)
20201003 020941 worker: wlan0 SSID is blank
20201003 020941 worker: eth0 addr exists, AP mode not started
20201003 020941 worker: wlan0 address not assigned
20201003 020941 worker: -- Audio
20201003 020942 worker: MPD conf updated
20201003 020942 worker: ALSA outputs unmuted
20201003 020942 worker: ALSA card number (0)
20201003 020942 worker: Audio output (HiFiBerry DAC+ Pro)
20201003 020942 worker: Audio formats (S16_LE, S24_LE, S32_LE)
20201003 020942 worker: ALSA mixer name (Digital)
20201003 020942 worker: MPD volume control (hardware)
20201003 020942 worker: Hdwr volume controller exists
20201003 020942 worker: Max ALSA volume (100%)
20201003 020942 worker: Reset renderer active flags
20201003 020942 worker: -- MPD
20201003 020942 worker: MPD started
20201003 020943 worker: MPD accepting connections
20201003 020943 worker: Configure MPD outputs
20201003 020943 worker: MPD output 1 ALSA default (on)
20201003 020943 worker: MPD output 2 ALSA crossfeed (off)
20201003 020943 worker: MPD output 3 ALSA parametric eq (off)
20201003 020943 worker: MPD output 4 ALSA graphic eq (off)
20201003 020943 worker: MPD output 5 ALSA polarity inversion (off)
20201003 020943 worker: MPD output 6 ALSA bluetooth (off)
20201003 020943 worker: MPD output 7 HTTP stream (off)
20201003 020943 worker: MPD crossfade (off)
20201003 020943 worker: -- Feature availability
20201003 020943 worker: Source select (available)
20201003 020943 worker: Source select (source: MPD)
20201003 020943 worker: Source select (output: HiFiBerry DAC+ Pro)
20201003 020943 worker: Bluetooth (available)
20201003 020943 worker: Airplay renderer (available)
20201003 020943 worker: Spotify renderer (available)
20201003 020943 worker: Spotify renderer (started)
20201003 020943 worker: Squeezelite renderer (available)
20201003 020943 worker: UPnP renderer (available)
20201003 020943 worker: DLNA server (available)
20201003 020943 worker: UPnP browser (available)
20201003 020943 worker: Audio scrobbler (available)
20201003 020943 worker: GPIO button handler (available)
20201003 020943 worker: -- Music sources
20201003 020943 worker: USB sources (none attached)
20201003 020943 worker: NAS and UPnP sources (none configured)
20201003 020943 worker: -- Miscellaneous
20201003 020943 worker: USB volume knob (Off)
20201003 020943 worker: USB auto-mounter (udisks-glue)
20201003 020943 worker: LED0 (On)
20201003 020943 worker: LED1 (On)
20201003 020943 worker: Saved MPD vol level (0)
20201003 020943 worker: Preamp volume level (0)
20201003 020943 worker: MPD volume level (0) restored
20201003 020943 worker: ALSA Digital volume (0%)
20201003 020943 worker: Auto-play (Off)
20201003 020943 worker: Maintenance interval (3 hrs)
20201003 020943 worker: Screen saver activation (Never)
20201003 020943 worker: Session permissions (OK)
20201003 020943 worker: Watchdog started
20201003 020943 worker: Ready
20201003 172513 worker: Job airplaysvc
20201003 172529 worker: Job btsvc
20201003 172547 worker: Job upnpsvc
20201003 172556 worker: Job minidlna
`

Originally created by @basmeyer on GitHub (Oct 3, 2020). Original GitHub issue: https://github.com/librespot-org/librespot/issues/528 Hi, I have been directed to you regarding problems with the moOde player. It is about very audible ticks of clicks and they appear when one song is playing and another is selected in Spotify. Equipment: Raspberry Pi 4B with HiFBerry DAC+ Pro XLR add-on board. Software: moOde Player 6.7.1 2020-07-22, but also in previous 6.4.0 2019-11-24. The loudness of the ticks follow the volume set in the player and are regardless of hardware or software volume control. System information below. Please let me know if I could provide more information. Thanks! ` S Y S T E M P A R A M E T E R S moOde release = 6.7.1 2020-07-22 RaspiOS = 10.4 Linux kernel = 5.4.51-v8+ #1325 Platform = Pi-4B 4GB v1.1 Architecture = aarch64 (64-bit) System uptime = up 16 hours, 26 minutes Timezone = Europe/Amsterdam Current time = 2020-10-03 18:36:15 Host name = moode Ethernet address = 192.168.1.13 Ethernet MAC = dc:a6:32:61:3c:2c WLAN address = unassigned WLAN MAC = dc:a6:32:61:3c:2e WLAN country = US SoC identifier = bcm2711 Core count = 4 Kernel timer freq = 250 Hz SDCard freq = 50 MHz USB boot = not available Warranty = OK Root size = 3.4G Root used = 80% Root available = 674M Root expand = not expanded Memory free = 3504 MB Memory used = 88 MB SoC temperature = 46.7°C CPU governor = ondemand Onboard WiFi = On Onboard BT = On HDMI output = Off LED state = 1,1 Eth addr wait = On Max USB current = Off USB (UAC2) fix = Off Pi-3B+ eth fix = Off SSH term server = Off PHP-FPM version = 7.3.14 NGINX version = 1.14.2 SQLite3 version = 3.27.2 Hostapd version = 2.8-devel WiringPi version = 2.50 RPi.GPIO version = 0.7.0 A U D I O P A R A M E T E R S Audio device = HiFiBerry DAC+ Pro Interface = I2S Mixer name = Digital Hardware volume = Controller detected Max ALSA volume = 100 Max MPD volume = 100 Volume step limit = 10 Audio source = Local Output device = Local Resume MPD = No Volume knob = 0 Volume mute = Unmuted Saved MPD vol = 0 Preamp volume = 0 ALSA version = 1.1.8-1+rpt1 SoX version = 0.1.2-3 Bluetooth controller = Off Pairing agent = Off Airplay receiver = Off Spotify receiver = On Squeezelite = Off UPnP client = Off DLNA server = Off GPIO button handler = Off UPnP browser = Off Auto-shuffle = Off Autoplay = Off Rotary encoder = Off Encoder params = 100 2 3 23 24 USB volume knob = Off Polarity inversion = Off Crossfeed = Off Crossfade = Off Parametric EQ = Off Graphic EQ = Off MPD httpd = Off A P P E A R A N C E S E T T I N G S Themes and backgrounds ---------------------- Theme = Default Accent color = Emerald Alpha blend = 1.0 Adaptive background = No Background image = No Cover backdrop = No Cover blur = 20px Cover scale = 1.25 Library options ---------------------- Instant play action = Add/Play Show tagview genres = Yes Show tagview covers = Yes Show sample rate = No Ellipsis limited text = No Thumbnail columns = 6/2 (Default) Albumview sort order = by Artist Tagview sort order = by Artist Compilation identifier = Various Artists Recently added = 1 Month Ignore articles = a,an,the UTF8 character filter = No Hi-res thumbs = Auto Cover search pri = Embedded cover Pixel ratio = 2 Coverview screen saver ---------------------- CoverView auto-display = Never CoverView style = Gradient (Linear) Other options ---------------------- Font size = Normal Auto-shuffle filter = None Extra metadata = track,disc,date,composer,encoded Playback history = No First use help = y,y M P D S E T T I N G S Version = 0.21.24 Volume control = hardware 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 = 8192 (kb) Output buffer size = 131072 (kb) B L U E T O O T H S E T T I N G S Bluetooth ver = 5.50 Bluealsa ver = v2.1.0 Speaker sharing = No Resume MPD = No PCM buffer time = 500000 (µs) A I R P L A Y S E T T I N G S Version = 3.3.6 Friendly name = moOde Airplay ALSA device = hw:0 Interpolation = soxr Output bit depth = S16 Output sample rate = 44100 Session interruption = no Session timeout = 120 (ms) Latency offset = 0.0 (secs) Audio buffer = 0.2 (secs) Resume MPD = No S P O T I F Y S E T T I N G S Friendly name = moOde Spotify ALSA device = plughw:0 Bit rate = 320 Initial volume = 0 Volume curve = Logarithmic Volume normalization = No Normalization pregain = 0 Autoplay = No Resume MPD = No 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/local Resume MPD = No L O C A L D I S P L A Y S E T T I N G S Local UI display = Off Mouse cursor = On Screen blank = 600 Secs Wake display on play = Off Brightness = 255 Pixel aspect ratio = Default Rotate screen = 0 Deg M O O D E S T A R T U P L O G 20201003 020939 worker: -- Start 20201003 020939 worker: Successfully daemonized 20201003 020939 worker: Integrity check (passed) 20201003 020939 worker: Session loaded 20201003 020939 worker: Debug logging (off) 20201003 020939 worker: Device raw: (0:sndrpihifiberry|1:empty|2:empty|3:empty 20201003 020939 worker: Device i2s: (HiFiBerry DAC+ Pro) 20201003 020939 worker: Device mpd: (0:HiFiBerry DAC+ Pro) 20201003 020939 worker: Device ses: (0|HiFiBerry DAC+ Pro|Digital|0%) 20201003 020939 worker: ALSA Digital volume set to (0%) 20201003 020939 worker: -- System 20201003 020940 worker: Host (moode) 20201003 020941 worker: moOde (6.7.1 2020-07-22) 20201003 020941 worker: RaspiOS (10.4) 20201003 020941 worker: Kernel (5.4.51-v8+ #1325) 20201003 020941 worker: Platform (Pi-4B 4GB v1.1) 20201003 020941 worker: ARM arch (aarch64, 64-bit kernel) 20201003 020941 worker: MPD ver (0.21.24) 20201003 020941 worker: CPU gov (ondemand) 20201003 020941 worker: USB boot not available 20201003 020941 worker: File system not expanded yet 20201003 020941 worker: HDMI port off 20201003 020941 worker: File check (OK) 20201003 020941 worker: -- Network 20201003 020941 worker: eth0 exists 20201003 020941 worker: IP addr (192.168.1.13) 20201003 020941 worker: Netmask (255.255.255.0) 20201003 020941 worker: Gateway (192.168.1.1) 20201003 020941 worker: Pri DNS (192.168.1.1) 20201003 020941 worker: Domain (blueeaglevision) 20201003 020941 worker: wlan0 exists 20201003 020941 worker: wifi country (US) 20201003 020941 worker: wlan0 SSID is blank 20201003 020941 worker: eth0 addr exists, AP mode not started 20201003 020941 worker: wlan0 address not assigned 20201003 020941 worker: -- Audio 20201003 020942 worker: MPD conf updated 20201003 020942 worker: ALSA outputs unmuted 20201003 020942 worker: ALSA card number (0) 20201003 020942 worker: Audio output (HiFiBerry DAC+ Pro) 20201003 020942 worker: Audio formats (S16_LE, S24_LE, S32_LE) 20201003 020942 worker: ALSA mixer name (Digital) 20201003 020942 worker: MPD volume control (hardware) 20201003 020942 worker: Hdwr volume controller exists 20201003 020942 worker: Max ALSA volume (100%) 20201003 020942 worker: Reset renderer active flags 20201003 020942 worker: -- MPD 20201003 020942 worker: MPD started 20201003 020943 worker: MPD accepting connections 20201003 020943 worker: Configure MPD outputs 20201003 020943 worker: MPD output 1 ALSA default (on) 20201003 020943 worker: MPD output 2 ALSA crossfeed (off) 20201003 020943 worker: MPD output 3 ALSA parametric eq (off) 20201003 020943 worker: MPD output 4 ALSA graphic eq (off) 20201003 020943 worker: MPD output 5 ALSA polarity inversion (off) 20201003 020943 worker: MPD output 6 ALSA bluetooth (off) 20201003 020943 worker: MPD output 7 HTTP stream (off) 20201003 020943 worker: MPD crossfade (off) 20201003 020943 worker: -- Feature availability 20201003 020943 worker: Source select (available) 20201003 020943 worker: Source select (source: MPD) 20201003 020943 worker: Source select (output: HiFiBerry DAC+ Pro) 20201003 020943 worker: Bluetooth (available) 20201003 020943 worker: Airplay renderer (available) 20201003 020943 worker: Spotify renderer (available) 20201003 020943 worker: Spotify renderer (started) 20201003 020943 worker: Squeezelite renderer (available) 20201003 020943 worker: UPnP renderer (available) 20201003 020943 worker: DLNA server (available) 20201003 020943 worker: UPnP browser (available) 20201003 020943 worker: Audio scrobbler (available) 20201003 020943 worker: GPIO button handler (available) 20201003 020943 worker: -- Music sources 20201003 020943 worker: USB sources (none attached) 20201003 020943 worker: NAS and UPnP sources (none configured) 20201003 020943 worker: -- Miscellaneous 20201003 020943 worker: USB volume knob (Off) 20201003 020943 worker: USB auto-mounter (udisks-glue) 20201003 020943 worker: LED0 (On) 20201003 020943 worker: LED1 (On) 20201003 020943 worker: Saved MPD vol level (0) 20201003 020943 worker: Preamp volume level (0) 20201003 020943 worker: MPD volume level (0) restored 20201003 020943 worker: ALSA Digital volume (0%) 20201003 020943 worker: Auto-play (Off) 20201003 020943 worker: Maintenance interval (3 hrs) 20201003 020943 worker: Screen saver activation (Never) 20201003 020943 worker: Session permissions (OK) 20201003 020943 worker: Watchdog started 20201003 020943 worker: Ready 20201003 172513 worker: Job airplaysvc 20201003 172529 worker: Job btsvc 20201003 172547 worker: Job upnpsvc 20201003 172556 worker: Job minidlna `
kerem 2026-02-27 19:30:05 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@JasonLG1979 commented on GitHub (Oct 6, 2020):

Sounds like buffer underruns.

While playing Spotify what is the output of cat /proc/asound/card*/pcm*p/sub*/hw_params?

<!-- gh-comment-id:704053475 --> @JasonLG1979 commented on GitHub (Oct 6, 2020): Sounds like buffer underruns. While playing Spotify what is the output of ```cat /proc/asound/card*/pcm*p/sub*/hw_params```?
Author
Owner

@basmeyer commented on GitHub (Oct 7, 2020):

Hi Jason,
Thanks for looking into this.
The output is, and stays:
pi@moode:/proc/asound/card0/pcm0p/sub0 $ !!
cat /proc/asound/card0/pcm0p/sub0/hw_params
access: RW_INTERLEAVED
format: S16_LE
subformat: STD
channels: 2
rate: 44100 (352800/8)
period_size: 225
buffer_size: 22050

Regards,
Bas Meijer

On 6 Oct 2020, at 08:15, Jason Gray notifications@github.com wrote:

Sounds like buffer underruns.

While playing Spotify was is the output of cat /proc/asound/card*/pcmp/sub/hw_params?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub https://github.com/librespot-org/librespot/issues/528#issuecomment-704053475, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABO2STELLBYU3DMG2M7O4FTSJKYWJANCNFSM4SDERFXQ.

<!-- gh-comment-id:704632129 --> @basmeyer commented on GitHub (Oct 7, 2020): Hi Jason, Thanks for looking into this. The output is, and stays: pi@moode:/proc/asound/card0/pcm0p/sub0 $ !! cat /proc/asound/card0/pcm0p/sub0/hw_params access: RW_INTERLEAVED format: S16_LE subformat: STD channels: 2 rate: 44100 (352800/8) period_size: 225 buffer_size: 22050 Regards, Bas Meijer > On 6 Oct 2020, at 08:15, Jason Gray <notifications@github.com> wrote: > > > Sounds like buffer underruns. > > While playing Spotify was is the output of cat /proc/asound/card*/pcm*p/sub*/hw_params? > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub <https://github.com/librespot-org/librespot/issues/528#issuecomment-704053475>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABO2STELLBYU3DMG2M7O4FTSJKYWJANCNFSM4SDERFXQ>. >
Author
Owner

@basmeyer commented on GitHub (Oct 7, 2020):

Hi Jason,
Thanks for looking into this.
The output is, and stays:
pi@moode:/proc/asound/card0/pcm0p/sub0 $ !!
cat /proc/asound/card0/pcm0p/sub0/hw_params
access: RW_INTERLEAVED
format: S16_LE
subformat: STD
channels: 2
rate: 44100 (352800/8)
period_size: 225
buffer_size: 22050

In addition, when I compare with HiFiBerryOS, this is then the output, which looks similar to me:

cat hw_params

access: MMAP_INTERLEAVED
format: S16_LE
subformat: STD
channels: 2
rate: 44100 (352800/8)
period_size: 225
buffer_size: 22050

Regards,
Bas Meijer

On 6 Oct 2020, at 08:15, Jason Gray <notifications@github.com mailto:notifications@github.com> wrote:

Sounds like buffer underruns.

While playing Spotify was is the output of cat /proc/asound/card*/pcmp/sub/hw_params?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub https://github.com/librespot-org/librespot/issues/528#issuecomment-704053475, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABO2STELLBYU3DMG2M7O4FTSJKYWJANCNFSM4SDERFXQ.

<!-- gh-comment-id:704639030 --> @basmeyer commented on GitHub (Oct 7, 2020): Hi Jason, Thanks for looking into this. The output is, and stays: pi@moode:/proc/asound/card0/pcm0p/sub0 $ !! cat /proc/asound/card0/pcm0p/sub0/hw_params access: RW_INTERLEAVED format: S16_LE subformat: STD channels: 2 rate: 44100 (352800/8) period_size: 225 buffer_size: 22050 In addition, when I compare with HiFiBerryOS, this is then the output, which looks similar to me: # cat hw_params access: MMAP_INTERLEAVED format: S16_LE subformat: STD channels: 2 rate: 44100 (352800/8) period_size: 225 buffer_size: 22050 Regards, Bas Meijer > On 6 Oct 2020, at 08:15, Jason Gray <notifications@github.com <mailto:notifications@github.com>> wrote: > > > Sounds like buffer underruns. > > While playing Spotify was is the output of cat /proc/asound/card*/pcm*p/sub*/hw_params? > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub <https://github.com/librespot-org/librespot/issues/528#issuecomment-704053475>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABO2STELLBYU3DMG2M7O4FTSJKYWJANCNFSM4SDERFXQ>. >
Author
Owner

@JasonLG1979 commented on GitHub (Oct 7, 2020):

period_size: 225

That's what I thought. That period size is WAY to small. That translates to 196 CPU interrupts per second. For about a 0.5 sec buffer a much more reasonable buffer setting would be a buffer size of 22052 and a period size of 5513. That would translate to about 8 CPU interrupts per second. Which is what the current git master pretty much uses from what I remember.

Basically what's happening is that with everything that's going on the CPU gets hammered and can't keep up.

I would advice both Moode Audio and HiFiBerryOS to rebuild librespot against the current git master. If that doesn't help they can create a new pcm device in asound.conf specifically for librespot and manually set their own buffer parmas.

<!-- gh-comment-id:704644682 --> @JasonLG1979 commented on GitHub (Oct 7, 2020): > period_size: 225 That's what I thought. That period size is WAY to small. That translates to 196 CPU interrupts per second. For about a 0.5 sec buffer a much more reasonable buffer setting would be a buffer size of 22052 and a period size of 5513. That would translate to about 8 CPU interrupts per second. Which is what the current git master pretty much uses from what I remember. Basically what's happening is that with everything that's going on the CPU gets hammered and can't keep up. I would advice both Moode Audio and HiFiBerryOS to rebuild librespot against the current git master. If that doesn't help they can create a new pcm device in asound.conf specifically for librespot and manually set their own buffer parmas.
Author
Owner

@basmeyer commented on GitHub (Oct 7, 2020):

Thank you for your help, this sounds like a very obvious cause of the clicks/spikes when starting new tracks!
I will forward this to Moode. As far as HiFiBerryOS I did not experience this problem (yet).

Not sure but perhaps this could also explain the “buggy” behavior using Spotify Connect with both (!) systems regarding the volume levels when switching sources, so like from another music source to Spotify.

Thanks again.

On 7 Oct 2020, at 03:50, Jason Gray notifications@github.com wrote:

period_size: 225

That's what I thought. That period size is WAY to small. That translates to 196 CPU interrupts per second. For about a 0.5 sec buffer a much more reasonable buffer setting would be a buffer size of 22052 and a period size of 5513. That would translate to about 8 CPU interrupts per second. Which is what the current git master pretty much uses from what I remember.

Basically what's happening is that with everything that's going on the CPU gets hammered and can't keep up.

I would advice both Moode Audio and HiFiBerryOS to rebuild librespot against the current git master. If that doesn't help they can create a new pcm device in asound.conf specifically for librespot and manually set their own buffer parmas.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub https://github.com/librespot-org/librespot/issues/528#issuecomment-704644682, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABO2STEKXKGCWKDIECD37KTSJPCM3ANCNFSM4SDERFXQ.

<!-- gh-comment-id:704647327 --> @basmeyer commented on GitHub (Oct 7, 2020): Thank you for your help, this sounds like a very obvious cause of the clicks/spikes when starting new tracks! I will forward this to Moode. As far as HiFiBerryOS I did not experience this problem (yet). Not sure but perhaps this could also explain the “buggy” behavior using Spotify Connect with both (!) systems regarding the volume levels when switching sources, so like from another music source to Spotify. Thanks again. > On 7 Oct 2020, at 03:50, Jason Gray <notifications@github.com> wrote: > > > period_size: 225 > > That's what I thought. That period size is WAY to small. That translates to 196 CPU interrupts per second. For about a 0.5 sec buffer a much more reasonable buffer setting would be a buffer size of 22052 and a period size of 5513. That would translate to about 8 CPU interrupts per second. Which is what the current git master pretty much uses from what I remember. > > Basically what's happening is that with everything that's going on the CPU gets hammered and can't keep up. > > I would advice both Moode Audio and HiFiBerryOS to rebuild librespot against the current git master. If that doesn't help they can create a new pcm device in asound.conf specifically for librespot and manually set their own buffer parmas. > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub <https://github.com/librespot-org/librespot/issues/528#issuecomment-704644682>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABO2STEKXKGCWKDIECD37KTSJPCM3ANCNFSM4SDERFXQ>. >
Author
Owner

@JasonLG1979 commented on GitHub (Oct 7, 2020):

I ran into the same issue using raspotify on a pi zero. I upped the buffer to 1 sec and 0.25 sec period time by overriding default in asound.conf and it worked wonders. The Pi4 is exponentially more powerful then a zero so 0.5 secs should be fine.

<!-- gh-comment-id:704647912 --> @JasonLG1979 commented on GitHub (Oct 7, 2020): I ran into the same issue using raspotify on a pi zero. I upped the buffer to 1 sec and 0.25 sec period time by overriding default in asound.conf and it worked wonders. The Pi4 is exponentially more powerful then a zero so 0.5 secs should be fine.
Author
Owner

@JasonLG1979 commented on GitHub (Oct 7, 2020):

Not sure but perhaps this could also explain the “buggy” behavior using Spotify Connect with both (!) systems regarding the volume levels when switching sources, so like from another music source to Spotify.

Well there could be several reasons for that depending on how volume is configured in librespot and the main volume setting in Moode Audio and HiFiBerryOS.

Your best bet is to just set volume to 100% everywhere and use the volume on whatever's downstream from your pi, a receiver or amp or whatever.

<!-- gh-comment-id:704649095 --> @JasonLG1979 commented on GitHub (Oct 7, 2020): > Not sure but perhaps this could also explain the “buggy” behavior using Spotify Connect with both (!) systems regarding the volume levels when switching sources, so like from another music source to Spotify. Well there could be several reasons for that depending on how volume is configured in librespot and the main volume setting in Moode Audio and HiFiBerryOS. Your best bet is to just set volume to 100% everywhere and use the volume on whatever's downstream from your pi, a receiver or amp or whatever.
Author
Owner

@basmeyer commented on GitHub (Oct 7, 2020):

That is really hopeful. I was eager to try it our myself, but I have not manage to locate the file/folder asound.conf than you mentioned.
We are talking Moode right?
I did had a look at the files in the /proc/asound folder but it does not make sense to me what to edit and to not recognise the current values there.

Tried lots of things and searched the whole remote location.
Thanks for your help.

On 7 Oct 2020, at 04:02, Jason Gray notifications@github.com wrote:

I ran into the same issue using raspotify on a pi zero. I upped the buffer to 1 sec and 0.25 sec period time by overriding default in asound.conf and it worked wonders. The Pi4 is exponentially more powerful then a zero so 0.5 secs should be fine.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub https://github.com/librespot-org/librespot/issues/528#issuecomment-704647912, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABO2STBNL2Y4WQNGZA3CYRDSJPD43ANCNFSM4SDERFXQ.

<!-- gh-comment-id:705038148 --> @basmeyer commented on GitHub (Oct 7, 2020): That is really hopeful. I was eager to try it our myself, but I have not manage to locate the file/folder asound.conf than you mentioned. We are talking Moode right? I did had a look at the files in the /proc/asound folder but it does not make sense to me what to edit and to not recognise the current values there. Tried lots of things and searched the whole remote location. Thanks for your help. > On 7 Oct 2020, at 04:02, Jason Gray <notifications@github.com> wrote: > > > I ran into the same issue using raspotify on a pi zero. I upped the buffer to 1 sec and 0.25 sec period time by overriding default in asound.conf and it worked wonders. The Pi4 is exponentially more powerful then a zero so 0.5 secs should be fine. > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub <https://github.com/librespot-org/librespot/issues/528#issuecomment-704647912>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABO2STBNL2Y4WQNGZA3CYRDSJPD43ANCNFSM4SDERFXQ>. >
Author
Owner

@JasonLG1979 commented on GitHub (Oct 7, 2020):

It's /etc/asound.conf unless created it does not exist. It's an override config file.

https://wiki.archlinux.org/index.php/Advanced_Linux_Sound_Architecture#Configuration

I would not change it if it exists already on an "Audiophile" Linux distro like Moode or HiFiBerryOS. I'm not sure how they handle the file but I know on Volumio they have scripts that generate/write to that file. If you change it you can break your system and/or anything you change can just get overwritten.

<!-- gh-comment-id:705054273 --> @JasonLG1979 commented on GitHub (Oct 7, 2020): It's ```/etc/asound.conf``` unless created it does not exist. It's an override config file. https://wiki.archlinux.org/index.php/Advanced_Linux_Sound_Architecture#Configuration I would not change it if it exists already on an "Audiophile" Linux distro like Moode or HiFiBerryOS. I'm not sure how they handle the file but I know on Volumio they have scripts that generate/write to that file. If you change it you can break your system and/or anything you change can just get overwritten.
Author
Owner

@JasonLG1979 commented on GitHub (Oct 7, 2020):

Another problem or at least inconsistency is that in every "Audiophile" distro I've tried no matter what you set the sample rate and bit depth and buffer settings in the main settings librespot always uses it's default settings. (16 bit 44.1 kHz and the above mentioned buffer sizes) Now granted that upsampling has absolutely zero benefit on modern DACs (they oversample internally anyway) and upping the bit depth is really only useful for improving the quality of software volume control, buffer settings are useful and, like I said for consistency's sake they should be in harmony.

It's very easily possible to make all the setting match with a custom pcm definition in /etc/asound.conf.

Something like this:

###############################################################################

pcm.hqstereo20 {
    @args [
        SAMPLE_RATE FORMAT SAMPLE_RATE_CONVERTER
        BUFFER_PERIODS BUFFER_PERIOD_TIME
    ]
    # Sampling rate in Hz:
    # 44100, 48000, 88200, 96000...
    # Defaults to 44.1 kHz (CD Quality).
    @args.SAMPLE_RATE {
        type integer
        default 44100
    }
    # Format:
    # S16_LE, S24_LE, S24_3LE, S32_LE...
    # Defaults to S16_LE (CD Quality).
    @args.FORMAT {
        type string
        default S16_LE
    }
    # Resampling algorithm.
    # Defaults to samplerate_linear.
    @args.SAMPLE_RATE_CONVERTER {
        type string
        default samplerate_linear
    }
    # Periods per buffer.
    @args.BUFFER_PERIODS {
        type integer
        default 4
    }
    # Period size in time.
    # Defaults to 125ms (0.125 sec).
    # BUFFER_PERIODS * BUFFER_PERIOD_TIME = buffer time/size
    @args.BUFFER_PERIOD_TIME {
        type integer
        default 125000
    }
    type plug
    rate_converter $SAMPLE_RATE_CONVERTER
    slave {
        channels 2
        rate $SAMPLE_RATE
        format $FORMAT
        pcm {
            type dmix
            ipc_key 1024
            ipc_perm 0660
            ipc_gid audio
            slowptr true
            hw_ptr_alignment roundup
            slave {
                pcm {
                    type hw
                    card {
                        @func refer
                        name defaults.pcm.card
                    }
                    device {
                        @func refer
                        name defaults.pcm.device
                    }
                    subdevice {
                        @func refer
                        name defaults.pcm.subdevice
                    }
                    channels 2
                    rate $SAMPLE_RATE
                    format $FORMAT
                }
                channels 2
                period_size 0
                buffer_size 0
                buffer_time 0
                period_time $BUFFER_PERIOD_TIME
                periods $BUFFER_PERIODS
                rate $SAMPLE_RATE
                format $FORMAT
            }
            bindings {
                0 0
                1 1
            }
        }
    }
}

###############################################################################

# Change to the card number or name that you want to be the default control card.
# Default: 0
defaults.ctl.card 0

# Change to the card number or name that you want to be the default playback card.
# It should usually be the same as defaults.ctl.card.
# Default: 0
defaults.pcm.card 0

# Change to the device number that you want to be the default device on the default card.
# 0 or 1 is usually the correct device number.
# Default: 0
defaults.pcm.device 0

# Change to the subdevice number that you want to be the default subdevice on the default device.
# Should rarely need to be changed.
# Default: -1
defaults.pcm.subdevice -1

pcm.spotify {
    type plug
    # Optional args:
    # SAMPLE_RATE: default: 44100 
    # FORMAT: default: S16_LE

    # SAMPLE_RATE_CONVERTER: default: samplerate_linear
    # SAMPLE_RATE_CONVERTER MAP:
    # low: samplerate_linear
    # medium: speexrate
    # High: speexrate_medium
    # Highest/Very High: speexrate_best

    # BUFFER_PERIODS: default: 4
    # BUFFER_PERIOD_TIME: default: 125000

    # Example:
    # 32 bit 96 kHz 1 sec buffer "high quality" sample rate conversion.
    "hqstereo20:SAMPLE_RATE=96000,FORMAT=S32_LE,SAMPLE_RATE_CONVERTER=speexrate_medium,BUFFER_PERIOD_TIME=250000"

    slave.pcm "hqstereo20"
}

###############################################################################

With the above all that has to be overwritten is the defaults and the slave.pcm definition in pcm.spotify when any of the main audio settings are changed and then they would just have to tell librespot to use the custom "spotify" pcm with --device spotify.

<!-- gh-comment-id:705083349 --> @JasonLG1979 commented on GitHub (Oct 7, 2020): Another problem or at least inconsistency is that in every "Audiophile" distro I've tried no matter what you set the sample rate and bit depth and buffer settings in the main settings librespot always uses it's default settings. (16 bit 44.1 kHz and the above mentioned buffer sizes) Now granted that upsampling has absolutely zero benefit on modern DACs (they oversample internally anyway) and upping the bit depth is really only useful for improving the quality of software volume control, buffer settings are useful and, like I said for consistency's sake they should be in harmony. It's very easily possible to make all the setting match with a custom pcm definition in ```/etc/asound.conf```. Something like this: ``` ############################################################################### pcm.hqstereo20 { @args [ SAMPLE_RATE FORMAT SAMPLE_RATE_CONVERTER BUFFER_PERIODS BUFFER_PERIOD_TIME ] # Sampling rate in Hz: # 44100, 48000, 88200, 96000... # Defaults to 44.1 kHz (CD Quality). @args.SAMPLE_RATE { type integer default 44100 } # Format: # S16_LE, S24_LE, S24_3LE, S32_LE... # Defaults to S16_LE (CD Quality). @args.FORMAT { type string default S16_LE } # Resampling algorithm. # Defaults to samplerate_linear. @args.SAMPLE_RATE_CONVERTER { type string default samplerate_linear } # Periods per buffer. @args.BUFFER_PERIODS { type integer default 4 } # Period size in time. # Defaults to 125ms (0.125 sec). # BUFFER_PERIODS * BUFFER_PERIOD_TIME = buffer time/size @args.BUFFER_PERIOD_TIME { type integer default 125000 } type plug rate_converter $SAMPLE_RATE_CONVERTER slave { channels 2 rate $SAMPLE_RATE format $FORMAT pcm { type dmix ipc_key 1024 ipc_perm 0660 ipc_gid audio slowptr true hw_ptr_alignment roundup slave { pcm { type hw card { @func refer name defaults.pcm.card } device { @func refer name defaults.pcm.device } subdevice { @func refer name defaults.pcm.subdevice } channels 2 rate $SAMPLE_RATE format $FORMAT } channels 2 period_size 0 buffer_size 0 buffer_time 0 period_time $BUFFER_PERIOD_TIME periods $BUFFER_PERIODS rate $SAMPLE_RATE format $FORMAT } bindings { 0 0 1 1 } } } } ############################################################################### # Change to the card number or name that you want to be the default control card. # Default: 0 defaults.ctl.card 0 # Change to the card number or name that you want to be the default playback card. # It should usually be the same as defaults.ctl.card. # Default: 0 defaults.pcm.card 0 # Change to the device number that you want to be the default device on the default card. # 0 or 1 is usually the correct device number. # Default: 0 defaults.pcm.device 0 # Change to the subdevice number that you want to be the default subdevice on the default device. # Should rarely need to be changed. # Default: -1 defaults.pcm.subdevice -1 pcm.spotify { type plug # Optional args: # SAMPLE_RATE: default: 44100 # FORMAT: default: S16_LE # SAMPLE_RATE_CONVERTER: default: samplerate_linear # SAMPLE_RATE_CONVERTER MAP: # low: samplerate_linear # medium: speexrate # High: speexrate_medium # Highest/Very High: speexrate_best # BUFFER_PERIODS: default: 4 # BUFFER_PERIOD_TIME: default: 125000 # Example: # 32 bit 96 kHz 1 sec buffer "high quality" sample rate conversion. "hqstereo20:SAMPLE_RATE=96000,FORMAT=S32_LE,SAMPLE_RATE_CONVERTER=speexrate_medium,BUFFER_PERIOD_TIME=250000" slave.pcm "hqstereo20" } ############################################################################### ``` With the above all that has to be overwritten is the defaults and the slave.pcm definition in pcm.spotify when any of the main audio settings are changed and then they would just have to tell librespot to use the custom "spotify" pcm with ```--device spotify```.
Author
Owner

@JasonLG1979 commented on GitHub (Oct 7, 2020):

hqstereo20 is more or less a function.

<!-- gh-comment-id:705091795 --> @JasonLG1979 commented on GitHub (Oct 7, 2020): ```hqstereo20``` is more or less a function.
Author
Owner

@basmeyer commented on GitHub (Oct 9, 2020):

Thanks Jason,
I contacted Moode and see what they (Tim Curtis) come up with.

I offered to do some testing with my current gear but the asked for a ready made asound.conf where I can only fill in the necessary params to moderate the period_size and buffer_size.
My C-skill are to outdated to seriously make a working asound.conf
It is not posible to permanently demolish the Moode system but I constantly end up with Spotify Connect that stops working to output to Moode once I press start or raise the volume from 0. ;)

I handed out your code and all necessary information around have them update the librespot use by Moode.

I still wonder why HiFiBerryOS does not give glitches with the similar output of hw_params but that could possibly have to do with other system things that will have its effect on CPU load.
Regards, Bas

On 7 Oct 2020, at 19:42, Jason Gray notifications@github.com wrote:

hqstereo20 is more or less a function.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub https://github.com/librespot-org/librespot/issues/528#issuecomment-705091795, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABO2STB3PKATZP73XHN3B63SJSSBZANCNFSM4SDERFXQ.

<!-- gh-comment-id:706198349 --> @basmeyer commented on GitHub (Oct 9, 2020): Thanks Jason, I contacted Moode and see what they (Tim Curtis) come up with. I offered to do some testing with my current gear but the asked for a ready made asound.conf where I can only fill in the necessary params to moderate the period_size and buffer_size. My C-skill are to outdated to seriously make a working asound.conf It is not posible to permanently demolish the Moode system but I constantly end up with Spotify Connect that stops working to output to Moode once I press start or raise the volume from 0. ;) I handed out your code and all necessary information around have them update the librespot use by Moode. I still wonder why HiFiBerryOS does not give glitches with the similar output of hw_params but that could possibly have to do with other system things that will have its effect on CPU load. Regards, Bas > On 7 Oct 2020, at 19:42, Jason Gray <notifications@github.com> wrote: > > > hqstereo20 is more or less a function. > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub <https://github.com/librespot-org/librespot/issues/528#issuecomment-705091795>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABO2STB3PKATZP73XHN3B63SJSSBZANCNFSM4SDERFXQ>. >
Author
Owner

@JasonLG1979 commented on GitHub (Oct 10, 2020):

My C-skill are to outdated to seriously make a working asound.conf

It's not C it's a plain text file.

<!-- gh-comment-id:706465023 --> @JasonLG1979 commented on GitHub (Oct 10, 2020): > My C-skill are to outdated to seriously make a working asound.conf It's not C it's a plain text file.
Author
Owner

@JasonLG1979 commented on GitHub (Oct 10, 2020):

When I say that hqstereo20 is like a function I mean that you can pass arguments to it like a function if you want to by editing the string in quotes after slave.pcm. It's not actually a real function.

<!-- gh-comment-id:706465791 --> @JasonLG1979 commented on GitHub (Oct 10, 2020): When I say that ```hqstereo20``` is ***like*** a function I mean that you can pass arguments to it like a function if you want to by editing the string in quotes after ```slave.pcm```. It's not actually a real function.
Author
Owner

@JasonLG1979 commented on GitHub (Oct 10, 2020):

I still wonder why HiFiBerryOS does not give glitches with the similar output of hw_params but that could possibly have to do with other system things that will have its effect on CPU load.

I don't know but I do know that HiFiBerryOS is not a Raspberry Pi/Debian based system. It's built with buildroot last I checked.

<!-- gh-comment-id:706466687 --> @JasonLG1979 commented on GitHub (Oct 10, 2020): > I still wonder why HiFiBerryOS does not give glitches with the similar output of hw_params but that could possibly have to do with other system things that will have its effect on CPU load. I don't know but I do know that HiFiBerryOS is not a Raspberry Pi/Debian based system. It's built with buildroot last I checked.
Author
Owner

@JasonLG1979 commented on GitHub (Oct 10, 2020):

I jumped in on your moodeaudio forum thread.

<!-- gh-comment-id:706470044 --> @JasonLG1979 commented on GitHub (Oct 10, 2020): I jumped in on your moodeaudio forum thread.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/librespot#339
No description provided.