Signal dissapears in spdif

Need help with MPD?
Post Reply
kdeenkhoorn
Posts: 4
Joined: May 28th, 2019, 8:53 am

Signal dissapears in spdif

Post by kdeenkhoorn » June 6th, 2019, 10:21 pm

All,

I have a NanoPi Neo Plus 2 board with armbian installed.
I've compiled the latest release from mpd on debian stretch.
I have connected my board to my receiver (cinch) and with intervals i'm losing signal on my receiver and the sound silences.
After several tries with nice values and ionice values i'm lost. Why is the signal interrupted. How can i see what is happening ?

The song continues where is was left after a fraction of a second absence.
Syslog mentions nothing, demesg is empty and mpd doe mention nothing specific.

Who can help?

Klaas Eenkhoorn

max
Forum team
Posts: 912
Joined: January 15th, 2013, 3:43 pm

Re: Signal dissapears in spdif

Post by max » June 7th, 2019, 4:53 pm

What makes you believe this is a software issue?

kdeenkhoorn
Posts: 4
Joined: May 28th, 2019, 8:53 am

Re: Signal dissapears in spdif

Post by kdeenkhoorn » June 9th, 2019, 1:51 pm

Max,
Why a software issue, in fact i don't know this for sure.
I have no idea where to start searching for a solution, that is my bigger problem at the moment.
How can i exclude the fact that it is not an software issue ?? Increasing logging doesn’t help so far.
Where can i get more info about the current state of mpd, if it runs fine and i have no buffer underun problems ...
I have no idea how to find out. Can you help me how to get this insight ?
I have tried several things with increasing priority but nothing seems to work. Increasing Nice value seems to help but still the sound gets interrupted from time to time.

A bit more info about my setup:
My board is an nanopi neo plus2 with an Allwinner's 64-bit quad-core A53 SoC with hexa-core Mali450 GPU and 1GB of DDR3 RAM and 8GB eMMC.

/etc/asound.conf does not exist and i ave no idear what should be in there ...

Code: Select all

aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Codec [H3 Audio Codec], device 0: CDC PCM Codec-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: SPDIF [On-board SPDIF], device 0: spdif-dit-hifi dit-hifi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Code: Select all

./mpd --version
Music Player Daemon 0.21.9 (0.21.9)
Copyright 2003-2007 Warren Dukes <warren.dukes@gmail.com>
Copyright 2008-2018 Max Kellermann <max.kellermann@gmail.com>
This is free software; see the source for copying conditions.  There is NO
warranty; not even MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Database plugins:
 simple proxy upnp

Storage plugins:
 local smbclient udisks nfs curl

Neighbor plugins:
 smbclient upnp udisks

Decoders plugins:
 [mad] mp3 mp2
 [mpg123] mp3
 [vorbis] ogg oga
 [oggflac] ogg oga
 [flac] flac
 [opus] opus ogg oga
 [sndfile] wav aiff aif au snd paf iff svx sf voc w64 pvf xi htk caf sd2
 [audiofile] wav au aiff aif
 [dsdiff] dff
 [dsf] dsf
 [hybrid_dsd] m4a
 [faad] aac
 [mpcdec] mpc
 [wavpack] wv
 [modplug] 669 amf ams dbm dfm dsm far it med mdl mod mtm mt2 okt s3m stm ult umx xm
 [mikmod] amf dsm far gdm imf it med mod mtm s3m stm stx ult uni xm
 [sidplay] sid mus str prg P00
 [wildmidi] mid
 [fluidsynth] mid
 [adplug] amd d00 hsc laa rad raw sa2
 [ffmpeg] 16sv 3g2 3gp 4xm 8svx aa3 aac ac3 adx afc aif aifc aiff al alaw amr anim apc ape asf atrac au aud avi avm2 avs bap bfi c93 cak cin cmv cpk daud dct divx dts dv dvd dxa eac3 film flac flc fli fll flx flv g726 gsm gxf iss m1v m2v m2t m2ts m4a m4b m4v mad mj2 mjpeg mjpg mka mkv mlp mm mmf mov mp+ mp1 mp2 mp3 mp4 mpc mpeg mpg mpga mpp mpu mve mvi mxf nc nsv nut nuv oga ogm ogv ogx oma ogg omg opus psp pva qcp qt r3d ra ram rl2 rm rmvb roq rpl rvc shn smk snd sol son spx str swf tak tgi tgq tgv thp ts tsp tta xa xvid uv uv2 vb vid vob voc vp6 vmd wav webm wma wmv wsaud wsvga wv wve
 [gme] ay gbs gym hes kss nsf nsfe sap spc vgm vgz
 [pcm]

Filters:
 libsamplerate soxr

Tag plugins:
 id3tag

Output plugins:
 shout null fifo sndio pipe alsa ao openal pulse jack httpd recorder

Encoder plugins:
 null vorbis opus lame twolame wave flac shine

Archive plugins:
 [bz2] bz2
 [zzip] zip
 [iso] iso

Input plugins:
 file archive alsa tidal qobuz curl ffmpeg smbclient nfs mms cdio_paranoia

Playlist plugins:
 extm3u m3u pls xspf asx rss soundcloud flac cue embcue

Protocols:
 file:// alsa:// tidal:// qobuz:// http:// https:// gopher:// rtp:// rtsp:// rtmp:// rtmpt:// rtmps:// smb:// nfs:// mms:// mmsh:// mmst:// mmsu:// cdda://

Other features:
 avahi dbus udisks epoll icu inotify ipv6 systemd tcp un

Code: Select all

more /etc/mpd.conf 
# Volumio MPD Configuration File

# Files and directories #######################################################
music_directory			"/var/lib/mpd/music"
playlist_directory		"/var/lib/mpd/playlists"
db_file				"/var/lib/mpd/tag_cache"
log_file			"/var/log/mpd/mpd.log"
pid_file			"/var/lib/mpd/run/pid"
state_file			"/var/lib/mpd/state"
#sticker_file                   "/var/lib/mpd/sticker.sql"
###############################################################################

# General music daemon options ################################################
user				"mpd"
group				"audio"
bind_to_address			"any"
#port				"6600"
log_level			"verbose"
#gapless_mp3_playback		"yes"
#save_absolute_paths_in_playlists	"no"
metadata_to_use			"artist,album,title,track,name,genre,date,composer,performe
r,disc"
auto_update			"yes"
#auto_update_depth		"3"
###############################################################################
# Symbolic link behavior ######################################################
follow_outside_symlinks		"yes"
follow_inside_symlinks		"yes"
###############################################################################
# Input #######################################################################
#
input {
        plugin "curl"
#       proxy "proxy.isp.com:8080"
#       proxy_user "user"
#       proxy_password "password"
}
###############################################################################

# Decoder ################################################################


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

# Audio Output ################################################################
audio_output {
	type		"alsa"
	name		"SPDIF"
	device		"hw:SPDIF,0"
	mixer_device	"none"
        always_on	"yes"
        format		"44100:16:2"
#       period_size	"4410"
#	buffer_size	"22050"
}

#audio_output {
#	type            "fifo"
#	enabled         "no"
#	name            "multiroom"
#	path            "/tmp/snapfifo" 
#	format          "44100:16:2"
#} 

samplerate_converter		"soxr very high"
#replaygain			"album"
#replaygain_preamp		"0"
#volume_normalization		"yes"
###############################################################################

# MPD Internal Buffering ######################################################
audio_buffer_size		"8192"
buffer_before_play		"30%"

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


# Resource Limitations ########################################################
connection_timeout		"120"
max_connections			"20"
#max_playlist_length		"16384"
#max_command_list_size		"2048"
max_output_buffer_size		"8192"
###############################################################################

# Character Encoding ##########################################################
filesystem_charset		"UTF-8"
id3v1_encoding			"UTF-8"
###############################################################################

Code: Select all

more ./local/lib/systemd/system/mpd.service
[Unit]
Description=Music Player Daemon
Documentation=man:mpd(1) man:mpd.conf(5)
After=network.target sound.target

[Service]
Type=notify
ExecStart=/usr/local/bin/mpd /etc/mpd.conf --no-daemon

# Enable this setting to ask systemd to watch over MPD, see
# systemd.service(5).  This is disabled by default because it causes
# periodic wakeups which are unnecessary if MPD is not playing.
#WatchdogSec=120

# allow MPD to use real-time priority 50
Nice=20
LimitRTPRIO=90
LimitRTTIME=infinity
IOSchedulingClass=realtime
IOSchedulingPriority=7

# move MPD to a top-level cgroup, as real-time budget assignment fails
# in cgroup /system/mpd.service, because /system has a zero real-time
# budget; see
# http://www.freedesktop.org/wiki/Software/systemd/MyServiceCantGetRealtime/
ControlGroup=cpu:/mpd

# assign a real-time budget
ControlGroupAttribute=cpu.rt_runtime_us 900000

# disallow writing to /usr, /bin, /sbin, ...
ProtectSystem=yes

# more paranoid security settings
NoNewPrivileges=yes
ProtectKernelTunables=yes
ProtectControlGroups=yes
ProtectKernelModules=yes
# AF_NETLINK is required by libsmbclient, or it will exit() .. *sigh*
RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX AF_NETLINK
RestrictNamespaces=yes

[Install]
WantedBy=multi-user.target
Also=mpd.socket

Code: Select all

uname -a                                   
Linux nanopineoplus2 4.19.38-sunxi64 #5.86 SMP Sun May 12 18:16:25 CEST 2019 aarch64 GNU/Linux

Code: Select all

more /boot/armbianEnv.txt 
verbosity=1
console=serial
overlay_prefix=sun50i-h5
overlays=usbhost1 usbhost2 spdif-out
rootdev=UUID=61146dc0-fa23-4537-b162-736772804a8e
rootfstype=ext4
usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u
Logging: Within one minute 3 sound interruptions.

Code: Select all

Jun 09 15:19 : decoder_thread: probing plugin flac
Jun 09 15:19 : decoder: audio_format=44100:16:2, seekable=true
Jun 09 15:20 : player: played "Morgen/Urker_MANS_Formatie-Morgen/15.Leningrad.flac"
Jun 09 15:20 : playlist: queue song 16:"Morgen/Urker_MANS_Formatie-Morgen/17.Edelweiss.flac"
Jun 09 15:20 : state_file: Saving state file /var/lib/mpd/state
Jun 09 15:23 : decoder_thread: probing plugin flac
Jun 09 15:23 : decoder: audio_format=44100:16:2, seekable=true
Jun 09 15:24 : player: played "Morgen/Urker_MANS_Formatie-Morgen/16.Nooit_meer_een_morgen.flac"
Jun 09 15:24 : playlist: queue song 17:"Morgen/Urker_MANS_Formatie-Morgen/18.Mama.flac"
Jun 09 15:24 : state_file: Saving state file /var/lib/mpd/state
Jun 09 15:26 : decoder_thread: probing plugin flac
Jun 09 15:26 : decoder: audio_format=44100:16:2, seekable=true
Jun 09 15:27 : player: played "Morgen/Urker_MANS_Formatie-Morgen/17.Edelweiss.flac"
Jun 09 15:27 : playlist: queue song 18:"Morgen/Urker_MANS_Formatie-Morgen/19.Nella_Fantasia.flac"
Jun 09 15:27 : state_file: Saving state file /var/lib/mpd/state
Jun 09 15:29 : decoder_thread: probing plugin flac
Jun 09 15:29 : decoder: audio_format=44100:16:2, seekable=true
Jun 09 15:30 : player: played "Morgen/Urker_MANS_Formatie-Morgen/18.Mama.flac"
Jun 09 15:30 : playlist: queue song 19:"Morgen/Urker_MANS_Formatie-Morgen/20.Kalinka.flac"
Jun 09 15:30 : state_file: Saving state file /var/lib/mpd/state
Jun 09 15:34 : decoder_thread: probing plugin flac
Jun 09 15:34 : decoder: audio_format=44100:16:2, seekable=true
Jun 09 15:35 : player: played "Morgen/Urker_MANS_Formatie-Morgen/19.Nella_Fantasia.flac"
Jun 09 15:35 : state_file: Saving state file /var/lib/mpd/state
Jun 09 15:38 : player: played "Morgen/Urker_MANS_Formatie-Morgen/20.Kalinka.flac"
Jun 09 15:38 : playlist: stop
Jun 09 15:38 : output: closed "SPDIF" (alsa)
Jun 09 15:38 : state_file: Saving state file /var/lib/mpd/state
Jun 09 15:56 : state_file: Saving state file /var/lib/mpd/state
Jun 09 15:56 : avahi: Shutting down interface
Jun 09 15:56 : avahi: Initializing interface
Jun 09 15:56 : avahi: Client changed to state 2
Jun 09 15:56 : avahi: Client is RUNNING
Jun 09 15:56 : avahi: Registering service _mpd._tcp/Music Player @ nanopineoplus2
Jun 09 15:56 : avahi: Service group changed to state 0
Jun 09 15:56 : avahi: Service group is UNCOMMITED
Jun 09 15:56 : state_file: Loading state file /var/lib/mpd/state
Jun 09 15:56 : inotify: initializing inotify
Jun 09 15:56 : inotify: watching music directory
Jun 09 15:56 : avahi: Service group changed to state 1
Jun 09 15:56 : avahi: Service group is REGISTERING
Jun 09 15:56 : avahi: Service group changed to state 2
Jun 09 15:56 : avahi: Service 'Music Player @ nanopineoplus2' successfully established.

max
Forum team
Posts: 912
Joined: January 15th, 2013, 3:43 pm

Re: Signal dissapears in spdif

Post by max » June 11th, 2019, 7:14 am

Define "losing signal".

Post Reply