jcorporation / myMPD

myMPD is a standalone and mobile friendly web mpd client with a tiny footprint and advanced features.
https://jcorporation.github.io/myMPD/
GNU General Public License v3.0
418 stars 65 forks source link

General smart playlists issues on Dietpi #269

Closed thaihugo closed 4 years ago

thaihugo commented 4 years ago

Hello,

I have a set of issues with playlists on my Raspberry Pi 4 with Dietpi 6.30 Mpd 0.21.5 Mympd 6.4.0

I had some problems before, but disabled smart playlists as a workaround. Now I'm trying to use them but they have some unexpected behaviors.

  1. Selecting a playlist in a timer doesn't work in the web client. It always reverts to "Database" when exiting and coming back. Disabling smart playlists, restarting and coming back to the same point shows the correct selected playlist.

  2. Smart playlist other than Genre doesn't fill. They do exist in var directory as yaml definition, the Playlist folder has ownership to mpd user account. Mympd is running as mympd user. Mpd will parse them, but will not write in the playlist folder. The smart playlists autogenerated by genre will populate correctly in the same folder. The most played default playlist will not for example, as any playlist created from a search.

  3. when smart playlists are enables, mympd will hang and use mpd process over 50%. Log will show:


May 25 19:23:40 DietPi mympd[15585]: WARN     Jukebox queue didn't contain 2147483647 entries
May 25 19:23:40 DietPi mympd[15585]: ERROR    Error adding song(s)

I then have to kill mympd, use reset_state and disable smart playlist to come back to normal.

I'll provide a log for each issue in the next posts. For number 3, you already answered me that an empty genre smart playlist would be the cause, but I don't see how I can not get this smart playlist generated in the first place without finding and tagging bad songs.

Maybe this is specific to dietpi, I updated mympd by myself over the default dietpi install. Mympd user and mpd user are autogenerated, playlist folder is in dietpi_userdata/music/playlist to allow for correct user rights to mpd user account as my music folder is in a extfat drive.

Thanks for your help

thaihugo commented 4 years ago

Log files for 1. and 2. log.zip

For 3. , it mostly happen after a few hours, and it's the same than for issue https://github.com/jcorporation/myMPD/issues/239#issuecomment-599003408

I'll try to get a fresh log if you need it if it comes back after a few hours.

thaihugo commented 4 years ago

Log for 3. mympd2.zip

Need to do a reset config to restart. Also, if I disable smart playlists, issue 1. disappear and the selected playlist appears in the timer setting without any user interaction.

thaihugo commented 4 years ago

Other remarks:

Removing all smart playlists previously generated in the playlist folder seems to alleviate the problem. I'm now trying to find if one or some of them is faulty. This is not the one identified in https://github.com/jcorporation/myMPD/issues/239#issuecomment-599003408

I can post a zip of all of them if it helps

jcorporation commented 4 years ago

Thanks for all that info, a zip off your smartpls folder could help to reproduce your issue. Unfortunately, I haven't had the time yet.

thaihugo commented 4 years ago

Here it is. If the issue is reproduced, it means putting this files in the playlist folder and restarting mympd will show "database" instead of a previously selected playlist in a timer.

Thanks for your work. Please take your time, your personal life matters more :-) Playlist.zip

Smart list "Genre progressive house" seems a prime candidate for the bug

jcorporation commented 4 years ago

In the future please open for each a separate issue.

1) Seems to be a timing issue: the playlist select box is sometimes populated after the value is set and "Database" is simply the default value. Commit 07b7ff1 should fix this.

2) I need a ZIP of /var/lib/mympd/smartpls/ directory not the from the mpd playlist directory. In devel I fixed a bug with saved searches as smart playlists.

This should fix this error:

May 25 20:49 : client: [0] process command "searchaddpl "2020smart" Date "((Date contains '2020'))"" May 25 20:49 : client: [0] command returned 0 May 25 20:49 : client: [0] process command "listplaylist "2020smart"" May 25 20:49 : exception: Failed to open '/mnt/dietpi_userdata/Music/Playlist/2020smart.m3u': No such file or directory May 25 20:49 : exception: No such playlist May 25 20:49 : client: [0] command returned 2

You should delete the files in the smartpls directory and recreate the smart playlist.

3) The jukebox uses the playlist "2020" that does not exists. The jukebox should deactivate it itself on errors to prevent excessive resource usage but does not although the log says it. Is now fixed in devel, commit 95acf64.

thaihugo commented 4 years ago

Thanks, I'm sorry for the 3 issues in one post. I though they where symptoms of the same bug.

It seems all issues are solved:

  1. doesn't reappear anymore
  2. All smart playlists are now generated. I can create new ones, and default playlists are populating
  3. Seems to be working, although a 24 hours period will confirm the bug doesn't reappear with the timers. Will close this when I see it worked properly today.

I can now enjoy this creative smart playlistings!

jcorporation commented 4 years ago

Enjoy myMPD and thanks for reporting the bugs in detail. If all works, I will release myMPD 6.4.1.

thaihugo commented 4 years ago

After testing more on dev version, 3. is not happening again.

However, 1. is working differently than I was expecting. Here is the current behavior:

At 18:45, I start a timer playing a "Database" selection. At 20:00, I order a stop from the timer playing a Database selection At 20:40, I order a start from the timer for a specific static playlist. Current (18:45) playlist continues, not song from the (20:40)static playlist.

Capture d’écran, le 2020-05-29 à 21 02 08

The jukebox function is now changed from Database to the (20:40) specific static playlist.

myMPD Phoebe Bridgers - Funeral

Mympd uses this playlist if I cleanup the current playing list.

I was expecting the current playlist to be erased and replaced by a new selection from the selected playlist at the time selected from a timer. The jukebox parameter should stay unchanged. Is it the correct behavior ?

jcorporation commented 4 years ago

The correct behaviour is: The jukebox playlist changes and the jukebox queue is cleared and filled again from the new playlist. I think I forgot the clearing action in the code.

thaihugo commented 4 years ago

Ok, it makes sense. However, I see 2 usability issues that would be unexpected by this:

jcorporation commented 4 years ago

In summary start/stop timers should set all jukebox options?

The scripting capability in issue #261 could be used to do this, but this would be rather a expert option.

thaihugo commented 4 years ago

I just mean that either timers are a subset of jukebox, not touching the main config and just launching a temp config until it ends (which I understand is not the current approach), or it needs to take into account the disparity between database and playlist, as the database parameter of album or artist uniqueness are probably not appropriate for a simple playlist compiled by adding a few albums.

I believe most user will use a uniqueness parameter to deal with their whole library, as an automatic filtering process, or use playlists/smart list to deal with this filtering, in which case the uniqueness is not really needed. So without thinking at advanced scripting mecanics, this leaves the question on how this uniqueness must be dealt with in the timer context if timers allows for a playlist selection.

thaihugo commented 4 years ago

Here is my timer list, if it helps: timer_list.zip

There is one specific playlist, the rest is database. If jukebox is set to enforce uniqueness to album, and last played order to 48 hours or more, then any playlist will deplete after maybe 10-15 songs if you add albums and not unique songs to create them.

jcorporation commented 4 years ago

I think we should discuss the timer functionality in a separate issue. I am open for usability enhancements.

With commit e693d6d the queue is no more populated with old jukebox queue content on a timer trigger. It was a timing issue. I tested it shortly and I hope the fix has no other negatived effects.

thaihugo commented 4 years ago

Thanks,

This is working on my side too. I'm closing this and will move the usability discussion in a new thread.