FS#6733 - Shutdown in menu

Attached to Project: Rockbox
Opened by Jacco Koning (menollo) - Monday, 05 March 2007, 00:24 GMT
Last edited by Alex Parker (BigBambi) - Saturday, 05 June 2010, 22:53 GMT
Task Type Patches
Category User Interface
Status Closed
Assigned To No-one
Operating System All players
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No


I think it would be nice if there is an option/submenu shutdown in the main menu.
This can contain the following things
- Shutdown player
- Reboot player (execute the rockbox.iriver file)
- Sleep timer (which is now under info)

I'm owning the iRiver H340, but i think its the same for the other players
This task depends upon

Closed by  Alex Parker (BigBambi)
Saturday, 05 June 2010, 22:53 GMT
Reason for closing:  Rejected
2017-01-31: A request to re-open the task has been made. Reason for request: > Reason for request To provide further information.
Comment by Kyle Kamperschroer (Phalangees) - Tuesday, 06 March 2007, 02:22 GMT
This is a very neat idea. I really don't think it would be very hard to implement. I'll take a look later and see if even someone as stupid with coding as me can figure out how to do it.
Comment by Alan F (alsaf) - Saturday, 10 March 2007, 15:15 GMT
This is be a great idea as I have read a common fault with iriver H120's is the eventual breaking on the stop button which is also used as shutdown.

I guess it will also reduce wear on similar buttons on other DAP's.
Comment by Robert Keevil (obo) - Saturday, 10 March 2007, 15:49 GMT
Something like this?
Comment by Jacco Koning (menollo) - Saturday, 10 March 2007, 16:13 GMT
Very nice,
(one small issue: the option 'shut down' isn't correct translated to dutch, it says 'uitgeschakeld' (what means 'disabled') in stead of 'uitschakelen' (= shut down)), but nevertheless it looks very good :)
Comment by Jacco Koning (menollo) - Saturday, 10 March 2007, 16:25 GMT
I think it's LANG_SHUTDOWN in de dutch .lang file (German French and English looks good)
Comment by Jacco Koning (menollo) - Sunday, 11 March 2007, 17:02 GMT
So i'm started with my first rockbox/c programming..
I think i've added reboot the patch from obo
It works on my H340, but i can't test it on other devices
(rolo doesn't work in the simulator)
Comment by Mark Reiche (Porphyr) - Wednesday, 11 April 2007, 16:27 GMT
patch is not in sync anymore :-(
Comment by Robert Keevil (obo) - Sunday, 29 April 2007, 22:12 GMT
Sync'd. Change sys_poweroff (and hence clean_shutdown and shutdown_hw) so it can reboot instead of halt - should work on all targets without worrying about the status of ROLO, but maybe a bit OTT.
Comment by David Maliniak (major_works) - Monday, 21 May 2007, 01:33 GMT
Seems out of sync again, at least for the e200. Causes errors when compiling in power_menu.c.
Comment by Dan Everton (safetydan) - Sunday, 15 July 2007, 11:43 GMT
Resync of the patch. The reboot function doesn't seem to work on my H120 though.
Comment by Robert Keevil (obo) - Sunday, 29 July 2007, 10:54 GMT
Resync, and add a "Rebooting..." splash.


Binary size increase is 472 bytes for a 5g.
Comment by Daniel Dalton (ddalton) - Monday, 20 August 2007, 07:22 GMT
I have found a couple of things wrong here.

1. There is an error with power_menu.c about the lang_shutdown. (I have fixed this in my patch)
2. "Shutting down" is broken when turning off the player. I hope to fix this.
3. I can't really see the point of "Reboot" Can't we just add an option "Shuttingdown" to the main menu and forget the other stuff?
That way the patch will be smaller and so will the voice file. Why would someone want too reboot there player?
And then just put the sleep timer back where it was before. This way only one option has been added. Of course we could add a quick menu maybe to the main menu and put "Shutdown" in there. And maybe other options later. But I don't understand why we need "Reboot" as an option.

So if I remove this will that be ok?

I will post my updated patch soon. Just about done. If you aren't happy with it let me know and I will maybe change it.
Comment by Robert Keevil (obo) - Tuesday, 28 August 2007, 22:06 GMT
Resync. Add SYS_REBOOT in cases where SYS_POWEROFF is used now to ensure a clean reboot of plugins etc.

As to the point of reboot - it can be useful to get back to the OF, or for a handful of settings that require a reboot of Rockbox to become active. If that is enough to justify the feature or not is another matter.
Comment by Daniel Dalton (ddalton) - Wednesday, 29 August 2007, 06:47 GMT
Sorry I didn't get around to updating. But thanks for the update.
I hope to at some stage make the "Rebooting" splash talk. It shouldn't be too hard I just need to find where the code should go.
But if someone beats me to it I won't worry about it.
Does the rebooting function work on any players? If so what players. I got the patch working but I needed to remove something like if(reboot) from it so the rebooting didn't work it just shutdown the player. But if it is working let me know.
Also if you just want a "shutdown" option in the main menu and no reboot option and the sleep timer to stay where it is then try
 FS#7639 : Shutdown item in main menu.
Comment by Jacob Brooks (jac0b) - Thursday, 30 August 2007, 00:54 GMT
Was getting a hunk error on english.lang kind of resynced. You don't get a error anymore.
Comment by Jacob Brooks (jac0b) - Thursday, 30 August 2007, 01:00 GMT
Also can this be ported to the gigabeat?
Comment by Daniel Dalton (ddalton) - Thursday, 30 August 2007, 07:33 GMT
Ok I will see what I can do.
I thought it would work with it. I just quickly looked at the code.
Anyway maybe try
Comment by Robert Keevil (obo) - Thursday, 30 August 2007, 09:47 GMT
Jacob: hunk errors in english.lang aren't entirely unexpected - any new phrase being added will cause that, just keep moving the ones in this patch to the end. The code /should/ be okay on the Gigabeat - what issues are you seeing? It's possible that the sys_reboot() function hasn't been implemented on that platform.

Comment by Jacob Brooks (jac0b) - Friday, 31 August 2007, 00:53 GMT
I get the below error when I try to compile.

rolo.c: In function 'rolo_load':
rolo.c:330: error: too few arguments to function 'sys_poweroff'
make[1]: *** [/rockbox/build/firmware/rolo.o] Error 1
make: *** [build] Error 2
Comment by Daniel Dalton (ddalton) - Friday, 31 August 2007, 06:31 GMT
What is line 330 in rolo.c?
Also what happens if you build for the h300?
Comment by Robert Keevil (obo) - Friday, 31 August 2007, 08:38 GMT
Jacob: On a clean checkout of SVN, with only this patch applied, I have no problems building for a Gigabeat. firmware/rolo.c is untouched by this patch, (at 328 lines long) so it seems you have one or more other patches applied?
Comment by Jacob Brooks (jac0b) - Friday, 31 August 2007, 10:43 GMT
It must be the below patch. It is a Gigabeat fast restart.
Comment by Robert Keevil (obo) - Friday, 31 August 2007, 11:00 GMT
Change the sys_poweroff() added in the fake-rolo patch to sys_poweroff(false)
Comment by Jacob Brooks (jac0b) - Thursday, 18 October 2007, 23:25 GMT
Comment by Jacob Brooks (jac0b) - Thursday, 18 October 2007, 23:59 GMT
Disregard the above patch it won't compile if applied.
Comment by Konstanin (eK3eKyToPa) - Saturday, 17 November 2007, 13:12 GMT
Please resync the patch,
it's usefull
Comment by Jacob Brooks (jac0b) - Wednesday, 16 January 2008, 22:40 GMT
Yes, please can someone look into getting this patch to work with SVN.
Comment by Robert Keevil (obo) - Wednesday, 16 January 2008, 23:51 GMT
Sync'd (and the shutdown and reboot options appear under the System menu...)
Comment by Jacob Brooks (jac0b) - Thursday, 17 January 2008, 03:39 GMT
Thank you very much
Comment by Jacob Brooks (jac0b) - Thursday, 17 January 2008, 03:40 GMT
Now if we could the fast reboot patch synced it would be fantastic.
Comment by Jacob Brooks (jac0b) - Thursday, 17 January 2008, 13:55 GMT
The shutdown option works but when you select reboot it shuts off and never comes back on even when you try pressing the power button. To turn it back on you have to turn off/on the battery switch and then press the power button.
Comment by Nikkhil (AceNik) - Tuesday, 06 May 2008, 10:23 GMT
patch synced with current svn & it use to always work with the iriver h10 [20GB] from my end thank you.
Comment by Nikkhil (AceNik) - Sunday, 18 May 2008, 22:38 GMT
patch break during build process at recording.c
Comment by Chris Kagan (KindOfBlues71) - Tuesday, 20 May 2008, 20:22 GMT
Just a suggestion/request, it would be great if both FS7639 and FS6733 patches were combined to have "Shutdown" in the main menu, "Restart" in the System menu and leave Sleep Timer where it was originally (basically remove that portion of the patch). I've used both patches with tdtooke's Underground build for ipods and these features are very useful!
Comment by Jacob Brooks (jac0b) - Wednesday, 21 May 2008, 00:15 GMT
Comment by Nikkhil (AceNik) - Thursday, 22 May 2008, 11:16 GMT
this patch still fails to compile at powermgt.c
Comment by Jacob Brooks (jac0b) - Thursday, 12 June 2008, 01:06 GMT
Try this one
Comment by Nikkhil (AceNik) - Sunday, 15 June 2008, 00:22 GMT
it still fails at recording.c says too few parameters in function "sys_poweroff"
Comment by Jacob Brooks (jac0b) - Sunday, 15 June 2008, 03:41 GMT
It compiles and runs fine on my player and the sim.
Comment by Nikkhil (AceNik) - Sunday, 15 June 2008, 11:44 GMT
hey im using it on the h10[20GB], would that make any difference ?
Comment by Jacob Brooks (jac0b) - Sunday, 15 June 2008, 13:57 GMT
Actually from looking at the patch file this doesn't even touch recording.c
But if you change sys_poweroff() to sys_poweroff(false) it compiles.
Comment by alex wallis (alexwallis646) - Monday, 23 June 2008, 14:22 GMT
Hi. like everyone else, I can't compile with this patch applied, i'm running an h140, and I can't compile either with the sim build or the target build.
Comment by Nikkhil (AceNik) - Sunday, 29 June 2008, 10:55 GMT
[quote] But if you change sys_poweroff() to sys_poweroff(false) it compiles.[/quote]

hey yes this works fine compiled at svn.17873, compiles perfect for h10[20GB]
Comment by alex wallis (alexwallis646) - Sunday, 29 June 2008, 15:19 GMT
Could a version of this patch be uploaded that includes the change? as i can't see what bit of code to change, and i'm running the last version uploaded.
Comment by Robert Keevil (obo) - Sunday, 29 June 2008, 16:38 GMT
Comment by Taktak (Whick) - Thursday, 21 August 2008, 10:53 GMT
added menu to japanese.lang.
Comment by Robert Keevil (obo) - Tuesday, 02 December 2008, 20:25 GMT
Synced. shutdown-only.patch only enables the existing Archos Player & Recorder shutdown menu entry for all targets. RAM and binsize cost are 128 bytes. shutdown.patch adds a reboot option - RAM cost is 496 bytes, binsize is 480.
Comment by Alexander Levin (fml2) - Thursday, 04 December 2008, 18:52 GMT
I would like it very much if the 'shutdown only' patch would be included into the official build.
Comment by Taylore (trailblaze) - Sunday, 21 December 2008, 16:11 GMT
hmm.. the shutdown (+) (not shutdown only), does not build properly.. MAy someone please resync it please?
Comment by Cristiano Rodrigues (microcris) - Monday, 09 February 2009, 16:02 GMT
Some things have changed in the destination files. I made some changes in order to apply the patch. I don't know if I made the right changes but it is working in my Ipod ver 5.5 80GB
Comment by Taylore (trailblaze) - Sunday, 15 February 2009, 00:35 GMT
Yes! Thank you! Works pefectly.. The other one was intrusive, this one is perfect... Thanks again!
Comment by Gman (Thecoolgman) - Friday, 19 June 2009, 04:22 GMT
Could some one re sync this? Please?
Comment by Jacob Brooks (jac0b) - Friday, 24 July 2009, 00:17 GMT
Its working fine for me