MPD icon indicating copy to clipboard operation
MPD copied to clipboard

Daemon mode does not work with MacOS

Open laiti opened this issue 2 years ago • 3 comments

Bug report

Describe the bug

Daemon mode does not work with MacOS. Starting mpd without --no-daemon makes it quit immediately without any error messages.

Expected Behavior

Starting mpd without --no-daemon should make it run in background.

Actual Behavior

Starting mpd without --no-daemon makes mpd shut down immediately without any errors in stderr or logs even when --verbose is set. There is no mpd in the process list.

Version

$ uname -a Darwin nark 23.1.0 Darwin Kernel Version 23.1.0: Mon Oct 9 21:27:24 PDT 2023; root:xnu-10002.41.9~6/RELEASE_ARM64_T6000 arm64

MacOS version is Sonoma 14.1.

$ mpd --version Music Player Daemon 0.23.14 (0.23.14) Copyright 2003-2007 Warren Dukes [email protected] Copyright 2008-2021 Max Kellermann [email protected] 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: [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 [dsdiff] dff [dsf] dsf [hybrid_dsd] m4a [faad] aac [wavpack] wv [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 snapcast 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:// rtmps:// rtmpt:// rtmpts:// rtp:// rtsp:// rtsps:// smb:// srtp://

Other features: icu ipv6 tcp un

Configuration

music_directory "/Users/laiti/Music"

playlist_directory "/Users/laiti/.local/var/mpd/playlists" db_file "/Users/laiti/.local/var/mpd/tag_cache" state_file "/Users/laiti/.local/var/mpd/state" sticker_file "/Users/laiti/.local/var/mpd/sticker.sql"

log_file "/Users/laiti/.local/log/mpd/mpd.log" pid_file "/Users/laiti/.local/run/mpd.pid"

user "laiti" bind_to_address "localhost:64031" port "64031"

password "PASS_REMOVED@read" password "PASS2_REMOVED@read,add,control" password "PASS3_REMOVED@read,add,control,admin"

filesystem_charset "UTF-8"

audio_output { type "osx" name "CoreAudio" mixer_type "software" }

decoder { plugin "mp4ff" enabled "no" }

Log

$ mpd --stderr --verbose .config/mpd/nark config_file: loading file .config/mpd/nark libsamplerate: libsamplerate converter 'Fastest Sinc Interpolator' vorbis: Xiph.Org libVorbis 1.3.7 opus: libopus 1.4 sndfile: libsndfile-1.2.2 hybrid_dsd: The Hybrid DSD decoder is disabled because it was not explicitly enabled simple_db: reading DB curl: version 8.1.2 curl: with (SecureTransport) LibreSSL/3.3.6 state_file: Loading state file /Users/laiti/.local/var/mpd/state decoder_thread: probing plugin flac playlist: queue song 35:"flac_albums/laineen_kasperi/2015_laineen_kasperi_ja_palava_kaupunki/07_-_sopeutumaton.flac" decoder: audio_format=44100:16:2, seekable=true

$ ps aux|grep mpd laiti 915 1,0 0,0 408626896 1408 s005 S+ 8:14am 0:00.00 grep mpd

in ~/.local/log/mpd/mpd.log: nothing.

Trace

$ brew install gdb gdb: The x86_64 architecture is required for this software. Error: gdb: An unsatisfied requirement failed this build.

Also, the backtrace guide tells to use --no-daemon but the bug is not reproducible with that option set.

laiti avatar Nov 16 '23 06:11 laiti

Sorry, I don't know anything about macOS, so I can't really help with this problem, because I wouldn't even know how to start analyzing this. On Linux, I'd strace it to see where it exits, but I don't know if such a tool even exists on macOS (and how to read its output).

MaxKellermann avatar Nov 16 '23 08:11 MaxKellermann

Same here, not that much of a knowledge on debugging this kind of things with MacOS. If I understood correctly, debugging with these ARM machines could be done with LLDB. I'll look into that at some point.

laiti avatar Nov 25 '23 08:11 laiti

I can confirm the same symptoms on x86. Crashes if run in daemon mode following an invocation of mpc play The best I can say is it appears to crash just before it opens the output device since that is the next thing printed in non-daemon mode. I tried some dtruss and ktrace command lines I found online but those only print during the initial invocation of the mpd command.

lordpixel23 avatar Jan 31 '24 03:01 lordpixel23

Due to lack of volunteers, the MPD project no longer supports macOS.

MaxKellermann avatar May 06 '24 11:05 MaxKellermann

As a stopgap, mpd --no-daemon & disown should work. I think most Mac users probably install MPD with Homebrew, which uses a launchd service that does not rely on self-daemonization.

spnw avatar May 15 '24 16:05 spnw