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
|-+  Support and General Use
| |-+  Audio Playback, Database and Playlists
| | |-+  Incorrect Resume
« previous next »
  • Print
Pages: [1] 2

Author Topic: Incorrect Resume  (Read 7127 times)

Offline MatthewP

  • Member
  • *
  • Posts: 21
Incorrect Resume
« on: April 05, 2010, 05:31:22 AM »
I paused a song, then connected the player to my computer and deleted a different song.  When Rockbox resumed playing, it was on another track.  Is this a known problem?
Logged

Offline AlexP

  • Global Moderator
  • Member
  • *
  • Posts: 3688
  • ex-BigBambi
Re: Incorrect Resume
« Reply #1 on: April 05, 2010, 07:04:09 AM »
Yes, as the info stored for resume is an index - i.e. restart at this position in the third track.  If you delete e.g. track 2, then the third track is now track 4.
Logged
H140, F60, S120, e260, c240, Clip, Fuze v2, Connect, MP170, Meizu M3, Nano 1G, Android

Offline MatthewP

  • Member
  • *
  • Posts: 21
Re: Incorrect Resume
« Reply #2 on: April 05, 2010, 05:11:05 PM »
Can this be changed so that it uses the filename instead of an index?
Logged

Offline AlexP

  • Global Moderator
  • Member
  • *
  • Posts: 3688
  • ex-BigBambi
Re: Incorrect Resume
« Reply #3 on: April 05, 2010, 05:32:57 PM »
It could, and that would be nice I agree - I think the problem here is that the way resume info is stored would need to be rewritten (it isn't just a case of swapping them) and someone needs to do it.

Other things to think about - the filename referenced for resume is deleted, the same file appears multiple times in the playlist...

However, it is a valid bug even if it isn't quite as simple as it first seems to fix :)
« Last Edit: April 05, 2010, 05:38:21 PM by AlexP »
Logged
H140, F60, S120, e260, c240, Clip, Fuze v2, Connect, MP170, Meizu M3, Nano 1G, Android

Offline MatthewP

  • Member
  • *
  • Posts: 21
Re: Incorrect Resume
« Reply #4 on: April 11, 2010, 02:53:45 AM »
This problem happens even when the file is deleted in Rockbox, when it's not connected to a computer.
Logged

Offline AlexP

  • Global Moderator
  • Member
  • *
  • Posts: 3688
  • ex-BigBambi
Re: Incorrect Resume
« Reply #5 on: April 11, 2010, 05:38:17 AM »
Quote from: MatthewP on April 11, 2010, 02:53:45 AM
This problem happens even when the file is deleted in Rockbox, when it's not connected to a computer.

Yes, for the same reason.
Logged
H140, F60, S120, e260, c240, Clip, Fuze v2, Connect, MP170, Meizu M3, Nano 1G, Android

Offline MatthewP

  • Member
  • *
  • Posts: 21
Re: Incorrect Resume
« Reply #6 on: April 12, 2010, 02:41:10 PM »
When a delete happens outside the player Rockbox doesn't know it needs to update the index.  But when it's done on the player Rockbox should update the index when the delete function is executed.
Logged

Offline GodEater

  • Member
  • *
  • Posts: 2829
Re: Incorrect Resume
« Reply #7 on: April 13, 2010, 03:13:08 AM »
Yes, but the delete function does do this, as it has no way to know that the file you're deleting is currently being used in a playlist.
Logged

Read The Manual Please

Offline MatthewP

  • Member
  • *
  • Posts: 21
Re: Incorrect Resume
« Reply #8 on: April 15, 2010, 03:40:44 AM »
If the original firmware can manage this, Rockbox should also.  When a delete is performed, just search the playlists for references to the deleted file.  If it's there, remove it.
Logged

Offline Llorean

  • Member
  • *
  • Posts: 12931
Re: Incorrect Resume
« Reply #9 on: April 15, 2010, 05:11:42 AM »
You seem to have missed the point - the problem is that the file isn't referenced in the playlist.

Basically, the playlist says "the third file in the directory" rather than a specific filename - it's an index. Since playback is stopped at the time anyway, we don't know if the third file in the directory is still the same one it used to be (they could've had file added, or other files deleted) so when the user deletes the file, it can't know which index in the dynamic playlist is the right one to delete.

You'll notice static playlists (which have filenames in them) don't present this problem - a missing file will simply be skipped over.


If you think it's easy to identify reliably whether the file was removed and handle it in the case of such dynamic playlists, though, feel free to submit a patch. Maybe something's been overlooked.
« Last Edit: April 15, 2010, 05:13:40 AM by Llorean »
Logged

Offline MatthewP

  • Member
  • *
  • Posts: 21
Re: Incorrect Resume
« Reply #10 on: April 19, 2010, 06:13:25 PM »
Is the dynamic playlist directory in .playlist_control?  And the index in nvram.bin?  I'm not a developer but wouldn't something like this work?:

// pseudocode
delete_dir =  directory of file being deleted
playlist_dir = dynamic playlist directory in .playlist_control
if delete_dir = playlist_dir // deleting a file in the dynamic playlist
{
    decrement playlist count // update # of playlist entries
    if delete file index < playlist index
    {
         decrement playlist index // deleted file is before current file so update current position to reflect deleted file
    }
}
Logged

Offline MatthewP

  • Member
  • *
  • Posts: 21
Re: Incorrect Resume
« Reply #11 on: April 30, 2010, 02:46:32 AM »
Does anyone have the time and know-how to implement this?
Logged

Offline Llorean

  • Member
  • *
  • Posts: 12931
Re: Incorrect Resume
« Reply #12 on: April 30, 2010, 03:03:32 AM »
I don't see how that solves the problem in your first post - if you deleted the file from the computer, how does Rockbox know it's missing exactly? Your pseudocode doesn't cover that at all.

As well, this would require the filetree code to know things about playback status, and depend on them. Generally it's beneficial not to have too many dependencies between separate areas. It can lead to new and stranger bugs.

It also doesn't address the situation of added files, or renamed files, or any other way in which the contents of the folder could be changed. For example, if I add two files from my PC then delete one on Rockbox, your code would have it move the index making the resume point even more wrong.

The simplest solution would be to make it clear in the manual that when folder playback is started, if the folder contents change, resume could be inaccurate, and not try to add any special magic that can muck up the code any worse. Since there is no way for it to be reliably accurate, being up front about it is basically the best you can offer.

 If it's really a problem, figure out a way to get the speed of index based playlisting, but actually store the filenames for verification purposes.
Logged

Offline MatthewP

  • Member
  • *
  • Posts: 21
Re: Incorrect Resume
« Reply #13 on: May 03, 2010, 01:37:30 AM »
It doesn't solve the problem initially presented.  But the solution is still useful because I still need to delete many files through Rockbox.  This is not a issue with any other DAP's original firmware, so I'm surprised that Rockbox can't handle such a simple use case.
Logged

Offline Yotto

  • Artist
  • Member
  • *
  • Posts: 826
  • Every Silver Lining has a Cloud
    • My Blog
Re: Incorrect Resume
« Reply #14 on: May 03, 2010, 06:13:57 AM »
A simple, non-programming solution is to not use the resume function.

Turn on bookmarks, and when you stop your music and hook your player to the computer, the bookmark will still load the correct file no matter what you do to the files. Unless you delete the file you were listening to, of course. Bookmarks don't like that too much.

Personally, I wish that the user could define "resume" as "Load last bookmark" instead of what it is now, but as a non-programmer I have no clue how to do it myself. I also have no expectations that "what I want" be "what is put in Rockbox" :)
Logged
Pulp Audio Weekly - Where we talk about News, Reviews, and pretty much anything else we feel like discussing.

  • Print
Pages: [1] 2
« previous next »
+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Audio Playback, Database and Playlists
| | |-+  Incorrect Resume
 

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

Page created in 0.097 seconds with 15 queries.