danbee / persephone

macOS MPD client written in Swift.
https://persephone.fm
MIT License
215 stars 18 forks source link

Bug: v0.17.3-alpha times out when connecting to MPD v0.22.3 on macOS v11.0.1 #79

Closed odkr closed 3 years ago

odkr commented 3 years ago

Hey! I’ve just come up with a rather odd setup. I have a NAS that that acts as an MPD satellite (running MPD v0.20.15 and serving files via NFS on an old Synology box) for an MPD v0.22.3 that runs on localhost under macOS v11.0.1. The NAS is accessed via a VPN over a slow-ish DSL connection. Generally speaking, that setup works surprisingly well. However, Persephone won’t connect to the MPD running on localhost; it simply times out.

Curiously, however, the daemon reports a connection:

% mpd --no-daemon --stderr -v
config_file: loading file /Users/odin/.mpd/mpd.conf
libsamplerate: libsamplerate converter 'Fastest Sinc Interpolator'
vorbis: Xiph.Org libVorbis 1.3.7
opus: libopus 1.3.1
sndfile: libsndfile-1.0.30
hybrid_dsd: The Hybrid DSD decoder is disabled because it was not explicitly enabled
curl: version 7.64.1
curl: with (SecureTransport) LibreSSL/2.8.3
client: [0] opened from [::1]:56933
client: [0] process command "status"
client: [0] command returned 0
client: [0] process command "playlistinfo"
client: [0] command returned 0
client: [0] process command "search Track "1""
client: [0] command returned 0
client: [0] closed

Cantata and mpc also have no problems connecting to the MPD instance on localhost.

System information

mpd -V

Music Player Daemon 0.22.3 (0.22.3)
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 nfs curl

Neighbor plugins:
 upnp

Decoders plugins:
 [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
 [dsdiff] dff
 [dsf] dsf
 [hybrid_dsd] m4a
 [faad] aac
 [fluidsynth] mid
 [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 rtp:// rtsp:// rtsps://
 [pcm]

Filters:
 libsamplerate soxr

Tag plugins:
 id3tag

Output plugins:
 shout null fifo pipe ao openal osx httpd recorder

Encoder plugins:
 null vorbis opus lame wave flac

Archive plugins:
 [bz2] bz2

Input plugins:
 file archive curl ffmpeg nfs

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

Protocols:
 file:// ftp:// ftps:// gopher:// hls+http:// hls+https:// http:// https:// mmsh:// mmst:// nfs:// rtmp:// rtmpe:// rtmps:// rtmpt:// rtmpte:// rtp:// rtsp:// rtsps:// smb:// srtp://

Other features:
 icu ipv6 tcp un

grep -vE '^(#|$)' ~/.mpd/mpd.conf

music_directory "nfs://192.168.77.1/volume1/music/files"
bind_to_address     "localhost"
port                "6600"
input_cache {
    size "256 MB"
}
database {
    plugin "proxy"
    host "192.168.77.1"
}
audio_output {
    type        "osx"
    name        "MacBook Air"
}
volume_normalization        "yes"

As always, thanks a lot for looking into this!

odkr commented 3 years ago

Oh, the access via NFS is read-only, in case that makes a difference.

odkr commented 3 years ago

One more observation, now, don't ask me why, Persephone does connect to localhost. But it crashes after about one to five seconds (it varies). Also it only displays the current playlist, but no albums. By contrast, when I connect to my Raspi over the VPN, everything works. I'm under the impression that it's loading the cover grid that crashes it. Cantata doesn't display cover images either. (Though I’m not sure it does that at any rate.)

danbee commented 3 years ago

@odkr Sorry for the delay in answering this. I suspect this has something to do with loading the cover art as the MPD protocol loads the files in 8k chunks and this can cause a lot of requests over the network for the files. I've had an MPD server hooked up to a library over HTTP and I've run into similar issues.

odkr commented 3 years ago

Hmm, that makes sense. So, I’ll just have to accept that my setup is way too quirky ;-). And no worries about slow replies!