Bugzilla – Bug 2274
Station Playlist plugin enhancement
Last modified: 2008-12-15 13:07:05 UTC
Hello A few times ago, i've asked for an plugin enhancement, which allow to automatically load "StationPlaylist" playlists. I've upgrade the slimserver with the new 10-10 version, and now the playlists are reloaded each minutes instead of each hour. I turned back to the 09-12 version, and everything is ok. I'm sure it's a simple issue, but I don't know where to check and change... Thank you
Created attachment 896 [details] the Station Playlist Plug-in
what do you see in the d_plugins debugging logs? particularly, the lines starting with "StationPlaylist: checking for.."
I have those lines 2005-10-10 20:38:00.7253 StationPlaylist: checking for D:\playlists\demo\actu\10 10-20.m3u, current is: 2005-10-10 20:38:02.7363 StationPlaylist: loading D:\playlists\demo\actu\1010-20 .m3u Nothing seems to be wrong here. But now, each minutes, playlist is reloaded (music is stopped) and the next file in the playlist is played
what is wrong in that log is the "current is: " shows now playlist. After the playlists are loading, does that change? If not, there may no longer be a way to properly check if the playlist is already loaded. Thus, it is loaded every minute. The only other way that I can think of to deal with this (unless the current playlist name is showing up somewhere), is to only check once an hour.
Oh yes, I didn't see the "current is" without playlist shown. The same lines are repeated each minute (always without current playlist). And the current playlist is shown nowhere... Could you give me the "each hour check" modification? I will try, and if it's not useful for me, I will turn back to the 09-12 server's version (hopefully I have a backup of it!) Thank you very much !
try adding this before line 92 (just before the foreach my $client...): # only bother exactly ON the hour return if $min;
C:\Program Files\SlimServer\server>slim --d_plugins 2005-10-10 21:30:26.9731 BROWSE_MUSIC does not exist. creating... 2005-10-10 21:30:26.9787 Registering screensaver Lecture (retour ve 2005-10-10 21:30:27.0013 Registering screensaver None 2005-10-10 21:30:30.2364 Requiring Plugins::StationPlaylist plugin. 2005-10-10 21:30:30.2622 PLUGINS does not exist. creating... And nothing more.Nothing is played I tried to change server's hour to 21:59:59 and wait... and still nothing's happen.
sorry, morning after fog hadn't cleared. of course that patch wont work :) This should be better, properly resetting the timer: # only bother exactly ON the hour if ($min) { setTimer(); return; }
Created attachment 897 [details] new version as another option, this version switches from seconds to minutes on the timer interval. this way, it will ONLY check once per hour, resetting to the hour on any server restart. I've added a debug line to show the timer interval each cycle. Hopefully one of these two choices will work.
The first solution gave the same problem: nothing is played. I try the new plugin version, and I get: C:\Program Files\SlimServer\server>slim --d_plugins 2005-10-11 08:45:00.3147 BROWSE_MUSIC does not exist. creating... 2005-10-11 08:45:00.3273 Registering screensaver Lecture (retour veille) 2005-10-11 08:45:00.3328 Registering screensaver None 2005-10-11 08:45:01.4558 Requiring Plugins::StationPlaylist plugin. 2005-10-11 08:45:01.4695 StationPlaylist: setting timer to minutes. 2005-10-11 08:45:01.4762 PLUGINS does not exist. creating... 2005-10-11 08:46:01.4808 StationPlaylist: checking timer 2005-10-11 08:46:01.4865 StationPlaylist: checking for D:\playlists\demo\actu\10 11-8.m3u, current is: 2005-10-11 08:46:01.4952 StationPlaylist: setting timer to 60 minutes. 2005-10-11 08:46:03.4997 StationPlaylist: loading D:\playlists\demo\actu\1011-8. m3u The playlist is correctly loaded, and played I suppose the next playlist will not be loaded at 9:00 but at 9:45. I will let you know if I still get issues with that Thank you
Created attachment 898 [details] simplification using minutes doesn't have to be so careful, so this simplified timer logic should hopefully work better.
Thank you I have installed and started play. I will let it run all the night, and I'll tell you. i have thoses messages at start: C:\Program Files\SlimServer\server>slim --d_plugins 2005-10-11 21:22:58.7135 BROWSE_MUSIC does not exist. creating... 2005-10-11 21:22:58.7201 Registering screensaver Lecture (retour veille) 2005-10-11 21:22:58.7339 Registering screensaver None 2005-10-11 21:23:00.1149 Requiring Plugins::StationPlaylist plugin. 2005-10-11 21:23:00.1432 StationPlaylist: setting timer to minutes. 2005-10-11 21:23:00.1489 PLUGINS does not exist. creating... 2005-10-11 21:24:00.1507 StationPlaylist: checking timer 2005-10-11 21:24:00.1642 StationPlaylist: checking for D:\playlists\demo\actu\10 11-21.m3u, current is: 2005-10-11 21:24:00.1763 StationPlaylist: setting timer to 60 minutes. 2005-10-11 21:24:02.1800 StationPlaylist: loading D:\playlists\demo\actu\1011-21 .m3u
Everything is perfect, but there is still a problem I didn't manage to understand. Yesterday and today, playing has been stopped when trying to load the 12:00 playlist. I have stop/run the server, and playlist was loaded. I have to try out more to find where exactly is the issue.
I had egain this same strange problem today: 2005-10-13 10:07:44.1143 StationPlaylist: checking timer 2005-10-13 10:07:44.3100 StationPlaylist: checking for D:\playlists\demo\actu\1013-10.m3u, current is: 2005-10-13 10:07:44.4715 StationPlaylist: setting timer to 60 minutes. 2005-10-13 10:07:46.4809 StationPlaylist: loading D:\playlists\demo\actu\1013- 10.m3u 2005-10-13 11:07:44.5758 StationPlaylist: checking timer 2005-10-13 11:07:44.7682 StationPlaylist: checking for D:\playlists\demo\actu\1013-11.m3u, current is: 2005-10-13 11:07:44.9825 StationPlaylist: setting timer to 60 minutes. 2005-10-13 11:07:46.9945 StationPlaylist: loading D:\playlists\demo\actu\1013- 11.m3u 2005-10-13 12:07:45.0468 StationPlaylist: checking timer 2005-10-13 12:07:45.0726 StationPlaylist: checking for D:\playlists\demo\actu\1013-12.m3u, current is: 2005-10-13 12:07:45.1812 StationPlaylist: setting timer to 60 minutes. 2005-10-13 12:07:47.1946 StationPlaylist: loading D:\playlists\demo\actu\1013- 12.m3u 2005-10-13 13:07:45.1869 StationPlaylist: checking timer 2005-10-13 13:07:45.4054 StationPlaylist: checking for D:\playlists\demo\actu\1013-13.m3u, current is: D:\playlists\client1\pub.m3u 2005-10-13 13:07:45.4465 StationPlaylist: setting timer to 60 minutes. 2005-10-13 13:07:47.4220 StationPlaylist: loading D:\playlists\demo\actu\1013- 13.m3u When trying to load the 12:00 hour playlist, Squeezebox plays nothing. When it's time for the 13:00, playing begin correctly, and we can see that the current playlist wasn't the 1310-12.m3u as it should be, but the D:\playlists\client1\pub.m3u, which is a very old playlist, that I have deleted from my disk for a long time ! I suppose it's saved somewhere in a database ? Why aren't the 12:00's playlists loaded, and why this pub.m3u is loaded instead, are the two questions...
have you downloaded the most recent version? it should NOT be saying 60 minutes for the timer at 7 minutes after. no idea why pub is loaded. perhaps you have an alarm set somewhere. the logs show that this plugin is NOT doing it.
from this log, it looks as if the plugin is doing everything that it should. check with d_command and d_source and look at your playlists to see if there is any problem loding that particular playlist. I've tested with the most recently posted version, attachment 8988 and confirmed that timer resets itself to be on the hour.
Shame on me ! I hadn't thought to check the alarm ! I had an alarm setted up at 12:15 ... Concerning the log, I still have the mention "60 minutes". C:\Program Files\SlimServer\server>slim --d_plugins 2005-10-13 19:34:41.4160 BROWSE_MUSIC does not exist. creating... 2005-10-13 19:34:41.5358 Registering screensaver Lecture (retour veille) 2005-10-13 19:34:41.5518 Registering screensaver None 2005-10-13 19:34:50.3411 Requiring Plugins::StationPlaylist plugin. 2005-10-13 19:34:50.5264 StationPlaylist: setting timer to minutes. 2005-10-13 19:34:50.5446 PLUGINS does not exist. creating... 2005-10-13 19:35:50.5470 StationPlaylist: checking timer 2005-10-13 19:35:50.5622 StationPlaylist: checking for D:\playlists\demo\actu\10 13-19.m3u, current is: 2005-10-13 19:35:50.7442 StationPlaylist: setting timer to 60 minutes. 2005-10-13 19:35:52.7502 StationPlaylist: loading D:\playlists\demo\actu\1013-19 .m3u I have updated slimserver and ensured that I use the last posted version of plugin. (however your attachment 8988 link does not seems to work) What should I see in this last log ? "StationPlaylist: setting timer to 25 minutes." ? The next playlist will be loaded at 20:35, so I had decided from now on to try to start server just after the beginning of an hour. (I'm not sure to be clear...)
sorry, that was attachment 898 [details], and it should stay setting timer to 25 minutes (or whatever the remainder is on the hour). I can't find anything that would make that part come out wrong (unless your time function is returning bad data for some unknown reason, but then the log times would also be wrong)
KDF: is this tied to 6.2? If not, can you bump it to the appropriate future release?
I sometimes have these kinds of lines: 2005-10-13 21:27:35.6258 StationPlaylist: setting timer to 33 minutes. But only in particular conditions, only during the first start of a new copy of tbe slimserver ! (I just decompress the slimserver zip in another folder, and start it) If I start/stop this copy, I have "60 minutes" everytime again
dean, this is an ongoing custom plugin thing, so I'll mark for future. seems to be basically fixed tho. jean-guillaume, the timer should say 60 minutes, when the minute is 0. At other times (like startup) it should set for the number of minutes until the hour. What was odd in your earlier log is that the check was happening 7 minutes after the hour. Please run with what you have and see how that works for you. Let me kow if that's got it.
I'm not sure to understand well. On my server, slimserver is working like that: If I start the slimserver, for instance at 21:43, the playlists will be loaded at 22:43, 23:43, 00:23 etc.. In my earlier log, the check was happening 7 minutes after the hour because I ran the server at 09:07 As you seem to be amazed, this is not the working you expect...
well, I've been running all day and I cannot reproduce what you say you are experiencing. for me, it is doing exactly what I have written the code to do. Starting the server at 9:58: 2005-10-13 09:58:47.6478 StationPlaylist: checking timer 2005-10-13 09:58:47.6488 StationPlaylist: checking for D:\playlists\1013-9.m3u, current is: 2005-10-13 09:58:47.6499 StationPlaylist: required playlist already loaded. 2005-10-13 09:58:47.6505 StationPlaylist: setting timer to 2 minutes. 2005-10-13 10:00:47.6516 StationPlaylist: checking timer 2005-10-13 10:00:47.6524 StationPlaylist: checking for D:\playlists\1013-10.m3u, current is: 2005-10-13 10:00:47.6533 StationPlaylist: required playlist already loaded. 2005-10-13 10:00:47.6538 StationPlaylist: setting timer to 60 minutes. 2005-10-13 11:00:47.6548 StationPlaylist: checking timer 2005-10-13 11:00:47.7506 StationPlaylist: checking for D:\playlists\1013-11.m3u, current is: 2005-10-13 11:00:47.7517 StationPlaylist: required playlist already loaded. 2005-10-13 11:00:47.7521 StationPlaylist: setting timer to 60 minutes. 2005-10-13 12:00:47.7526 StationPlaylist: checking timer 2005-10-13 12:00:47.7534 StationPlaylist: checking for D:\playlists\1013-12.m3u, current is: 2005-10-13 12:00:47.7645 StationPlaylist: required playlist already loaded. 2005-10-13 12:00:47.7650 StationPlaylist: setting timer to 60 minutes. 2005-10-13 13:00:47.7663 StationPlaylist: checking timer 2005-10-13 13:00:47.7705 StationPlaylist: checking for D:\playlists\1013-13.m3u, current is: 2005-10-13 13:00:47.7716 StationPlaylist: required playlist already loaded. 2005-10-13 13:00:47.7725 StationPlaylist: setting timer to 60 minutes. The initial timer for 2 minutes, resets the plugin on the hour and you can see that it checks again at 10, 11, 12 and so on with only the 47 seconds offset. I'll post another version in a minute, and try to work the timing in a different way. On startup,you should see the timer with something other than 60 minutes and then it should check timer on the hour after that.
First of all, thank you for testing yourself ! In my case, offset is minutes instead of seconds ! Another thing at the first start of server, log shows : 2005-10-13 23:13:28.1614 StationPlaylist: setting timer to minutes. ie with no number between "to" and "minutes" Don't you think it's strange ? the checking timer comes one minute after, and the timer is set to 60
Created attachment 904 [details] latest update mine is in minutes too. Look at the timestamps from my log. the 47 seconds that I mention is the offset from the EXACT hour. Less than a minute, unlike yours which has seemed to skip some rather simple math in the code. The missing number is expected on startup, since there is no interval on startup. However, the first time that the timer is checked (very shortly after the missing number) then it should set to 60 - current minutes from the hour. Your copy seems to simply not do this, despite it being in the code. Frankly, that is inexplicable and I can't think of a thing to fix it directly. This updated version tries to set the timer right from startup, so you dont get that missing value in the first message. The math is the same, so if your copy still refuses to do simple math, then there is little else I can offer. cross your fingers on this one.
Now the timer is correctly set up at start up ! C:\Program Files\SlimServer\server>slim --d_plugins 2005-10-14 08:54:06.1593 BROWSE_MUSIC does not exist. creating... 2005-10-14 08:54:06.1767 Registering screensaver Now Playing (Jump back on wake ) 2005-10-14 08:54:06.2127 Registering screensaver None 2005-10-14 08:54:07.9130 Requiring Plugins::StationPlaylist plugin. 2005-10-14 08:54:08.0208 StationPlaylist: setting timer to 6 minutes. 2005-10-14 08:54:08.0357 PLUGINS does not exist. creating... Playlist starts at 09:00, and timer is set to 60 minutes. I think this "bug" is now fixed ;-)
thanks!
This bug appears to have been fixed in the latest release! If you are still experiencing this problem, feel free to reopen the bug with your new comments and we'll have another look. Make sure to include the version number of the software you are seeing the error with.