Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


My Solution to "playing silence to avoid xrun" Over Samba
#1
I am posting this in the hopes that it helps others; I searched and read almost every thread here involving "xrun" and never found one that adequately described my situation. I'm pretty new to this, so don't kill me if this is a "you didn't know that?" topic.

TL;DR: Increasing the bsize (and maybe rsize) parameter of a Samba source may stop tracks from skipping.

Problem Description: Higher bitrate tracks (flac), NOT RADIO, were experiencing the xrun errors as others have reported. Some played for a bit, then skipped. By skipped I mean that they would play for a second, then silence, then play again having moved forward in the track, repeating the whole track.

My Setup: Moode (8.3.7), rPi4, ProtoDAC, No DSP, Windows 10 hosting tracks on an attached USB drive. Note: I realize 8.3.9 is out, but I kinda wanted to solve this and learn.

Code:
20240306 163616 worker: --
20240306 163616 worker: -- Start moOde 8 series
20240306 163616 worker: --
20240306 163616 worker: Successfully daemonized
20240306 163616 worker: Wait for Linux startup...
20240306 163634 worker: Linux startup complete
20240306 163634 worker: Boot config backed up
20240306 163635 worker: Session loaded
20240306 163637 worker: Package holds applied
20240306 163638 worker: File check complete
20240306 163638 worker: Debug logging off
20240306 163638 worker: Reduced logging off
20240306 163638 worker: --
20240306 163638 worker: -- Audio debug
20240306 163638 worker: --
20240306 163638 worker: ALSA cards:  0:sndrpirpidac | 1:empty | 2:empty | 3:empty
20240306 163638 worker: MPD config:  0:ProtoDAC TDA1387 X8 | mixer:none | cardnum:0
20240306 163638 worker: Mixer name:  none exists
20240306 163638 worker: Hdwr volume: controller not detected
20240306 163638 worker: --
20240306 163638 worker: -- System
20240306 163638 worker: --
20240306 163639 worker: Host:     moode
20240306 163639 worker: Model:    Pi-4B 1.5 4GB
20240306 163639 worker: moOde:    8.3.7 2023-12-07
20240306 163639 worker: RaspiOS:  11.7 Bullseye 64-bit
20240306 163639 worker: Kernel:   6.1.21 64-bit
20240306 163639 worker: MPD ver:  0.23.14
20240306 163639 worker: CPU gov:  ondemand
20240306 163639 worker: Userid:   moodeuser
20240306 163639 worker: Homedir:  /home/moodeuser
20240306 163639 worker: Timezone: America/New_York
20240306 163639 worker: Keyboard: us
20240306 163639 worker: USB boot: enabled
20240306 163640 worker: File sys: expanded
20240306 163640 worker: HDMI out: off
20240306 163640 worker: Sys LED0: on
20240306 163640 worker: Sys LED1: on
20240306 163640 worker: --
20240306 163640 worker: -- Network
20240306 163640 worker: --
20240306 163640 worker: Eth: adapter exists
20240306 163640 worker: Eth: timeout off
20240306 163640 worker: Eth: address not assigned
20240306 163640 worker: Wlan: adapter exists
20240306 163640 worker: Wlan: country US
20240306 163640 worker: Wlan: SSID    metroid
20240306 163640 worker: Wlan: other   none
20240306 163640 worker: Wlan: router  off
20240306 163640 worker: Wlan: timeout up to 90 secs
20240306 163640 worker: Wlan: connect to metroid
20240306 163640 worker: Wlan: sleep   disabled
20240306 163640 worker: Wlan: method  dhcp
20240306 163640 worker: Wlan: address 192.168.211.46
20240306 163640 worker: Wlan: netmask 255.255.255.0
20240306 163640 worker: Wlan: gateway 192.168.211.1
20240306 163640 worker: Wlan: pri DNS 75.75.75.75
20240306 163640 worker: Wlan: domain  hsd1.pa.comcast.net
20240306 163640 worker: --
20240306 163640 worker: -- Software update
20240306 163640 worker: --
20240306 163640 worker: Automatic check off
20240306 163640 worker: --
20240306 163640 worker: -- File sharing
20240306 163640 worker: --
20240306 163640 worker: SMB file sharing:  off
20240306 163640 worker: NFS file sharing:  off
20240306 163640 worker: DLNA file sharing: off
20240306 163640 worker: --
20240306 163640 worker: -- Audio config
20240306 163640 worker: --
20240306 163640 worker: MPD config:    updated
20240306 163640 worker: Audio device:  ProtoDAC TDA1387 X8
20240306 163640 worker: Formats:       S16_LE, S24_LE
20240306 163640 worker: Mixer type     Software
20240306 163640 worker: Mixer name     none exists
20240306 163641 worker: Hdwr volume:   controller not detected
20240306 163641 worker: ALSA card:     0
20240306 163641 worker: ALSA mode:     Direct
20240306 163641 worker: ALSA loopback: off
20240306 163641 worker: CamillaDSP:    off
20240306 163641 worker: Renderers:     active flags reset
20240306 163641 worker: --
20240306 163641 worker: -- MPD startup
20240306 163641 worker: --
20240306 163641 worker: MPD service:        started
20240306 163641 worker: MPD port 6600:      accepting connections
20240306 163641 worker: MPD ALSA Default:   on
20240306 163641 worker: MPD ALSA Bluetooth: off
20240306 163641 worker: MPD HTTP Server:    off
20240306 163641 worker: MPD crossfade:      off
20240306 163641 worker: MPD ignore CUE:     yes
20240306 163641 worker: MPD CDSP volsync:   off
20240306 163641 worker: MPD CDSP volrange:  60 dB
20240306 163641 worker: --
20240306 163641 worker: -- Music sources
20240306 163641 worker: --
20240306 163641 worker: USB auto-mount: udisks-glue
20240306 163641 worker: USB drive:      128GB
20240306 163641 worker: NAS source:     Wesley
20240306 163643 worker: NAS mount:      mount all submitted
20240306 163643 worker: --
20240306 163643 worker: -- Feature availability
20240306 163643 worker: --
20240306 163643 worker: Input select:    available, src MPD, out ProtoDAC TDA1387 X8
20240306 163643 worker: Bluetooth:       available, ALSA mode Default
20240306 163643 worker: AirPlay:         available
20240306 163643 worker: Spotify Connect: started
20240306 163643 worker: Squeezelite:     available
20240306 163643 worker: RoonBridge:      not installed
20240306 163643 worker: Multiroom:       available
20240306 163643 worker: UPnP client:     available
20240306 163643 worker: GPIO buttons:    available
20240306 163643 worker: Stream recorder: n/a
20240306 163643 worker: HTTPS-Only mode: n/a
20240306 163643 worker: --
20240306 163643 worker: -- Volume levels
20240306 163643 worker: --
20240306 163643 worker: Volume knob:      24
20240306 163643 worker: Saved MPD volume: 0
20240306 163643 worker: Saved SRC volume: 0
20240306 163643 worker: Hdwr volume:      controller not detected
20240306 163643 worker: --
20240306 163643 worker: -- Peripherals
20240306 163643 worker: --
20240306 163643 worker: Local display:   off
20240306 163643 worker: On-screen kbd:   off
20240306 163643 worker: Rotary encoder:  off
20240306 163643 worker: USB volume knob: off
20240306 163643 worker: LCD updater:     off
20240306 163643 worker: --
20240306 163643 worker: -- Miscellaneous
20240306 163643 worker: --
20240306 163643 worker: Auto-CoverView:    off
20240306 163643 worker: CoverView timeout: Never
20240306 163643 worker: Auto-shuffle:      off
20240306 163643 worker: Auto-play:         off
20240306 163643 worker: Web SSH server:    off
20240306 163643 worker: Maintenance task:  360 mins
20240306 163643 worker: Current view:      reset to Playback
20240306 163643 worker: Session check:     ok
20240306 163643 worker: --
20240306 163643 worker: -- Startup complete
20240306 163643 worker: --
20240306 163643 worker: Mount monitor:    off
20240306 163644 worker: MPD monitor:      off
20240306 163644 worker: Watchdog monitor: started
20240306 163644 worker: Responsiveness:   Default
20240306 163644 worker: Ready
Troubleshooting:
  1. I ran a constant ping from PC to rPi, monitored cpu, disk, network on the rPi (via nmon), and tailed /var/log/mpd/log
  2. I found that the ping timed out while the xrun error occurred, and nmon was unresponsive at the same time - both were intermittently working, in sync with the music playing. Same for the moOde UI. [There was a xrun/radio thread where Tim mentioned mpd port 6600 was unresponsive during xrun errors, could it be all ports?]
  3. I copied the problem flac files onto a USB thumbdrive and they played flawlessly when inserted into the rPi.
  4. This didn't look like a moOde problem at all. A tip from a KODI forum led me to look at the mount for the Samba share and the rsize and bsize parameters
Solution:
  • I increased the Rsize parameter (via moOde UI) from 61440 to 262144 (256k). Things maybe a bit better; less skipping.
  • I added a bsize=4194304 (it defaulted to 1048576, 1MB previously) argument into the mount options of the UI. This has, so far, eliminated xrun errors.
  • I don't know if it's a combination of the 2 changes, or just the bsize change that is key. It's working and I have to make dinner now.
I hope this helps someone,
Mike
Reply


Forum Jump: