Closed ian-s-mcb closed 3 years ago
See https://github.com/MusicPlayerDaemon/MPD/commit/27cc7b352d54b013e04c6e2b66b7ff0ab6e6bfb8
The default is 2 minutes, try adding this to your conf
state_file_interval "1"
@leigh123linux good point, but MPD should save the state file on proper shutdown.
@ian-s-mcb why do you believe this is related to io_uring? Your log is incomplete, it doesn't show a restart of MPD.
@MaxKellermann
It doesn't here if I update the package which runs this scriplet to restart mpd
https://pkgs.rpmfusion.org/cgit/free/mpd.git/tree/mpd.spec#n210
It doesn't here if I update the package which runs this scriplet to restart mpd
So that's the problem, I guess, and this has nothing to do with io_uring at all.
@MaxKellermann Below is a log that included a restart of MPD.
@leigh123linux Adding state_file_interval "1"
to my mpd.conf fixed the state issue.
The io_uring error is still being thrown. Should I ignore it?
$ mpd --stderr --no-daemon --verbose
config_file: loading file /home/ian/.config/mpd/mpd.conf
exception: bind to '0.0.0.0:6600' failed (continuing anyway, because binding to '[::]:6600' succeeded): Failed to bind socket: Address already in use
path: SetFSCharset: fs charset is:
libsamplerate: libsamplerate converter 'Fastest Sinc Interpolator'
vorbis: Xiph.Org libVorbis 1.3.7
opus: libopus 1.3.1
sndfile: libsndfile-1.0.28
hybrid_dsd: The Hybrid DSD decoder is disabled because it was not explicitly enabled
exception: Decoder plugin 'wildmidi' is unavailable: configuration file does not exist: /etc/timidity/timidity.cfg
simple_db: reading DB
Failed to initialize io_uring: io_uring_queue_init() failed: Cannot allocate memory
exception: Input plugin 'tidal' is not configured: No Tidal application token configured
exception: Input plugin 'qobuz' is not configured: No Qobuz app_id configured
curl: version 7.73.0
curl: with OpenSSL/1.1.1h
avahi: Initializing interface
exception: RTIOThread could not get realtime scheduling, continuing anyway: sched_setscheduler failed: Operation not permitted
avahi: Client changed to state 101
avahi: Client is CONNECTING
state_file: Loading state file /home/ian/.config/mpd/state
inotify: initializing inotify
inotify: watching music directory
client: [0] opened from [::1]:60416
client: [0] process command "status"
client: [0] command returned 0
client: [0] process command "plchanges "0""
client: [0] command returned 0
client: [0] process command "outputs"
client: [0] command returned 0
client: [0] process command "decoders"
client: [0] command returned 0
client: [0] process command "outputs"
client: [0] command returned 0
client: [0] process command "outputs"
client: [0] command returned 0
client: [0] process command "idle"
client: [0] command returned 1
client: [0] process command "list Artist"
client: [0] command returned 0
client: [0] process command "find Artist "[unknown]""
client: [0] command returned 0
client: [0] process command "find Artist "[unknown]" Album "20 Years of Dischord" Date "2002-10-15""
client: [0] command returned 0
client: [0] process command "idle"
client: [0] command returned 1
client: [0] process command "find Artist "Air""
client: [0] command returned 0
client: [0] process command "find Artist "Air" Album "Playground Love" Date "2000-01-17""
client: [0] command returned 0
client: [0] process command "idle"
client: [0] command returned 1
client: [0] process command "find Artist "Air""
client: [0] command returned 0
client: [0] process command "addid "music-full/Air/2000 - Playground Love/03 Playground Love (Vibraphone version).mp3""
client: [0] command returned 0
client: [0] process command "addid "music-full/Air/2007 - Pocket Symphony/01 Space Maker.mp3""
client: [0] command returned 0
client: [0] process command "addid "music-full/Air/2007 - Pocket Symphony/02 Once Upon a Time.mp3""
client: [0] command returned 0
client: [0] process command "addid "music-full/Air/2007 - Pocket Symphony/03 One Hell of a Party.mp3""
client: [0] command returned 0
client: [0] process command "addid "music-full/Air/2007 - Pocket Symphony/04 Napalm Love.mp3""
client: [0] command returned 0
client: [0] process command "addid "music-full/Air/2007 - Pocket Symphony/05 Mayfair Song.mp3""
client: [0] command returned 0
client: [0] process command "addid "music-full/Air/2007 - Pocket Symphony/06 Left Bank.mp3""
client: [0] command returned 0
client: [0] process command "addid "music-full/Air/2007 - Pocket Symphony/07 Photograph.mp3""
client: [0] command returned 0
client: [0] process command "addid "music-full/Air/2007 - Pocket Symphony/08 Mer du Japon.mp3""
client: [0] command returned 0
client: [0] process command "addid "music-full/Air/2007 - Pocket Symphony/09 Lost Message.mp3""
client: [0] command returned 0
client: [0] process command "addid "music-full/Air/2007 - Pocket Symphony/10 Somewhere Between Waking and Sleeping.mp3""
client: [0] command returned 0
client: [0] process command "addid "music-full/Air/2007 - Pocket Symphony/11 Redhead Girl.mp3""
client: [0] command returned 0
client: [0] process command "addid "music-full/Air/2007 - Pocket Symphony/12 Night Sight.mp3""
client: [0] command returned 0
client: [0] process command "idle"
client: [0] command returned 1
client: [0] process command "status"
client: [0] command returned 0
client: [0] process command "plchanges "1""
client: [0] command returned 0
client: [0] process command "idle"
client: [0] command returned 1
client: [0] process command "find Artist "Airhead""
client: [0] command returned 0
client: [0] process command "find Artist "Airhead" Album "LateNightTales: Bonobo" Date "2013-11-18""
client: [0] command returned 0
client: [0] process command "idle"
client: [0] command returned 1
^Cavahi: Shutting down interface
mpd: ../src/event/Loop.cxx:70: EventLoop::~EventLoop(): Assertion `sockets.empty()' failed.
Aborted (core dumped)
$ mpd --stderr --no-daemon --verbose
config_file: loading file /home/ian/.config/mpd/mpd.conf
exception: bind to '0.0.0.0:6600' failed (continuing anyway, because binding to '[::]:6600' succeeded): Failed to bind socket: Address already in use
path: SetFSCharset: fs charset is:
libsamplerate: libsamplerate converter 'Fastest Sinc Interpolator'
vorbis: Xiph.Org libVorbis 1.3.7
opus: libopus 1.3.1
sndfile: libsndfile-1.0.28
hybrid_dsd: The Hybrid DSD decoder is disabled because it was not explicitly enabled
exception: Decoder plugin 'wildmidi' is unavailable: configuration file does not exist: /etc/timidity/timidity.cfg
simple_db: reading DB
Failed to initialize io_uring: io_uring_queue_init() failed: Cannot allocate memory
exception: Input plugin 'tidal' is not configured: No Tidal application token configured
exception: Input plugin 'qobuz' is not configured: No Qobuz app_id configured
curl: version 7.73.0
curl: with OpenSSL/1.1.1h
avahi: Initializing interface
exception: RTIOThread could not get realtime scheduling, continuing anyway: sched_setscheduler failed: Operation not permitted
avahi: Client changed to state 101
avahi: Client is CONNECTING
state_file: Loading state file /home/ian/.config/mpd/state
inotify: initializing inotify
inotify: watching music directory
client: [0] opened from [::1]:60446
client: [0] process command "status"
client: [0] command returned 0
client: [0] process command "plchanges "0""
client: [0] command returned 0
client: [0] process command "outputs"
client: [0] command returned 0
client: [0] process command "decoders"
client: [0] command returned 0
client: [0] process command "outputs"
client: [0] command returned 0
client: [0] process command "outputs"
client: [0] command returned 0
client: [0] process command "idle"
client: [0] command returned 1
Of course MPD can't write the state file on shutdown. It crashes before it gets a chance to do that! Duplicate of https://github.com/MusicPlayerDaemon/MPD/issues/986 About the io_uring error see https://www.musicpd.org/doc/html/user.html#error-failed-to-initialize-io-uring
I don't understand why you marked this as a duplicate of #986 .
I noticed the MPD crash, but only on when I installed MPD from source in order to get an unstripped binary:
$ mpd --version Music Player Daemon 0.23~git (v0.22.1-67-gad585e179+)
When I installed MPD from the Arch Linux package, the service shuts down without an error:
$ mpd --version Music Player Daemon 0.22.1 (0.22.1)
Bug report
Describe the bug
After updating version 0.22, MPD stopped retaining the state (playlist items, current track, etc) between service restarts or OS reboots. When starting the service, the service logs the following memory allocation error, which may be the root cause.
Failed to initialize io_uring: io_uring_queue_init() failed: Cannot allocate memory
This issue is similar to, if not the same as, issues #972 and #984, but the conversation in those bug report didn't lead to a solution for me.
Thank you for your time and advice.
Expected Behavior
MPD retains the state after service restarts using the
state
file.Actual Behavior
MPD doesn't retain the state. Although tracks were in the playlist before the service was restarted, the playlist shows up as empty.
Version
Log
mpd.conf
Other info