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 343785 - Mass storage updates
Mass storage updates
Status: RESOLVED FIXED
Product: banshee
Classification: Other
Component: general
git master
Other Linux
: Normal normal
: 2.x
Assigned To: Banshee Maintainers
Banshee Maintainers
: 337800 337829 340781 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2006-06-03 20:31 UTC by James Stembridge
Modified: 2006-06-13 18:22 UTC
See Also:
GNOME target: ---
GNOME version: 2.13/2.14


Attachments
Mass storage fixes/updates (24.00 KB, patch)
2006-06-03 20:31 UTC, James Stembridge
reviewed Details | Review
Patch updated for CVS (21.88 KB, patch)
2006-06-04 20:29 UTC, James Stembridge
none Details | Review
Updated patch (25.75 KB, patch)
2006-06-06 22:48 UTC, Gabriel Burt
committed Details | Review

Description James Stembridge 2006-06-03 20:31:04 UTC
The attached patch addresses a number of issues with and adds features to mass storage DAP support. Below is a summary of the parts of this that I have been involved with, I'll leave Gabriel to comment on the parts he wrote:

Bugs fixed:
* Starting Banshee with the DAP already plugged in would cause a crash. This was caused by starting the scanning of tracks on the device before the GUI was loaded. As scanning uses ImportManager which in turn uses the GUI this caused the crash. Fixed by delaying the scanning until after the GUI is initialized.

* Filenames of tracks copied to the DAP are not escaped properly. Fixed by escaping the filename components using the existing FilenamePattern.Escape method.

* The DAP volume's name is always used as the name in the interface, even if it's empty. Fixed by checking for an empty volume name and reverting to the device name if necessary.

* When finding the VFS volume for the DAP the block device was incorrectly matched against the non-existing block_device attribute, which caused the incorrect VFS volume to be associate with the DAP or for loading to fail entirely. Fixed by correcting the attribute to block.device.

* When finding the VFS volume for the DAP it was assumed that VFS would already know about the device, which is not always the case. Fixed by allowing the VFS volume to be found when VFS subsequently figures out it exists.

New features:
* Support for locating mass storage DAPs by the presence of a .is_audio_player file in the root of the device as well as by hal attributes. Creating this file is much easier than trying to create fdi files for use with unsupported DAPs. Rhythmbox also supports this method of device detection. In order to support this the device scanning on startup had to be modified such that all volumes on the system are passed to the DAP plugins for checking, I can't foresee any situations in which this would be problematic.
Comment 1 James Stembridge 2006-06-03 20:31:59 UTC
Created attachment 66712 [details] [review]
Mass storage fixes/updates
Comment 2 James Stembridge 2006-06-03 20:33:39 UTC
*** Bug 337800 has been marked as a duplicate of this bug. ***
Comment 3 James Stembridge 2006-06-03 20:34:04 UTC
*** Bug 337829 has been marked as a duplicate of this bug. ***
Comment 4 James Stembridge 2006-06-03 20:35:40 UTC
Just remembered, the patch also adds meta-info based duplicate detection so you can't copy the same track to the device multiple times .
Comment 5 Aaron Bockover 2006-06-03 20:50:40 UTC
Just commenting to remind me to take a good look at this later, I'm out of time for today. Thanks James, Gabriel!
Comment 6 James Stembridge 2006-06-04 20:29:40 UTC
Created attachment 66745 [details] [review]
Patch updated for CVS
Comment 7 Mikayla Hutchinson 2006-06-05 00:02:48 UTC
*** Bug 340781 has been marked as a duplicate of this bug. ***
Comment 8 Gabriel Burt 2006-06-06 22:48:34 UTC
Created attachment 66863 [details] [review]
Updated patch

This is a slightly updated version of the patch.
Comment 9 James Stembridge 2006-06-07 14:22:32 UTC
Gabriel,

The additional logic you've added around checking the mounted status
seems unnecessary, specifically:

private bool mounted = false
...
volume = monitor.GetVolumeForPath(MountPoint);
if (volume == null) {
   // Gnome VFS doesn't know volume is mounted yet
   monitor.VolumeMounted += OnVolumeMounted;
   is_read_only = true;
} else {
   mounted = true;
   is_read_only = volume.IsReadOnly;
}

If volume is null it doesn't mean that the volume isn't mounted yet
(we can't ever get to this situation due to the previous check on the
volume.is_mounted property) rather it just means that VFS hasn't
noticed that it's mounted yet. This means we can always carry on
regardless of what VFS says as we've already established that it's
mounted.

Also, you seem to have reverted my change to base duplicate detection
on meta info rather than filename. I think meta info detection should
be more reliable?
Comment 10 Gabriel Burt 2006-06-07 17:21:21 UTC
James,

Regarding the extra logic, I was noticing that my iAudio would appear in the source list but it's tracks would not be loaded when I plugged it in after starting Banshee -- so I added that logic and it worked.  Perhaps the problem was somewhere else - if it's consistently working for you with out it, ok.

Regarding duplicate detection, I didn't mean to revert anything - I was trying to merge changes to the patch that I had made and must have missed something.  Can you elaborate or attach an updated version of the patch that has your changes?

Thanks
Comment 11 Gabriel Burt 2006-06-12 21:34:36 UTC
I committed the patch I attached above.  I looked through your most recently attached patch, James, and couldn't tell what you meant by using meta data to detect duplicates.  Since there were so many other changes in this patch, I figured it was better to get them in and we'll tweak/fix problems one by one from now on.
Comment 12 James Stembridge 2006-06-13 18:22:16 UTC
Ok, no worries. 

I've opened bugs #344797 and #344795 for the only problems I've seen so far.