GNOME Bugzilla – Bug 547363
Copying track to PSP incorrectly appends additional audio folder
Last modified: 2008-11-14 22:35:04 UTC
Please describe the problem: Assume the mount point of a PSP (Playstation Portable) is /media/disk. When copying a track to the PSP source in Rhythmbox, the file is copied to /media/disk/PSP/MUSIC/PSP/MUSIC, when it should be copied to /media/disk/PSP/MUSIC. I tracked down the problem to two functions: impl_get_mount_path in plugins/generic-player/rb-psp-source.c impl_build_dest_uri in plugins/generic-player/rb-generic-player-source.c impl_get_mount_path returns /media/disk/PSP/MUSIC, but impl_build_dest_uri assumes this is the mount point /media/disk, not the audio folder, so impl_build_dest_uri appends the audio folder again (which it gets from Hal). I managed to fix it in 0.11.6 by changing impl_get_mount_path to return the mount path /media/disk rather then the audio folder path. I'm not sure if this is a bug in the psp source or in impl_build_dest_uri (although with a name like impl_get_mount_path I would think that it should return the mount path, not the audio folder path). The problem still exists in svn, but I couldn't get it working there for other reasons (it seems to expect a newer version of glib than I have, was causing me to seg fault), although the fix for the incorrect path is almost identical. Steps to reproduce: 1. Mount a PSP 2. Drag a track from the library to the PSP source 3. Check the PSP audio folder, path will be something like /media/disk/PSP/MUSIC/PSP/MUSIC/<copied folders> instead of /media/disk/PSP/MUSIC/<copied folders> Actual results: see 3 Expected results: see 3 Does this happen every time? yes Other information: There is also a problem that the PSP only supports one level of folder depth, but Rhythmbox copies files to <artist>/<album>/<track>, but I figured out this isn't a Rhythmbox problem but a Hal problem. The default fdi config doesn't set the folder_depth option like it should. Add the folder_depth option to that file (hal/fdi/information/10freedesktop/10-usb-music-players.fdi)and it works fine.
I think the real answer here is to allow subclasses of RBGenericPlayerSource to provide device information (list of folders, folder depth, audio formats, etc.). I've just fixed a few bits and pieces in there, but not the main issue.
I tested out the patch, and it fixes my main problem (the files are now copied to the correct place). Thank you very much for that. Most of that info should already be available in Hal, although it would be nice to be able to override it if it is missing (like the folder depth).
*** Bug 530658 has been marked as a duplicate of this bug. ***
With those 2 patches: http://lists.freedesktop.org/archives/hal/2008-November/012605.html http://lists.freedesktop.org/archives/hal/2008-November/012625.html And the recent changes I made to the PSP source, adding files to the top-level music folder should work as expected. I'm working on playlist support in bug 560864.