FS#7520 - frame_period bug in coldfire's pcm_calculate_peaks

Attached to Project: Rockbox
Opened by Martin (misarm) - Thursday, 02 August 2007, 19:34 GMT
Last edited by Linus Nielsen Feltzing (linusnielsen) - Saturday, 04 August 2007, 10:55 GMT
Task Type Bugs
Category Operating System/Drivers
Status Closed
Assigned To No-one
Operating System Coldfire-based
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


Maybe in "firmware/target/coldfire/pcm-coldfire.c" procedure pcm_calculate_peaks(int *left, int *right) should be:
frame_period = (3*period + period) >> 2;
instead of
frame_period = (3*frame_period + period) >> 2;
This task depends upon

Closed by  Linus Nielsen Feltzing (linusnielsen)
Saturday, 04 August 2007, 10:55 GMT
Reason for closing:  Not a Bug
Additional comments about closing:  False alarm.
Comment by Will Robertson (aliask) - Friday, 03 August 2007, 00:09 GMT
I've taken a quick look at the code (which definitely doesn't look right).
At the moment frame_period = (period) >> 2;, but what it LOOKS like it's trying to is frame_period = period;, however I don't know understand the code enough to make any changes. (Note that (3*period + period) >> 2; is the same as period.)
Comment by Linus Nielsen Feltzing (linusnielsen) - Saturday, 04 August 2007, 09:12 GMT
The current code surely looks right to me. It calculates a running average of the time between the calls to pcm_calculate_peaks(). Remember that sample_period is a static variable.
Comment by Martin (misarm) - Saturday, 04 August 2007, 09:46 GMT
I'm sorry, (3*period + period) >> 2 is really same as period. I inly didn't understand frame_period = (3*frame_period + period) >> 2; when frame_period is initialized to 0. I want to do simple frequency spectrum analyzer plugin. Which way is the best to get playing/recording samples? When I was thinking about it, I found this (maybe) mistake.(Sorry for my bad English).
Comment by Linus Nielsen Feltzing (linusnielsen) - Saturday, 04 August 2007, 10:54 GMT
Again, note that frame_period is a *static* variable. This is not a bug.

As far as getting help for your spectrum analyzer plugin, seek help on the mailing list, IRC or the forums.