[Top][All Lists]

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

Re: [Bug-gnupod] mktunes.pl creates corrupt iTunesDB ?

From: Richard van den Berg
Subject: Re: [Bug-gnupod] mktunes.pl creates corrupt iTunesDB ?
Date: Sat, 13 Jun 2009 22:36:41 +0200
User-agent: Thunderbird (Macintosh/20090302)

The results I got today were not consistent with yesterday (ok iTunesDBs would now be "not ok"). I learned a lot about the binary format, and figured out that by messing with the ArtworkDB (for the performance tests) the dbid_1 numbers were now out of whack. However, restoring the whole iPod_Control/Artwork directory from yesterday didn't help.

So I decided to clear the iPod_Control/Artwork directory and take out the dbid_1, artworkcnt and has_artwork parameters from my GNUtunesDB.xml files. I had to do a complete new binary search to find the following ok -> ok -> not_ok sequence:


This time file number 11126 seems to be the problem:

<file addtime="3327445665" album="Love Train - The Sound Of Philadelphia - Disc 2" artist="Billy Paul" bitrate="215" cdnum="0" cds="0" comment="" compilation="1" composer="" desc="/d01/mp3/marcel/Love Train/The Sound Of Philadelphia/32 - Billy Paul - Thanks For Saving My Life.mp3" fdesc="MPEG 1 layer 3 file" filesize="4813000" genre="Soul" id="11152" mediatype="1" path=":iPod_Control:Music:f23:g0_For_Saving_My_Life.mp3" playcount="0" songnum="12" songs="0" soundcheck="5070" srate="44100" time="178311" title="Thanks For Saving My Life" volume="0" year="2008" />

On 6/13/09 12:43 PM, H. Langos wrote:
I don't have much time this weekend but maybe you could check out what
happens if you start giving those IDs from the highest value and decrement
with each entry.

Interesting idea. See attached patch. It does make the diff a whole lot easier to read. And it made a difference as well. With this patch applied 11126 suddenly worked.

During the binary search for the next limit I found that if an iTunesDB does not work right after I unplug the USB, it *might* work after a reset of the iPod. How weird is that? I verified that after the reboot the iTunesDB is exactly (cmp -bl) the same as before.

I'm now starting to think it's a RAM issue. According to http://ipodlinux.org/wiki/Generations#Fifth_Generation_.285G.29_.2F_Fifth_Generation_Enhanced_.285.5G.29 my 30GB turned 240GB iPod has 32MB of RAM. Maybe I should try to get a hold of a 60GB/80GB version (64GB of RAM)?

Using a binary search including a reset cycle, I was able to get it to work with 17759 files (then I got bored):

25026442 not_ok/18053/iTunesDB-plid
25826240 not_ok/18640/iTunesDB-plid
28968870 not_ok/20987/iTunesDB-plid
42047276 not_ok/30415/iTunesDB-plid
22566800 ok/16293/iTunesDB-plid
24192148 ok/17466/iTunesDB-plid
24621122 ok/17759/iTunesDB-plid

You can find the files here: http://richard.vdberg.org/gnupod/no_artwork/
I used the "plid" extension to show I've used the decrement-plid patch to produce those iTunesDBs.


? .gnupod_version
? Makefile
? autom4te.cache
? config.log
? config.status
? configure
Index: src/ext/Mktunes.pm
RCS file: /sources/gnupod/gnupod/src/ext/Mktunes.pm,v
retrieving revision 1.6
diff -u -r1.6 Mktunes.pm
--- src/ext/Mktunes.pm  6 Oct 2007 07:26:52 -0000       1.6
+++ src/ext/Mktunes.pm  13 Jun 2009 17:05:41 -0000
@@ -12,7 +12,7 @@
                my($class,%args) = @_;
                my $self = { Connection=>$args{Connection}, Mode=>MODE_ADDFILE, 
-                            ArrayFiles => [], CountFiles => 0, Sequence => 0,  
iPodName => $args{iPodName},
+                            ArrayFiles => [], CountFiles => 0, Sequence => 0, 
PlSequence => 0xFFFFFFFF, iPodName => $args{iPodName},
                             MasterPlaylist => [], Playlists => {}, 
SmartPlaylists => {},
                             FuzzyDb_Normal => {}, FuzzyDb_Lowercase => {} };
@@ -91,6 +91,8 @@
        sub GetFileCount        { my($self) = @_; return $self->{CountFiles};   
        # Increments Sequence counter
        sub GetNextId           { my($self) = @_; return ++$self->{Sequence};   
+       # Decrements PlSequence counter
+       sub GetPrevId           { my($self) = @_; return --$self->{PlSequence}; 
        # Dispatch connector
        sub GetConnection       { my($self) = @_; return $self->{Connection}    
        # Returns array to files
@@ -240,7 +242,7 @@
                        foreach my $fqid (@{$cont}) {
-                               my $current_id = $self->GetNextId;
+                               my $current_id = $self->GetPrevId;
                                my $current_mhod = 
                                my $current_mhip = 
GNUpod::iTunesDB::mk_mhip({childs => 1, plid => $current_id, sid=>$fqid, 
                                next unless (defined($current_mhod) && 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]