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 628675 - Banshees new ipod/iphone support does not sync playlists
Banshees new ipod/iphone support does not sync playlists
Status: RESOLVED FIXED
Product: banshee
Classification: Other
Component: Device - iPod
git master
Other Linux
: High normal
: 1.8
Assigned To: Banshee Maintainers
Banshee Maintainers
: 629982 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2010-09-03 08:51 UTC by Alan McGovern
Modified: 2010-09-28 15:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch to fix memory corruption in libgpod-sharp (9.19 KB, patch)
2010-09-12 22:27 UTC, Alan McGovern
committed Details | Review
Patch to banshee to add playlist support (6.70 KB, patch)
2010-09-12 22:46 UTC, Alan McGovern
committed Details | Review
libgpod patch, return null if Podcasts playlist is null (1.54 KB, patch)
2010-09-23 20:30 UTC, Gabriel Burt
committed Details | Review
libgpod patch, add Playlists ctor (1.10 KB, patch)
2010-09-23 20:31 UTC, Gabriel Burt
none Details | Review
libgpod patch, return null if Master playlist null (1.22 KB, patch)
2010-09-23 21:36 UTC, Gabriel Burt
none Details | Review
libgpod patch, return null if Master playlist null, v2 (fix whitespace) (1.21 KB, patch)
2010-09-23 21:38 UTC, Gabriel Burt
committed Details | Review
libgpod patch, add Playlists ctor (v2) (1.07 KB, patch)
2010-09-24 18:19 UTC, Gabriel Burt
committed Details | Review

Description Alan McGovern 2010-09-03 08:51:49 UTC
This should be implemented by 1.7.6. It may require another release of libgpod-sharp in order to implement this as it may be missing required API points.
Comment 1 Alan McGovern 2010-09-12 22:27:20 UTC
Created attachment 170102 [details] [review]
patch to fix memory corruption in libgpod-sharp

Step 1: Fix memory corruption issues when accessing any of the glists exposed in libgpod.

Can I get this pushed upstream pretty please? ;)
Comment 2 Alan McGovern 2010-09-12 22:46:23 UTC
Created attachment 170103 [details] [review]
Patch to banshee to add playlist support

Aaand done. That was easy :)
Comment 3 Christophe Fergeau 2010-09-13 08:30:15 UTC
(In reply to comment #1)
> Step 1: Fix memory corruption issues when accessing any of the glists exposed
> in libgpod.

Do I understand the patch correctly that there is an iteration over the whole GList everytime something like Itdb.get_tracks() is called? This can get really costly with 10000 tracks in the databas if called too often. Wouldn't it be possible to get rid of the bindings for itdb_track_remove and similar, and to silently call these when a native C# remove is called on the container you use for the tracks, or something in that spirit ?
Comment 4 Alan McGovern 2010-09-18 11:14:10 UTC
*** Bug 629982 has been marked as a duplicate of this bug. ***
Comment 5 Ian Berke 2010-09-20 17:00:40 UTC
Has this been fixed in 1.7.6?  because it ain't working for me.  My ipod classic syncs and the playlists show up in the ipod submenu of banshee, but when I eject they're not on the device.
Comment 6 Andrés G. Aragoneses (IRC: knocte) 2010-09-20 17:02:18 UTC
(In reply to comment #5)
> Has this been fixed in 1.7.6?

The bug doesn't have the status FIXED. Does that answer your question?
Comment 7 Ian Berke 2010-09-20 17:23:10 UTC
Only brings up another.... why not?  There are patches for it in git before 1.7.6 was released. This has been a real killer for me and I'm ready to drop banshee, even though I like everything else. But thanks for the cheeky response.
Comment 8 Jensen Somers 2010-09-20 17:32:20 UTC
There are a few things which had to be verified and some other issues that came up with a higher priority. It's a lot worse when Banshee doesn't work at all than when just some things don't perfectly work.

Banshee 1.8 (which is a stable release, 1.7 is an unstable series so it is perfectly possible things break) is set to be released somewhere next week and this issue will be fixed without a doubt.
Comment 9 Ian Berke 2010-09-20 17:51:48 UTC
Thank you.  I appreciate all the work you do in making a really great piece of software.  I waited patiently for a couple of weeks and was only a bit disappointed when the patch wasn't included in the recent release.  I look forward to 1.8.
Comment 10 Andrés G. Aragoneses (IRC: knocte) 2010-09-20 17:55:11 UTC
(In reply to comment #7)
> Only brings up another.... why not?  There are patches for it in git before

In git? I guess you mean bugzilla, not git. If they were in git they would be marked here as "committed".

> But thanks for the cheeky response.

I just try to teach people how the bug lifecycle works if they don't seem to know.
Comment 11 Gabriel Burt 2010-09-20 20:40:01 UTC
Review of attachment 170103 [details] [review]:

Fine with me -- obviously blocks on the libgpod changes.
Comment 12 Alan McGovern 2010-09-20 20:56:21 UTC
Hey,

Just to answer the original question, "Is this in 1.7.6", the answer is no. The reason was there was a very difficult to debug memory corruption issue. It took quite a lot of my free time to track down and by the time I had it figured out there wasn't enough time left for me to get everything committed and tested before 1.7.6, so I held off. Better to have no playlist support than have banshee crashing every time you try and sync anything.

Secondly, if you're getting any kind of playlists showing up you must not be running the AppleDevice extension. It still has zero support for playlists. Could you check in the banshee extensions list that "Apple Device" is there and is enabled? It sounds like you have the ipod-sharp plugin enabled.

Anyway, all the patches are ready now, I'm just doing some more testing to ensure there's definitely no memory corruption issues and then I'm going to upstream all the work. This will require another libgpod-sharp release as well as another banshee release. If you want to to help test things in the meantime, please do! Just compile banshee and libgpod-sharp from their respective repositories and let us know if everything works as expected.

I'll update this bug again when everything is upstreamed.
Comment 13 Gabriel Burt 2010-09-20 21:11:25 UTC
Review of attachment 170102 [details] [review]:

::: bindings/mono/libgpod-sharp/GPodList.cs
@@ +29,2 @@
 		protected HandleRef handle;
+		protected abstract GLib.List List {

Christopher is right, creating new Lists each time is not good.  This is painful b/c the GLib.List binding isn't complete (really doesn't support lists that change very well).

I think we should store the IntPtr to the List, and implement/bind Count and this[int] manually by calling g_list_length(list_ptr) g_list_nth_data (list_ptr, int).  GetEnumerator can be implemented using Count and this[].

Alan, do we really need to make a copy of the list before enumerating it to avoid collection-modified type issues (albeit in native memory land)?  Can we either add a lock or throw an exception if the user calls Insert/Remove while iterating, or just ignore it and assume users will use it properly?
Comment 14 Gabriel Burt 2010-09-20 21:46:51 UTC
Ok, talked to Alan about this on IRC some and looked deeper at GLib.List/ListBase -- I think I'd thought that it iterated the collection each time you made a new List, but it doesn't -- it just wraps the native pointer -- so the overhead is just a few dozen bytes of memory.

I asked Alan if we could get rid of the Enumerator list copy, and he thinks we can.  Given that, I think the rest of it is OK for now -- it's not ideal to create a new (relatively cheap) GLib.List each time Count or this[] is called, but it does fix the currently very broken code.

Plus, with his patch to Banshee, the only things we're actually using are the Enumerator and Add functions.
Comment 15 Ian Berke 2010-09-21 00:51:47 UTC
Hi,

To follow up, I do have the "Apple device Support" extension enabled (I also have MTP and Mass Storage Media Player support enabled, no libgpod is listed in the version info).  I'm happy to test out the newest and greatest releases, I'll add the Banshee daily build ppa repository to my sources list.

BTW, sorry I was confused regarding the status.  I had seen the suggestion of the patch being included in 1.7.6 and thought it was in git because all emails have "git master" near the header.  It also wasn't clear how important and related the memory issue was from the comment thread, but as a layman end user I'm glad you are all working so hard on this.
Comment 16 Ian Berke 2010-09-21 00:52:37 UTC
sorry libgpod is listed in version info
Comment 18 Christophe Fergeau 2010-09-21 18:02:34 UTC
(In reply to comment #17)
> libgpod patch committed upstream:
> http://gtkpod.git.sourceforge.net/git/gitweb.cgi?p=gtkpod/libgpod;a=commit;h=c5c64bd98989074523e83a395b8efe7358e8c05d

I think there's a second patch needed for playlist support which adds a constructor for ItdbPlaylist.
Comment 19 Gabriel Burt 2010-09-23 20:30:55 UTC
Created attachment 170962 [details] [review]
libgpod patch, return null if Podcasts playlist is null
Comment 20 Gabriel Burt 2010-09-23 20:31:14 UTC
Created attachment 170963 [details] [review]
libgpod patch, add Playlists ctor
Comment 21 Gabriel Burt 2010-09-23 20:31:53 UTC
Comment on attachment 170102 [details] [review]
patch to fix memory corruption in libgpod-sharp

Nathaniel, please mark patches at committed when appropriate.
Comment 22 Christophe Fergeau 2010-09-23 21:14:24 UTC
Review of attachment 170962 [details] [review]:

A similar patch is probably needed for the master playlist since it might not exist when creating a new empty database from scratch using itdb_new (though I'm not sure people will try to do this)
Comment 23 Gabriel Burt 2010-09-23 21:36:14 UTC
Created attachment 170967 [details] [review]
libgpod patch, return null if Master playlist null
Comment 24 Gabriel Burt 2010-09-23 21:38:37 UTC
Created attachment 170968 [details] [review]
libgpod patch, return null if Master playlist null, v2 (fix whitespace)
Comment 25 Christophe Fergeau 2010-09-24 18:15:44 UTC
Review of attachment 170963 [details] [review]:

::: bindings/mono/libgpod-sharp/Playlist.cs
@@ +130,3 @@
 								  set { ((Itdb_Playlist *) Native)->type = (byte) (value ? 1 : 0); } }
 
+		public Playlist(string name, bool smartPlaylist) : base (Itdb_Playlist.itdb_playlist_new (name, smartPlaylist)) {}

This is your call, but for now I'd just add a Playlist(string name) constructor since this boolean is unlikely to be enough to get smart playlist handling working. Moreover, you might want to expose smart playlists as deriving from Playlist. Maybe it won't make sense, but until you do know for sure how you want to handle smart playlist, I'd recommend not adding this boolean.

Once again, this is your call, if you want this patch to go in as is, I'm fine with it.
Comment 26 Gabriel Burt 2010-09-24 18:19:25 UTC
Created attachment 171054 [details] [review]
libgpod patch, add Playlists ctor (v2)

I agree with your advice; updated patch attached.
Comment 27 Jensen Somers 2010-09-25 10:00:06 UTC
I feel there are certain things not yet working as expected which is why I am reopening this issue.

What works:
* Add several songs to the iPod.
* Create a playlist on the iPod.
* Select the songs from the Music category on the iPod and add them to the playlist created in the previous step.

What doesn't work:
* Create a playlist in Banshee. (Just a regular one, I did not test a smart one.)
* Drag & drop the newly created playlist on the iPod.

The songs were transferred correctly but the playlist was not created on the device and thus the songs were not added to it.
Comment 28 Gabriel Burt 2010-09-28 14:53:27 UTC
Jensen, AFAICT what you describe has never worked with any DAP backend.  Please see if there's already a bug filed about it, and if not file one.  Re-closing since AppleDevice at least isn't regressing compared to other DAP support now.
Comment 29 Michael Martin-Smucker 2010-09-28 15:24:57 UTC
Looks like the functionality described in Comment 27 is actually Bug 551604 -- a fairly popular request, but not a regression with AppleDevice.