Rockbox

  • Status Closed
  • Percent Complete
    100%
  • Task Type Bugs
  • Category Codecs
  • Assigned To No-one
  • Operating System All players
  • Severity Low
  • Priority Very Low
  • Reported Version Release 3.12
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Rockbox
Opened by ligd_user - 2013-06-13
Last edited by saratoga - 2014-01-12

FS#12871 - rockbox play ogg_vorbis data has noise when enable the macro CPU_ARM

in the file fft-ffmpeg_arm.h
in the function XNPROD31_R, use the t5 and t6 as input data while ouput data,
there maybe has a error.

static inline FFTComplex* TRANSFORM_W01( FFTComplex* z, int n, const FFTSample* w )
{

  register FFTSample t1,t2 asm("r5"),t5 asm("r6"),t6 asm("r7"),r_re asm("r8"),r_im asm("r9");
  /* load wre,wim into t5,t6 */
  asm volatile( "ldmia %[w], {%[wre], %[wim]}\n\t":[wre] "=r" (t5), [wim] "=r" (t6):[w] "r" (w));
  z += n*2; /* z[o2] -- 2n * 2 since complex numbers */
  asm volatile( "ldmia %[my_z], {%[r_re],%[r_im]}\n\t":[r_re] "=r" (r_re), [r_im] "=r" (r_im):[my_z] "r" (z));
  XPROD31_R(r_re, r_im, t5 /*wre*/, t6 /*wim*/, t1,t2);
  z += n; /* z[o3] */
  asm volatile( "ldmia %[my_z], {%[r_re],%[r_im]}\n\t":[r_re] "=r" (r_re), [r_im] "=r" (r_im):[my_z] "r" (z));
  XNPROD31_R(r_re, r_im, t5 /*wre*/, t6 /*wim*/, t5,t6);

}

I suggest use like this, maybe a butter way, but I am not sure:
static inline FFTComplex* TRANSFORM_W01( FFTComplex* z, int n, const FFTSample* w )
{

  register FFTSample t1, t3, t4, t2 asm("r5"),t5 asm("r6"),t6 asm("r7"),r_re asm("r8"),r_im asm("r9");
  /* load wre,wim into t5,t6 */
  asm volatile( "ldmia %[w], {%[wre], %[wim]}\n\t":[wre] "=r" (t3), [wim] "=r" (t4):[w] "r" (w));
  z += n*2; /* z[o2] -- 2n * 2 since complex numbers */
  asm volatile( "ldmia %[my_z], {%[r_re],%[r_im]}\n\t":[r_re] "=r" (r_re), [r_im] "=r" (r_im):[my_z] "r" (z));
  XPROD31_R(r_re, r_im, t3 /*wre*/, t4 /*wim*/, t1,t2);
  z += n; /* z[o3] */
  asm volatile( "ldmia %[my_z], {%[r_re],%[r_im]}\n\t":[r_re] "=r" (r_re), [r_im] "=r" (r_im):[my_z] "r" (z));
  XNPROD31_R(r_re, r_im, t3 /*wre*/, t4 /*wim*/, t5,t6);

}

Closed by  saratoga
2014-01-12 21:10
Reason for closing:  Not a Bug

Which device are you testing on?

I just tested x86 and AMSv2 with ASM enabled and the output is identical to 16 bits precision for our vorbis_128k track.

Is this problem specific to one track?
Is it specific to one device?
Have you made any changes to the source code?

Also, if possible please use diff to post code changes. Its very difficult to parse assembly changes otherwise :)

1. I merged all the code which related with vorbis decoding to my project;
2. If I don’t include the file “fft-ffmpeg_arm.h” in mdct.c, then the vorbis will use C code to decoding vorbis, it can work normal;
3. Otherwise, I include the file “fft-ffmpeg_arm.h” in mdct.c, the vorbis will use assembly, it will has noise;
4. My project is work on arm926EJ-S single core, compiler is arm-none-eabi-gcc;

The attached file is the diff.

Location:
file: fft-ffmpeg_arm.h
function: TRANSFORM_W01

   1.txt (0.7 KiB)

So about a million different things could be wrong :)

First verify that your compiler can successfully compile our version of the code by using it to compile our codeclib’s command line interface:

configure > (pick any target) > (W) Warble Codec Tool
make

Assuming the binary you get decodes correctly, I guess you’ll have to go through your changes one by one and try to figure out what is wrong.

Maybe this problem is caused by compiler, I’m working on it.

I have find the root_cause, it is my platform’s error, cause the embedded assemble error when compile, please close this bug.

What was the problem with your platform? Is it something we could have prevented?

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing