Merge lp:~dobey/ubuntu/oneiric/banshee/faster-u1ms-loading into lp:ubuntu/oneiric/banshee

Proposed by dobey
Status: Merged
Merge reported by: dobey
Merged at revision: not available
Proposed branch: lp:~dobey/ubuntu/oneiric/banshee/faster-u1ms-loading
Merge into: lp:ubuntu/oneiric/banshee
Diff against target: 137 lines (+91/-2)
5 files modified
debian/changelog (+9/-0)
debian/control (+2/-2)
debian/patches/91_u1ms_switch_faster.patch (+54/-0)
debian/patches/92_avoid_source_race.patch (+24/-0)
debian/patches/series (+2/-0)
To merge this branch: bzr merge lp:~dobey/ubuntu/oneiric/banshee/faster-u1ms-loading
Reviewer Review Type Date Requested Status
Ubuntu branches Pending
Review via email: mp+80259@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Michael Terry (mterry) wrote :

I looked into this. After this and the libubuntuone patch [1], starting banshee with a u1ms url doesn't switch to the music store after startup. dobey is looking into it.

[1] https://code.launchpad.net/~dobey/ubuntu/oneiric/libubuntuone/faster-u1ms/+merge/80260

Revision history for this message
dobey (dobey) wrote :

This seems to be a race condition internal to banshee as best I can tell. When attempting to debug using banshee from git, the problem went away, and I can no longer replicate it. I'm not sure how to further debug that specific issue, either, as it appears to be a Heisenbug. :-/

130. By dobey

Backport patch to avoid race condition using idle handler (LP: #882732)

Revision history for this message
dobey (dobey) wrote :

Just pushed up with a new patch to also fix bug #872972 (the race) as well.

Revision history for this message
dobey (dobey) wrote :

Sorry, bug #882732 is the race. Not 872972.

Revision history for this message
Michael Terry (mterry) wrote :

Awesome, works great now. Pushed to oneiric-proposed.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2011-09-23 12:03:29 +0000
3+++ debian/changelog 2011-10-27 19:59:25 +0000
4@@ -1,3 +1,12 @@
5+banshee (2.2.0-1ubuntu3) oneiric-proposed; urgency=low
6+
7+ * Backport patch to allow opeing u1ms:// links faster (LP: #872972)
8+ - Also removes code which could cause freeze/crash (LP: #875632)
9+ - Require new version of libubuntuone for faster u1ms loading
10+ * Backport patch to avoid race condition using idle handler (LP: #882732)
11+
12+ -- Rodney Dawes <rodney.dawes@ubuntu.com> Thu, 27 Oct 2011 15:54:52 -0400
13+
14 banshee (2.2.0-1ubuntu2) oneiric; urgency=low
15
16 * [cd59790] Backport patch to add U1MS URI support (LP: #856542)
17
18=== modified file 'debian/control'
19--- debian/control 2011-09-21 13:54:50 +0000
20+++ debian/control 2011-10-27 19:59:25 +0000
21@@ -26,7 +26,7 @@
22 libgtk-sharp-beans2.0-cil-dev (>= 2.8),
23 libgpod-cil-dev (>= 0.7.95),
24 libgpod-cil-dev (<< 0.8.2),
25- libubuntuone1.0-cil-dev (>= 0.9.2),
26+ libubuntuone1.0-cil-dev (>= 0.11.0-0ubuntu3),
27 libwebkitgtk-dev (>= 1.2.2) | libwebkit-dev (>= 1.2.2),
28 libsoup2.4-dev (>= 2.26),
29 libsoup-gnome2.4-dev (>= 2.26),
30@@ -102,7 +102,7 @@
31 ${cli:Depends},
32 ${shlibs:Depends},
33 ${misc:Depends},
34- libubuntuone1.0-cil (>= 0.9.2)
35+ libubuntuone1.0-cil (>= 0.11.0-0ubuntu3)
36 Enhances: banshee
37 Description: Media Management and Playback application - U1MS extension
38 Banshee is a media management and playback application for the GNOME
39
40=== added file 'debian/patches/91_u1ms_switch_faster.patch'
41--- debian/patches/91_u1ms_switch_faster.patch 1970-01-01 00:00:00 +0000
42+++ debian/patches/91_u1ms_switch_faster.patch 2011-10-27 19:59:25 +0000
43@@ -0,0 +1,54 @@
44+From 16473cd9def9d706892439c71013e05558f69101 Mon Sep 17 00:00:00 2001
45+From: Rodney Dawes <rodney.dawes@canonical.com>
46+Date: Thu, 20 Oct 2011 19:19:46 +0000
47+Subject: Don't wait for the default URL loading any more
48+
49+Remove the callback for default URL being loaded
50+Just load u1ms:// URLs straight away from startup
51+
52+Fixes https://bugs.launchpad.net/ubuntu/+source/banshee/+bug/872972
53+Fixes https://bugzilla.gnome.org/show_bug.cgi?id=660818
54+diff --git a/src/Extensions/Banshee.UbuntuOneMusicStore/Banshee.UbuntuOneMusicStore/UbuntuOneMusicStoreSource.cs b/src/Extensions/Banshee.UbuntuOneMusicStore/Banshee.UbuntuOneMusicStore/UbuntuOneMusicStoreSource.cs
55+index d8e8656..6cedff0 100644
56+--- a/src/Extensions/Banshee.UbuntuOneMusicStore/Banshee.UbuntuOneMusicStore/UbuntuOneMusicStoreSource.cs
57++++ b/src/Extensions/Banshee.UbuntuOneMusicStore/Banshee.UbuntuOneMusicStore/UbuntuOneMusicStoreSource.cs
58+@@ -47,7 +47,6 @@ namespace Banshee.UbuntuOneMusicStore
59+ // In the sources TreeView, sets the order value for this source, small on top
60+ const int sort_order = 190;
61+ CustomView custom_view;
62+- string cached_startup_uri;
63+
64+ public UbuntuOneMusicStoreSource () : base (
65+ Catalog.GetString ("Ubuntu One Music Store"),
66+@@ -62,12 +61,11 @@ namespace Banshee.UbuntuOneMusicStore
67+
68+ // So we can handle u1ms:// URIs
69+ ServiceManager.Get<DBusCommandService> ().ArgumentPushed += OnCommandLineArgument;
70+- custom_view.store.UrlLoaded += OnDefaultStoreUrlLoaded;
71+
72+ // make sure that the u1ms uri gets handled on banshee startup
73+ foreach (string uri in ApplicationContext.CommandLine.Files) {
74+ if (IsU1msUri (uri)) {
75+- cached_startup_uri = uri;
76++ LoadU1msUri (uri);
77+ break;
78+ }
79+ }
80+@@ -83,17 +81,6 @@ namespace Banshee.UbuntuOneMusicStore
81+ get { return 0; }
82+ }
83+
84+- private void OnDefaultStoreUrlLoaded (object o, UbuntuOne.UrlLoadedArgs args)
85+- {
86+- if (args.Url.StartsWith( "http://stores.7digital.com/default")) {
87+- // we just do this the first time we load the default store view
88+- // so that we can switch to the passed u1ms uri and not have it switch out on us.
89+- custom_view.store.UrlLoaded -= OnDefaultStoreUrlLoaded;
90+- if (!string.IsNullOrEmpty (cached_startup_uri))
91+- LoadU1msUri (cached_startup_uri);
92+- }
93+- }
94+-
95+ private void OnCommandLineArgument (string uri, object value, bool isFile)
96+ {
97+ if (!isFile || String.IsNullOrEmpty (uri)) {
98
99=== added file 'debian/patches/92_avoid_source_race.patch'
100--- debian/patches/92_avoid_source_race.patch 1970-01-01 00:00:00 +0000
101+++ debian/patches/92_avoid_source_race.patch 2011-10-27 19:59:25 +0000
102@@ -0,0 +1,24 @@
103+From 9323f7b5c056ce52128dd4dfdf5b16abff8fb6e9 Mon Sep 17 00:00:00 2001
104+From: Rodney Dawes <dobey@gnome.org>
105+Date: Thu, 27 Oct 2011 19:09:22 +0000
106+Subject: Call the notify handler from a GLib idle delegate
107+
108+Uses a delegate in a glib idle callback to call the nofity handler.
109+We need to do this to avoid racing on startup with other activities
110+which can block the main loop, causing the handler to only work
111+sometimes, or only partially.
112+
113+Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=662883
114+diff --git a/src/Core/Banshee.Services/Banshee.Sources/SourceManager.cs b/src/Core/Banshee.Services/Banshee.Sources/SourceManager.cs
115+index d0878bd..289f954 100644
116+--- a/src/Core/Banshee.Services/Banshee.Sources/SourceManager.cs
117++++ b/src/Core/Banshee.Services/Banshee.Sources/SourceManager.cs
118+@@ -411,7 +411,7 @@ namespace Banshee.Sources
119+ if(handler != null) {
120+ SourceEventArgs args = new SourceEventArgs();
121+ args.Source = active_source;
122+- handler(args);
123++ GLib.Idle.Add (delegate { handler(args); return false; });
124+ }
125+
126+ source.Activate();
127
128=== modified file 'debian/patches/series'
129--- debian/patches/series 2011-09-23 12:03:29 +0000
130+++ debian/patches/series 2011-10-27 19:59:25 +0000
131@@ -12,4 +12,6 @@
132 workaround-clideps-winmm.patch
133 workaround-clideps-meego.patch
134 0001-U1MS-Ensure-that-u1ms-uris-passed-to-Banshee-at-star.patch
135+91_u1ms_switch_faster.patch
136+92_avoid_source_race.patch
137 99_ltmain_as-needed.patch

Subscribers

People subscribed via source and target branches

to all changes: