Bug 7012 - Now Playing art doesn't always work when on SN
: Now Playing art doesn't always work when on SN
Status: CLOSED FIXED
Product: SB Controller
Classification: Unclassified
Component: Screensavers
: unspecified
: Macintosh Other
: P1 normal (vote)
: 7.0
Assigned To: Brandon Black
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-02-07 13:46 UTC by Andy Grundman
Modified: 2009-09-08 09:23 UTC (History)
4 users (show)

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andy Grundman 2008-02-07 13:46:52 UTC
I have no idea why this happens, but NP artwork sometimes stops working if you're on SN.
Comment 1 Blackketter Dean 2008-02-07 22:30:01 UTC
Andy: Can you tell if Jive is requesting the artwork at all?  How often have you seen this?
Comment 2 Ben Klaas 2008-02-08 09:31:26 UTC
I think from what Andy described we should have this on the 7.0 target list for now. If we see it's not a readily reproducible problem, then move it to 7.0.1.
Comment 3 Blackketter Dean 2008-02-08 15:59:52 UTC
The importance of this is proportional to how often it happens.  :)

Comment 4 Andy Grundman 2008-02-08 17:18:23 UTC
Possibly related to this: after a while the radio and music services icons no longer work.
Comment 5 Chris Owens 2008-02-11 10:02:27 UTC
http logging would be helpful.  Andy and Steven note that sometimes it affects all artwork, not just album art.  Richard notes switching between SqueezeCenter and SqueezeNetwork might make this happen.
Comment 6 Brandon Black 2008-02-11 21:44:52 UTC
I've found one way to reliably trigger the bug while on SN: switch over to SomaFM for a while (or presumably any random noncommercial radio stream with no official icon/artwork).  Once you've hit NowPlaying / Screensaver / whatever a few times the artwork fetch queue will be permanently full and icons/artwork will break everywhere (unless they're already cached I guess).

I've found two ways to fix this.  I'm not 100% sure either of them is completely correct, but WorksForMe.  At Andy's suggestion I committed the simpler (higher-level) of the two so it would make tonight's nightly build, but Richard may well replace that with something better.

The simpler fix I committed:

Index: jive/share/jive/net/RequestHttp.lua
===================================================================
--- jive/share/jive/net/RequestHttp.lua	(revision 1914)
+++ jive/share/jive/net/RequestHttp.lua	(working copy)
@@ -346,6 +346,9 @@
 				end
 			end
 		else
+			if not err then
+				err = "HTTP request failed with code" .. code
+			end
 			sink(nil, err)
 		end
 	end


The deeper fix which makes the above unecessary, but I'm not very confident about whether is the The Right Thing:

Index: jive/share/jive/net/SocketHttp.lua
===================================================================
--- jive/share/jive/net/SocketHttp.lua	(revision 1914)
+++ jive/share/jive/net/SocketHttp.lua	(working copy)
@@ -363,7 +363,7 @@
 				
 			if data then
 				statusCode = tonumber(data)
-				statusLine = chunk
+				statusLine = chunk or statusCode
 			else
 				self:close(err)
 				return

------

In either case, the bottom line for the artwork thing is that if the http layer calls the artwork sink with no chunk data and no error code (due to, say, a 404 error which produced no statusLine), the count of outstanding artwork fetches doesn't get decremented, which leaks one of the 4 entries and eventually leads to no artwork being fetched at all.
Comment 7 Richard Titmuss 2008-02-12 03:04:53 UTC
Actually this looks like a bug during refactoring, the patch should be:


Index: jive/share/jive/net/SocketHttp.lua
===================================================================
--- jive/share/jive/net/SocketHttp.lua  (revision 1914)
+++ jive/share/jive/net/SocketHttp.lua  (working copy)
@@ -363,7 +363,7 @@

                        if data then
                                statusCode = tonumber(data)
-                               statusLine = chunk
+                               statusLine = line
                        else
                                self:close(err)
                                return


I'll include this in my http pipelining changes today.
Comment 8 Richard Titmuss 2008-02-12 03:55:07 UTC
Fixed in r1916. Brandon, can you please test this.
Comment 9 Brandon Black 2008-02-12 08:32:03 UTC
Richard: r1916 works as far as the original artwork issue goes (but then again r1915's change is still in there, which would mask the underlying problem anyways).  But I think the other half of r1916 (pipelining stuff) has introduced some related new bug.  Ben and Andy are saying on softjive the first icon in menus like Internet Radio or Music Services is missing, but the rest are fine (but scrolling down and back up fixes it).  I also had some problems getting Pandora to play at all on real hardware, until I played it via the SN Web UI first, then it started working...
Comment 10 Brandon Black 2008-02-12 09:57:36 UTC
Richard made another fix in r1918 that seems to have cleared all related issues up, at least for me.  If there's anything new it probably needs to be a new bug.  Anyone else watching this still able to reproduce artwork issues w/ r1918?
Comment 11 Blackketter Dean 2008-02-12 12:09:38 UTC
Marking as fixed.  Please reopen if you can reproduce.
Comment 12 James Richardson 2008-05-15 13:03:21 UTC
This bug has recently been fixed in the latest release of SqueezeCenter 7.0.1

Please try that version, if you still see the error, then reopen this bug.

To download this version, please navigate to: http://www.slimdevices.com/su_downloads.html