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 548131 - fetching cover art results in 100% cpu utilization
fetching cover art results in 100% cpu utilization
Status: RESOLVED FIXED
Product: banshee
Classification: Other
Component: Importing
1.2.1
Other Linux
: Normal normal
: 1.x
Assigned To: Banshee Maintainers
Banshee Maintainers
: 560475 564093 564180 571289 575110 576599 581498 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2008-08-17 14:28 UTC by Jochen Bartl
Modified: 2009-09-06 09:12 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Banshee log file (8.50 KB, text/plain)
2008-08-26 15:33 UTC, Majkijin
  Details
Change the cover art count query (973 bytes, patch)
2008-12-11 21:58 UTC, Bertrand Lorentz
committed Details | Review

Description Jochen Bartl 2008-08-17 14:28:15 UTC
I have always 100% cpu utilization after importing new songs via "Import Media -> Local Folder". Banshee tries to fetch the album covers and fails, but the application doesn't crash. My internet connection is working and I don't use a http proxy.

Here is the log file from "banshee-1 --debug":

[Debug 16:10:30.425] Player state change: Playing -> Paused
[Debug 16:13:00.368] Importing Media duration: 0.071002s
[Debug 16:13:10.166] Importing Media duration: 9.79161s
[Warn  16:13:15.993] Caught an exception - The remote server returned an error: (404) Not Found. (in `System')
  at System.Net.HttpWebRequest.CheckFinalStatus (System.Net.WebAsyncResult result) [0x00000] 
  at System.Net.HttpWebRequest.SetResponseData (System.Net.WebConnectionData data) [0x00000] 
[Warn  16:13:17.887] Caught an exception - The remote server returned an error: (404) Not Found. (in `System')
  at System.Net.HttpWebRequest.CheckFinalStatus (System.Net.WebAsyncResult result) [0x00000] 
  at System.Net.HttpWebRequest.SetResponseData (System.Net.WebConnectionData data) [0x00000] 
[Debug 16:13:28.636] TrackInfoDisplay RenderAnimation: 31.00 FPS
[Debug 16:14:26.898] Service disposed (CoverArtService)
[Debug 16:14:26.898] Service disposed (GStreamerCoreService)
[Debug 16:14:26.903] Service disposed (MultimediaKeysService)
[Debug 16:14:26.945] Service disposed (PodcastService)
[Debug 16:14:26.945] Service disposed (GnomeService)
[Debug 16:14:26.964] Service disposed (NotificationAreaService)
[Debug 16:14:26.965] Service disposed (BookmarksService)
[Debug 16:14:26.974] Service disposed (DapService)
[Debug 16:14:26.978] Service disposed (AudioCdService)
[Debug 16:14:26.980] Service disposed (NereidPlayerInterface)
[Debug 16:14:26.981] Service disposed (HardwareManager)
[Debug 16:14:26.982] (libbanshee:player) bp_stop: setting state to GST_STATE_NULL
[Debug 16:14:27.016] Player state change: Paused -> Idle
[Debug 16:14:27.020] (libbanshee:player) bp_destroy: disposed player
[Debug 16:14:27.020] Service disposed (PlayerEngine)
[Debug 16:14:27.029] Service disposed (SourceManager)
[Warn  16:14:27.036] Caught an exception - Object reference not set to an instance of an object (in `Banshee.CoverArt')
  at Banshee.CoverArt.CoverArtJob.RunQuery () [0x00000] in /build/buildd/banshee-1-1.2.1/src/Extensions/Banshee.CoverArt/Banshee.CoverArt/CoverArtJob.cs:105 
  at Banshee.CoverArt.CoverArtJob.Run () [0x00096] in /build/buildd/banshee-1-1.2.1/src/Extensions/Banshee.CoverArt/Banshee.CoverArt/CoverArtJob.cs:126 
[Debug 16:14:27.130] Service disposed (DbConnection)

When I'm playing one of the newly imported songs, the following error message alwys appears in the debug log:

[Warn  16:15:32.133] Caught an exception - The remote server returned an error: (404) Not Found. (in `System')
  at System.Net.HttpWebRequest.CheckFinalStatus (System.Net.WebAsyncResult result) [0x00000] 
  at System.Net.HttpWebRequest.SetResponseData (System.Net.WebConnectionData data) [0x00000]

OS: Ubuntu Hardy
Banshee Version: 1.2.1
Banshee Version from Repository: deb http://ppa.launchpad.net/banshee-team/ubuntu hardy main

regards,

jochen
Comment 1 Jochen Bartl 2008-08-17 14:39:17 UTC
I forgot to mention that "Tools -> Cover Art -> Download Cover Art" also results in 100% cpu utilization. When I open now the "Stop Downloading Cover Art" dialog and click on the "Stop" button, I get no debug output and banshee stil tries to fetch the cover art. But after exiting from banshee, the last debug log message is:

[Warn  16:29:56.948] Caught an exception - Object reference not set to an instance of an object (in `Banshee.CoverArt')
  at Banshee.CoverArt.CoverArtJob.Run () [0x0002e] in /build/buildd/banshee-1-1.2.1/src/Extensions/Banshee.CoverArt/Banshee.CoverArt/CoverArtJob.cs:121 
[Debug 16:29:57.039] Service disposed (DbConnection)
Comment 2 Majkijin 2008-08-26 15:33:00 UTC
Created attachment 117410 [details]
Banshee log file

Created by launching kill -s QUIT $(pidof banshee-1); cp ~/.config/banshee-1/log ~/Desktop/banshee.log
Comment 3 Majkijin 2008-08-26 15:34:10 UTC
I have similar problem. While trying to download the album cover banshee is using 100% of CPU. There is no way to cancel the download process. Clicking the suitable for cancelling button, gives no effect. The only way to fix this problem is to restart banshee. After that, the album cover of which downloading caused the problem is available in banshee and appears while playing the tracks from that album. I've attached the log file which had been created by launching this command: kill -s QUIT $(pidof banshee-1); cp ~/.config/banshee-1/log ~/Desktop/banshee.log
Comment 4 Bertrand Lorentz 2008-11-12 20:27:05 UTC
*** Bug 560475 has been marked as a duplicate of this bug. ***
Comment 5 Dag Ringdal 2008-12-03 21:50:15 UTC
I encounter the same problem with the cover art fetching plugin.
When a new album is imported to Banshee the the program start searching
for new album cover. It doesn't stop, keeps going and the cpu power is
drained out of my linux box. I have a two kernel prosessor. And Banshee
uses ordinarly less than 3% av the cpu resources. when fetching album
art it uses up to 90% of the cpu available.

I have to stop the program to reset. I haven't experienced this before,
and I have used Benahee for some month's.
-- 
mvh

Dag R
Comment 6 Bertrand Lorentz 2008-12-11 18:27:03 UTC
*** Bug 564093 has been marked as a duplicate of this bug. ***
Comment 7 Bertrand Lorentz 2008-12-11 21:43:39 UTC
*** Bug 564180 has been marked as a duplicate of this bug. ***
Comment 8 Bertrand Lorentz 2008-12-11 21:44:42 UTC
The log from bug #564180 :

[Debug 15:39:30.943] Executed in 111ms 
            SELECT DISTINCT CoreAlbums.AlbumID, CoreAlbums.Title, CoreArtists.Name, CoreTracks.Uri, CoreTracks.UriType
            FROM CoreTracks, CoreArtists, CoreAlbums
            WHERE
                CoreTracks.PrimarySourceID = 1 AND
                CoreTracks.DateUpdatedStamp > 1203107966 AND
                CoreTracks.AlbumID = CoreAlbums.AlbumID AND 
                CoreAlbums.ArtistID = CoreArtists.ArtistID AND
                CoreTracks.AlbumID NOT IN (
                    SELECT AlbumID FROM CoverArtDownloads WHERE
                        LastAttempt > 1202503166 OR Downloaded = 1)
            GROUP BY CoreTracks.AlbumID LIMIT 10
[Debug 15:39:31.030] Executed in 77ms 
            SELECT count(DISTINCT CoreTracks.AlbumID)
            FROM CoreTracks
            WHERE
                CoreTracks.PrimarySourceID = 1 AND
                CoreTracks.DateUpdatedStamp > 1203107966 AND
                CoreTracks.AlbumID NOT IN (
                    SELECT AlbumID FROM CoverArtDownloads WHERE
                        LastAttempt > 1202503166 OR Downloaded = 1)
[Debug 15:39:31.138] Executed in 106ms 
            SELECT DISTINCT CoreAlbums.AlbumID, CoreAlbums.Title, CoreArtists.Name, CoreTracks.Uri, CoreTracks.UriType
            FROM CoreTracks, CoreArtists, CoreAlbums
            WHERE
                CoreTracks.PrimarySourceID = 1 AND
                CoreTracks.DateUpdatedStamp > 1203107966 AND
                CoreTracks.AlbumID = CoreAlbums.AlbumID AND 
                CoreAlbums.ArtistID = CoreArtists.ArtistID AND
                CoreTracks.AlbumID NOT IN (
                    SELECT AlbumID FROM CoverArtDownloads WHERE
                        LastAttempt > 1202503166 OR Downloaded = 1)
            GROUP BY CoreTracks.AlbumID LIMIT 10
[Debug 15:39:31.199] Executed in 58ms 
            SELECT count(DISTINCT CoreTracks.AlbumID)
            FROM CoreTracks
            WHERE
                CoreTracks.PrimarySourceID = 1 AND
                CoreTracks.DateUpdatedStamp > 1203107966 AND
                CoreTracks.AlbumID NOT IN (
                    SELECT AlbumID FROM CoverArtDownloads WHERE
                        LastAttempt > 1202503166 OR Downloaded = 1)
Comment 9 Bertrand Lorentz 2008-12-11 21:51:01 UTC
Banshee gets into an infinite loop because the "count" query return 1, but the other query returns no result.
This happens when a database contains entries in CoreTracks whose AlbumID or ArtistID is wrong.

You can check it by running the two following commands :

sqlite3 ~/.config/banshee-1/banshee.db "select count(*) from coretracks where albumid not in (select albumid from corealbums)"

sqlite3 ~/.config/banshee-1/banshee.db "select count(*) from coretracks where artistid not in (select artistid from coreartists)"

If any of those have a non zero value, that's a problem.

I'll post a patch to work around this.
Comment 10 Bertrand Lorentz 2008-12-11 21:58:03 UTC
Created attachment 124460 [details] [review]
Change the cover art count query

This patch changes the count query so that it has the same "where" clause as the other query. This should prevent the infinite loop.
The change probably degrades the performance of the query, I'm not sure about the impacts.
Comment 11 Gabriel Burt 2009-01-13 18:57:32 UTC
Bertrand, please commit after 1.4.2 assuming you've tested this.
Comment 12 Bertrand Lorentz 2009-01-21 21:38:29 UTC
This problem has been fixed in our software repository. The fix will go into the next software release. Thank you for your bug report.

The patch degrades the performance of the count query by 20 or 30% in my tests, but it's still running in less than 50ms on my system.
Comment 13 Bertrand Lorentz 2009-02-11 21:26:20 UTC
*** Bug 571289 has been marked as a duplicate of this bug. ***
Comment 14 Bertrand Lorentz 2009-03-23 22:46:32 UTC
*** Bug 575110 has been marked as a duplicate of this bug. ***
Comment 15 Bertrand Lorentz 2009-03-25 19:55:08 UTC
*** Bug 576599 has been marked as a duplicate of this bug. ***
Comment 16 David Nielsen 2009-03-28 16:59:02 UTC
We have several reports of this happening on 1.4.3

Please reopen

http://mail.gnome.org/archives/banshee-list/2009-March/msg00216.html
Comment 17 Bertrand Lorentz 2009-03-28 17:56:21 UTC
As I said in my e-mail, the fix did NOT make it into 1.4.3, but it is in trunk.

Bug #575110 turned out to be caused by the same problem.
Comment 18 Gabriel Burt 2009-06-02 21:53:56 UTC
*** Bug 581498 has been marked as a duplicate of this bug. ***
Comment 19 Mike 2009-09-06 09:12:17 UTC
Yup I've had this - had to disable fetching cover art completely! Good to hear it's fixed in 1.6 beta :)