This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#11268 - Optimization for tremor on targets that don't use iram.
Attached to Project:
Rockbox
Opened by Nils Wallménius (nls) - Thursday, 13 May 2010, 14:45 GMT+2
Last edited by Nils Wallménius (nls) - Monday, 06 June 2011, 15:28 GMT+2
Opened by Nils Wallménius (nls) - Thursday, 13 May 2010, 14:45 GMT+2
Last edited by Nils Wallménius (nls) - Monday, 06 June 2011, 15:28 GMT+2
|
DetailsSome of our targets don't use iram sections as most do, in tremor we assume that all targets use iram so these targets do the same copying etc. that targets with a little iram do (due to that being the default case in the preprocessor logic.
This patch inserts #ifdef USE_IRAM around the iram specific parts especially avoiding the vector copy in block.c. This speeds up decoding on the gigabeast about 2MHz across the test set. I'm not entirely confident that i understand the logic in the memry handling so i would apreciate reviewing of the changes. Other targets that should see a speedup are gigabeat f/x and the ams targets with little ram that have the codec buffer entirely in iram (clip at least). |
This task depends upon
Closed by Nils Wallménius (nls)
Monday, 06 June 2011, 15:28 GMT+2
Reason for closing: Accepted
Additional comments about closing: committed
Monday, 06 June 2011, 15:28 GMT+2
Reason for closing: Accepted
Additional comments about closing: committed
Usually the first track is fine but if i skip back to the beginning the sound sometimes becomes messed up.
any ideas about that?
Of course just setting IRAM_IBSS_SIZE to be large enough to hold the double buffer in "iram" works but it doesn't give as large speedup.
Anyway, this patch turns tremor into a bit more of an #ifdef mess so i would like suggestions how to make it cleaner.
Also if anyone knows why, in vorbis_synthesis_blockin prevCenter is different if the iram double buffer is used.
bug where the sound becomes garbled after skipping back to the beginning of a song. Sometimes i need
to do it 10 times to trigger the bug, sometimes less :/
What is the main intention here - use more of the Gigabeast's ram to avoid having to do the memcpy in the blockin code? (does Gigabeast have larger plugin buffer than other targets?). The fact its garbled suggests the pointers are not being reset properly on reinit. The code is admittedly a bit of a spaghetti bowl.
As you say this leads to copying between the "iram" buffer and the dram one which is completely useless when the "iram" buffer is not in iram.
Benchmarking on the beast shows that this saves about 2MHz or about 5-7%
AFAIU it shouldn't use any more ram than currently as the static buffer is gone and the malloc()'s that are now used as fallbacks when
the iram buffer is full should be used always, it works but there is that sound garbling bug i've gotten on the sim...
I found one bug with the fallback malloc, v->first_pcm is never freed (though this should not happen currently since all targets use the static "iram" buffer)
Another approach that would probably work better but is slightly hacky is to just pretend to have more iram so the static buffer is
large enough to avoid the copy, should be a less intrusive change too.
Not only the gigabeast is affected, the gigabeat f/x don't use iram either and the clip has the entire codec buffer in iram so it doesn't use
it in the traditional way either.
I would be happy if you took a look and commented on the patch.