Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Rockbox Ports are now being developed for various digital audio players!

+  Rockbox Technical Forums
|-+  Rockbox General
| |-+  Rockbox General Discussion
| | |-+  Automatic playback on startup
« previous next »
  • Print
Pages: [1] 2

Author Topic: Automatic playback on startup  (Read 2968 times)

gaugino

  • Guest
Automatic playback on startup
« on: August 17, 2017, 08:11:13 PM »
Dear Rockbox Team!

Thank you for your work on Rockbox! I use Rockbox for several years on my Sansa ClipZip, and during the last 2-3 years I have the following problem: playback starts automatically when I turn on the player. I had this problem with v. 3.13, the same thing with v. 3.14. After installing v. 3.14 (using the Rockbox Utility) I reset settings, it did not help.
I use "Previous Screen" setting in the "Start Screen" option. But even if I pause a song before turning off the player, the song begins to play automatically when I turn on the player or when I plug it to the charger. Is it normal? It would be much more convenient if there was a possibility to keep the song paused after turning on the player. I have failed to find the option which could solve the problem.
I would appreciate your help.
Logged

gaugino

  • Guest
Re: Automatic playback on startup
« Reply #1 on: August 23, 2017, 01:37:25 PM »
Yesterday I checked the problem, described above, on a Clip+ player with the Rockbox and on another Clip Zip player. The Clip Zip was with the stock firmware, so I installed the last Rockbox on it. The situation is exactly the same - if one pauses the song on the WPS and then turns off the player, the song begins to play automatically after turning on the player (of course, if the "Previous Screen" option is selected in the "Start Screen" setting). So, it is not a bug of my Clip Zip, but the feature of the Rockbox.

Of course, the problem can be solved by choosing, say, the "Main Menu" option in the "Start Screen" setting. But as for me, it would be much more convenient (using the "Previous Screen" option), if the Rockbox remembered the state of the playback (play or pause) and applied it after the startup of the player (if it goes to WPS at startup).
« Last Edit: August 23, 2017, 01:39:18 PM by gaugino »
Logged

Offline Bilgus

  • Developer
  • Member
  • *
  • Posts: 537
Re: Automatic playback on startup
« Reply #2 on: August 23, 2017, 02:11:34 PM »
*Previous Screen* Doesn't seem to store the Main Menu after you exit the playback screen so it goes back to now playing screen

I think this is a limitation of having the power button do double duty as *Return* and *Power Off*.

I'm not sure how you could really 'fix' it as if you make it recognize the *Main Menu* then it will always return there since the power button returns you to the *Main Menu* just prior to power off, otherwise you could just select a different menu before shutdown and start there or change the 'Start Screen' setting
Logged

gaugino

  • Guest
Re: Automatic playback on startup
« Reply #3 on: August 23, 2017, 03:43:00 PM »
Bilgus,
thank you for the answer!

I did not realize that this could be the effect of the power button double duty. I just have checked that the "Previous Screen" indeed does not store the Main Menu position. I usually shut down my Clip Zip on WPS, so I did not observe this effect during several years (or simply forgot about it) :). Indeed, when I power off while residing, say, in Settings, the system first goes back to Main Menu (the Main Menu appears on the screen) and only then turns off the player. However, when I power off while on WPS, the Main Menu does not appear on the screen before turning off the player - there is still a background image of the WPS theme (I use my own custom WPS). That is why I did not even think about possible effect of the power button double duty... So, thank you for the clarification!

However, it is not necessary to store the Main Menu when you exit WPS. I mean that it would be nice to have a possibility to force the pause when the system goes to WPS on startup (of course, if the Start Screen option is not "Resume Playback"). However, I don't know whether such an option can be easily realized in Rockbox...
« Last Edit: August 23, 2017, 03:50:52 PM by gaugino »
Logged

Offline Bilgus

  • Developer
  • Member
  • *
  • Posts: 537
Re: Automatic playback on startup
« Reply #4 on: August 23, 2017, 04:25:25 PM »
It wouldn't be hard to add the option but I'm not sure how likely it would be that it gets added to the mainline release.
However, if you would like to make your own patch for it I could help guide you on how to proceed
Logged

gaugino

  • Guest
Re: Automatic playback on startup
« Reply #5 on: August 23, 2017, 04:56:05 PM »
Bilgus,
thank you for your help and for the suggestion!

Unfortunately, I am not sure I have enough skills to make a patch. I am rather tech savvy, so it is not difficult for me to write my own WPS, etc. However, I am not a programmer, so it will take a large amount of time just to understand how to deal with Rockbox...
If the problem can not be solved just by changing some settings or by simple editing of the configuration files, I will choose the "Main Menu" option for the Start Screen, it is the simplest (and not the worst) solution.

Once again thank you for the help!
Logged

Offline Bilgus

  • Developer
  • Member
  • *
  • Posts: 537
Re: Automatic playback on startup
« Reply #6 on: August 23, 2017, 06:32:48 PM »
It really wasn't hard to add the functionality here is the diff file
Code: [Select]
--- /home/ubuntu/Desktop/orig/rockbox/apps/gui/wps.c	2016-10-27 01:50:12.388048590 +0200
+++ apps/gui/wps.c 2017-08-24 04:58:50.798515757 +0200
@@ -1213,6 +1213,9 @@
     state->paused = false;
     if(audio_status() & AUDIO_STATUS_PLAY)
     {
+        if(global_settings.start_in_screen == 0 && state->id3 == NULL)
+            audio_pause(); /*If there was no current track pause playback*/
+
         state->id3 = audio_current_track();
         state->nid3 = audio_next_track();
     }

basically all this does is checks if start_in_screen == previous screen and if there wasn't a track already loaded

and below are precompiled firmware for the clip+ and clipzip based on the current HEAD of the dev builds with the functionality you asked for added
http://www.mediafire.com/?bjp1te1et1t2h <--Updated

Really this needs to be controlled by a setting before it is perfect but I'll leave that as an exercise for you

« Last Edit: August 23, 2017, 11:10:09 PM by Bilgus »
Logged

gaugino

  • Guest
Re: Automatic playback on startup
« Reply #7 on: August 23, 2017, 07:24:24 PM »
Dear Bilgus,

thank you very much for the help! I very much appreciate that you spent your time to create the build especially for me!

I just installed the build on my Clip Zip (unfortunately, Clip+ is not with me, so I am unable to test the build for Clip+), reset all the settings (just in case) and choose "Previous Screen" for Start Screen. Unfortunately, the player still starts playback automatically after power up... Maybe it is a feature of the Sansa players that overrides the changes in the Rockbox that you have made?
Logged

Offline Bilgus

  • Developer
  • Member
  • *
  • Posts: 537
Re: Automatic playback on startup
« Reply #8 on: August 23, 2017, 09:39:12 PM »
no it's probably that the clipzip takes longer to startup than the clip+ which is what I tested it on, I'll see what I can do and update the post above; Update, Ok it should work for you now

Now lets talk about caveats, since we are no longer going on lasttime, it may not be exactly what you desired since anytime there is not a track loaded it will go into the WPS and you will have to press PLAY to get it to start but this is about as good as you're going to get without running some test code for me
« Last Edit: August 23, 2017, 11:14:18 PM by Bilgus »
Logged

gaugino

  • Guest
Re: Automatic playback on startup
« Reply #9 on: August 24, 2017, 09:36:47 AM »
Dear Bilgus,

now everything works perfectly, this is exactly what I need! I will also install this build on my father's Clip Zip and, as soon as I get my old Clip+ (it is not with me now, but I will get it again in 1-2 weeks), I will install the build on the Clip+ too.

As for the caveat, it is not a problem for me to press PLAY one more time in the situation with no track loaded - the advantages of this build outweigh this small drawback (at least for me).

Once again thank you very much for your help and efforts!!! If you ever need to test a code on Clip Zip, I am ready to help you.

PS: maybe a very naive and incorrect question, but what if not to use lasttime equal to 0, but to use a condition like lasttime<1-2sec or a parameter (if exists) like runtime<1-2sec (or a time which is necessary to rockbox to load if 1-2 sec is not enough)?   
« Last Edit: August 24, 2017, 09:59:33 AM by gaugino »
Logged

Offline Bilgus

  • Developer
  • Member
  • *
  • Posts: 537
Re: Automatic playback on startup
« Reply #10 on: August 24, 2017, 03:04:23 PM »
That is exactly what I was going to try but I wanted to guarantee that it would work, its hard telling how many 'ticks' (1/100) of a second its going to count to before it gets to my code, but hey if its good enough for your use why not leave it as is
Logged

gaugino

  • Guest
Re: Automatic playback on startup
« Reply #11 on: August 24, 2017, 03:28:05 PM »
Dear Bilgus,

my question was just for fun :) Everything is fine now, and please don't spend your time on it (but of course, if it is interesting for you or if it can be useful for future builds, I am ready to be a tester :) ).
Logged

gaugino

  • Guest
Re: Automatic playback on startup
« Reply #12 on: August 24, 2017, 04:30:53 PM »
Just to add. I think that in principle such an option in the Settings menu, if ever added to the main release, could be useful for someone. It is indeed convenient to go to the previous screen after power up (there would be no such an option if it was useless). Moreover, if this previous screen is WPS, sometimes it is convenient when the playback starts automatically (but not always). However, when you plug the player, say, to the charger; or disconnect it from the PC, the playback also starts automatically. The latter is not good, in particular, when you forget to press PAUSE just after plugging the player to a charger and two hours later find your audiobook in a completely different timestamp :) Or if your player is connected to the stereo system and the volume is high :)

If I were able to add such a feature by myself, no doubt I would do it . But now many thanks to Bilgus!
« Last Edit: August 24, 2017, 05:47:09 PM by gaugino »
Logged

Offline Bilgus

  • Developer
  • Member
  • *
  • Posts: 537
Re: Automatic playback on startup
« Reply #13 on: September 26, 2017, 02:38:55 PM »
I added this functionality in a patch on gerrit
http://gerrit.rockbox.org/r/#/c/1675/

Needs testing..
Logged

gaugino

  • Guest
Re: Automatic playback on startup
« Reply #14 on: September 29, 2017, 11:00:32 PM »
Hi!
I am ready to do the test. Where can I get the compiled firmware?
Logged

  • Print
Pages: [1] 2
« previous next »
+  Rockbox Technical Forums
|-+  Rockbox General
| |-+  Rockbox General Discussion
| | |-+  Automatic playback on startup
 

  • SMF 2.0.17 | SMF © 2019, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.049 seconds with 14 queries.