Rockbox

Tasklist

FS#11348 - PDbox changes (fix, optimization)

Attached to Project: Rockbox
Opened by Andree Buschmann (Buschel) - Thursday, 03 June 2010, 13:45 GMT
Last edited by Andree Buschmann (Buschel) - Friday, 04 June 2010, 23:38 GMT
Task Type Patches
Category Plugins
Status Closed
Assigned To No-one
Operating System All players
Severity Low
Priority Normal
Reported Version Release 3.4
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

This entry collects some patches to PDbox.

1) pdbox_cos_generation_v01.patch
This patch corrects the interpolation formular used in the waveform generation. It also unifies the generation loop that is used in cos~.c and osc~.c

2) pdbox_mult_asm_v01.patch
This patch adds ARM assembler for the mult(a,b) macro for speed up. Similar Coldfire assembler could easily be added as well.

3) pdbox_cos_tab_v01.patch
This patch reduces the size of cos_table[] to 1/4 of svn's size. Now it uses ~32KB and can be moved to IRAM on several targets. This patch moves cos_table to IRAM on all targets for now. Major speed up on Coldfire is expected.
This task depends upon

Closed by  Andree Buschmann (Buschel)
Friday, 04 June 2010, 23:38 GMT
Reason for closing:  Accepted
Additional comments about closing:  Patches were adapted and submitted with several revisions. Coldfire asm was rejected because it introduced clicking noise.
Comment by Andree Buschmann (Buschel) - Thursday, 03 June 2010, 16:09 GMT
Somehow the smaller cos_table results in severe audio problems... Should be further investigated...
Comment by Wincent Balin (wincent) - Thursday, 03 June 2010, 22:20 GMT
It is rather simple. If you look at the middle part of your table, you will probably notice that you have removed minuses from the values in the utmost left column in the middle part of the table. I corrected that and checked it in. Same goes for the mult() optimization and cos~ interpolation.
Comment by MichaelGiacomelli (saratoga) - Friday, 04 June 2010, 00:34 GMT
Two suggestions:

1) Using the full 32 bit range might be a good idea. You're probably not hurting for precision but it seems strange to only use 19 bits of a 32 bit register for no real reason.

2) Unless I'm confused, it looks like you have 0..360. Using the trig identity cos(180-theta)=-cos(theta) and the evenness of cos, the size of the tables could be further reduced. You should only need to include the range 0..90 degrees.
Comment by Wincent Balin (wincent) - Friday, 04 June 2010, 01:38 GMT
Answers:

1) I suppose that there were some justifications why G√ľnther Geiger (the author of PD-anywhere, the fixed-point Pure Data fork) chose this format.

2) I know. But in this stage I would rather like to update the standard GUI, making it somewhat more compatible for all targets. However, my intentions do not prevent anyone from solving this problem. The files that use cos_table are PDa/intern/cos~.c , PDa/intern/osc~.c and PDa/intern/vcf~.c . To test the result (osc~ only) use pdpod_test.pd patch from both PureData.zip and PureData2.zip archives.
Comment by Andree Buschmann (Buschel) - Friday, 04 June 2010, 08:01 GMT
Wincent, thanks for spotting the bug in the cos_table and for submitting. I keep this open as there might follow some more patches (e.g. asm for Coldfire).
Comment by Andree Buschmann (Buschel) - Friday, 04 June 2010, 12:47 GMT
Some comments:
1) You should also submit the "#include plugin.h" in m_fixed.h. Otherwise CPU_ARM is not defined for each object build.
2) pdbox does not compile on pcsim (cygwin) anymore ("make: *** No rule to make target `/cygdrive/c/development/rockbox_test/build-pcsim/../src/m_fixed.h', needed by `/cygdrive/c/development/rockbox_test/build-pcsim/apps/plugins/pdbox/PDa/intern/biquad~.o'. Stop."). Target builds fine under cygwin, both target and pcsim build fine under vmware.
Comment by Andree Buschmann (Buschel) - Friday, 04 June 2010, 17:18 GMT
Added a patch to coldfire asm. Cannot test it though as I do not have access to coldfire target.
Comment by Wincent Balin (wincent) - Friday, 04 June 2010, 18:58 GMT
It seems that your multiplication optimization for Coldfire is making overflows repeatedly - well audible cracks are coming in repeating patterns (using pdpod_test.pd).

Also, if you made changes to makecostab.c , would you like to add them here too?
Comment by Wincent Balin (wincent) - Friday, 04 June 2010, 18:59 GMT
In case I did not mention it, the cracks came on iriver H320.

Loading...