Re: [Banshee-List] Rock Box and iPod DAP extensions

On Thu, Nov 20, 2008 at 5:32 PM, David Spreen
<david spreen googlemail com> wrote:
> Hi again,
> if you could just provide me with the code you wrote to create the
> tagcache for rockbox, I would like to write a simple plugin that just
> updates the tagcache. Apart from that rockbox already works fine with
> the mass-storage plugin (which already includes configurable support for
> rockbox cover art etc., so if we could just write a plugin that updates
> the tagcache after every sync (from what's on the player, that way we
> don't have to worry about recopying files), things would be a lot
> better.

The problem with just writing the DB and not reading it would be how
does Banshee know what's already on the device? The only way it can is
by scanning the music folders which takes a very long time. In my own
test on reasonably full 30gig iPod that took several minutes, where as
getting the data from the tag cache takes only a couple seconds
exactly like using Apple's iPod DB.

The current problem I am having with syncing is that the DAP
extension's sync system for whatever reason doesn't think the files in
the Library are the same as those on the device. So it requests all
existing files be removed and copies back all the new ones. They show
up correctly in Bashee's track list and can be played directly off the
device. It all works fine just that it takes ages to sync because of
all the unnecessary file IO. I am sure its something fairly simple to
fix. Its just a matter of following through exactly what meta data
Banshee bases its syncing decision on and working out what's confusing
it. All the key Meta data is present in the devices tracks listing
(such as Artists, Album Artist, Track Name, .....).

The problem with the tag cache DB format is that its hard to append
new entries directly on the disk. From reading the RockBox source and
as the name suggests its used directly by the RockBox menu system.
Because of this most of the tag files need to maintain a correct
sorted order so you can't simply append new entries to them. I think
that's one reason why in RockBox it takes so long to update.

In my plugin it loads all the DBs data in to memory then adds /
removes new entries and rewrites the whole DB structure back out. On
the PC side we have many resources so its not really a major problem
compared to the Rock Box Player. On my 4 year old PC it only takes a
second or two every time its ejected for a reasonably sized DB.

It does mean the device needs to be properly ejected so the new DB can
be written when the device is manually managed. When its synced it
simply writes the new DB after the sync cycle completes. When the
first change is made to the player (adding or removing tacks) it sets
the Tag Cache DB's dirty flag. This means if the DB isn't properly
written the device will regenerate it when the user next accesses the
DB. The last stage of writing the DB is setting this flag back to
clean. My plugin has a dialogue which informs the user of this if its
not properly ejected. Worst case scenario is the DB needs to be
rebuilt by the device which is the best case scenario if the user were
to just use the existing mass storage extension.

Incidentally the version on bugzilla works correctly with play lists
now. So if you sync, all the play lists get copied over and work fine
in Rock Box. I would really like to be able to manually sync playlists
as well, although I think that requires work in the DAP extension to
support it.

I am quite keen to have a Rock Box extension with the same
functionality and out of the box simplicity as the iPod extension. I
think I am very close to that with the current version of the Rock Box
extension. If you want to integrate the tag cache support in to the
highly configurable Mass Storage extension for users who want complete
control over their device then by all means.

The other option is that configurableity could be added to the new
Rock Box extension and just let it assume sensible defaults so it
works out of the box. Since it knows its a Rock Box player it can
assume a lot more and perhaps provide Rock Box Specific functionality
which would be hard to generalise to all Mass Storage players.

Charlie M

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]