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 581936 - music skips when X server is busy
music skips when X server is busy
Status: RESOLVED OBSOLETE
Product: rhythmbox
Classification: Other
Component: playback
0.12.x
Other Linux
: Normal major
: ---
Assigned To: RhythmBox Maintainers
RhythmBox Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-05-08 21:32 UTC by Paul Pogonyshev
Modified: 2018-05-24 14:21 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Paul Pogonyshev 2009-05-08 21:32:32 UTC
While I understand that mp3 decoding is CPU-intensive and skips are inevitable in principle, the situation here is not acceptable.  It sometimes skips even just when switching desktops (serious window redrawing).

* Make decoding in a high priority thread?

* Buffer decoded music so the player always has some 5 secs of predecoded music to play if CPU load is suddenly high?

I don't know, this all looks quite basic to me, but I really do have serious skipping problems here with 0.12.0.  Can only assume that's because of mp3 backend is not well-developed, don't know.
Comment 1 Jonathan Matthew 2009-05-09 02:07:00 UTC
Are you sure this is related to CPU load?  People have reported similar problems that occur with no noticeable CPU load at all.

Do you actually think this is specifically related to mp3 playback?  Have you tried any other formats?

Do you have crossfading enabled in rhythmbox?  Do you experience similar problems in other applications (specifically GStreamer applications)?
Comment 2 Paul Pogonyshev 2009-05-09 11:04:16 UTC
Yes, it is certainly because of high load or at least certainly happens when the system is busy.  Maybe not because CPU is loaded, but because some other system resource is clogged.  But certainly not because sound card is busy --- nothing else uses it at the time when I listen to music.  For the record, this is on KDE 4.2.

I will reopen the bug when I can test with .ogg.
Comment 3 Jonathan Matthew 2009-05-09 11:17:11 UTC
It would be more useful if you could narrow down exactly what system resource causes the problem.  It's extremely unlikely to be file type specific.  I was mostly asking to find out if you had a specific reason for stating mp3 in your original comment.  It seems that you don't, but that's OK.

If you're using ALSA for 'music and movies' output (GNOME sound preferences) you can try increasing the audio sink buffer size by setting /system/gstreamer/0.10/default/musicaudiosink in gconf to 'alsasink buffer-time=n' where n is a number of microseconds.  The default is 200000.  You may find that adjusting this doesn't help at all.

You haven't answered my last two questions.  Also, since you mentioned a version number - was there an earlier version where this worked better?
Comment 4 Paul Pogonyshev 2009-05-09 11:37:19 UTC
OK, tried more.  This is certainly not CPU --- I tried running a computation-heavy, but certainly not using any other resource program --- music was playing fine even though load on both cores went to 100%.

Moreover, I tried switching between desktops constantly as I did yesterday --- still no music skipping.

What is different is yesterday I had system running for many hours already.  Probably memory was used up and some swapping was occurring already.  Maybe if GStreamer buffer was swapped out from RAM to disk and back this exact sound skipping would occur.  Now I cannot reproduce it, but 'free' says that swap is not used.

> I was mostly asking to find out if you had a specific reason for stating mp3 in your original comment.

No, I didn't, I just assumed that because I knew free software was not kin to .mp3.  Currently don't have any music in a different format.

> If you're using ALSA for 'music and movies' output (GNOME sound preferences)...

I will test that when I experience skipping again.  Also, I use KDE as desktop, but quite a few GNOME programs on it.

> Do you have crossfading enabled in rhythmbox?

No.

> Do you experience similar problems in other applications (specifically GStreamer applications)?

Didn't check, but I'd assume this is indeed GStreamer-related.
Comment 5 Jonathan Matthew 2009-05-09 13:25:39 UTC
(In reply to comment #4)
> OK, tried more.  This is certainly not CPU --- I tried running a
> computation-heavy, but certainly not using any other resource program --- music
> was playing fine even though load on both cores went to 100%.
> 
> Moreover, I tried switching between desktops constantly as I did yesterday ---
> still no music skipping.
> 
> What is different is yesterday I had system running for many hours already. 
> Probably memory was used up and some swapping was occurring already.  Maybe if
> GStreamer buffer was swapped out from RAM to disk and back this exact sound
> skipping would occur.  Now I cannot reproduce it, but 'free' says that swap is
> not used.

That's one possibility.  It might also be triggered by network or disk IO, some other device you have attached to the system.. one bug reporter said he'd noticed a correlation with network activity.

> > I was mostly asking to find out if you had a specific reason for stating mp3 in your original comment.
> 
> No, I didn't, I just assumed that because I knew free software was not kin to
> .mp3.  Currently don't have any music in a different format.

That isn't true of GStreamer, at least.
 
> > Do you experience similar problems in other applications (specifically GStreamer applications)?
> 
> Didn't check, but I'd assume this is indeed GStreamer-related.
> 

It would still be useful to try a few other things - even playing .wav files with aplay.
Comment 6 Paul Pogonyshev 2009-05-09 14:38:46 UTC
This appears to not be swapping either.  I used the same program only now it would run in 1 thread (so 1 CPU is almost free), but use tons of memory for internal caches.  Now 'free' would show that swap was used heavily, but still no sound skipping.  I cannot rule swapping out, because I'm not sure if GStreamer buffer was swapped out yesterday, but not this time, but still possibility that it is caused by memory swapping is quite small I'd say.

This is likely not network activity, because today I'm doing exactly the same as yesterday --- mail, IRC, web browsing and torrents.

I can think of two more major candidates.  Disk I/O (maybe from some 'cron' task running in the background, e.g. 'locate' database update) and maybe buggy stupid flash plugin for Firefox.

> It would still be useful to try a few other things - even playing .wav files
with aplay.

I agree, but since now I don't experience skipping with .mp3 in Rhythmbox it would not be useful currently.
Comment 7 Paul Pogonyshev 2009-05-14 18:19:31 UTC
I had this issue on another computer also.  It seems that music skipping occurs when X is busy.  I first noticed it when resizing 'Song Lyrics' window in Rhythbox itself, but skipping would also occur if Rhythmbox was left alone.  E.g. when resizing 'About' dialog of some other application.

On the other hand, I just tried on this computer --- no skipping.  Still, sometimes it happens on this machine too: I had it once more after the bug was opened.  It disappeared after I restarted X server, but I'm not sure of exact reason as the restart freed up a lot of different resources.
Comment 8 Paul Pogonyshev 2009-05-15 16:19:37 UTC
I had this issue today again.  Swap memory was not used and it again occurred when X was busy redrawing things.  Might depend on video and/or sound card though, but I had this problems on two different machines.
Comment 9 greylander 2009-11-12 05:52:41 UTC
Hello, I believe that I also have this bug.

I am using Jaunty 64-bit, on a 4 cpu 8 Gig machine.

The problem, for me, is specific to Rhythmbox.  I have tried several other music players with no problem at all.

The "skips" that I encounter happen randomly several times per typical song, or roughly one skip per minute of playback.

For me this does not seem to be a resource issue -- the skips happen quite often when I am doing nothing else -- no window resizing, menus, dialogs.  There might be background processes doing something, but the system resources are not being taxed at all.  I have observe system monitor when the skips occur and there is no jump in cpu utilization (which is generally less than 20% of the 4 cpu's).  Likewise there is plenty of resident memory available.

I have reported this as a bug in Rhythmbox, but a developer there thinks this is a Gnome bug.  Please see the bug reported in rhythmbox here:  

   https://bugs.launchpad.net/ubuntu/+source/rhythmbox/+bug/480430

I am happy to do some leg-work to try to isolate this bug, but I am new to this, so any guidance from developers woudl be greatly appreciated.  If there are any diagnostics or logs that would be useful, just tell me what commands to run.

I think the reason for believing this is a Gnome bug is that the problem might be new to a recent release of Ubuntu or Gnome while no changes have been made to rhythmbox.  However, I never used rhythmbox prior to Jaunty, so I cannot comment on this.  Over the next few days, I will try different combinations of release versions of ubuntu/gnome and rhythmbox to see if I can identify exactly where the problem was introduced.
Comment 10 Jonathan Matthew 2009-11-12 06:08:10 UTC
Which other music players have you tried?  Do you have crossfading enabled in rhythmbox?  Does this happen with all songs, or just some?
Comment 11 greylander 2009-11-12 08:06:18 UTC
Cross-fading NOT enabled.  I never use cross-fading.

The skipping occurs on all songs -- at least I have not noticed particular songs that do or do not skip.  My collection is mostly mp3's, but there are some flac, ogg, wmv... I do not know if the problem is specific to any file type, but I doubt it.

The skipping occurs several times per typical track (2-5 times on a 3-4 minute track) on nearly every track.  Very rarely, a complete track will play without a skip (or maybe this just means I was not paying attention).

This has been a constant problem since I started using rhythmbox on this machine (I have only had Jaunty on this machine).  I have given up on Rhythmbox for the time being (althrough I prefer it's interface and library organization).  I currently use Banshee.

The problem does not occur with the following music players (or other playback):

    mouse-over preview (which I believe uses totem)
    movie player (which I also belive uses totem)
    banshee
    gmusicbrowser
    songbird
    audacious

*** OK, this is interesting, in compiling the above list, I just tested Audacious for the first time.  In past testing I have liked to go back and replay a track in Rhythmbox just to verify that the skipping occurs again after it played clean in another application.  So I did this again (haven't used Rhythmbox much since I tried all those others and settled on Banshee).  Now I have just played four tracks in Rhythmbox with no skipping (recall -- this has been a constant problem up until now).  I wonder if it is possible that in installing one of the other music player apps, some shared resource was also installed/updated which rhythmbox also uses, thereby clearing up the problem.  Installing all the other music player apps is the only change I've made to my system recently.  (If I uninstall these apps, is it likely to revert any/all shared modules, such that Rhythmbox would revert to using an older version of some shared object?  Is this a likely avenue of investigation?  If so, any suggestions on best way to proceed?)

I will start using rhythmbox regularly to see if the problem comes back on its own.  If not, then I may try a clean Jaunty install on a new partition and take a more systematic approach to determine under what conditions the bug occurs.

(by the time I've finished adding this comment... Rhythmbox has now played for over 20 minutes withou my noticing a single skip).
Comment 12 Jonathan Matthew 2009-11-12 09:55:03 UTC
I'm pretty sure this is a different problem, so to avoid confusion with the original issue, I've opened bug 601662. Please add further comments there.
Comment 13 Paul Pogonyshev 2010-03-19 19:46:20 UTC
Skipping mostly occurs when I use a Java program.  At work I have to use DBVis (non-free) and JasperReports' iReport (this one is free: http://sourceforge.net/projects/ireport/).  I can robustly produce skipping by e.g. heavily scrolling some widget in one of those programs.
Comment 14 Paul Pogonyshev 2010-04-18 18:36:53 UTC
Another way that often (but not always) lets me reproduce it: open the lyrics window (ctrl-L) and continously resize it.  I.e. mousedown window border and keep dragging it around without releasing.  Music often starts to skip or even stops completely.  Unfortunately, doesn't work always.
Comment 15 GNOME Infrastructure Team 2018-05-24 14:21:31 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/rhythmbox/issues/743.