[PROBLEM] moOde does not appear to notice when ashuffle fails to start - Printable Version +- Moode Forum (https://moodeaudio.org/forum) +-- Forum: moOde audio player (https://moodeaudio.org/forum/forumdisplay.php?fid=3) +--- Forum: Support (https://moodeaudio.org/forum/forumdisplay.php?fid=7) +--- Thread: [PROBLEM] moOde does not appear to notice when ashuffle fails to start (/showthread.php?tid=3847) |
moOde does not appear to notice when ashuffle fails to start - cricalix - 05-23-2021 In http://moodeaudio.org/forum/showthread.php?tid=3845 I was hitting issues with shuffle not working. Then I got it working briefly while rebuilding the mpd database. Now the rebuild has finished, ashuffle doesn't work any more. ashuffle is exiting with status code 1 set in the shell, and "MPD error: Response line too large" in the output. That line ties to https://github.com/joshkunz/ashuffle/issues/89. I've checked with the various shell commands, and the longest data line from my library is 1500 bytes or so, but I could see a case where multiple of these ended up in the buffer (I've not read libmpdclient's code to be sure), and caused an overflow. Unfortunately, the moOde UI (and debug logs) give no indication that ashuffle failed to start up when shuffle mode is selected. Wasn't sure whether to post this here or on the github issues for the project. RE: moOde does not appear to notice when ashuffle fails to start - cricalix - 05-23-2021 As a thought for the whole startup and being able to get the status - ashuffle ships with a default systemd config that can be used as a system level config instead of a user level config (https://github.com/joshkunz/ashuffle/pull/75/files). I've done a quick test that proves that this systemd config works. Putting in the filters etc via the override.conf feature of systemd should hypothetically work; the override just rewrites the ExecStart with all the additional bits. Once the service is started, the status can be checked easily enough with systemctl status ashuffle.service or systemctl is-active ashuffle.service, and on failure (which could then potentially be passed to the web ui?), the status looks like: Code: ● ashuffle.service - Shuffle service for mpd RE: moOde does not appear to notice when ashuffle fails to start - Tim Curtis - 05-23-2021 (05-23-2021, 07:42 PM)cricalix Wrote: In http://moodeaudio.org/forum/showthread.php?tid=3845 I was hitting issues with shuffle not working. Ashuffle runs independently of MPD in the background. It's similar to the audio renderers for example Shairport-sync, librespot, squeezelite, etc., which are all independent of MPD and run in the background. This makes it a challenge to monitor them and trap/report errors. It could prolly be done by adding some code to /var/www/command/watchdog.sh that checks to see if ashuffle was activated and then checks to see if the ashuffle process is running. If its not running then write "Ashuffle activated but not running" to the Moode startup log. Something like that. I think if there were many reports of ashuffle failing it would prolly be justified to add the code to watchdog.sh but generally ashuffle works. It's just the rare situation of a track having > 4K amount of metadata that causes it to bomb. RE: moOde does not appear to notice when ashuffle fails to start - Tim Curtis - 05-23-2021 (05-23-2021, 08:03 PM)cricalix Wrote: As a thought for the whole startup and being able to get the status - ashuffle ships with a default systemd config that can be used as a system level config instead of a user level config (https://github.com/joshkunz/ashuffle/pull/75/files). Currently it's started/stopped via some functions in /var/www/inc/playerlib.php Code: // Auto-shuffle random play RE: moOde does not appear to notice when ashuffle fails to start - cricalix - 05-23-2021 (05-23-2021, 09:02 PM)Tim Curtis Wrote: Ashuffle runs independently of MPD in the background. It's similar to the audio renderers for example Shairport-sync, librespot, squeezelite, etc., which are all independent of MPD and run in the background. This makes it a challenge to monitor them and trap/report errors. Yeah, I'm really not sure it's a single 4k metadata that's causing it in my case; I can't find tracks with any single tag having > 4096 bytes of data, but perhaps there's some with > 4096 across all tags on the file and libmpdclient is trying to fit all of that in the buffer. I have found that calling ashuffle with -n causes it to not do a validation check against mpd, so I can sort of work around this with a search for filename NAS in the autoshuffle configuration, which startAutoShuffle() should then use as a mpc search filter to pass to ashuffle (and I can manually customise that startup command to have -n as well as --queue-buffer 1). Bit of a hack, but at least posting it here means that someone else who hits this has a chance of trying a hacky fix. I grok that ashuffle is being spun off in the background - I've dug through playerlib.php to see how ashuffle was being started and noted the backgrounding. The idea of sticking it in systemd is you then get systemd to manage it in the background, and then all of the status/info/is-active commands become available for simple checking. |