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 664402 - [gapless] Banshee track slider displaying incorrectly, incorrect time
[gapless] Banshee track slider displaying incorrectly, incorrect time
Status: RESOLVED WONTFIX
Product: banshee
Classification: Other
Component: Playback
2.2.0
Other Linux
: Normal normal
: ---
Assigned To: Banshee Maintainers
Banshee Maintainers
gnome[unmaintained]
Depends on:
Blocks:
 
 
Reported: 2011-11-20 01:37 UTC by Chow Loong Jin
Modified: 2020-03-17 09:27 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Screenshot of defunct slider (140.44 KB, image/png)
2011-11-20 01:37 UTC, Chow Loong Jin
Details

Description Chow Loong Jin 2011-11-20 01:37:52 UTC
Created attachment 201725 [details]
Screenshot of defunct slider

Originally reported at:
  https://bugs.launchpad.net/bugs/869301

Recently discovered a bug with Banshee. The track slider/skipper displays the correct time periods for the first track off an album, but then instead of sliding when the next track is played it stays static and the track time displayed below displays the total of the tracks played rather than per song.

I have attached a screenshot

Cheers

Description:	Ubuntu oneiric (development branch)
Release:	11.10
banshee:
  Installed: 2.2.0-1ubuntu2
  Candidate: 2.2.0-1ubuntu2
  Version table:
 *** 2.2.0-1ubuntu2 0
        500 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main amd64 Packages
        100 /var/lib/dpkg/status

Additional information:
- It only happens with gapless playback enabled
- It apparently happens because PlayerEngine is not resetting its Position attribute (https://bugs.launchpad.net/ubuntu/+source/banshee/+bug/869301/comments/3)
Comment 1 rlange 2011-11-20 02:34:28 UTC
To recap from the Ubuntu report:

I instrumented ConnectedSeekSlider.cs with debugging statements and found that PlayerEngine.Position (supposedly, the number of milliseconds into the track you currently are) is not reset on track change in gapless mode.

The bug was tricky to track down, because sometimes when changing tracks, the slider continues to show both position and new track length, and sometimes it reverts to only showing total play time.

If the new track's length (PlayerEngine.Length) is *longer* than the "position" (PlayerEngine.Position) then the slider will show the "position" and the new track length.  However, the "position" will be the sum of previous play time, not the actual position in the new track, so the slider will appear to be far into the new track, even though the new track has just started.  Once the "position" (once again, the sum of previous play time) becomes greater than the track length, the slider will no longer show the track length, but merely the "position".  (In the code, the slider still has the current track's length as one of its attributes, but it no longer displays it.)

If you move the slider, this forces the PlayerEngine to seek to the relative location on the track, e.g., if you move the slider to the 50% position while a 3 minute long track is playing, the PlayerEngine will seek to 1 minute 30 seconds into the current track.  This resets PlayerEngine.Position and thus the slider behaves properly again, for a time.

Unfortunately, this is as far as I got.  There are some fairly opaque interactions between Banshee and GStreamer (which Banshee uses as the actual playback engine).  I spent several hours digging through the respective code bases, and I still have no clue how gapless playback works or which module is actually responsible for this bug.
Comment 2 Andrés G. Aragoneses (IRC: knocte) 2011-11-20 09:42:09 UTC
(In reply to launchpad comment no. 3)
> I instrumented ConnectedSeekSlider.cs with debugging statements and found that
> the PlayerEngine is not resetting its Position attribute (the number of
> milliseconds into the track it is) when it rolls over to a new track. If the
> new track is shorter than the current "position" (the sum of previous
> positions) then the slider will show only the "position", not the time on the
> current track. If you move the slider, this forces the PlayerEngine to reset
> its Position and thus the slider behaves properly again, for a time.

Thanks for the investigation!

> I am currently looking into why the PlayerEngine is not resetting its
> position on track change.

If you got this far, I'm sure you will eventually figure out the ultimate reason, and writing a patch to fix it.

One thing that may help you to figure this out is print the stacktrace on each debug statement, for example:

System.Console.WriteLine("___this is a debug statement, stacktrace:" + System.Environment.StackTrace);

This way, you can know from which part of the code the PlayerEngine was ordered to reset, so you can figure out why it doesn't happen in a certain situation.
Comment 3 rlange 2011-11-20 18:52:23 UTC
After further examination, I am thinking that this is a bug/shortcoming in GStreamer, not in Banshee.  Banshee merely reports the position information that GStreamer provides.  Furthermore, GStreamer provides correct position information for some files (OGG Vorbis) and not others (FLAC).

This might happen because Vorbis has a special GStreamer plugin (ext/vorbis/gstvorbis{parse,dec}.c) whereas FLAC does not.  This is speculation, because I find the layers of abstraction and the lack of comments/documentation to make GStreamer really difficult to understand.  If I am right, then to parse FLACs in gapless mode, someone will need to engineer a FLAC plugin for GStreamer.  That requires a greater time commitment than I can make for the foreseeable future.
Comment 4 rlange 2011-11-20 19:55:43 UTC
https://bugzilla.gnome.org/show_bug.cgi?id=664433

Here is the GStreamer bug report I filed.
Comment 5 maweki 2012-03-11 17:03:43 UTC
I experience the same issue with mp3-files on Ubuntu 11.10 with Gnome3 ppa and Banshee 2.2.1.
Am I the only one or was this obvious that this is also an mp3 issue?
Comment 6 André Klapper 2020-03-17 09:27:39 UTC
Banshee is not under active development anymore and had its last code changes more than three years ago. Its codebase has been archived.

Closing this report as WONTFIX as part of Bugzilla Housekeeping to reflect
reality. Please feel free to reopen this ticket (or rather transfer the project
to GNOME Gitlab, as GNOME Bugzilla is being shut down) if anyone takes the
responsibility for active development again.
See https://gitlab.gnome.org/Infrastructure/Infrastructure/issues/264 for more info.