Rockbox Technical Forums

Support and General Use => Audio Playback, Database and Playlists => Topic started by: ThaCrip on March 02, 2009, 11:37:40 PM

Title: Glitchy audio after resume playback (split from: New USB mode questions)
Post by: ThaCrip on March 02, 2009, 11:37:40 PM
just a side note... there is new bootloaders for your Sansa e250 (i have same player) so it never boot original firmware unless you specifically tell it to when the power is off by holding the left button on the d-pad when powering it on ;)

p.s. to anyone... earlier i was using my e250 and for the first time ever while playing (i might have been pausing it here and there and when i resumed etc) the sound basically got all static etc etc so i had to stop it and resume to get it back to normal again.... happened twice earlier... prior to this i never had it happen so it might be some glitches in recent-ish builds?.

EDIT: ... i just noticed when i power it on, on the main Rockbox screen just before it fully loads it changed between 2 different versions on the screen (for the build and date etc) ... i might do a clean install of a recent build and see if it acts up in the near future.
Title: Glitchy audio after resume playback (was: New USB mode questions)
Post by: jgsprenger on March 03, 2009, 08:53:38 AM
p.s. to anyone... earlier i was using my e250 and for the first time ever while playing (i might have been pausing it here and there and when i resumed etc) the sound basically got all static etc etc so i had to stop it and resume to get it back to normal again.... happened twice earlier... prior to this i never had it happen so it might be some glitches in recent-ish builds?.

I noticed the same here on my e280... more than twice, I got the weird static and had to shuffle/jog the mp3 file to clear the static...(I just thought it was a crappy mp3 recording?) .... i have r20185 loaded.


EDIT: ... i just noticed when i power it on, on the main Rockbox screen just before it fully loads it changed between 2 different versions on the screen (for the build and date etc) ... i

did not see this
Title: Glitchy audio after resume playback (was: New USB mode questions)
Post by: epithetless on March 03, 2009, 12:26:36 PM
p.s. to anyone... earlier i was using my e250 and for the first time ever while playing (i might have been pausing it here and there and when i resumed etc) the sound basically got all static etc etc so i had to stop it and resume to get it back to normal again.... happened twice earlier... prior to this i never had it happen so it might be some glitches in recent-ish builds?.

I noticed the same here on my e280... more than twice, I got the weird static and had to shuffle/jog the mp3 file to clear the static...(I just thought it was a crappy mp3 recording?) .... i have r20185 loaded.


EDIT: ... i just noticed when i power it on, on the main Rockbox screen just before it fully loads it changed between 2 different versions on the screen (for the build and date etc) ... i

did not see this

I've noticed both of those things myself. On my e280, MP3 playback turns to crackly static sometimes (but not always -- so reproducibility is elusive) after resuming playback from a lengthy paused state. Typically, simply re-pausing then un-pausing has returned playback to normal.

The two Rockbox boot screens, as I see it, show 1) the test bootloader version number, and 2) the Rockbox build number. The latter has always happened; the former is new to the new bootloader.
Title: Glitchy audio after resume playback (was: New USB mode questions)
Post by: ThaCrip on March 03, 2009, 06:17:06 PM
as said above... yes, i had the static issue from 'a long pause state' to is when i think it mainly happened if i recall correctly.



as said here, "The two Rockbox boot screens, as I see it, show 1) the test bootloader version number, and 2) the Rockbox build number. The latter has always happened; the former is new to the new bootloader."

so apparently (as said above) the new bootloader causes it to show 2 different dates/build numbers?.

as for the... "(I just thought it was a crappy mp3 recording?)" ... im pretty sure that's NOT the issue because i never had this issue up until recently, v3.1 works perfect and never done anything like this... heck, Rockbox has been pretty much flawless for me up until this recent static glitch.
Title: Glitchy audio after resume playback (was: New USB mode questions)
Post by: Llorean on March 03, 2009, 06:18:55 PM
The bootloader shows its own version number, not the Rockbox build number. It always has. since it's built from Rockbox sources, unless we've changed the string (as we do for release bootloaders usually) it will have a version number that looks like a Rockbox version number.

So yes, you should always expect to see a different version number in the bootloader than after the bootloader.
Title: Glitchy audio after resume playback (was: New USB mode questions)
Post by: AstroBoy on March 03, 2009, 06:52:10 PM
I had the static issue after a long pause.  I could pause and play, but still got static.  I powered it down, on power up it said battery was too low.  I assumed the issue was related to the battery voltage being too low.  I do long pauses (hours) all the time and this has only happened once.  I have auto-off disabled.
Title: Glitchy audio after resume playback (was: New USB mode questions)
Post by: Llorean on March 03, 2009, 06:53:07 PM
Please track down exactly which version the static issue starts with. It's unlikely that it's caused by the USB support.
Title: Glitchy audio after resume playback (was: New USB mode questions)
Post by: AstroBoy on March 03, 2009, 07:11:39 PM
I have version r20107-090225.
I don't know what version I had before that.  Does rbutilqt-v1.0.8 keep any history?

I don't know how this can help, but...  The static was not white noise.  Not even static.  Just random tones and chirps and clicks.  I have heard simular sounds when I had a bad mp3 file.  But this was not a bad file, I replayed the same part without issue.  The file was .mp3 or .ogg.  I have no way of knowing beyond that.
Title: Glitchy audio after resume playback (was: New USB mode questions)
Post by: Llorean on March 03, 2009, 07:12:36 PM
You'll need to search back through old versions. As I said, we'd need to know the exact version it was introduced with.
Title: Glitchy audio after resume playback (was: New USB mode questions)
Post by: ThaCrip on March 03, 2009, 07:43:30 PM
just to more confirm AstroBoy's statements... i 100percent agree with him about where he said... "The static was not white noise.  Not even static.  Just random tones and chirps and clicks."

but i guess i might be able to help a little with tracking down the issue but it might take me a while since i dont use my e250 alot but i use it here and there and i aint exactly sure how it can be replicated but it does seem to be related to a long-ish pause and when resuming it does the 'chirps and clicks' stuff... cause the time it happened to me im pretty sure i had mine paused to for a little while... the 2nd time it might have just did it out of no where while playing a song i always played before that i know works fine and he said he just pressed paused and play again to fix his... i never tried that but i just pressed the power button quickly and then resumed the file and it seemed fine again.

but assuming i can help, which version of Rockbox is the first one with USB support? , this way i can start from there and see what happens, but like i say it might take quite a bit of time to track it down.
Title: Glitchy audio after resume playback (was: New USB mode questions)
Post by: AstroBoy on March 03, 2009, 08:04:03 PM
You'll need to search back through old versions. As I said, we'd need to know the exact version it was introduced with.

Since I have had the failure once in about 6 days, it will take a long time to track this down.  We need to maintain a list of versions that don't fail and do.  We can then do a binary search between them.

I know version r20107-090225 has the bug.  Any idea what version does not?
Also, my failure was while the battery was really low, so I am not sure the problem was not caused by low voltage.
Title: Glitchy audio after resume playback (was: New USB mode questions)
Post by: ThaCrip on March 03, 2009, 11:27:07 PM
about Astroboy's 'low voltage' comment... i dont think that's the issue cause my battery was pretty much FULL when it happened to me (at least 80+ percent easy left in battery).... i always keep my battery close to full because i was told it's easier on the Lithium Ion type battery's to keep them close to full then charging them (basically a small drain on battery then charge) vs draining them quite low then charging them.

p.s. i just hope whatever happens this bug is not in the v3.2 release because my general opinion of Rockbox is close to perfect (it was pretty much perfect up until this issue recently ;) ) and that could hurt it's rep a little bit... but i guess on a positive side is that it's not a extremely important issue (since Rockbox is still more than usable overall) but it's definitely important if you ask me that it's fixed.
Title: Glitchy audio after resume playback (was: New USB mode questions)
Post by: Llorean on March 03, 2009, 11:37:45 PM
It's impossible to fix if you guys don't track down where it started, since it needs someone who's actually experiencing the issue to figure it out...
Title: Glitchy audio after resume playback (was: New USB mode questions)
Post by: epithetless on March 04, 2009, 12:18:32 AM
It's impossible to fix if you guys don't track down where it started, since it needs someone who's actually experiencing the issue to figure it out...

Agreed, but the problem is intermittent enough that reproducing it is a bigger issue than finding the first build where it appeared. As AstroBoy said, this one is going to take a while...
Title: Glitchy audio after resume playback (was: New USB mode questions)
Post by: ThaCrip on March 04, 2009, 01:11:56 AM
It's impossible to fix if you guys don't track down where it started, since it needs someone who's actually experiencing the issue to figure it out...

can you link me to the first build of Rockbox that supports USB? ... if so ill start there ;) (because i dont know how to access older builds, on the 'current builds' section etc)

also, i assume that the bootloader has ZERO chance to cause issues like this? (just making sure ;) , since im using the new bootloaders so i dont need original firmware at all now. )

p.s. keep in mind i know NOTHING about coding (just basic concepts, like the general idea behind it) ... im just good with general PC related stuff like fixing PC's, moding consoles etc etc.
Title: Glitchy audio after resume playback (was: New USB mode questions)
Post by: Llorean on March 04, 2009, 01:33:23 AM
You've been told this before. "u" is not a word, you need to type out "you" in our forums. We ask that you use proper English spellings at the very least.

You probably want to start earlier than the first build that supports USB, as it may be from changes somewhat before that. As well, the builds available for download are only once a day. At some point you're going to need to compile builds to get more precise, so you may as well learn how now so that you can pick any build revision you want.
Title: Glitchy audio after resume playback (was: New USB mode questions)
Post by: ThaCrip on March 04, 2009, 01:50:24 AM
You've been told this before. "u" is not a word, you need to type out "you" in our forums. We ask that you use proper English spellings at the very least.

You probably want to start earlier than the first build that supports USB, as it may be from changes somewhat before that. As well, the builds available for download are only once a day. At some point you're going to need to compile builds to get more precise, so you may as well learn how now so that you can pick any build revision you want.

Yes your right, sorry about that 'u' instead of 'You' as i got into a habit of doing that sorta stuff as it speeds up typing a little. (i edited the post and corrected it ;) )

but anyways....

i guess i could start before USB was implemented but if i recall correctly the 'USB Test Build' (just before it was officially in the 'current builds') worked fine, but to be honest i dont know if i used that enough to know with reasonable certainty if the issue was there or not.... but then again when i did notice that recently (in the last few days or so) i was on a small trip of probably no more than 15minutes 1-way (maybe 30-40minutes round trip) and it acted up once on the way there and once on the way back. and like someone else said i think at least one of those times i had it on pause for roughly a minute or two and when i resumed from pause it started the issue i been explaining.

but if possible... what was the build that USB was first enabled on 'officially' in the current builds section? ... main reason i ask is because i would rather not go prior to that unless i have to due to using the new bootloader. that's why i figured that build is a good place to start to give me a good idea on which direction to go, be it prior to USB support or builds after it.

also, if you dont mind any advice on where i should start as far as compiling my own builds? (as i typed this message i did not search at all yet so i guess i could get started ... i just figure with a little push in the right direction that would help speed things along a little bit ;) )

EDIT: i assume this ( http://www.rockbox.org/twiki/bin/view/Main/SimpleGuideToCompiling ) is a good place to start?

EDIT#2: i think i got that Cygwin thing installed... any advice on how to build exact versions? (because i assumed you needed me to test r20100/r20101/r20102 and so on until i think i located the build where the sound glitch dont exist)
Title: Glitchy audio after resume playback (was: New USB mode questions)
Post by: AstroBoy on March 04, 2009, 08:27:45 AM
You've been told this before. "u" is not a word, you need to type out "you" in our forums. We ask that you use proper English spellings at the very least.

You probably want to start earlier than the first build that supports USB, as it may be from changes somewhat before that. As well, the builds available for download are only once a day. At some point you're going to need to compile builds to get more precise, so you may as well learn how now so that you can pick any build revision you want.

Give me a hint.  What version do you want me to start with?  Go back 1 month?  or 2 months?  Maybe 1 week?

Please, anyone with the problem, please post your version!!  We don't need to be testing the same version or a version after the bug.
Title: Glitchy audio after resume playback (was: New USB mode questions)
Post by: Chronon on March 04, 2009, 04:49:48 PM
Binary search:
1) Pick an initial build that's long enough ago to not have this bug.
2) Verify that it doesn't exhibit the bug
3) Make a build that's halfway between that build and the current build.
4a) If it contains the bug then make a build halfway between that build and the initial one.
4b) If it doesn't contain the bug then make a build halfway between that build and the current one.
5) Repeat the process until you find the build where the bug begins.

To give you an idea of how much time this may take, for a set of 1024 revisions this will give the result in 10 steps.

Unfortunately, my e280 is currently AWOL so I cannot help test for the time being.
Title: Glitchy audio after resume playback (was: New USB mode questions)
Post by: ThaCrip on March 04, 2009, 06:53:09 PM
thanks Chronon for the advice but the question i have is...

what's the first build that supports USB AND how do i build exact build versions with that Cygwin? , because as far as i can tell in the stuff i read it dont really mention this. i would seriously like to help but as of now i cant really help since i dont really know how to build specific versions etc.

http://www.rockbox.org/twiki/bin/view/Main/SimpleGuideToCompiling (i used that to get the basic thing setup)
Title: Glitchy audio after resume playback (was: New USB mode questions)
Post by: ryran on March 04, 2009, 07:12:16 PM
For the record, there are tons of posts on the forum on what is likely the exact same thing you all are talking about: glitchy ear-shattering craziness. I've had it happen occasionally on my ipods ever since I started using rockbox back when it was first ported.

I can't say with certainty that it's been happening more lately, but I've definitely seen it a few times in the last week (at least twice after resuming from a pause).

PS: Also, from my perspective the controls-being-locked-after-reaching-end-of-playlist feature has been there for about the last year. Annoying. But I haven't had time to complain. ;)
Title: Glitchy audio after resume playback (was: New USB mode questions)
Post by: ThaCrip on March 04, 2009, 07:28:01 PM
@ Ryran ... i dont know the details but is the IPOD different hardware vs the Sansa e200 series? ... because like i say i never had this issue at all on Rockbox up until fairly recently... i know v3.1 release version never did it to me (and prior to that) and it's to hard to tell when the static issue thing came into play because i was using Rockbox v3.1 up until recently (the last week or two) when i learned of USB support and new bootloaders for my player, so then i updated and then ran into the glitch.
Title: Glitchy audio after resume playback (was: New USB mode questions)
Post by: Llorean on March 04, 2009, 07:42:58 PM
@ryran - Is there a bug report filed on this locking controls thing?
Title: Glitchy audio after resume playback (was: New USB mode questions)
Post by: cool_walking_ on March 04, 2009, 08:03:18 PM
I just heard that glitchy ear-shattering craziness yesterday, for the first time ever.  While I connected the USB plug, there was a song playing.  Upon disconnecting the iPod, playback was paused at the place I left it, so I resumed and got an earful of some highly experimental noise music.  I paused and resumed, hoping that would fix it, but it didn't.  I then fast-forwarded a few seconds, and normal playback resumed.  I wasn't paying attention, and my memory is pretty bad, so it might not have happened exactly like that.

Maybe this is FS#9949 (http://rockbox.org/tracker/9949).
Title: Glitchy audio after resume playback (was: New USB mode questions)
Post by: saratoga on March 04, 2009, 09:07:36 PM
thanks Chronon for the advice but the question i have is...

what's the first build that supports USB AND how do i build exact build versions with that Cygwin? , because as far as i can tell in the stuff i read it dont really mention this.

http://www.rockbox.org/twiki/bin/view/Main/UsingSVN#How_to_check_out_the_source_code
Title: Glitchy audio after resume playback (was: New USB mode questions)
Post by: cool_walking_ on March 04, 2009, 09:56:03 PM
The first build in which USB was *enabled by default for particular PortalPlayer targets* was r20105 (http://svn.rockbox.org/viewvc.cgi?view=rev;revision=20105).
Title: Glitchy audio after resume playback (was: New USB mode questions)
Post by: dreamlayers on March 05, 2009, 12:15:17 AM
With unmodified r20205, I am able to get noise, screeching and stalls of playback by repeatedly pausing and resuming playback.   However, this is extremely rare.

Another important release to consider is "r20052: Use DMA for audio playback on PP502x".
Title: Glitchy audio after resume playback (was: New USB mode questions)
Post by: AstroBoy on March 05, 2009, 12:21:01 AM
Binary search:
1) Pick an initial build that's long enough ago to not have this bug.
2) Verify that it doesn't exhibit the bug
3) Make a build that's halfway between that build and the current build.
4a) If it contains the bug then make a build halfway between that build and the initial one.
4b) If it doesn't contain the bug then make a build halfway between that build and the current one.
5) Repeat the process until you find the build where the bug begins.

To give you an idea of how much time this may take, for a set of 1024 revisions this will give the result in 10 steps.

Unfortunately, my e280 is currently AWOL so I cannot help test for the time being.

I think 1024 would take up to 11 steps and 1023 would take up to 10.  :)  10 tests could take me 60 days since I had 1 failure in 6 days.  But it happeded again today, so 3.5 days per failure on average.  I don't understand why almost no one is posting known bad versions.

I found the archives here: http://www.rockbox.org/dl.cgi?bin=sansae200
I will test the oldest archive I could find, rockbox-sansae200-20090201.

The only known bad versions are: r20107-090225, r20205

Maybe we should consider the release that added support for the 2 cores?  I don't know what version that is.
Title: Glitchy audio after resume playback (was: New USB mode questions)
Post by: ThaCrip on March 05, 2009, 12:25:20 AM
astroboy said, "Maybe we should consider the release that added support for the 2 cores?  I don't know what version that is."

i dont think that's the problem because im pretty sure 'both cores' where supported in v3.1 release version and i never had a issue BUT i was primarily using .ogg files on that and not .mp3 files so maybe it's mp3 related specifically.

but i must mention this as it might have some relevance...

in general since i got my Sansa running Rockbox is that i was pretty much using .ogg audio files... but when i got that sound skipping stuff as other's have said it was in .mp3 format (most of the files has the vbr of around 192kbps (the ones that vary from 128kbps to 320kbps ... Lame encoded) ... so to my knowledge i never seen that 'sound issues' when playing .ogg files. (ogg files bit rates are around 45-60kbps if that matters at all)

and like i said before... i cant start testing different builds until i find out how to compile specific versions which i cant find out how that's done so far.... if anyone knows it would be nice if you could give me a push in the right direction ;)
Title: Glitchy audio after resume playback (was: New USB mode questions)
Post by: dreamlayers on March 05, 2009, 12:33:16 AM
Okay, how about this:  add a debug menu entry which pauses playback, sleeps, unpauses playback, sleeps, etc.  Then listen to that or better yet record the audio and look at its spectrum later.  If you play a continuous tone, software or a PLL chip could easily auto-detect failures, but it may not be necessary to go that far.

I have a 30GB 5G iPod, so I guess this is a PP502x issue.

Edit:  Yeah, this seems like a good idea.  I got two failures in one song already.  Time to use old versions.  Is there some bandwidth-efficient way to get the source to old versions?
Title: Glitchy audio after resume playback (was: New USB mode questions)
Post by: perrikwp on March 05, 2009, 01:27:16 AM
As Saratoga noted earlier this can be found in wiki:

Quote
How to check out the source code

   svn co svn://svn.rockbox.org/rockbox/trunk rockbox

If you would like to use older sources use the -r parameter replacing YYYY-MM-DD with the appropriate date:

   svn checkout svn://svn.rockbox.org/rockbox/trunk -r {YYYY-MM-DD} rockbox

To check out a specific revision, use

   svn checkout svn://svn.rockbox.org/rockbox/trunk -r 12345 rockbox

A "rockbox" directory will be created in your current directory, and all the directories and source files go there.

and also:

Quote
To go back to a specific revision, use:

   svn update -r 12345

from http://www.rockbox.org/twiki/bin/view/Main/UsingSVN#How_to_check_out_the_source_code
Title: Glitchy audio after resume playback (was: New USB mode questions)
Post by: ThaCrip on March 05, 2009, 01:39:43 AM
thanks for the reply perrikwp!

i think this will help me as it looks like you pinpointed mainly what i needed to know... but i wont know how it turns out til i try it and i think i setup the cygwin program properly.

but i guess ill get started now and possibly report back any issues i might have and hopefully i dont have issues this way i can start narrowing it down.
Title: Glitchy audio after resume playback (was: New USB mode questions)
Post by: dreamlayers on March 05, 2009, 01:41:19 AM
Yeah, I've read that wiki page.  I was looking for a bandwidth-efficient way, so I don't have to check out the entire source code.

Now I see that is the bandwidth efficient way!  If SVN sees a rockbox subdirectory, it upgrades or downgrades it as needed.

Edit:  I'm hearing problems with r20052.   Now I'm going to try r20051.
Title: Glitchy audio after resume playback (was: New USB mode questions)
Post by: ThaCrip on March 05, 2009, 01:51:30 AM
im sorta stuck cause even though those commands work like what was said above i don't exactly know how to make a compiled build that i can extract to test on my player.

any advice?
Title: Glitchy audio after resume playback (was: New USB mode questions)
Post by: dreamlayers on March 05, 2009, 02:05:38 AM
See http://www.rockbox.org/twiki/bin/view/Main/SimpleGuideToCompiling

r20051 seems solid (and earlier I reported problems with r20052) so it seems the problem is due to using DMA for audio playback.  Next, I want to try r20052 at 80 Mhz.

I think that using DMA for audio playback is a good thing.  I hope we can get it working properly.
Title: Glitchy audio after resume playback (was: New USB mode questions)
Post by: ThaCrip on March 05, 2009, 02:08:34 AM
@ dreamlayers ... thanks for the link and reply but im at the 'compiling the source code' > 'configuring build' section (which i assumed i needed to goto since i ran the commands in the above post from what's his name) and nothing really seems to happen.

but if dream layers is right... than i assume me trying to help is pointless now? lol
Title: Glitchy audio after resume playback (was: New USB mode questions)
Post by: dreamlayers on March 05, 2009, 02:22:22 AM
@ThaCrip: What environment are you using to compile?  See http://www.rockbox.org/twiki/bin/view/Main/SimpleGuideToCompiling#What_You_Will_Need  Yeah, you don't really need to do this now.

80 Mhz doesn't help r20052.  I still hear problems.
Title: Glitchy audio after resume playback (was: New USB mode questions)
Post by: ThaCrip on March 05, 2009, 02:24:24 AM
@ dreamlayers...

im using Cygwin but since you seemed to have narrow it down (if you did that was quick ;) ) then i probably dont need to worry but i do think it's a good idea if you can somehow upload that build to some website (say yousendit.com ) and link me to those two builds to see if i can confirm anything you have said ;)
Title: Glitchy audio after resume playback (was: New USB mode questions)
Post by: dreamlayers on March 05, 2009, 02:39:41 AM
@ThaCrip:  If you run configure, you should get a menu of different player types.  If you don't get that, something is wrong with your Cygwin install.  When you're done with that you can run make.  When that finishes you can run make zip to get rockbox.zip, which you can install.

Here are 30GB 5th generation iPod builds:

r20051 build, should work (http://drop.io/dreamlayers/asset/rockbox-ipodvideo30gb-r20051-pauseunpause-zip)

r20052 build, should fail eventually (http://drop.io/dreamlayers/asset/rockbox-ipodvideo30gb-r20052-pauseunpause-zip)

Here's a patch that was added to those builds (http://drop.io/dreamlayers/asset/pause-unpause-loop-patch).  After you start playback, from the main menu you can go to System -> Debug (Keep Out!) -> Pause unpause loop.  That will keep pausing and unpausing, which makes it easier to see the problem.  Hold the bottom button (ie. stop) to get out of that.
Title: Glitchy audio after resume playback (was: New USB mode questions)
Post by: ThaCrip on March 05, 2009, 02:45:13 AM
thanks for the builds BUT will these work on a Sansa e200 series also?

if not, any chance you could make those builds for a Sansa e200 series?
Title: Glitchy audio after resume playback (was: New USB mode questions)
Post by: Chronon on March 05, 2009, 03:06:18 AM
I think 1024 would take up to 11 steps and 1023 would take up to 10.  :)
Not to be pedantic, but I think you got it backward.  The number of iterations is asymptotic to Log2N - 1.  The  number of iterations for N=1024=210 would be: # = Log2(210)-1 = 9.   ;)
Quote
10 tests could take me 60 days since I had 1 failure in 6 days.  But it happeded again today, so 3.5 days per failure on average.  I don't understand why almost no one is posting known bad versions.

I understand.  Bugs like this can be troublesome to track down for this reason.  I will try to borrow my daughter's e250 if possible.
Title: Glitchy audio after resume playback (was: New USB mode questions)
Post by: dreamlayers on March 05, 2009, 03:36:15 AM
thanks for the builds BUT will these work on a Sansa e200 series also?

if not, any chance you could make those builds for a Sansa e200 series?

Here are e200 builds:
http://drop.io/dreamlayers/asset/rockbox-e200-r20051-pauseunpause-zip
http://drop.io/dreamlayers/asset/rockbox-e200-r20052-pauseunpause-zip
Title: Glitchy audio after resume playback (was: New USB mode questions)
Post by: ThaCrip on March 05, 2009, 04:29:19 AM
i am testing r20052 on my e250 with the pause/play loop and 'so far' it's not acting up, is there any general time frame it's expected to screw up in if it does act up?

also, if i recall when i was just using a recent version of Rockbox when i first noticed the sound glitch i seemed to have it paused for a good 30+seconds (maybe even 1minute or more) before resuming from what i can recall before it acted up... because i dont think it happened to me on a quick pause/resume from what i remember.... so assuming im right would that mean the 'pause/resume loop' option might not mean much since it might take a longer pause to get it to trigger the sound glitches?

p.s. and as im typing this the pause/resume loop has been going for a constant 5-7+minutes and so far it's not acting up at all for me.

EDIT: it's been going for a good 20+ minutes so far and it's not acting up on build r20052... so i think im going to stop this 'pause/resume loop' and see if i can manually trigger it with longer pauses etc, plus i think i remembered which song i was playing when i got one of those sound glitches, so i think ill test that out and then come back here.... also it was a MP3 when the sound glitch turned up as like i said before i primarily been using Rockbox on .ogg files if that matters and 'so far' i never got the sound glitch when playing .ogg files.

EDIT #2: i just got build r20052 to do that 'sound glitch' on the MP3 i got it to do it on before (seems like i had to leave the song paused for a good 1+minutes before resuming playback to get it to act up) ;) ... now ill go test build r20051 and see if i can get that to act up... because if that dont act up that would mean it's changes between r20051 and r20052 that caused it to do the sound glitch, right?

EDIT 3: after more testing on r50052 and r50051 ... im starting to have reasonable confidence that the issue is between these two builds because here is what i did...

in the last hour or so i first started with r50052 and manually started pausing the mp3 file and trying to get it to 'sound glitch' and i did it within a reasonable time frame to as i got it to do it within around 5minutes which would usually require me pausing the song for a good 1+minutes before resuming from pause to get it to trigger, sometimes 2minutes or a little more...... then i switched to r50051 and could not get this one to act up within that same time frame or so.... then just to further make sure r50052 was not a fluke i went back to that build (r50052) and proceeded to recreate the 'sound glitch' and within roughly the same time frame (maybe a little longer) , using the pausing for 1-2minutes (or so) range and resuming from pause it plays fine for a brief second and then the sound glitch kicks in.... sometimes it would take a few attempts to get it to work though.

so basically it does seem to appear 'as of now' i can confirm dreamlayers comments about the 'sound glitch' being between r50051 and r50052 somewhere. ;)

im going to keep playing with this stuff for around another half hour or so switching between r50051 and r50052 to make sure i can get reasonable consistency between the builds but 'as of now' it does appear dreamlayers is right.

EDIT #4 : well after attempting to do the 'sound glitch' for a third time in r50052 i cant seem to get it to do it and i was trying for roughly a good 20minutes or so when before i got it to act up within 10minutes tops 2 times.... but i guess at this point since i KNOW r50052 has the 'sound glitch' im probably just going to stick with using build r50051 for a while and see if it dont act up... if it dont, i would assume it must have something to do with the using of 'DMA for audio playback on PP502x' stuff since that appears to be the only change between r50051 and r50052..... just some thoughts ;)
Title: Glitchy audio after resume playback (was: New USB mode questions)
Post by: dreamlayers on March 05, 2009, 11:24:59 AM
Wow, ThaCrip, that's a lot of testing.  Thanks!

Regarding use of the pause unpause loop I added:  What I heard is bursts of perfect music, one burst of noise, and then more bursts of perfect music.  It seems that if one pauses again soon after a problematic unpause (like what that loop does), it's always possible to recover and get music again.  I did not find it too hard to notice these bursts of noise, but they're certainly not as obvious as lasting noise.

Edit: Here's a patch from r20051 to r20052:
http://drop.io/dreamlayers/asset/rockbox-20051-20052-patch

Edit2:  So far I've only figured out how to break things more.  If I comment out DMA interrupting code in play_stop_pcm(), pausing and unpausing never recovers; it just pauses and unpauses noise.  Stopping and resuming still fixes the problem then.

Edit3:  When noise is played, dma_play_data.size goes negative.

Edit4:  Since dma_play_data.size is of type size_t, that's not seen as negative.  Just making it a long seems to prevent the noise, but I suppose the root cause is that when pausing, .size and .addr may be changed twice, both by fiq_playback() and play_stop_pcm().
Title: Re: Glitchy audio after resume playback (was: New USB mode questions)
Post by: AstroBoy on March 05, 2009, 07:01:25 PM
I think 1024 would take up to 11 steps and 1023 would take up to 10.
Not to be pedantic, but I think you got it backward.  The number of iterations is asymptotic to Log2N - 1.  The  number of iterations for N=1024=210 would be: # = Log2(210)-1 = 9.   ;)

We probably should start another thread!  :)
Your math is beyond me.  :(
With 1 sample, it takes 1 test to find a match.
2 to 3 samples take 2 tests at most.
4-7 take 3.
8-15 take 4.
16-31 take 5.
32-63 take 6.
64-127 take 7.
128-255 take 8.
256-511 take 9.
512-1023 take 10.

Now if the samples are contiguous, you would save 1 test I think.  If 3 was too low and 5 was too high you would know the answer was 4 without testing it.  But if 3 was good and 5 was bad, you would need to test 4 to see if it was good or bad.

wow, I exceeded the smiley limit! !!
Title: Re: Glitchy audio after resume playback (split from: New USB mode questions)
Post by: dreamlayers on March 05, 2009, 07:24:02 PM
This bug already had its own entry in the tracker.  I just submitted a patch:  http://www.rockbox.org/tracker/task/9949#comment28863
Title: Re: Glitchy audio after resume playback (split from: New USB mode questions)
Post by: Chronon on March 05, 2009, 08:23:28 PM
Your math is beyond me.  :(

You are looking at the worst case scenario, which actually seems apt for this instance of it.  Usually, it's assumed that when the test returns a member of the set that you're searching you know if it's correct or not.  In this case it isn't known unless you search for pairs of consecutive builds.  (Testing one build at a time cannot tell you if a broken build is the first one or not.)  For that reason, it's likely that you won't know until the very end of the test that you have gotten the right result.  So, your analysis is good for this situation.  However, it seems that you are shifted by one with your initial case.  In this case (though not in general) we can assume that the object of our search exists in the set we're searching.  So, a set with only one member needs to be searched zero times to find a particular member (there's only one!).  A single search on a 2 member set will return the correct result -- it's either successful and you have picked the right one, or it wasn't and you can choose the other member of the set without running the test again.

So, after further consideration, it seems that my off-the-cuff answer of 10 for 1024 was correct, but not for the reasons that I initially thought.  Wikipedia has a good explanation for why, in the ideal case, the number tends to correspond to the formula that I used (http://en.wikipedia.org/wiki/Binary_search#Average_performance) in my previous comment. 

Anyway, I don't care to quibble over the exact value.  It's really not a big deal and my initial answer was really a back of the envelope approximation, not intended to be a rigorous answer.  And it appears this may now be moot, anyway.   ;D
Title: Re: Glitchy audio after resume playback (split from: New USB mode questions)
Post by: dreamlayers on March 05, 2009, 09:45:56 PM
Here are r20211 builds for testing:
These builds also include the pause unpause loop function for testing.  You can use it from the debug menu and you can get out of the loop by holding stop.  If you don't use it, its presence makes no difference.

You should also find that when unpaused, playback continues exactly from the point where it was paused.  When this bug did not cause noise, it sometimes caused small changes in playback position.

Edit: Never mind, I didn't fix this correctly.  No, it didn't show up as noise; the buffer is not advanced in some cases when pausing.
Title: Re: Glitchy audio after resume playback (split from: New USB mode questions)
Post by: AstroBoy on March 06, 2009, 01:47:51 AM
In this case (though not in general) we can assume that the object of our search exists in the set we're searching.  So, a set with only one member needs to be searched zero times to find a particular member (there's only one!). 

Even if you only gave me 1 version of RockBox to test, I would not know if it had the bug or not until I tested it.
I was a programmer for years (but not now).  I don't recall ever knowing that the opject I was looking for would be in the tree or not.  Maybe you have a list of names, or checking account numbers.  If you only have a set of 1 you still need to test it to see if you have a match or not.  If not, maybe you would create a second object on the tree.  Anyway, I will look at the Wikipedia link.  Been fun, ty.
Title: Re: Glitchy audio after resume playback (split from: New USB mode questions)
Post by: Chronon on March 06, 2009, 03:18:30 PM
 :-[
I have been sloppy again.  Now that I have been through this once again I see the resolution.  The number of iterations they discuss in that article is for the number required to reduce the set to one candidate.  It does not include the final test for whether the test, as a whole, fails or succeeds (i.e. whether or not the object of the search in the set).  So, log2N iterations gets you down to one candidate but doesn't tell you whether the candidate is the one that you want.  Given the stated problem your calculation was spot on.  In order to gain the speed up from early truncation, the problem needs to be posed in a way that satisfies those conditions.  If pairs of code revisions are tested then you can positively identify a given pair as the correct one and on average you will find your desired result one iteration early (provided the object of the search is in the set).  To set things up so this is the case you would also want to ensure that the endpoints are not the desired result.  This situation seems less like a set of account numbers which may or may not contain a given account number.  It's a sequential set of code revisions whose open boundary (in a mathematical sense) on the lower side lacks a bug and whose open boundary on the upper side contains a bug.  In this sense, it's more akin to an analog to digital converter in which, given an in-range voltage, you search for the nearest digital number that does not exceed the target -- there will always be such a number unless the initial voltage is out of range.

Anyway, thanks for pointing out my mistakes.  It's good to find a proper resolution in these cases.   :)

*Apologies for getting off topic.  If anyone feels this exchange should be trimmed, I'm fine with that.
Title: Re: Glitchy audio after resume playback (split from: New USB mode questions)
Post by: soap on March 07, 2009, 02:38:40 AM
This bug should be fixed now (as of SVN r20227).  Despite speculation, it was the DMA audio commit, not the USB one, which led to this problem.  (Pack up the jump-to-conclusions mats).

Please, no more posts on this thread unless confirming either:
1 - bug is still reproduceable for you.  (With reproduction recipe)
2 - bug is no longer reproduceable for you.
Title: Re: Glitchy audio after resume playback (split from: New USB mode questions)
Post by: DrRemulak on March 09, 2009, 09:37:37 AM
After getting the latest build of Rockbox, I no longer have this bug (in limited testing.)

Thank you to everyone who had a hand in fixing this!