Rockbox mail archive
Subject: search a string
From: François-Xavier Houard (idefx_at_iname.com)
so, i've been working last few days on something to search a text entry in
the mp3 files. My goal was to make something like the "j" key in xmms; so
i did it, but it was awfully slow (45 secs to scan 64 files).
Then i decided to follow the advices i was given on irc, and, with mats
lidell, we thought of some kind of database on the device, generate on the
I tried an arbitrary-choosed format for the db, and tried to implement it
to make a first try.
And i'm happy to annonce you that, using the same algorithm, searching a 2
word entry ("marsalis blase") on 592 files takes from 2 to 5 seconds (on a
This is nice (i think), and the possibility offered by the use of that kind
of DB could be huge, like fast-dir-browsing, fast-playlist-generation, fast
displaying-information, fast-sorting... So, i'd like to know which feature
would really be appreciated (and worked on by other guy for example), to
see how we could improve the database format. Here is how we think it for
One database for the whole filesystem:
and another file, just to tell where start each directory in the database,
maybe like that:
(where the classical directory begin at the 726th byte, and
classical/Mozart at the 942th byte)
this way, scanning the whole device wouldn't need the openning of too much
files, and scanning one dir may always take nearly the same time.
So, if anyone have a suggestion, an idea, want's to create a text input, or
a database generation stuff for windows (and even for linux, for the
moment, i don't use directory, so i generate the database using : mp3info
-p "%f\n%t\n%a\n%l\n", but a perl script that could also work recursively
and generate the directory database would be welcome...), just post it ;)
I will send a patch later, when i'll get the directory stuff work, and when
i'll have replaced my strcasestr by a boyer moore algorithme, that should
be much quicker.
Page was last modified "Jan 10 2012" The Rockbox Crew