getmusicbee.com

Support => Bug Reports => Topic started by: StevensNJD4 on June 04, 2021, 12:02:11 AM

Title: Shutdown while open does not remember last position
Post by: StevensNJD4 on June 04, 2021, 12:02:11 AM
Hello,

I have "on startup: resume position" enabled and by force of habit, I shutdown with everything open. When I start MB on next boot, it resumes the last position of when I last actually closed it. This did not happen on v3.3.

Version 3.4.7805
Regular installer
Title: Re: Shutdown while open does not remember last position
Post by: StevensNJD4 on June 04, 2021, 12:04:19 AM
Please get a better CAPTCHA service. Holy hell. Took 3 refreshes to post this.
Title: Re: Shutdown while open does not remember last position
Post by: Steven on June 04, 2021, 06:52:41 AM
working fine here and nothing has been changed for that functionality since v3.3
Title: Re: Shutdown while open does not remember last position
Post by: StevensNJD4 on June 04, 2021, 01:35:07 PM
Where does it save the information?
Title: Re: Shutdown while open does not remember last position
Post by: Steven on June 05, 2021, 12:26:39 AM
If you mean shutdown windows without exiting musicbee and windows classifies it as a critical shutdown, then v3.4 will not attempt to save the settings file (MusicBee3Settings.ini) to avoid file corruption.
Title: Re: Shutdown while open does not remember last position
Post by: StevensNJD4 on June 05, 2021, 03:03:27 PM
Could it please be an option?
Title: Re: Shutdown while open does not remember last position
Post by: hiccup on June 05, 2021, 03:17:52 PM
If you mean shutdown windows without exiting musicbee and windows classifies it as a critical shutdown, then v3.4 will not attempt to save the settings file (MusicBee3Settings.ini) to avoid file corruption.
Could it please be an option?
That looks like asking for an option to possibly introduce file corruption.
And all that because you don't want to close MusicBee properly, and after starting MusicBee the next time, it starts playing the last song that played fine before MusicBee was forcefully shutdown.
Seems like both an invalid bug report, and an inappropriate request to me.
Title: Re: Shutdown while open does not remember last position
Post by: Steven on June 05, 2021, 11:59:15 PM
Could it please be an option?
you will either change how you shutdown windows - its only when windows needs to shutdown without allowing apps to save data that MB skips the settings save or go back to using v3.3
Title: Re: Shutdown while open does not remember last position
Post by: jewahe on June 10, 2021, 02:52:10 AM
I just signed up because I have a similar issue. I like to have music playing while I sleep. So I have a Windows task to launch Music Bee at 9pm, and a separate task to shut it down at 9am. Music Bee is configured to resume playback (not position). This worked fine for a long time, but then about a year or so it stopped working, and I have to manually start the playlist again every evening.

I don't care that it starts from the previous position, only that it starts playing again.

This feature must be able to deal with unexpected shut downs.
Title: Re: Shutdown while open does not remember last position
Post by: frankz on June 10, 2021, 05:40:31 AM
I just signed up because I have a similar issue. I like to have music playing while I sleep. So I have a Windows task to launch Music Bee at 9pm, and a separate task to shut it down at 9am. Music Bee is configured to resume playback (not position). This worked fine for a long time, but then about a year or so it stopped working, and I have to manually start the playlist again every evening.

I don't care that it starts from the previous position, only that it starts playing again.

This feature must be able to deal with unexpected shut downs.
The developer directly addressed the issue of improperly shutting down the program and gave mitigation suggestions in the post right above yours, so I'm not sure what you hope to accomplish reiterating the problem.  

Task Scheduler shut downs are like killing the task from the Task Manager. It is not the proper way to close a program. MusicBee has a timed shutdown feature (File->Activate Auto-Shutdown) which closes the program properly on a timer.
Title: Re: Shutdown while open does not remember last position
Post by: jewahe on June 11, 2021, 01:09:06 AM
The developer directly addressed the issue of improperly shutting down the program and gave mitigation suggestions in the post right above yours, so I'm not sure what you hope to accomplish reiterating the problem. 

Task Scheduler shut downs are like killing the task from the Task Manager. It is not the proper way to close a program. MusicBee has a timed shutdown feature (File->Activate Auto-Shutdown) which closes the program properly on a timer.

1) I posted in agreement with the OP that the program does not properly handle unexpected shutdowns.

2) I know how Task Scheduler works (which is why I used the term "unexpected shutdown").

3) Using the Task Scheduler process worked for me for a long time, until it stopped working about a year ago. Obviously, something changed.

4) I tested the Activate Auto Shutdown feature, and it does NOT persist across sessions. So that means more manual intervention on my part. That's the whole reason I use the Windows Task Scheduler in the first place - I wanted Music Bee to start prior to by bedtime and shut off the next morning. Again, this process worked fine for around 2 years, but stopped working about a year ago.

5) The obvious conclusion is that Music Bee needs better support for unexpected shutdowns (something Windows is notorious for) or needs a better scheduler.
Title: Re: Shutdown while open does not remember last position
Post by: frankz on June 11, 2021, 01:23:14 AM
5) The obvious conclusion is that Music Bee needs better support for unexpected shutdowns (something Windows is notorious for) or needs a better scheduler.
As was explained by the developer in the post directly above your first post, the the result you're seeing in later versions is the "better support for unexpected shutdowns." Prior to this change, a risk of corrupted files existed.  Problem solved.

If you'd like changes made to the scheduler, that could be posted to the wishlist.  I'd probably even +1 some updates to that functionality.
Title: Re: Shutdown while open does not remember last position
Post by: jewahe on June 11, 2021, 04:00:58 AM
To be frank, if what you're saying is true, the "fix" broke established functionality and needs to be revisited. As I said, Windows is well-known for being flaky. I expect better from knowledgeable developers.
Title: Re: Shutdown while open does not remember last position
Post by: frankz on June 11, 2021, 04:10:39 AM
I'm sorry that having to manually press play happened to you, and I hope you're OK.
Title: Re: Shutdown while open does not remember last position
Post by: jewahe on June 11, 2021, 04:26:00 AM
I posted a thread in the wish list, but I still think it's a bug that needs to be addressed. I understand that the last position/time index cannot be recorded at the point of an unexpected shut down, but the last played track should be written to the database/log which can be used as the starting point upon restart.

My issue is that not only doesn't Music Bee remember the last played track, but it also DOES NOT resume playback. I can deal with the former issue, but the latter issue is a serious issue.
Title: Re: Shutdown while open does not remember last position
Post by: hiccup on June 11, 2021, 04:24:19 PM
I posted a thread in the wish list, but I still think it's a bug that needs to be addressed.

It's not a bug.

The cause of your issue is that you are using Task Scheduler to abruptly kill a process. MusicBee can't be blamed for that.
If you want to achieve this in a proper manner using Task Scheduler you could use AHK (AutoHotKey) to have it close MusicBee properly before your Windows gets shutdown:

howto:

1.
Create a global shortcut in MusicBee to close it.
(General: exit MusicBee)
For this example use: [ctrl]+[shift]+[F4]

2.
Install AHK and create a script for it:

Code
PressTheKey:
Send, {ctrl down}{shift down}{F4}{shift up}{ctrl up}
3.
Save the script, then right-click it, and select 'Compile Script'.
Save the resulting AHK .exe script somewhere. (you can delete the .ahk version)

4.
In Task Scheduler create a task to run this AHK .exe script e.g. 1 min. before you have Windows shutdown.

Now MusicBee will get closed properly and should restart the way you have set it in preferences.
Title: Re: Shutdown while open does not remember last position
Post by: nightzey on June 19, 2022, 04:52:48 AM
In case anyone stumbles upon this thread and they have the plugin "windows 10 media control overlay" this may be at fault
Title: Re: Shutdown while open does not remember last position
Post by: elliot15 on June 19, 2022, 10:53:57 PM
In case anyone stumbles upon this thread and they have the plugin "windows 10 media control overlay" this may be at fault

Not much of a solution, more of a compromise.
Title: Re: Shutdown while open does not remember last position
Post by: Steven on June 20, 2022, 12:47:04 AM
In case anyone stumbles upon this thread and they have the plugin "windows 10 media control overlay" this may be at fault

Not much of a solution, more of a compromise.
is the same issue also happening because you are using that plugin? Otherwise you should try the v3.4 patch version which made a change to how cached data is saved on windows shutdown