Rockbox Technical Forums

Support and General Use => Audio Playback, Database and Playlists => Topic started by: catawompus on December 23, 2007, 01:37:48 PM

Title: interruptions while playing songs
Post by: catawompus on December 23, 2007, 01:37:48 PM
I have an H340 with the latest current build installed. Sometimes, when I start playing a new album (and only then, never in the middle of an album) there's a short interruption, sometimes two, at the beginning of the first song. It doesn't happen with all albums and it doesn't always happen with the same album. Any ideas what could cause this? Thanks in advance!
Title: Re: interruptions while playing songs
Post by: bassistguy on December 31, 2007, 08:07:52 AM
I had the same problem with my Gigabeat F60, and my "fix" was enabling Directory Cache, that way it doesn't have to load song data in to memory at the beginning of each song (I'm assuming that's what was causing the pauses).
Title: Re: interruptions while playing songs
Post by: Llorean on December 31, 2007, 03:29:10 PM
Please research what features do *before* trying to explain them to others.

Directory cache caches filenames and paths to files. It makes browsing files easer, and because it maintains a list of all the files in your player, can make certain operations a bit faster. One thing it won't do, though, is affect buffering in any significant manner. When you start buffering, it loads several songs (approximately 29MB) into memory. This means that only every few songs does it need to rebuffer (and thus re-access the disk). Meanwhile, while it's buffering, the load should be pretty constant whether dircache is on or off.

If enabling dircache fixed it, it's not because "it doesn't have to load song data into memory", as it'd be impossible to play songs without loading them first.
Title: Re: interruptions while playing songs
Post by: catawompus on December 31, 2007, 09:00:09 PM
Llorean, do you have an explanation for my problem?
Title: Re: interruptions while playing songs
Post by: Llorean on January 01, 2008, 04:26:26 PM
No. If I'd had an answer, I would've said it.
Title: Re: interruptions while playing songs
Post by: catawompus on January 05, 2008, 03:15:44 AM
Is it possible that a certain theme has got something to do with my problem? When I was using Cabbie default it would occur on and off, now that I use Ultima it seems to be gone as far as I can tell...
Title: Re: interruptions while playing songs
Post by: flinchbot on January 14, 2008, 02:28:48 PM
I have this often when first turning mine on. It does what appear to be commits to the database and the player can't keep up for the first 5-10 seconds. After that, flawless playback.
Title: Re: interruptions while playing songs
Post by: erik7 on January 14, 2008, 02:50:18 PM
My first post on this forum, because since a long time I have problems with Rockbox.

I have the interruptions too and it seems like it happens when you have lots of songs in the directory you are playing music from.
First I had 2000 songs in one directory, then 500 and at last 250. When playing a songs from one of the 'big' directories I get the interruptions.
'Smaller' directories (20-25 songs) don't have it.

Hope it make sence and somebody can do something with it.
I'm having a iRiver H320, latest Rockbox build.
Title: Re: interruptions while playing songs
Post by: NicolasP on January 14, 2008, 06:26:18 PM
This issue seems to be the same one as described in FS#8260 (http://www.rockbox.org/tracker/task/8260). It seems to have been introduced by r15444 (http://svn.rockbox.org/viewvc.cgi?view=rev&revision=15444) (confirmation welcome). Increasing the default chunksize has helped in some cases, but not solved the problem. It is belied that the issue is in the thread scheduling and priority, but by attempts to fix it have been unsuccessful so far.
Title: Re: interruptions while playing songs
Post by: Sherv on January 16, 2008, 01:24:56 PM
My first post on this forum, because since a long time I have problems with Rockbox.

I have the interruptions too and it seems like it happens when you have lots of songs in the directory you are playing music from.
First I had 2000 songs in one directory, then 500 and at last 250. When playing a songs from one of the 'big' directories I get the interruptions.
'Smaller' directories (20-25 songs) don't have it.

Hope it make sence and somebody can do something with it.
I'm having a iRiver H320, latest Rockbox build.

Interesting, I have this issue on my 80 gig iPod vid no matter how many songs are in the directory. Having directory cache ON has reliably resulted in stuttering and interruptions far more frequently than when I have it off, but even with it off there are stutters. As mentioned by flinchbot, this occurs most heavily when the player is first turned on (from what little I can tell, it appears directly related to the buffers are being filled) but unlike flinchbot I experience this randomly as I listen to music (I originally thought it was high-bitrate related but that doesn't seem to be the case).



Thanks for checking into this
Title: Re: interruptions while playing songs
Post by: GodEater on January 16, 2008, 04:09:14 PM
The testing that I've done into this issue seems to suggest that the level of stuttering increases with the depth of the directory tree that the music files are buried in.

I made a test directory off the root of the player with around 70 files in, and couldn't get any stuttering at all when playing back the files in it.

When I moved the entire directory to about four folders deep into my music hierarchy though - the stuttering was apparent straight away.
Title: Re: interruptions while playing songs
Post by: erik7 on January 16, 2008, 04:38:26 PM
I'm glad this subject gets full attention. :)
The files on my player are 2 directories deep.

Root -
          Top 2000 -
                           0001-0250
                           0251-0500
                           etc

Hope this issue will get some piority. ???
Title: Re: interruptions while playing songs
Post by: Lear on January 16, 2008, 05:44:49 PM
This issue seems to be the same one as described in FS#8260 (http://www.rockbox.org/tracker/task/8260). It seems to have been introduced by r15444 (http://svn.rockbox.org/viewvc.cgi?view=rev&revision=15444) (confirmation welcome).

Hm, r15444 mainly affected ipods (and the h10), so we might have different causes here...

Increasing the anti-skip buffer ought to help re-buffering issues (if so, increasing it to 15 or 30 seconds should be enough). For ipods, it could hide the probably slower disk spin-ups from r15444.

Otherwise, one reason could be that file open isn't very fast. This would match the behavior of big or "deep" directories causing problems (either makes locating the file file on disk slower), while enabling the dircache can reduce or eliminate the problems. Using album art could make things worse (at least without dircache). Making sure the CPU is boosted before opening files in playback.c (including for album art and metadata) might help.

For the initial buffering, maybe it just more data needs to be buffered before actual playback is started (so that slow open calls doesn't cause the filebuf to go empty). I couldn't figure out what triggers pcm playback to start though... ;)
Title: Re: interruptions while playing songs
Post by: catawompus on January 17, 2008, 11:44:30 AM
All I can say that in my case the depth of the directory tree has probably got nothing to do with the skips. I have a folder "music" in the root of the player. What's in there is all subfolders of single albums with an average of probably 12 tracks  and some bigger ones in case of a double album. There are no further subfolders.
The skipping disappeared when I changed themes from Cabbie default to Ultima.
Thanks for looking into this issue.
Title: Re: interruptions while playing songs
Post by: Lear on January 17, 2008, 03:20:35 PM
I have a folder "music" in the root of the player. What's in there is all subfolders of single albums with an average of probably 12 tracks  and some bigger ones in case of a double album. There are no further subfolders.

But how many album folders? Sounds like it could be quite a few. That could make sense, as for some albums the file open "search" would take longer.

Quote
The skipping disappeared when I changed themes from Cabbie default to Ultima.

Thus no album art, which would reduce the slow file open problem noticeably.

I wonder if adding a yield() call towards the end of search_albumart_files() could help...
Title: Re: interruptions while playing songs
Post by: Sherv on January 18, 2008, 11:24:16 AM
Album art definitely seems to be intimately linked to this problem...interesting.
Title: Re: interruptions while playing songs
Post by: rocinante69 on January 20, 2008, 08:47:25 PM
I was experincing the same issue with my H10, but I also own an H340 and there wasn't any problem on that player. The only difference between the two units (as far as Rockbox) was that I was using the default Rockbox WPS on my H340 (because I couldn't get the fonts to display correctly on the WPS that came with the theme I was using) & on the H10 the fonts weren't an issue so I didn't change the WPS at installation on that unit.  I changed the WPS on the H10 to the Rockbox default and the problem went away. The WPS that came with the theme displayed the next song queued to play so maybe that was the problem?  Seems weird... ???
Title: Re: interruptions while playing songs
Post by: dip on January 21, 2008, 10:55:35 AM
I have the same problem with my iPod 80GB 5.5G. I had the impression that it started with integration of album art into svn. Previously I used the inofficial album art patch and never had this problem. Now stuttering appears very often after turning on the iPod. So I also have the impression that the problem is related to album art.

However, stuttering now also appears when I scroll through long lists in the database (e.g. browsing artists) while playing music, when I scroll through a long list of files using the file browser or when I scroll through a long now playing list. This did also not happen previously.
Title: Re: interruptions while playing songs
Post by: dip on January 23, 2008, 06:57:00 AM
One further note: I also have the impression that with introducing the stuttering problem the disk spinns much longer after having turned on my iPod than before. It takes sometimes almost 1-2 minutes before the iPod reacts on any key press after it has been turned on.
Title: Re: interruptions while playing songs
Post by: Sherv on January 23, 2008, 09:25:44 AM
Ooh, good point! The disk is indeed spinning intensely during said pauses and unresponsiveness. What is curious is that at times the drive will suddenly enter a long stretch of activity without anything from the user prompting it. That is, I could be playing a playlist and then at one point the drive will begin spinning and it appears that data is being accessed for a long period of time (upwards of 5 minutes or longer but I haven't accurately timed this to give a better idea).
Title: Re: interruptions while playing songs
Post by: kubu4 on January 24, 2008, 12:18:21 PM
I'm experiencing the exact same things, but on both my X5 and H140.  Also, I don't use themes with album art so, in my case, album art isn't a factor in causing this problem.

Additionally, the most recent build I've put on both units (r16096) no longer supports gapless playback.  

Finally, I've been getting a very high frequency of "Database Not Ready" messages when I am browsing through the database.  In fact, usually about once a day, the players will prompt me to initialize the database when I try to browse the database.

Of course, I have no idea if any of this stuff is related, but in all the years I've been using Rockbox, I've never had any problems.  So, it has definitely thrown me for a loop with all the issues that I'm having with the current build.  

In any case, just thought I'd throw out as much info as possible that might be related to the stuttering problem that so many people are experiencing.  Thanks to the devs for all the hard work!
Title: Re: interruptions while playing songs
Post by: Llorean on January 24, 2008, 01:35:20 PM
Do you mean "Gapless playback isn't working for me?"

It's still supported, and *should* be working, so I'm curious why you're saying it isn't supported...
Title: Re: interruptions while playing songs
Post by: kubu4 on January 25, 2008, 01:06:49 PM
Whoops!   :P  Sorry.  Definitely meant "is not working" for me.  Of course it is supported!  And, my problems are occurring with both OGG (q5) and MP3 (192Kbps VBR).  Thank you for the clarification.
Title: Re: interruptions while playing songs
Post by: erik7 on February 04, 2008, 03:04:48 PM
Is there any good news about this subject? For some reason I have the feeling that this is not high priority.  :'(
Title: Re: interruptions while playing songs
Post by: Llorean on February 04, 2008, 05:04:11 PM
Nobody's paying anyone to work on Rockbox, and very few people have the appropriate knowledge to work on this. If you want it fixed, the only way to be absolutely certain it happens is to dedicate your own time to learning about the playback code, and working on it. EVERYONE who works on it is a volunteers.

The thing NOT to do is to ask for progress reports or make little teary faces. If the situation changes, it'll change.
Title: Re: interruptions while playing songs
Post by: erik7 on February 04, 2008, 05:19:01 PM
Wooh, I'm sorry, but you feel very offensive I see. It was never meant it that way. This directly will be my last post here (for some or long time). I don't like it this way!
Title: Re: interruptions while playing songs
Post by: catawompus on February 25, 2008, 11:42:03 AM
I downloaded the latest current build today, and as far as I can tell the bug seems to be gone. Thanks to all the people who were looking into this issue.
Title: Re: interruptions while playing songs
Post by: dip on March 04, 2008, 09:44:23 AM
With the current build my stutterin problems are gone and my iPod is now again very well responsive. Thank you guys very much for your efforts!