Bug 10419 - FWD/REW (scanning) broken for remote tracks
: FWD/REW (scanning) broken for remote tracks
Status: CLOSED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Scanner
: 7.3.0
: All All
: P2 major with 1 vote (vote)
: 7.x
Assigned To: Andy Grundman
http://forums.slimdevices.com/showthr...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-12-22 06:01 UTC by Alan Young
Modified: 2009-07-31 10:33 UTC (History)
4 users (show)

See Also:
Category: ---


Attachments
Proposed fix (2.79 KB, patch)
2008-12-22 08:38 UTC, Alan Young
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alan Young 2008-12-22 06:01:28 UTC
The changes to the transcoding framework have broken scanning for remote tracks. This is because the decision as to whether a track is seekable is made before starting to stream the track. In turn, this is on the assumption that the pre-scan (Scanner/Remote) will have set the duration in the DB, but in fact this only gets set when we start streaming.

Andy, is there any good reason why Scanner/Remote could not set this info?
Comment 1 Andy Grundman 2008-12-22 06:57:55 UTC
Yeah I think the scanner should be responsible for this, I'll take a look.
Comment 2 Dominic Evans 2008-12-22 08:17:40 UTC
Can't seek podcasts here. But is this the same issue with the iPlayer plugin too (i.e. any remote file)?
Comment 3 Alan Young 2008-12-22 08:38:35 UTC
Created attachment 4495 [details]
Proposed fix
Comment 4 Alan Young 2008-12-22 08:39:34 UTC
I expect the iPlayer and AlienBBC plugins may need updating. Not sure which yet.
Comment 5 Andy Grundman 2008-12-22 08:42:48 UTC
That looks OK, I am not sure we need the Content-Length code in the icy-br block, that should only be set for live streams.
Comment 6 Alan Young 2008-12-22 08:50:48 UTC
But that is where the bitrate is set, and hence where the duration could be worked out from the length.
Comment 7 Alan Young 2008-12-22 08:51:47 UTC
Actually, it looks like Alien is working fine wit this fix. iPlayer may be different - I cannot test it here.
Comment 8 Adrian Smith 2008-12-22 16:42:50 UTC
Alan - users of iPlayer (and I) report scanning being possible via the web interface, but not via the button mode interface sometimes.  Is this potentially related to this?
Comment 9 Alan Young 2008-12-22 22:37:49 UTC
I cannot see how it would work in one interface but not in others as the decision is first made in Song and then cached.
Comment 10 Adrian Smith 2008-12-23 02:49:15 UTC
Well it looks like iPlayer now no longer has the random problem with scanning - it won't do it at all!

Is there no way we can avoid making the decision early and use the headers returned when we play the stream to set the bitrate and length?

The reason iPlayer can't use this is that the scanning code does a normal http request using a standard request header and hence doesn't use my protocol handler.  I think the approach you have now restricts the ability to extend this via protocol handers...
Comment 11 Alan Young 2008-12-23 23:37:30 UTC
triode, do you try the idea of setting the flag directly, as we discussed?
Comment 12 Alan Young 2008-12-24 00:39:19 UTC
Change 24413.

Andy, I took out the icy-br clause setting of duration.
Comment 13 Alan Young 2008-12-24 00:46:22 UTC
Andy, I'm not really comfortable with the structure of Remote::parseAudioData(). It goes to the trouble of scanning the stream data for the bitrate and then only sets this, and now the duration, in the DB if the bitrate was not already known. Either we should not scan for the bitrate if we are not going to use the acquired info, or we should use it even if we think we already know it. Also, it sets the Track filesize field in this method, even though that info was known in readRemoteHeaders().

A separate issue is the way we call all the Slim::Music::Info methods for each field we want to set, causing a separate DB transaction each time. It would be better if we could bundle these up into a single call.
Comment 14 Adrian Smith 2008-12-24 11:46:07 UTC
Alan - looks like it works if I just set the canSeek flag to undef during header parsing, meaning that the originally cached value is not retained and we can update the bitrate/duration at stream start time.

Could this be used in the general case - i.e. don't cache until after the track is actually streaming and you have read the real headers of the stream?
Comment 15 Alan Young 2008-12-26 05:19:50 UTC
I'm not sure that there is an easy way to determine that. However, a suitable general API call might be Song::resetCanSeekCache().
Comment 16 Adrian Smith 2008-12-28 04:29:30 UTC
Alan - actually this doesn't work so easily in all cases.  For the direct streaming case the parseDirectHeader call includes $client so I can do this, for the proxied streaming case, parseHeaders doesn't include $client so I can't do this as I can't get to the song object.

There is a status variable in the song object - can this be used to restrict when the cache is started, otherwise can we look in $owner for this?  I think this is the streaming controller and it should know if we are streaming or not?
Comment 17 Adrian Smith 2008-12-30 09:40:33 UTC
Alan - turned out to be easier to fix iPlayer - as this can always seek for streams via the protocol handler I'm just including a canSeek method which always returns 1.  It seems ok to update the bitrate and duration later, but we always need to set can seek correctly the first time as it is cached..
Comment 18 Alan Young 2009-01-04 03:36:06 UTC
Great.
Comment 19 Richard Harnwell 2009-01-10 08:14:54 UTC
I'm a little unclear on the status of this. It is set to RESOLVED/FIXED, though it looks like some details of the solution are still being discussed. Would the proposed fix be found in any recent nightlies?
Comment 20 Alan Young 2009-01-10 08:26:00 UTC
Yes, it is fixed and the fix has been in the nightlies since Christmas. There was some additional discussion about the impact on iPlayer but this has also been resolved.
Comment 21 Richard Harnwell 2009-01-10 10:39:05 UTC
Thanks for the clarification.

I've downloaded the nightly and it certainly seems fixed now.
Comment 22 James Richardson 2009-01-16 13:37:28 UTC
(In reply to comment #21)
> Thanks for the clarification.
> 
> I've downloaded the nightly and it certainly seems fixed now.
> 

verified fix in SqueezeCenter 7.3.2 r24679
Comment 23 James Richardson 2009-01-22 09:58:47 UTC
Fixed - Closed Message (SC)

This bug has been fixed in the 7.3.3 release version of SqueezeCenter!

Please download the new version from http://www.slimdevices.com/su_downloads.html if you haven't already.  

If you are still experiencing this problem, feel free to reopen the bug with your new comments and we'll have another look.
Comment 24 James Richardson 2009-01-22 13:54:33 UTC
Correction: SqueezeCenter version is 7.3.2
Comment 25 Pete T. 2009-01-22 15:00:57 UTC
I'm not sure if it's the same bug, but I am running version 7.3.2 - 24695 and still getting "CANNOT SCAN THROUGH REMOTE TRACKS" message on the display of my Sqeezebox3 when trying to fast-forward or rewind.  But this only happens on mp3 files which have a .cue file associated with them (logical breakdown of tracks within a long mp3 file).  This used to work properly in old SqueezeCenter version (6.x).

I initially thought this bug was supposed to fix just that.  But now I see you guys closed it, yet I am still having the problem.

Thanks.
Comment 26 Alan Young 2009-01-23 01:13:56 UTC
Pete, That sounds like a different bug, even if the error message is the same. Please open a new bug for that specifically.
Comment 27 Pete T. 2009-01-23 13:31:14 UTC
Done.

https://bugs-archive.lyrion.org/show_bug.cgi?id=10805

Thanks,
Pete
Comment 28 Chris Owens 2009-07-31 10:33:39 UTC
Reduce number of active targets for SC