After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 637202 - libgpod-sharp exception when trying to sync
libgpod-sharp exception when trying to sync
Status: RESOLVED FIXED
Product: banshee
Classification: Other
Component: Device - iPod
git master
Other Linux
: Normal major
: 1.x
Assigned To: Banshee Maintainers
Banshee Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-12-14 00:25 UTC by Andrés G. Aragoneses (IRC: knocte)
Modified: 2010-12-14 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix for the problem (755 bytes, patch)
2010-12-14 01:02 UTC, Andrés G. Aragoneses (IRC: knocte)
committed Details | Review

Description Andrés G. Aragoneses (IRC: knocte) 2010-12-14 00:25:47 UTC
git master as of today, I'm getting this exception when syncing my iPod:

[7 Warn  01:22:28.597] Cannot save track to iPod - GLib.GException: No 'F..' directories found in '/media/KNOCPOD/iPod_Control/Music'. (in `libgpod-sharp')
  at GPod.ITDB.CopyTrackToIPod (GPod.Track track, System.String localPath) [0x00000] in <filename unknown>:0 
  at Banshee.Dap.AppleDevice.AppleDeviceTrackInfo.CommitToIpod (GPod.ITDB database) [0x003b8] in /home/knocte/banshee/src/Dap/Banshee.Dap.AppleDevice/Banshee.Dap.AppleDevice/AppleDeviceTrackInfo.cs:288 
  at Banshee.Dap.AppleDevice.AppleDeviceSource.PerformSyncThreadCycle () [0x000a2] in /home/knocte/banshee/src/Dap/Banshee.Dap.AppleDevice/Banshee.Dap.AppleDevice/AppleDeviceSource.cs:541 


The exception seems to lie because I have this directories:

knocte@lenovo:~$ ls /media/KNOCPOD/iPod_Control/Music
F02  F08  F26  F29

So I really don't know what is hapenning.
Comment 1 Andrés G. Aragoneses (IRC: knocte) 2010-12-14 00:36:50 UTC
The offending code in the binding is:

                public bool CopyTrackToIPod(Track track, string localPath) {
                        IntPtr gerror = IntPtr.Zero;
                        bool result = Itdb_iTunesDB.itdb_cp_track_to_ipod(track$
                        if (gerror != IntPtr.Zero)
                                throw new GException(gerror);
                        return result;
                }


So this seems to be a libgpod issue.
Comment 2 Andrés G. Aragoneses (IRC: knocte) 2010-12-14 01:02:21 UTC
Created attachment 176384 [details] [review]
Fix for the problem

Credit goes to Alan though, who told me to add this call at device initialization.
Comment 3 Andrés G. Aragoneses (IRC: knocte) 2010-12-14 09:54:00 UTC
Hey guys thanks for committing.

Before closing, can you guys check that it doesn't break in any way the synchronization with your devices? I'm a bit worried this didn't have much testing, and today the new release is expected IIRC.
Comment 4 Alex Launi 2010-12-14 14:43:48 UTC
Andés, it's safe. I read the code in libgpod. It is indeed non-destructive, and will just create missing bits.
Comment 5 Gabriel Burt 2010-12-14 18:05:10 UTC
Hey Alex, a couple nitpicks w/ your committing:

1) Please set the `git commit --author=""` value to the actual patch author and sign-off on the patch w/ -s
2) Keep the first line of your commit msgs short, around 50 chars

Also, I'm not sure why this patch is needed.  We already call ITDB.InitIpod if we fail to load the database.  Andres, did you have a "iPod database could be loaded, creating a new one" log message in your log?
Comment 6 Alex Launi 2010-12-14 18:30:34 UTC
This was from F## directories not existing. libgpod expects the full directory structure to already exist, it doesn't create it dynamically.

And as for the patch, it wasn't really the patch- you'll note there's a small difference in them.
Comment 7 Alex Launi 2010-12-14 18:30:35 UTC
This was from F## directories not existing. libgpod expects the full directory structure to already exist, it doesn't create it dynamically.

And as for the patch, it wasn't really the patch- you'll note there's a small difference in them.
Comment 8 Andrés G. Aragoneses (IRC: knocte) 2010-12-14 18:40:59 UTC
(In reply to comment #5)
> Also, I'm not sure why this patch is needed.  We already call ITDB.InitIpod if
> we fail to load the database. 

I guess that this means that in my case the database was being loaded successfully, but at the moment of the transfer of the songs the directory structure was not populated correctly. So I think the patch is still useful.

> Andres, did you have a "iPod database could be
> loaded, creating a new one" log message in your log?

I guess you mean "couldn't" instead of "could". No, I think I didn't get that.