Rockbox

This is the bug/patch tracker for Rockbox. Click here for more information.

Quick links: Bugs · Patches · Rockbox frontpage

Tasklist

FS#9093 - Database initialization hangs if there's no music file on the player

Attached to Project: Rockbox
Opened by William Poetra Yoga Hadisoeseno (wpyh) - Monday, 16 June 2008, 10:58 GMT+1
Task Type Bugs
Category Database
Status Unconfirmed
Assigned To No-one
Player Type All players
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Private No

Details

The database hangs when doing initialization if there is no music file on the player.

How to reproduce:
1. Install Rockbox.
2. Put some music files onto the device.
3. Initialize database.
4. Reboot.
5. Remove all music files from the player.
6. Initialize database.
This task depends upon

Comment by Dominik Riebeling (bluebrother) - Monday, 16 June 2008, 22:19 GMT+1
How do you tell it's hanging?
Comment by William Poetra Yoga Hadisoeseno (wpyh) - Tuesday, 17 June 2008, 12:32 GMT+1
Here's how:

1-6. Repeat the steps I described above.
7. Go to Main Menu, scroll to Database, try to open it (for example by pressing the SELECT button on the iPod).
8. It says "xxx files found". Press |<< to return to the Main Menu.
9. Go eat your lunch.
10. Go to Main Menu, scroll to Database, open it.
11. It says "xxx files found". The number didn't change. Press |<< to return to the Main Menu.
12. Go eat your dinner.
... and so on.

Of course, if the device runs out of battery, then it will power off ;)
Comment by Bart (debber) - Tuesday, 16 December 2008, 15:19 GMT+1
Step 2, 3, 4 and 5 of the original bugreport are not needed. Simply try to initialize the database when no music files are present does it as well.

When you put an empty file (0 bytes) mp3 file, the behaviour is the same.
As soon as at least 1 valid mp3 (or other music file) is present then the initialization of the database finishes.
Comment by William Poetra Yoga Hadisoeseno (wpyh) - Thursday, 25 December 2008, 18:15 GMT+1
This patch seems to fix the problem.
1. If there is no music file found, the database is initialized anyway.
2. Upon reboot, the database is fully functional, except that it is empty.

Is this solution/workaround acceptable? I personally find it logical to create an empty database.
   db_init.v1.diff (0.8 KiB)
 tagcache.c |   10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

Comment by William Poetra Yoga Hadisoeseno (wpyh) - Friday, 26 December 2008, 05:55 GMT+1
Sometimes, doing an "Update Database" will make the database unusable. This patch also fixes that problem, and is less invasive (entry_count==0 is still being logged).

I hope that this is a better solution.
   db_init.v2.diff (1.1 KiB)
 tagcache.c |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

Loading...